window.onload = function(){
    var leftArrow = document.getElementById("left_arrow");
    var rightArrow = document.getElementById("right_arrow");
    var wrap = document.getElementById("screenshots") || document.getElementById("small_screenshots");
    var container = wrap.getElementsByTagName("DIV")[0];

    var imgs = container.getElementsByTagName("IMG");
    var step = imgs[0].clientHeight;
    var height = step * imgs.length - step;

    leftArrow.onclick = function(){
        rightArrow.style.cursor = "pointer";
        margin = parseInt(container.style.marginTop);
        if(margin < 0){
            container.style.marginTop = margin + step + "px";
            if((margin + step) === 0)
                leftArrow.style.cursor = 'default';
        }
    }

    rightArrow.onclick = function(){
        leftArrow.style.cursor = "pointer";
        margin = parseInt(container.style.marginTop);        
        if(margin > (-1 * height)){
            container.style.marginTop = margin - step + "px";
            if((margin - step) == (-1 * height))
                rightArrow.style.cursor = "default";
        }
    }
}


