var nEnd, nLeft, timTicker;
var nSpeed = 1;
var nOff = "#000000";
var nOn  = "#333333";

function TickerRun(){
	obj.style.backgroundColor = nOff;
	tck.style.left = nLeft+'px';
	nLeft = nLeft - nSpeed;
	if( nLeft < nEnd ) {nLeft = 0;}
	timTicker=setTimeout('TickerRun()', 30);
}

function TickerStop(){
    clearTimeout(timTicker);
    obj.style.backgroundColor = nOn;
}

function TickerInit(){
	tck = document.getElementById('tickertext');
	obj = document.getElementById('tickercont_t');
	var prefix = " &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ";
	var location_top = true;
	if (obj == null)
	{
		obj = document.getElementById('tickercont_b');
		prefix = "";
		location_top = false;
	}	
	var txt = prefix + tck.innerHTML;
	tck.innerHTML = "<nobr>"+txt+"</nobr>";
	var nWidth = tck.offsetWidth;
	nEnd = -nWidth;
	nLeft = 0;
	var txt2 = txt;
	while (nWidth < obj.offsetWidth)
	{
		txt = txt + txt2;
		tck.innerHTML = txt;
		nWidth = tck.offsetWidth;
	}
	tck.innerHTML = txt + txt;
	if (location_top)
	{
		obj.onmouseover=TickerStop;
		obj.onmouseout=TickerRun;
	}
	TickerRun();
}
appendOnloadHandler(TickerInit);
