Array.prototype.shuffle=function(){ var i=this.length,j,t; while(i--) { j=Math.floor((i+1)*Math.random()); t=this[i]; this[i]=this[j]; this[j]=t; } } var tg; var q; var c; function initQuotes() { q = new Array(); q.push("/ThoughtsNewsAndTips/News/|OMG....... thanks Lisa Nolan. What a night.|Read More..."); q.push("/ThoughtsNewsAndTips/News/|Sharon Broadley tackled here second half marathon with a preparation that had been interrupted due to travel, work and illness.|Read More..."); q.push("/ThoughtsNewsAndTips/Tips/|Injury management is key to the ability to maintain consistency of training.|Read More..."); q.shuffle(); c = 0; tg = document.getElementById('quotes'); nextQuote(); setInterval(nextQuote,7500); } function nextQuote() { var input = q[c]; input = input.split('|'); var quote = document.createElement('P'); var link = document.createElement('A'); link.setAttribute("href",input[0]); var quoteText = document.createTextNode(input[1]); link.appendChild(quoteText); if(input[2] != null) { if(input[2] =='Read More...') var attrib = document.createElement('SPAN'); else var attrib = document.createElement('EM'); var attribText = document.createTextNode(input[2]); attrib.appendChild(attribText); var br = document.createElement('BR'); link.appendChild(br); link.appendChild(attrib); } quote.appendChild(link); while(tg.hasChildNodes()) { tg.removeChild(tg.childNodes[0]); } tg.appendChild(quote); c++; if(c == q.length) { c = 0; } }