//--- JavaScript Document
var theTickerText = new Array();
var theTickerLinks = new Array();
theTickerText[0]  = "Steady start to the season but thanks to Turm Me On, Ubi Ace and Baltimore Jack we are back in business!!  "
//theTickerLinks[0] = "http://horses.sportinglife.com" ;



theTickerText[1] ="Back to big, green jumpers everywhere"
//theTickerLinks[1] ="http://horses.sportinglife.com"

theTickerText[2]  ="For results and entries see Recent Results "
theTickerLinks[2] ="results.htm" 


theTickerText[3] ="Join the Chasing Gold Syndicate for £2000 per annum and have an interest in seven horses for the NH season" 
//theTickerLinks[3] = "http://horses.sportinglife.com ";

theTickerText[4] = "Robert, Louise and Beth coming north in mid August"
//theTickerLinks[4] ="http://horses.sportinglife.com" 

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] + " ' >";
   endhrefstr = "</a>";
   document.getElementById("hottext").innerHTML = hrefstr + theTickerText[vn].substring(0,theEnumerator) + aWidget + endhrefstr;
}
