$(document).ready(function() {
   if ($("#foto img").length > 1) {
		setInterval("slideShow()", 5000)
   }
 })
function slideShow() {
	var $images = $('#container #page #foto IMG.hide');
		$images.removeClass('hide');
    var $active = $('#container #page #foto IMG.active');
    if ($active.length == 0)
    	$active = $('#container #page #foto IMG:last');

    var $next =  $active.next().length ? $active.next() : $('#container #page #foto IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1500, function() {
            $active.removeClass('active last-active');
        });
}
