// JavaScript Document
var theTickerText = new Array();
var theTickerLinks = new Array();
theTickerText[0]  = "Sheriff Hutton launches new website"
theTickerLinks[0] = "#" ;

theTickerText[1] ="Jumblies recognised with national awards" 
theTickerLinks[1] = "#";

theTickerText[2] ="Local business invited to advertise on website"
theTickerLinks[2] ="#"

//theTickerText[3]  =""
//theTickerLinks[3] ="" 

//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='_blank'>";
   endhrefstr = "</a>";
   document.getElementById("hottext").innerHTML = hrefstr + theTickerText[vn].substring(0,theEnumerator) + aWidget + endhrefstr;
}
