/* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com) 
This notice MUST stay intact for legal use 
Visit http://www.dynamicdrive.com/ for this script and 100s more. */

var scrollDelay = 1000;
var scrollSpeed = 1 // larger is faster, 1-10
var pauseScroll = 1 //Pause marquee onMousever (0=no. 1=yes)?
var actualSpeed = scrollSpeed;
var pauseSpeed = (pauseScroll==0) ? actualSpeed : 0;
var actualOffset = null;
var scrollIn = null;
var scrollOut = null;

function doScroll(direction) {
	if (direction == "horizontal") {
		if (parseInt(scrollIn.style.left) > (actualOffset*(-1)+6)) {
			scrollIn.style.left = parseInt(scrollIn.style.left)-actualSpeed+"px";
		} else {scrollIn.style.left = parseInt(scrollOffset)+6+"px";}
	} else {
		if (parseInt(scrollIn.style.top) > (actualOffset*(-1)+6)) {
			scrollIn.style.top = parseInt(scrollIn.style.top)-actualSpeed+"px";
		} else {scrollIn.style.top = parseInt(scrollOffset)+6+"px";}
	}
}

function initScroll(direction) {
	scrollIn = document.getElementById("scrollIn");
	scrollOut = document.getElementById("scrollOut");
	if (direction=="horizontal") {
		scrollIn.style.left = 0;
		scrollOffset = scrollOut.offsetWidth;
		actualOffset = scrollIn.offsetWidth;
	} else {
		scrollIn.style.top = 0;
		scrollOffset = scrollOut.offsetHeight;
		actualOffset = scrollIn.offsetHeight;
	}
	if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=- 1){
		//if Opera or Netscape 7x, add scrollbars to scroll and exit
		if (direction=="horizontal") {scrollIn.style.width = scrollOffset+"px";}
		else {scrollIn.style.height = scrollOffset+"px";}
		scrollIn.style.overflow = "scroll";
		return;
	}
	scrollOut.onmouseover = function() {actualSpeed = pauseSpeed;};
	scrollOut.onmouseout = function() {actualSpeed = scrollSpeed;};
	setTimeout('lefttime = setInterval("doScroll(\''+direction+'\')",30);', scrollDelay);
}
