$(document).ready(function(){
/*
    $("#simpleSlider").easySlider({
        auto: true,
        continuous:    true,
        pause: 2500,
        speed: 2160,
        controlsShow: false
    });
*/


function slideSwitch() {

    $('#simpleSlider ul li').addClass("notactive");
    var $active = $('#simpleSlider LI.active');

    if ( $active.length == 0 ) $active = $('#simpleSlider LI:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#simpleSlider LI:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $(".notactive").animate({opacity: 0.0}, 1000);
    $next.animate({opacity: 1.0}, 2000, function() {
        $active.removeClass('active last-active');
        $next.addClass('active');
    });


    /*
    $next.css({opacity: 0.0})
        .addClass('active')
        .removeClass('notactive')
        .animate({opacity: 1.0}, 3000, function() {
            $active.removeClass('active last-active');
        });
*/
//    $('#simpleSlider').animate({opacity: 1.0}, 10000, function() {
//        slideSwitch();
//    });
}
    $('#simpleSlider LI:first').addClass("active");
    $('#simpleSlider LI').addClass("notactive");
    $('#simpleSlider LI:first').removeClass("notactive");
    $(".notactive").animate({opacity: 0.0}, 3);
//    slideSwitch();
    setInterval( slideSwitch, 5000 );
//    setInterval( slideSwitch, 1 );
//setInterval( slideSwitch, 4000 );
//$(function() {
//    setInterval( "slideSwitch()", 1000 );
//});

}); 

