// Layer Scrolling script
// (c) Michael Kefeder

// Set Variables
var blank = "images/blank.gif"; // image with vertical stripes
var boxheight = 18; 			// height of news box
var boxwidth  = 400;			// width of news box
var contentwidth  = 500;			// width of news box
var topedge   = 30;  // location of news box from top of page
//var leftedge  = (winWidth - boxwidth) / 2;		// location of news box from left edge (centered)
var leftedge  = 70;		// location of news box from left edge (centered)
var rightedge = leftedge + boxwidth;
var scrollheight = contentwidth*2;							// total height of all data to be scrolled
var newsDiv;
var works = true; // becomes only true when the browser supports the feature

function scrollnews(cliptop)
{
	if (document.getElementById) // DOM Browsers only
	{
		newsDiv = document.getElementById('tickertext');
		if (newsDiv)
		{
			newsDiv.style.visibility = "visible";
			newsDiv.style.left = (boxwidth-cliptop) + "px";
			//window.status = "cliptop: " + cliptop;
			if (rightedge-cliptop < 0-contentwidth)
			{
				cliptop = 0;
				scrollnews2(0);
				return;
			}
		}
		if (!newsDiv)
			window.status = "UFO";
		cliptop = (cliptop + 6) % (scrollheight + boxwidth);
		setTimeout("scrollnews(" + cliptop + ")", 100);
	}
}

function scrollnews2(cliptop2)
{
	if (document.getElementById) // DOM Browsers only
	{
		newsDiv = document.getElementById('tickertext2');
		if (newsDiv)
		{
			newsDiv.style.visibility = "visible";
			newsDiv.style.left = (boxwidth-cliptop2) + "px";
			//window.status = "cliptop2: " + cliptop;
			if (rightedge-cliptop2 < 0-contentwidth)
			{
				cliptop2 = 0;
				scrollnews(0);
				return;
			}
		}
		if (!newsDiv)
			window.status = "UFO";
		cliptop2 = (cliptop2 + 6) % (scrollheight + boxwidth);
		setTimeout("scrollnews2(" + cliptop2 + ")", 100);
	}
}


