﻿
//$(document).ready(function ()
//{
//    $('#Fade').crossSlide
//    (
//      {
//        sleep: 2,
//        fade: 1
//      },
//      [
//        { src: 'fatigue_home_ella_25.png' },
//        { src: 'home.gif' },
//        { src: 'login.gif' },
//        { src: 'logo.png' }
//      ]
//    );
//});

function slideSwitch() {
    var $active = $('#slideshow div.active');
    var $active_tab = $('#tabs div.tab1');

    if ($active.length == 0) 
    {
        $active = $('#slideshow div:last');
        $active_tab = $('#tabs div:last');
    }

    var $next = $active.next().length ? $active.next() : $('#slideshow div:first');
    var $next_tab = $active_tab.next().length ? $active_tab.next() : $('#tabs div:first');

    var slideshow = document.getElementById("slideshow");


        $(slideshow).fadeOut(500,  function()
        {
            //$active.css("display", "none");
            $active.addClass('last-active')
            //$next.css("display", "block");
            $next.addClass('active');
            $active.removeClass('active last-active');

            $(slideshow).fadeIn(500);
        });
//    

//    $active.css({ filters:'progid:DXImageTransform.Microsoft.Alpha(Opacity=1)', filter: 'alpha(opacity=1)', opacity: 1.0 })
//        .animate({ filters:'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)', filter: 'alpha(opacity=0)', opacity: 0.0 }, 1000, function () { $active.addClass('last-active') });

//    $next.css({ filters:'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)', filter: 'alpha(opacity=0)', opacity: 0.0, bgcolor:'#000000' })
//        .addClass('active')
//        .animate({ filters:'progid:DXImageTransform.Microsoft.Alpha(Opacity=1)', filter: 'alpha(opacity=1)', opacity: 1.0 }, 1000, function () {
//            $active.removeClass('active last-active');
//        });

    $next_tab.removeClass('tab2');
    $next_tab.addClass('tab1');
    var $next_img = $next_tab.children('img');
    $next_img.attr("src", "/Images/image_tab1.png");

    $active_tab.removeClass('tab1');
    $active_tab.addClass('tab2');
    var $active_img = $active_tab.children('img');
    $active_img.attr("src", "/Images/image_tab2.png");
}

$(function () {
    setInterval("slideSwitch()", 5000);
});

