<!-- 
var popupStatus = "0";  

function loadPopup(qualescheda){
	if (popupStatus == "0") {
		$("#backgroundPopup").css({
				"opacity": "0.7"
		});  
		$("#backgroundPopup").fadeIn("slow");  
		$("#popupScheda" + qualescheda).fadeIn("slow");  
		popupStatus = qualescheda;
	}  
}  

function disablePopup(qualescheda) {
	if (popupStatus == qualescheda) {  
		$("#backgroundPopup").fadeOut("slow");  
		$("#popupScheda" + qualescheda).fadeOut("slow");  
		popupStatus = "0";
	}
}

function centerPopup(qualescheda, posX, posY) {
//	var windowWidth = document.documentElement.clientWidth;  
//	var windowWidth = document.body.clientWidth;  
//	var windowHeight = document.body.clientHeight;  
	var windowWidth = $(window).width();
	var windowHeight = $(window).height();
	var windowClientHeight = $(document).height();  
	var popupHeight = $("#popupScheda" + qualescheda).height();  
	var popupWidth = $("#popupScheda" + qualescheda).width();  
	$("#popupScheda" + qualescheda).css({
			"position": "absolute", 
//			"top": windowHeight/2-popupHeight/2, 
			"top": posY,
			"left": windowWidth/2-popupWidth/2
//			"left": posY
	});  
	$("#backgroundPopup").css({
			"height": windowClientHeight
	});  
}

// -->