function slideshow() 
{
    var $active = $('#page .slideshow div.active');

    if ( $active.length == 0 ) $active = $('#page .slideshow div:last');

    var $next =  $active.next().length ? $active.next() : $('#page .slideshow div:first');

	$active.addClass('last-active').removeClass('active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('last-active');
			$active.css({opacity: 0.0});
        });
}

$(function() {
	if ($('#page .slideshow div').length>1)
	{
		setInterval( "slideshow()", 3500 );
	}
});
