//A simple news ticker written by Steve Arnott, 20th May 2007
//-----------------------------------------------------------
//Number of seconds to pause between stories - integers only!
var delay = 5;
//The news stories array. You can have as many as you like, but make sure the
//array identifiers iterate from 0. No gaps or errors ensue!
var news=new Array();


news[0]=["", "The Spring concert is now on Wednesday, 17th March in the Cathedral at 7 p.m. with the all day rehearsal on Friday, 12th March"];
news[1]=["", "Congratulations to our U14 Netball Squad who have qualified for the English Schools National Finals."];
news[2]=["", "As runners-up to Broxbourne (Herts) at the Regional Round on Saturday they will be representing the East Region at the tournament which is to be held at the Roedean School, Brighton on Saturday 20th March."];
news[3]=["", "The Samba Band and Senior Flute choir are taking part in the Music for Youth competition on Saturday 13th March in Brentwood at the Ursuline school"];
news[4]=["http://www.cchs.co.uk/current-students/bus-news.php", "Please click here for updated information on the bus service"];
news[5]=["http://www.cchs.co.uk/prospective-students/uniform.php", "Uniform List for Years 7 - 11"];


//Don't edit beneath here, unless you really want to
//-----------------------------------------------------------
delay = delay*1000; //Convert seconds to milliseconds
var call = true; //Flag used to pause the ticker on hover
var counter = 0; //Step through the news array

function drawnews() {
	if (call==true) { //Only draw if we're not hovering
		document.getElementById('ticker').innerHTML = '<a href="'+news[counter][0]+'">'+news[counter][1]+'</a>';

		if (counter>=news.length-1) {
			counter = 0;
		} else {
			counter++;
		}
	}
	setTimeout(drawnews, delay); //Call recursively
}

function over() {
	call = false;
}

function out() {
	call = true;
}

document.getElementById('ticker').onmouseover = over;
document.getElementById('ticker').onmouseout = out;

drawnews();