// Ticker startup function startTicker() { // Define run time values currentItem = -1; currentLength = 0; // Locate base objects if (document.getElementById) { anchorObject = document.getElementById("tickerAnchor"); runTicker(); } } // Ticker main run loop function runTicker() { var myTimeout; // Go for the next story data block if(currentLength == 0) { currentItem++; currentItem = currentItem % theItemCount; tickerText = arTickerText[currentItem].replace(/"/g,'"'); tickerLink = arItemLinks[currentItem]; anchorObject.href = tickerLink; // thePrefix = "News: "; } // Stuff the current ticker text into the anchor anchorObject.innerHTML = //thePrefix + tickerText.substring(0,currentLength) + getTickerCursor(); // Modify the length for the substring and define the timer if(currentLength != tickerText.length) { currentLength++; myTimeout = tickerCharTimeout; } else { currentLength = 0; myTimeout = tickerTimeout; } // Call up the next cycle of the ticker setTimeout("runTicker()", myTimeout); } function getTickerCursor() { if(currentLength == tickerText.length) { return ""; } if((currentLength % 2) == 1) { return "_"; } else { return "-"; } } var tickerCharTimeout = 50; var tickerTimeout = 5000; var arTickerText = new Array(); var arItemLinks = new Array(); var theItemCount = 5; arTickerText[0] = "Junior Medal/South Links Medal Sunday 18th May"; arItemLinks[0] = "webpages/news_item.php?id=14"; arTickerText[1] = "Orr Wins Lothians Championship"; arItemLinks[1] = "webpages/news_item.php?id=15"; arTickerText[2] = "Can you help?"; arItemLinks[2] = "webpages/news_item.php?id=13"; arTickerText[3] = "Lothians Championship Forms"; arItemLinks[3] = "webpages/news_item.php?id=6"; arTickerText[4] = "Pro Shop - New Stock "; arItemLinks[4] = "webpages/news_item.php?id=5"; startTicker();