window.onload = function() {
	
}

function rolloverMenu() {
	var nav = document.getElementById("nav");
	if (nav != "") {
		//alert(nav);
		var div_menu = nav.getElementsByTagName("div");
		//alert(div_menu);
		for (var i = 0; i < div_menu.length; i++) {
			//alert(div_menu[i]);
			 div_menu[i].onmouseover = function() {
				var Lid = this.id;
				document.getElementById(Lid).style.background = "#8ec3d5";	
			}
			div_menu[i].onmouseout = function() {
				var Lid = this.id;
				document.getElementById(Lid).style.background = "none";	
			}
		}
	}
}

function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}


function popUp(url,w,h) {
	window.open(url, 'popupWin', 'status,top=15,left=15,width=' + w + ',height=' + h).focus();
}
function popUpResize(url,w,h) {
	window.open(url, 'popupWin', 'top=15,left=15,resizable,scrollbars,width=' + w + ',height=' + h).focus();
}

function checkSize()  {
	window.resizeTo(document.images[0].width + 10, document.images[0].height + 30); window.focus();
}

function goBack() {
	history.back(-1)
}
	
function alertDelete() {
	return(confirm('Attenzione! La cancellazione non puņ essere annullata, vuoi procedere?'));
}

function checksize2()  {
	if (document.images[0].complete) {
		window.resizeTo(document.images[0].width+10,document.images[0].height+30); window.focus();
	} else {
		setTimeout('check()',250)
		}
}

function checkSizeGallery(dida)  {
	var foto = document.getElementById("fotoBig");
	if (foto.width < 640) {
		var fotoWidth = 640;
	} else {
		var fotoWidth = foto.width;
	}
	if (foto.height < 480) {
		var fotoHeight = 480;
	} else {
		var fotoHeight = foto.height;
	}
	var didHeight = 0;
	if (dida == true) {
		didHeight = 100;
	}
	window.resizeTo(fotoWidth + 15, fotoHeight + didHeight + 94); window.focus();
}

function hideShow(obj) {
	var theObj = document.getElementById(obj).style
	if (theObj.display == "block") {
		theObj.display = "none";
	} else {
		theObj.display = "block";
	}
}