var movetimeout;



function scroll_right(step)
{
	var div=document.getElementById('bannerprod');
	
	div.scrollLeft+=25;
	if (step<5)
	{
		step++;
		timerRight=setTimeout("scroll_right("+step+")",35);
	}
	clearTimeout(movetimeout);
	startmoving();
}

function scroll_left(step)
{
	var div=document.getElementById('bannerprod');
	div.scrollLeft-=25;
	if (step<5)
	{
		step++;
		timerRight=setTimeout("scroll_left("+step+")",35);
	}
	clearTimeout(movetimeout);
	startmoving();
}

function scroll_first()
{
	var div=document.getElementById('bannerprod');
	div.scrollLeft = 0;
	clearTimeout(movetimeout);
	startmoving();
}

function startmoving()
{
	var div=document.getElementById('bannerprod');
	
	if(div.scrollLeft < div.scrollWidth - 501)
	{
		movetimeout = setTimeout("scroll_right(1)", 3000);
	}
		else
		{
			movetimeout = setTimeout("scroll_first()", 3000);
		}

}


