
function slideSwitch() {
    var $active = $('#slideshow img.active');

    if ( $active.length == 0 ) $active = $('#slideshow img:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow img:first');

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

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

$("#slideshow").css("position:relative; height:300px; width: 400px; overflow: hidden;")
$("#slideshow img").css("position:absolute; top:0; left:0; z-index:8;");
$("head").append("\t<style type='text/css'>\n\t\t#slideshow IMG.active { z-index:10; }\n\t\t#slideshow IMG.last-active { z-index:9; }\n\t</style>\n");

setInterval( "slideSwitch()", 5000 );



