﻿var scrollbar;

$(function() {
    // initialize scrollable  
    $("div#toutScroller").scrollable({
    size: 2,
        clickable: false,
        items: '#toutContainer',
        hoverClass: 'hover'
    });
});

$(function() {

 if ($("div#toutScroller > ul >*").length <= 2) {
     $("a.next").css("display", "none");
    }

})

$(function() {
    $(".accordionPaneContainer").accordion({
        header: ".accordionPaneHeader",
        autoHeight: false,
        clearStyle: true,
        alwaysOpen: false,
        active: false
    }).bind("accordionchange", function(event, ui) {
        scrollbar.scrollbar("resizeHandle");
       scrollbar.scrollbar("safariFix");
    });

    scrollbar = $(".accordionPaneContainer").scrollbar({ scrollViewWidth: 230, scrollViewHeight: 548, showArrows: true, slowScrollFactor: 1 / 40, slowScrollTimestep: 10 });
    var scrollbar1 = $(".contentDescription").scrollbar({ scrollViewWidth: 607, scrollViewHeight: 70, showArrows: true });
});

