var timerLeft="";
var timerRight="";
var time = 15;
var scrollStep=3;


function toLeft(id) { document.getElementById(id).scrollLeft=0; }
function toBottom(id) { document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth;}

function scrollDivRight(id)
{
	clearTimeout(timerRight);
	var el=document.getElementById(id);
	var soFar=el.scrollLeft;
	//el.scrollLeft=(soFar+el.offsetWidth+scrollStep > el.scrollWidth)?0:soFar+scrollStep;
	if (soFar+el.offsetWidth+scrollStep < el.scrollWidth) el.scrollLeft=soFar+scrollStep;
	timerRight=setTimeout("scrollDivRight('"+id+"')",time)
}

function scrollDivLeft(id)
{
	clearTimeout(timerLeft)
	var el=document.getElementById(id);
	var soFar=el.scrollLeft;
	//el.scrollLeft=(soFar-scrollStep <0)?el.scrollWidth:soFar-scrollStep;
	if (soFar-scrollStep >0) el.scrollLeft = soFar-scrollStep;
	timerLeft=setTimeout("scrollDivLeft('"+id+"')",time)
}

function stopMe()
{
	clearTimeout(timerRight) 
	clearTimeout(timerLeft)
}
