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

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

		// 3 linee che servono per far comparire le immagini in ordine casuale
		var $sibs  = $active.siblings();
    	var rndNum = Math.floor(Math.random() * $sibs.length );
    	var $next  = $( $sibs[ rndNum ] );

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

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

	$(function() {
    	setInterval( "slideShow()", 4000 );
		
	
	});
	
	
$(document).ready(function() {
	
	
	// tabs //
	
	$(function () {
                        var tabContainers = $('div.tabs > div');
                        tabContainers.hide().filter(':first').show();
                        
                        $('div.tabs ul.tabsnav a').click(function () {
                                tabContainers.hide();
                                $('div.tabs ul.tabsnav a').removeClass('selected');
                                $(this).addClass('selected');
							    tabContainers.filter(this.hash).fadeIn("slow");
                                return false;
                        }).filter(':first').click();
     });
	 
	 // gallery & projects & advertising //
	 
	// $("img").lazyload({
	//    effect : "fadeIn" 				   
	// });
	 
	 $(".pics,.projects,.geos,.maxim,.mito,.mito,.kitchen,.adv,.hilton,.sheraton,.jolly,.savoia,.hyatt,.ibis").fancybox({
			'overlayShow'			: false,
			'zoomSpeedIn'			: 600,
			'zoomSpeedOut'			: 500,
			'easingIn'				: 'easeOutBack',
			'easingOut'				: 'easeInBack'
	});
	 
});

