﻿var ScrollAmount = 100;

$(function NextButtonClick() {
    $(".divNextButton").click(function () {
        if ($(".divInner").height() > $(".divOutter").height()) {
            if (($(".divInner").height() - Math.abs($(".divInner").position().top)) > ($(".divOutter").height())) {
                $(".divInner").stop().animate({ "top": ($(".divInner").position().top - ScrollAmount) }, 500);
            }
        }
    });
});

$(function PreviousButtonClick() {
    $(".divPreviousButton").click(function () {
        if ($(".divInner").position().top < 0) {
            $(".divInner").stop().animate({ "top": ($(".divInner").position().top + ScrollAmount) }, 500);
        }
    });
});

$(function () {
    $(".divNextButton, .divPreviousButton").css("opacity", "0.35");

    $(".divNextButton, .divPreviousButton").hover(function () {
        $(this).stop().animate({ "opacity": "0.7" }, 250);
    }, function () {
        $(this).stop().animate({ "opacity": "0.35" }, 250);
    });
})

