var interval = 12;
var fadeSpeed = 30;
var list;
var tickerObj;
var hex = 0;
function fadeText(divId)
{	if(tickerObj)
	{	if(hex<=255)
		{	hex+=10;
			tickerObj.style.color="rgb("+hex+","+hex+","+hex+")";
			setTimeout("fadeText('" + divId + "')", fadeSpeed);	}
		else
			hex=0;		}	}
function initialiseList(divId)
{	tickerObj = document.getElementById(divId);
	if(!tickerObj)
		reportError("Could not find a div element with id \"" + divId + "\"");
	list = tickerObj.childNodes;
	if(list.length <= 0)
		reportError("The div element \"" + divId + "\" does not have any children");
	for (var i=0; i<list.length; i++)
	{	var node = list[i];
		if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
	        		tickerObj.removeChild(node);		}
	run(divId, Math.floor(Math.random()*list.length));	}
function run(divId, count)
{	fadeText(divId);
	var j=count;
	for (j=0; j<list.length; j++)
		if(j!=count)
			list[j].style.display = "none";
		else
			list[count].style.display = "block";
	window.setTimeout("run('" + divId + "', " + Math.floor(Math.random()*list.length) + ")", interval*1000);	}
function reportError(error)
{	alert("The script could not run because you have errors:\n\n" + error);
	return false;	}