/* Javascript functions for showing and hiding divs */
function showHide(layer_ref)
{
    if(layer_ref.length < 1)
        return;

    if(document.getElementById(layer_ref).style.display == "none")
        document.getElementById(layer_ref).style.display = "block";
    else
        document.getElementById(layer_ref).style.display = "none";
}

/* Javascript functions for the image-scrolling div */
scrollStep = 1;
timerLeft="";
timerRight="";

function toLeft(id)
{
    document.getElementById(id).scrollLeft = 0;
}

function scrollDivRight(id)
{
    clearTimeout(timerRight);
    document.getElementById(id).scrollLeft += scrollStep;
    timerRight = setTimeout("scrollDivRight('"+id+"')", 10);
}

function scrollDivLeft(id)
{
    clearTimeout(timerLeft);
    document.getElementById(id).scrollLeft -= scrollStep;
    timerLeft = setTimeout("scrollDivLeft('"+id+"')", 10);
}

function toRight(id)
{
    document.getElementById(id).scrollLeft = document.getElementById(id).scrollWidth;
}

function stopScroll()
{
    clearTimeout(timerRight);
    clearTimeout(timerLeft);
}
