var t;
var doLoop = true;

function scrollDivToLeft(divid)
{
var div = document.getElementById(divid);

if (div.scrollLeft>0 && doLoop)
{
div.scrollLeft-=5;
t = setTimeout("scrollDivToLeft('" + divid + "')", 1);
}
else clearTimeout(t);
}

function scrollDivToRight(divid)
{

var div = document.getElementById(divid);

if (div.scrollLeft<999999999 && doLoop)
{
div.scrollLeft+=5;
t = setTimeout("scrollDivToRight('" + divid + "')", 1);
}
else clearTimeout(t);
}

function stop()
{
doLoop = false;
setTimeout('doLoop = true;', 5);
}