function runStories()
{
	// :: Set the Start Values ::
	intActiveStory = 4;
	intCurrentLen = 0;

	if (document.getElementById) {	
		objItemScroller = document.getElementById("ItemScroller");
		startStories();
	}
}

function startStories()
{
	var myTimeout;  
	// Go for the next story data block
	if(intCurrentLen == 0)
	{
		intActiveStory++;
		intActiveStory = intActiveStory % intTotalStories;
		theStorySummary = arrNewsStories[intActiveStory][0];		
		objItemScroller.removeAttribute('href')
		if(arrNewsStories[intActiveStory][1] != '')
		{
			objItemScroller.setAttribute('href', arrNewsStories[intActiveStory][1]);
			objItemScroller.setAttribute('target', arrNewsStories[intActiveStory][2]);
		}
	}
	// :: update the scroller to the current story ::
	objItemScroller.innerHTML = theStorySummary.substring(0,intCurrentLen) + '_';

	// :: set the length and timeout for this story ::
	if(intCurrentLen < theStorySummary.length)
	{
		intCurrentLen++;
		intTimeout = theCharacterTimeout;
	}
	else
	{
		intCurrentLen = 0;
		intTimeout = intStoryChange;
	}

	// :: loop to the next story ::
	setTimeout("startStories()", intTimeout);
}

var theCharacterTimeout = 43;
var intStoryChange = 4500;
var arrNewsStories = new Array();

arrNewsStories[0] = new Array(3);

arrNewsStories[0][0] = "Building for the coming season: - Girls Under 14's & Boy's Under 16's";
arrNewsStories[0][1] = "http://www.trevensonfc.co.uk/Default.asp?Area=NewsStory&Story=130";
arrNewsStories[0][2] = "_blank";
arrNewsStories[1] = new Array(3);

arrNewsStories[1][0] = "Next Coaches Meeting: - AGM 12th August 2010, starting @ 7:15pm Camborne School 6th Form room";
arrNewsStories[1][1] = "http://www.trevensonfc.co.uk/Default.asp?Area=NewsStory&Story=36";
arrNewsStories[1][2] = "_blank";
arrNewsStories[2] = new Array(3);

arrNewsStories[2][0] = "MANAGERS & COACHES WANTED: - Please click here for more information";
arrNewsStories[2][1] = "http://www.trevensonfc.co.uk/Documents/TFC%20Managers%20wanted%20Poster.doc.pdf";
arrNewsStories[2][2] = "_blank";

var intTotalStories = 3;
