$('html').addClass('js');

$(document).ready(
	function () {

        $('.header>#block-menu-primary-links>.content>.menu').supersubs({ 
            minWidth:    5,     // minimum width of sub-menus in em units 
            maxWidth:    19.5,  // maximum width of sub-menus in em units 
            extraWidth:  0      // extra width can ensure lines don't sometimes turn over 
                                // due to slight rounding differences and font-family 
        }).superfish({ 
            delay:       800,   // one second delay on mouseout
            autoArrows:  false, // disable generation of arrow mark-up 
            dropShadows: false, // disable drop shadows
        }); 
	
		$.localScroll();

		$('.view-frontpage-banners .view-content .item-list ul').jcarousel({
	        auto: 4,
	        wrap: 'last',
	        visible: 1,
	        initCallback: mycarousel_initCallback,
	        scroll: 1,
	        animation: 'slow',
    	});

});

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};
