﻿function scroll(id, side, step, countblock) {
    var div = document.getElementById(id);
    if (side == 'Left') {
        if (div.scrollLeft != step * countblock - step) {
            div.scrollLeft += step;
            document.getElementById("leftButton" + id).src = '/App_Themes/SkinFile/img/btnNewScrollerPreviousArrowNormal.png';
            document.getElementById("leftButton" + id).style.cursor = "hand";
            document.getElementById("leftButton" + id).style.cursor = "pointer";
        }
    }
    if (side == 'Right') {
        div.scrollLeft -= step;
        document.getElementById("rightButton" + id).src = '/App_Themes/SkinFile/img/btnNewScrollerNextArrowNormal.png';
        document.getElementById("rightButton" + id).style.cursor = "hand";
        document.getElementById("rightButton" + id).style.cursor = "pointer";
    }
    if (div.scrollLeft == 0) {
        document.getElementById("leftButton" + id).src = '/App_Themes/SkinFile/img/btnNewScrollerPreviousArrowPasive.png';
        document.getElementById("leftButton" + id).style.cursor = "auto";
        document.getElementById("rightButton" + id).src = '/App_Themes/SkinFile/img/btnNewScrollerNextArrowNormal.png';
        document.getElementById("rightButton" + id).style.cursor = "hand";
        document.getElementById("rightButton" + id).style.cursor = "pointer";
    }
    if (div.scrollLeft == step * countblock - step) {
        document.getElementById("rightButton" + id).src = '/App_Themes/SkinFile/img/btnNewScrollerNextArrowPasive.png';
        document.getElementById("rightButton" + id).style.cursor = "auto";
    }
}

