
// WebTicker by Mioplanet
// www.mioplanet.com
TICKER_CONTENT = "";
Ticker_Name = "TICKER";
TICKER_RIGHTTOLEFT = false;
TICKER_SPEED = 2;
TICKER_STYLE = "";
TICKER_PAUSED = false;



//ticker_start();




function ticker_start() {
	Ticker_Control = document.getElementById(Ticker_Name);
	
	if (Ticker_Control != null) {
	
		TICKER_CONTENT = Ticker_Control.innerHTML;
		if (Ticker_Control.Ticker_Direction != undefined ) 
		{
			TICKER_RIGHTTOLEFT = Ticker_Control.Ticker_Direction;
		}
		
		if (Ticker_Control.TICKER_SPEED != undefined ) 
		{
			TICKER_SPEED = Ticker_Control.TICKER_SPEED;
		}
		
		var tickerSupported = false;
		TICKER_WIDTH = Ticker_Control.style.width;
		TICKER_STYLE = Ticker_Control.style;
		var img = "<img src=ticker_space.gif width="+TICKER_WIDTH+" height=0>";

		// Firefox
		if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1) {
			Ticker_Control.innerHTML = "<TABLE  cellspacing='0' cellpadding='0' width='100%'><TR><TD nowrap='nowrap'>"+img+"<SPAN style='"+TICKER_STYLE+"' id='TICKER_BODY' width='100%'>&nbsp;</SPAN>"+img+"</TD></TR></TABLE>";
			tickerSupported = true;
		}
		// IE
		if (navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1) {
			Ticker_Control.innerHTML = "<DIV nowrap='nowrap' style='width:100%;'>"+img+"<SPAN style='"+TICKER_STYLE+"' id='TICKER_BODY' width='100%'></SPAN>"+img+"</DIV>";
			tickerSupported = true;
		}
		if(!tickerSupported) Ticker_Control.outerHTML = ""; else {
			Ticker_Control.scrollLeft = TICKER_RIGHTTOLEFT ? Ticker_Control.scrollWidth - Ticker_Control.offsetWidth : 0;
			document.getElementById("TICKER_BODY").innerHTML = TICKER_CONTENT;
			Ticker_Control.style.display="block";
			TICKER_tick();
		}
	}
}

function TICKER_tick() {
	if(!TICKER_PAUSED) Ticker_Control.scrollLeft += TICKER_SPEED * (TICKER_RIGHTTOLEFT ? -1 : 1);
	if(TICKER_RIGHTTOLEFT && Ticker_Control.scrollLeft <= 0) Ticker_Control.scrollLeft = Ticker_Control.scrollWidth - Ticker_Control.offsetWidth;
	if(!TICKER_RIGHTTOLEFT && Ticker_Control.scrollLeft >= Ticker_Control.scrollWidth - Ticker_Control.offsetWidth) Ticker_Control.scrollLeft = 0;
	window.setTimeout("TICKER_tick()", 30);
}
