
var walk = 1;
var newsHeight = 0;
var maxHeight;
var pause = 0;
var mqTimer;
var run = walk;

function scrollMarquee(){
	if (parseInt(ticker.style.top) > (newsHeight*(-1)+8)) {
		ticker.style.top = parseInt (ticker.style.top) - run + "px"
		if (parseInt(ticker.style.top)%maxHeight == 0) {
		    // pause for each entry
	    	clearInterval (mqTimer);
	    	setTimeout ('mqTimer = setInterval ("scrollMarquee()", 120)', 1500);
		}
	} else {
		ticker.style.top = parseInt (maxHeight) + 8 + "px"
	}
}

function startMarquee() {
	holder = document.getElementById('wrapper');
	holder.style.left = '2%';
	holder.style.height = '32px';
	holder.style.width = '90%';
	holder.style.overflow = 'hidden';
	ticker = document.getElementById ("news");
	ticker.style.position = 'absolute';
	ticker.style.width = '90%';
	ticker.style.textAlign = 'center';
	ticker.style.top = 0;
	var mqHeight = 0;
	maxHeight = 0;
	tmp = ticker.firstChild;
	while (tmp) {
	    if (tmp.hasChildNodes()) {
	        mqHeight += tmp.scrollHeight;
	        if (tmp.scrollHeight > maxHeight) { maxHeight = tmp.scrollHeight; }
		}
		tmp = tmp.nextSibling;
	}
	holder.style.height = maxHeight + 'px';
	newsHeight = mqHeight;
	if (navigator.userAgent.indexOf ('Netscape/7') != -1) {
		// If Netscape 7, add scrollbars to scroll and exit
		ticker.style.height = mqHeight + 'px';
		ticker.style.overflow = 'scroll';
		return;
	}
	setTimeout ('mqTimer = setInterval ("scrollMarquee()", 120)', 1500);
}

if (window.addEventListener) {
	window.addEventListener ('load', startMarquee, false)
} else if (window.attachEvent) {
	window.attachEvent ('onload', startMarquee)
} else if (document.getElementById) {
	window.onload = startMarquee;
}

