document.write('
'); // Ticker startup var maxHeadline = 65; function initTicker() { // Define run time values article = -1; articleLen = 0; // Locate base objects if (document.getElementById) { theTicker = document.getElementById("tickerLink"); if (headlines.length > 0) renderTicker(); }else{ document.write(" "); return true; } } // Ticker main run loop function renderTicker() { var myTimeout; // Go for the next story data block if(articleLen == 0) { article++; article = article % theItemCount; headline = headlines[article].replace(/"/g,'"'); if (headline.length > maxHeadline) { //cut down to 50 chars headline = headline.substr(0,maxHeadline); //jump back to last SPACE; headline = headline.substr(0, headline.lastIndexOf(" ")); headline += " ..."; } destination = destinations[article]; theTicker.href = destination; if (targets[article] == 1) { theTicker.target = "_blank"; }else{ theTicker.target = "_self"; } thePrefix = "" + introString + ""; } // Stuff the current ticker text into the anchor theTicker.innerHTML = thePrefix + headline.substring(0,articleLen) + seperator(); // Modify the length for the substring and define the timer if(articleLen != headline.length) { articleLen++; myTimeout = theCharacterTimeout; }else{ articleLen = 0; myTimeout = theStoryTimeout; } // Call up the next cycle of the ticker setTimeout("renderTicker()", myTimeout); } // Widget generator function seperator() { if(articleLen == headline.length) { return seperator0; } if((articleLen % 2) == 1) { return seperator1; }else{ return seperator2; } } var theCharacterTimeout = 50; var theStoryTimeout = 5000; var seperator0 = ""; var seperator1 = "_"; var seperator2 = " "; var introString = "LATEST: "; var headlines = new Array(); var destinations = new Array(); var targets = new Array(); headlines[0] = "LGBT Charter of Rights"; destinations[0] = "http://www.youthlink.co.uk/news/newsarticles/lgbtcharter"; targets[0] = 0; headlines[1] = "Baking the Evaluation Cake events"; destinations[1] = "http://www.youthlink.co.uk/news/newsarticles/evaluationcakeevents"; targets[1] = 0; headlines[2] = "Vacancy - Senior Policy Officer"; destinations[2] = "http://www.youthlink.co.uk/jobs"; targets[2] = 0; headlines[3] = "YouthLink Scotland EGM - 15th May"; destinations[3] = "http://www.youthlink.co.uk/news/newsarticles/egm"; targets[3] = 0; headlines[4] = "Click here to view YMCA Scotland's Youthwork and Schools publication"; destinations[4] = "http://www.ymcascotland.org/news.asp"; targets[4] = 1; var theItemCount = headlines.length; initTicker();