﻿
// initialise plugins
jQuery(function () {
    // main navigation init
    jQuery("ul.sf-menu").supersubs({
        minWidth: 13,   // minimum width of sub-menus in em units 
        maxWidth: 27,   // maximum width of sub-menus in em units 
        extraWidth: 1     // extra width can ensure lines don't sometimes turn over 
        // due to slight rounding differences and font-family 
    }).superfish();
    jQuery('ul.sf-menu').superfish({
        delay: 1000, 		// one second delay on mouseout 
        animation: { opacity: 'show', height: 'show' }, // fade-in and slide-down animation 
        speed: 'normal',  // faster animation speed 
        autoArrows: false,   // generation of arrow mark-up (for submenu) 
        dropShadows: false   // drop shadows (for submenu)
    });

    // prettyphoto init
    jQuery("a[rel^='prettyPhoto']").prettyPhoto({
        animation_speed: 'normal',
        theme: 'facebook',
        slideshow: 5000,
        autoplay_slideshow: false
    });

    jQuery(".recent-posts.resources li:nth-child(2)").addClass("second_item");
});

// Init for audiojs
//audiojs.events.ready(function () {
//    var as = audiojs.createAll();
//});

jQuery(window).load(function () {
    // nivoslider init
    jQuery('#slider').nivoSlider({
        effect: 'sliceDown',
        slices: 1,
        boxCols: 8,
        boxRows: 8,
        animSpeed: 500,
        pauseTime: 5000,
        directionNav: true,
        directionNavHide: false,
        controlNav: false,
        captionOpacity: 1,
        afterLoad: function () {
            jQuery(".nivo-caption").css("bottom", "0px");
        },
        beforeChange: function () {
            jQuery(".nivo-caption").stop().animate({ bottom: "-85px" }, { easing: "easeInBack" });
        },
        afterChange: function () {
            jQuery(".nivo-caption").stop().animate({ bottom: "0px" }, { easing: "easeOutBack" });
        }
    });
    jQuery(".tw-content, .widget.tabbed-widget ul.tw-tabbed-nav").addClass("visible");
});
	
