/*
 * Marquee scroll script
 * Copyright (c) 2005 Hristo Drumev [www.hdrumev.com]
 *
 */

var speed = 10, step = 1, containerWidth = 500, width = element = timer = null;

function move()
{
	if( !element || !element.style )
		element = document.getElementById ? document.getElementById( 'mar' ) : document.all['mar'];
	else
	{
		var cp = parseInt( element.style.left );
		cp -= step;
		if( cp < -width )
			cp = containerWidth;
		element.style.left = cp + 'px';
	}
}

function startMarquee()
{
	element = document.getElementById ? document.getElementById( 'mar' ) : document.all['mar'];
	element.style.left = containerWidth + 'px';
	// get marquee layer width ;)
	width = element.clientWidth;
	// setup marquee stop on mouse over
	element.onmouseover = stopTimer;
	element.onmouseout = startTimer;
	
	startTimer();
}

function startTimer()
{
	stopTimer();
	timer = window.setInterval( 'move()', speed );
}

function stopTimer()
{
	if( timer == null )
		return;
	else
	{
		window.clearInterval( timer );
		timer = null;
	}
}

startMarquee();