topEdge			= 50;	// absolute position (in pixels) of news box from top edge
leftEdge		= 235;	// absolute position (in pixels) of news box from left edge
boxHeight		= 100;	// height of ticker box
boxWidth		= 275;	// width of ticker box
tickerPause		= 10000;// milliseconds for ticker to pause on each event (not including scroll time)
scrollPause		= 30;	// milliseconds between scrolls
nextDiv			= -1;	// counter for next div to scroll in ticker
nextEvent		= 0;	// counter for next event to load into div from news array

function scrollnews(divId, clipTop) {
	try {
		// Set the style of the div.
		var newsDiv = document.getElementById(divId).style;
		newsDiv.visibility = 'visible';
		newsDiv.clip = "rect(" + clipTop + "px " + (boxWidth + leftEdge) + "px " + (clipTop + boxHeight) + "px 0px)";

		// style.left, style.top are the DOM-compliant methods.
		newsDiv.left = leftEdge + "px";
		newsDiv.top = (topEdge - clipTop) + "px";
		// Older versions of IE use style.pixelLeft, style.pixelTop.
		newsDiv.pixelLeft = leftEdge;
		newsDiv.pixelTop = topEdge - clipTop;
	} catch(e) {}

	// Increment clip top.  This makes it appear to scroll.
	clipTop = (clipTop + 1);

	switch(clipTop) {
		case 0:
			// Pause scrolling.  Load next event (out of view below).
			setTimeout('startNewHeadline()', tickerPause);
			setTimeout('scrollnews(\'' + divId + '\', ' + clipTop + ')', tickerPause);
			break;
		case boxHeight - 1:
			// Stop scrolling when totally out of view.
			newsDiv.visible = 'invisible';
			break;
		default:
			// Scroll after brief delay.
			setTimeout('scrollnews(\'' + divId + '\', ' + clipTop + ')', scrollPause);
	}
}

function startNewHeadline() {
	if (tickerHeadlines != null) {
		// Increment the div counter (will be 0 or 1).
		nextDiv = (nextDiv + 1) % 2;
		document.getElementById('news' + nextDiv).innerHTML = tickerHeadlines[nextEvent];

		// Grab next event from array (acts as a circular queue).
		nextEvent = (nextEvent < (tickerHeadlines.length - 1) ? nextEvent + 1 : 0);

		// Start scrolling the div.
		scrollnews(('news' + nextDiv), (0 - boxHeight));
	}
}

// Capture any existing functions assigned to window.onload before continuing...
if (window.onload != null) {
    var wo = window.onload;
    window.onload = function (e)
    {
        wo(e);
        startNewHeadline();
    };
} else {
    window.onload = startNewHeadline;
}