﻿$(document).ready(function () {

    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

    $(".scrollable").scrollable({ items: '.items', easing: 'custom', speed: 400, circular: true, mousewheel: true, next: '.next', prev: '.prev' })
					.autoscroll({ autoplay: true, interval: 7000 })
					.navigator().data("scrollable");

    $.easing.custom = function (x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
        return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
    }

    function EndRequestHandler(sender, args) {
        $("#scroll").scrollable({ items: '.tools', vertical: true, mousewheel: true, circular: true, size: 3, next: '', prev: '' })
                    .autoscroll({ autoplay: true, interval: 7000, size: 3 });

    }
});

