// JavaScript Document
var theTickerText = new Array();
var theTickerLinks = new Array();

theTickerText[0]  = "Click here for all the latest straight from the yard"
theTickerLinks[0] = "gallery.htm" ;

theTickerText[1] ="Ruth has trained over 75 winners since taking over the license in 2008" 
theTickerLinks[1] = "results.htm";


//theTickerText[2]  ="txt to go here "
//theTickerLinks[2] ="link to go here"

//theTickerText[3]  ="txt to go here "
//theTickerLinks[3] ="link to go here" 

//theTickerText[4] = "txt to go here"
//theTickerLinks[4] ="link to go here" 

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;
}

