function startTicker() {
	theCurrentStory     = -1;
	theCurrentLength    = 0;
    theAnchorObject     = document.getElementById("tickerAnchor");
    runTheTicker();
}

function runTheTicker() {
	var myTimeout;
	if (theCurrentLength == 0) {
		theCurrentStory++;
		theCurrentStory      = theCurrentStory % theItemCount;
		theStorySummary      = theSummaries[theCurrentStory].replace(/&quot;/g,'"');
		theTargetLink        = theSiteLinks[theCurrentStory];
		theAnchorObject.href = theTargetLink;
		thePrefix 	         = "<b>" + theLeadString + "</b>";
	}
	theAnchorObject.innerHTML = thePrefix + theStorySummary.substring(0,theCurrentLength) + whatWidget();
	if (theCurrentLength != theStorySummary.length) {
		theCurrentLength++;
		myTimeout = theCharacterTimeout;
	} else {
		theCurrentLength = 0;
		myTimeout = theStoryTimeout;
	}
	timer = setTimeout("runTheTicker()", myTimeout);
}

function whatWidget() {
	if (theCurrentLength == theStorySummary.length) {
		return theWidgetNone;
	}
	if ((theCurrentLength % 2) == 1) {
		return theWidgetOne;
	} else {
		return theWidgetTwo;
	}
}

var theCharacterTimeout = 50;
var theStoryTimeout     = 6000;
var theWidgetOne        = "_";
var theWidgetTwo        = "-";
var theWidgetNone       = "";
var theLeadString       = "News:&nbsp; ";

var theSummaries = new Array();
var theSiteLinks = new Array();
var theItemCount = 4;

theSummaries[0] = "Housing Rights Information";
theSiteLinks[0] = "http://www.housing-rights.info/index.html";
theSummaries[1] = "New Gas Safety Changes";
theSiteLinks[1] = "http://www.gassaferegister.co.uk/";
theSummaries[2] = "The Keep Warm Hotline: 0800 519 1100";
theSiteLinks[2] = "http://www.southampton.gov.uk/s-environment/energy/hotline.aspx";
theSummaries[3] = "Launch of PUSH 4 Safer Homes initiative";
theSiteLinks[3] = "http://www.push.gov.uk/general/article.aspx?id=250";

window.onload = startTicker;