// --- Global variable stuff here
	var theitemcount;
	var theCurrentStory;
	var theCurrentLength;
	var theDate;
	var theStorySummary;
	var theCharacterTimeout;
	var theStoryTimeout;
	var startText, endText;
	var theStoryState;
	var summary = new Array();
	var url = new Array();
	var news_date = new Array();

// --- Only run for V4 browsers (check browser again here - some old browsers won't do this inline)
	function startTicker()
	{
		if (parseInt(navigator.appVersion) < 4) {
			return;
		}

// ------ Set up initial values
		theCharacterTimeout =   50;
		theStoryTimeout     = 3000;

// ------ Set up initial values
		theStoryState		= 1;
		theCurrentStory		= 0;
		theDate				= "";
		theCurrentLength    = 0;

		setupStories();

		if (document.layers)
			document.tickernsmain.visibility="show";

		runTheTicker();
	}


// --- Index to next story
	function setupNextStory()
	{
		theStoryState = 0;

		if (theCurrentStory >= theItemCount) {
			theCurrentStory = 0;
		}
          
		theStorySummary = summary[theCurrentStory];
		theDate   = news_date[theCurrentStory] + "<BR>";
		startText			= "<a href='" + url[theCurrentStory] + "'>";
		endText				= "</A>";
		theCurrentLength = 0;
		theCurrentStory++;
	}


// --- The basic rotate function
	function runTheTicker()
	{
		if (theItemCount == 0) return;

		if (theStoryState == 1) {
			setupNextStory();
		}

		if (theCurrentLength != theStorySummary.length) {
			drawStory();
		} else {
			closeOutStory();
		}
	}


// --- Draw a teletype line
	function drawStory()
	{
		var myWidget;
          
		if ((theCurrentLength % 2) == 1) {
			myWidget = ".";
		} else {
			myWidget = ".";
		}

		var msg = startText + " " + theStorySummary.substring(0,theCurrentLength) + myWidget + endText;

		if (document.layers) {
			document.tickernsmain.document.tickernssub.document.write(msg)
			document.tickernsmain.document.tickernssub.document.close()
		} else if (document.all) {
			tickerie.innerHTML=msg;
		}

		theCurrentLength++;
		setTimeout("runTheTicker()", theCharacterTimeout);
	}


// --- Finalise the item
	function closeOutStory()
	{
		var msg = startText + " " + theStorySummary + endText;

		if (document.layers) {
			document.tickernsmain.document.tickernssub.document.write(msg)
			document.tickernsmain.document.tickernssub.document.close()
		} else if (document.all) {
			tickerie.innerHTML=msg;
		}
		theStoryState = 1;
		setTimeout("runTheTicker()", theStoryTimeout);
	} 

	function setupStories()
	{


		summary[summary.length] = "<p class='scroller'>..19-04-2007 : Bishops from Cape Town arrive in the UK this month with their rugby team..</p>";
		url[url.length]         = "http://www.edwindoran.com/news_4.htm";

		summary[summary.length] = "<p class='scroller'>..15-04-2007 : The Royal Navy Hockey Club are off to Argentina in May..</p>";
		url[url.length]         = "http://www.edwindoran.com/news_9.htm";

		summary[summary.length] = "<p class='scroller'>..11-04-2007 : The King&#039;s School, Grantham, are off to Singapore and Australia to play cricket..</p>";
		url[url.length]         = "http://www.edwindoran.com/news_10.htm";

		summary[summary.length] = "<p class='scroller'>..07-04-2007 : Middleton College are bringing their rugby team from New Zealand to the UK..</p>";
		url[url.length]         = "http://www.edwindoran.com/news_8.htm";

		summary[summary.length] = "<p class='scroller'>..29-03-2007 : Lloyd&#039;s of London RFC are off to Spain to play rugby..</p>";
		url[url.length]         = "http://www.edwindoran.com/news_7.htm";

		summary[summary.length] = "<p class='scroller'>..22-03-2007 : Emirates Airlines becomes the first airline to include fuel surcharges in their fares...</p>";
		url[url.length]         = "http://www.edwindoran.com/news_11.htm";

		summary[summary.length] = "<p class='scroller'>..15-03-2007 : Epsom College rugby and girls hockey are attending the Limerick Festival in August..</p>";
		url[url.length]         = "http://www.edwindoran.com/news_6.htm";

		summary[summary.length] = "<p class='scroller'>..10-03-2007 : Sutton & Epsom RFC use the same facilities as the European Champions for their pre-season training...</p>";
		url[url.length]         = "http://www.edwindoran.com/news_12.htm";

		summary[summary.length] = "<p class='scroller'>..07-02-2007 : Cranbrook School are taking their cricket and netball teams to Grenada..</p>";
		url[url.length]         = "http://www.edwindoran.com/news_5.htm";

		summary[summary.length] = "<p class='scroller'>..07-02-2007 : Welcome to the Sports World of Edwin Doran!..</p>";
		url[url.length]         = "http://www.edwindoran.com/news_1.htm";

		theItemCount = summary.length;
		return true;
	}
