/***********************************************
* (c) by Octadyne Systems / AutoJini.com
***********************************************/

// Globals 
var pauseScroll = false;
var tickerDiv = 'TAPE';
var speed = 2;
var scrollRight = false;

function octTicker(div,spacerImageURL,ticCSS,scrollSpeed,sRight) {
    tickerDiv = div;
	speed = scrollSpeed;
	scrollRight = sRight;
	var ie4 = (document.all) ? true : false;
	var ns4 = (document.layers) ? true : false;
	var ns6 = (document.getElementById && !document.all) ? true : false;
	if (ie4 || ns6)
	{
		with(document.getElementById(tickerDiv))
		{
			scrollLeft = 0;
			ticWidth = style.width;
			style.display = "block";
			content = innerHTML;
			innerHTML = "<TABLE cellpadding=0 cellspacing=0 width='100%'><TR><TD nowrap><img src="+spacerImageURL+" width="+ticWidth+" height=1><SPAN width='100%' style='"+ticCSS+"' ID='scrollerContent'>&nbsp;</SPAN><img src="+spacerImageURL+" width="+ticWidth+" height=1></TD></TR></TABLE>";
		}
		document.getElementById("scrollerContent").innerHTML = content;
		octScrollTap();
	}
}
function octScrollTap() 
{
	with (document.getElementById(tickerDiv))
	{ 
		if (!pauseScroll)
		{
			scrollLeft += speed * (scrollRight ? -1 : 1);
		}
		maxLeft = scrollWidth-offsetWidth;
		currentLeft = scrollLeft;
		if (scrollRight == 1 && currentLeft <=0)
		{
		 	scrollLeft = scrollWidth - offsetWidth;
		}
		if (!scrollRight && currentLeft >= maxLeft)
		{
			scrollLeft = 0;
		}
	}
	window.setTimeout("octScrollTap()", 30);
}
