/*
$(window).resize(function() {
	
	var H =$("#azureCenter").outerHeight(true) + $("#azureTop").height() + $("#azureBottom").height();
	var b = $("#azure").css("bottom").replace("px","");
	var t = $("#azure").css("top").replace("px","");
	var CH =$("#container").height() - b - t
 
	if( CH > H ) {
		$("#azureCenter").css("height", "auto");
		$("#azureCenter").css("padding-bottom", "10px");
	} else {
		$("#azureCenter").css("height", "100%");
		$("#azureCenter").css("padding-bottom", "0");
		if( $("#azureCenterContainer").get(0).scrollHeight == $("#azureCenterContainer").height() ) {
			$("#azureCenter").css("height", "auto");
			$("#azureCenter").css("padding-bottom", "10px");
		}
	}
});
*/

	$(document).ready(function(){
        //  Initialize Backgound Stretcher	  
		$('body').bgStretcher({
			images: [_urlBase+'/images/foto.jpg'],
			imageWidth: 1100, 
			imageHeight: 738
		});
		
		$(".cam a").colorbox({width:"435px", height:"385px", iframe:true, scrolling:false});

		$("#mappaSpiaggia a").colorbox();


		$("#logoBox").mouseover( function() {
			if( ! $("#youtube").hasClass("openBox") ) {
				$("#youtube").addClass("openBox");
				$("#youtube").animate({left: "250px"}, 500);
			}

			if( ! $("#mappaSpiaggia").hasClass("openBox") ) {
				$("#mappaSpiaggia").addClass("openBox");
				$("#mappaSpiaggia").animate({top: (50+68)+"px"}, 500);
			}
		});
		
		$("#logoBox").mouseleave( function() {
			if( $("#youtube").hasClass("openBox") ) {
				$("#youtube").animate({left: "229px"}, 500, function(){$("#youtube").removeClass("openBox")});
			}

			if( $("#mappaSpiaggia").hasClass("openBox") ) {
				$("#mappaSpiaggia").animate({top: (50)+"px"}, 500, function() {$("#mappaSpiaggia").removeClass("openBox");});
			}
		});

		$("#expandBottomPanel").click( function() {
			$("#cameras").slideToggle();
			return false;
		});
	/*	
		var nh	= $("#news").height();
		var noh	= $("#news").outerHeight(true);
		var ch	= $("#content").height();
		var nmt	= $("#news").css("margin-top");
	
		if( ch < noh ) {
			$("#contentCenter").height(noh-$("#contentTop").height()-$("#contentBottom").height());	
		} else if( noh < ch ) {
			$("#newsCenter").height( ch-$("#newsTop").height()-$("#newsBottom").height() - $("#news").css("margin-top").replace("px","") );
		}
	*/
/*		
		if( $("#azureCenterContainer").get(0).scrollHeight == $("#azureCenterContainer").height() ) {
			$("#azureCenter").css("height", "auto");
			$("#azureCenter").css("padding-bottom", "10px");
		}
*/
 
	});

