Is_NS=window.navigator.appName == "Netscape"
Is_IE=window.navigator.appName == "Microsoft Internet Explorer"

function GetElement(nome){
	if (Is_IE) {
		return document.all[nome];
	} else {
		return document.getElementById(nome);
	}

}

function PopupXY(nome, menuItem, dx, dy){
	showBox = GetElement(nome);
	showBox.style.visibility = "visible";
	mleft = menuItem.offsetLeft + dx;
	mtop  = menuItem.offsetTop + menuItem.offsetHeight + dy;
	parente = menuItem.offsetParent;
	while (parente){
		mtop  += parente.offsetTop; 
		mleft += parente.offsetLeft;
		parente = parente.offsetParent;
	}
	showBox.style.top  = mtop; 
	showBox.style.left = mleft;
}


function PopupBox(nome, menuItem, dx, dy){
	PopCloseAll();
	PopupXY(nome, menuItem, dx, dy)
}

function PopupFoto(image, fnome, padre){
	showBox = GetElement('Menu0');
	menuItem = GetElement('I0');
	mleft = menuItem.offsetLeft;
	mtop  = menuItem.offsetTop + menuItem.offsetHeight + 8; 
	parente = menuItem.offsetParent;
	while (parente){
		mtop  += parente.offsetTop; 
		mleft += parente.offsetLeft;
		parente = parente.parentElement;
	}
	image.src = fnome;
	showBox.style.visibility = "visible";
	showBox.style.top  = mtop; 
	showBox.style.left = 10;
}

function Popup(nome, padre){
	PopupBox(nome, GetElement('I'+nome));
}

function PopClose(nome){
	showBox = GetElement(nome);
	if (showBox){
		showBox.style.visibility = "hidden";
		return true
	} else {
		return false
	}
}

function PopCloseAll(){
	conta = 0;
	while (	PopClose('Menu'+conta)) {++conta;}
}

function ScriviUltimaData(){
	var datAgg = new Date(document.lastModified);
	with (datAgg) {	document.writeln(getDate(), '-', getMonth()+1, '-', getFullYear());}
}

