var ns = navigator.appName == 'Netscape';
var ns4 = (ns && parseInt(navigator.appVersion) == 4);
var ns5 = (ns && parseInt(navigator.appVersion) > 4);

function setText(text)
{
	if ((obj=document.getElementById('TICKER'))!=null) with (obj)
	if (document.layers) {document.write(unescape(text)); document.close();}
	else innerHTML = unescape(text);
}

function playTicker()
{
	document.cf.style.left = 0;
	document.cf.frame = 0;
	//setTimeout('playTicker()',document.cf.showtime); 
	setTimeout('setColor()',document.cf.fadetime);
	
	if (document.ticker.length <= document.cf.num)
	{
		document.cf.num = 0;
	}
	
	setText(document.ticker[document.cf.num]);
	document.cf.style.color = document.cf.color[document.cf.frame];
}

function setColor()
{
	document.cf.style.color = document.cf.color[document.cf.frame];
	document.cf.frame ++;
	setText(document.ticker[document.cf.num]);
	if (document.cf.frame < document.cf.color.length)
	{
		time = (document.cf.showtime - document.cf.fadetime) / document.cf.color.length;
		time = Math.floor(time);
		setTimeout('setColor()',time);
 	}
 	else
 	{
		document.cf.num = ++document.cf.num;
		setTimeout('playTicker()',0);
		//setTimeout('document.cf.style.color = document.cf.color[0]',(document.cf.fadetime/document.cf.color.length));
	}
}

function initTicker()
{
	document.cf = new Array();
	document.cf.name = 'TICKER';
	document.cf.frame = 0;
	document.cf.num = 0;
	document.cf.showtime = 8000;
	document.cf.fadetime = 4000;
	document.cf.color = new Array("#516370","#596A77","#62727E","#6B7A85","#73828C","#7C8A93","#85919A","#8D99A2","#96A1A9","#9FA9B0","#A7B1B7","#B0B8BE","#B9C0C5","#C2C8CC","#CAD0D4","#D3D8DB","#DCDFE2","#E4E7E9","#EDEFF0","#FFFFFF");
	document.cf.obj = document.getElementById('TICKER');
	
	if (!ns4)
	{
		document.cf.style = document.cf.obj.style;
		document.cf.x = parseInt( document.cf.obj.style.left );
	}
	else
	{
		document.cf.style = document.cf.obj;
		document.cf.x = parseInt( document.cf.obj.left );
	}
	document.cf.style.left = 0;
	document.cf.style.color = document.cf.color[document.cf.frame];
	setText(document.ticker[document.cf.num]);
	playTicker();
}
