﻿jQuery(document).ready(function() {
    jQuery(".Nav li").hover(function() {
        jQuery(this).find(".SubNav").slideDown(200);
    },
    function() {
        jQuery(this).find(".SubNav").slideUp(200);
    });

    setInterval("slideSwitch()", 7000);    
});

function slideSwitch() {
    var $active = jQuery('#Slideshow IMG.active');

    if ($active.length == 0) $active = jQuery('#Slideshow IMG:last');

    var $next = $active.next().length ? $active.next() : jQuery('#Slideshow IMG:first');

    $active.addClass('last-active');
    $next.css({ opacity: 0.0 })
        .addClass('active')
        .animate({ opacity: 1.0 }, 1500, function() {
            $active.removeClass('active last-active');
        });
}
