// initialise plugins
jQuery(function() {
    //jQuery('ul.sf-menu').superfish();
    jQuery("ul.nav").superfish({ speed: 500, autoArrows: false }).find('div.overlay-box');
});
function slideSwitch() {
    var $active = jQuery('#dnn_homeSlides IMG.active');
    if ($active.length == 0) $active = jQuery('#dnn_homeSlides IMG:last');
    var $next = $active.next().length ? $active.next()
            : jQuery('#dnn_homeSlides IMG:first');
    $active.addClass('last-active');
    $next.css({ opacity: 0.0 })
            .addClass('active')
            .animate({ opacity: 1.0 }, 1000, function() {
                $active.removeClass('active last-active');
            });
}
$(document).ready(function() {
    jQuery('#dnn_homeSlides IMG:last').addClass('vis');
    //setInterval("slideSwitch()", 5000);
    if (jQuery("#scrollable").scrollable != null) {
        jQuery("#scrollable").scrollable({
            circular: true,
            speed: 800,
            mousewheel: true
        }).navigator()//.autoscroll({interval: 5000});
    }
    jQuery("a[rel^='prettyPhoto']").prettyPhoto({
        animation_speed: 'normal',
        theme: 'light_rounded',
        social_tools: false,
        overlay_gallery: false
    });
});
$(window).load(
    function() {
        jQuery('#dnn_homeSlides IMG').addClass('vis');
        setInterval("slideSwitch()", 5000);
    }
);

