
var moverightvar = setTimeout('',1);
var moveleftvar = setTimeout('',1);
var moving = 0;

function move_right(div_scroll)
{
    stop = document.getElementById(div_scroll).scrollWidth - document.getElementById(div_scroll).clientWidth;
    speed = 1
    moving+=speed
    if ((stop > document.getElementById(div_scroll).scrollLeft) && (moving < 159)) {
        document.getElementById(div_scroll).scrollLeft += speed
        moverightvar = setTimeout("move_right('" + div_scroll + "')", 10);
    } else {
        moving = 0;
        clearTimeout(moverightvar);
    }
}

function move_left(div_scroll)
{
    speed = 1
    moving += speed
    if (((document.getElementById(div_scroll).scrollLeft-speed) >= 0) && (moving < 159)){
        document.getElementById(div_scroll).scrollLeft -= speed
        moveleftvar = setTimeout("move_left('" + div_scroll + "')", 10);
    } else {
        if ((document.getElementById(div_scroll).scrollLeft - speed) < 0) {
            document.getElementById(div_scroll).scrollLeft = 0
        }
        moving = 0;
        clearTimeout(moveleftvar);
    }
}
