function imagesSwitch() {
    var $active = $('#images img.currentact');
    if ( $active.length == 0 ) $active = $('#images img:last');
    var $next =  $active.next().length ? $active.next()
        : $('#images img:first');
    $active.addClass('currentlastact').fadeOut(2000);
    $next.addClass('currentact').fadeIn(2000, function() {
			$active.removeClass('currentact currentlastact');
        });
}

$(function() {
    setInterval( "imagesSwitch()", 5000 );
});

