
$(document).ready(function(){
    $('.slideshow').cycle({
        fx: 'fade',
        speed: 3000,
        timeout: 5000
    });
});

function slideSwitch(){
    var $act = $('#slideshow IMG.act');

    if ($act.length == 0)
        $act = $('#slideshow IMG:last');

    var $next = $act.next().length ? $act.next() : $('#slideshow IMG:first');

    $act.addClass('last-act');

    $next.css({
        opacity: 0.0
    }).addClass('act').animate({
        opacity: 1.0
    }, 1000, function(){
        $act.removeClass('act last-act');
    });
}

$(function(){
    setInterval("slideSwitch()", 5000);
});
