﻿function slideSwitch() {
    var $active = $('#slideshow a.active');

    //$active.parent().hide(); // a tag

    if ($active.length == 0) $active = $('#slideshow a:last');

    var $next = $active.next().length ? $active.next()
        : $('#slideshow a:first');

    $active.addClass('last-active');

    // $active.parent().show(); // a tag

    $("#slideshow-narration").text($next.attr("title"));

    $next.css({ opacity: 0.0 })
        .addClass('active')
        .animate({ opacity: 1.0 }, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval("slideSwitch()", 5000);
    $("#slider").easySlider({
        prevText: '<img src="Content/Images/prev.gif" alt="Previous" />',
        nextText: '<img src="Content/Images/next.gif" alt="Next" />'
    });
    jQuery("#slider a").lightBox();
});