// JavaScript Document
var theTickerText = new Array();
var theTickerLinks = new Array();
theTickerText[0]  = "Set up your online sponsor form free of charge."
//theTickerLinks[0] = "register.asp" ;

//theTickerText[1] = "If you would like to make a donation for the up keep of this website and though that donation, assist us in raising money for our preferred charity then please log in to your account and click the donation button. Thank you in advance.";
//theTickerLinks[1] = "http://horses.sportinglife.com/Arch_Race_Pup/0,13215,205153,00.html ";

//theTickerText[2] ="Very successful open day photos to follow"
//theTickerLinks[2] ="http://horses.sportinglife.com"

//theTickerText[3] = "Wee William, Harry the Hawk and St Wilfrid entered this week"
//theTickerLinks[3] ="http://horses.sportinglife.com " 

//theTickerText[4] = 
//theTickerLinks[4] = 

var Inc = new Number(0);      // used to itterate through array
var theCharacterTimeout = 40; //pause tween chars
var theStoryTimeout = 3000;   //pause at end of line
var theEnumerator = 0;        //used to iterate through the individual strings


// --- Run the ticker
function start()
{
doTheTicker();
}



function doTheTicker()
{
if(Inc > (theTickerText.length - 1)){Inc=0;}

   if((theEnumerator % 2) == 1)
   {
      writeTicker("|",Inc);
   }
   else
   {
      writeTicker("|",Inc);
   }

   theEnumerator++;
	
   if(theEnumerator == theTickerText[(Inc)].length+1)
   {
      writeTicker("",Inc);
      theEnumerator = 0;
      Inc++;
      setTimeout('doTheTicker()', theStoryTimeout); 
          
   }
   else
   {
      setTimeout('doTheTicker((Inc))', theCharacterTimeout);
   }
}

function writeTicker(aWidget,vn)
{
   
   var hrefstr = new String();
   var endhrefstr = new String();
   
  // hrefstr = "<a href=' " + theTickerLinks[vn] + " ' target='_self'>";
//   endhrefstr = "</a>";
   document.getElementById("hottext").innerHTML = hrefstr + theTickerText[vn].substring(0,theEnumerator) + aWidget + endhrefstr;
}
