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 Menuintest() {
	document.write('<a href="index.phtml" onMouseOver="PopCloseAll()">DATA BASE</a> - ');
	document.write('<a href="elenco.phtml" onMouseOver="PopCloseAll()">RICERCA</a> - ');
	document.write("<span style='color: #0000FF; text-decoration: underline;' onMouseOver=\"PopupBox('Menu0', this, -20, 10)\">Elenco strumenti</span> - ");
	document.write('<a href="scheda.phtml" onMouseOver="PopCloseAll()">SCHEDE</a>');
	document.write('<div class="Menu" id="Menu0">');
	document.write('<a href="elenco_imm.phtml">PER IMMAGINI</a>');		
	document.write('<BR><a href="testistrum.phtml">PER TESTI</a>');	
	document.write('<br><a href="vetrina.phtml">PER VETRINA</a>');
	document.write('<br><a href="elenco_data.phtml">PER DATAZIONE</a>');
	document.write('<br><a href="fonti_det.phtml">PER FONTE</a>');
	document.write('<br><a href="elenco_lav.phtml">PER LAVORI</a>');
	document.write('<br><a href="elenco_sett.phtml">PER SETTORE</a>');
	document.write('<br><a href="elenco_stato.phtml">PER STATO DI CONSERVAZIONE</a>');
	document.write('</div>');
}

function Menuintest_uk() {
	document.write('<a href="index_uk.phtml" onMouseOver="PopCloseAll()">DATABASE</a> - ');
	document.write('<a href="elenco_uk.phtml" onMouseOver="PopCloseAll()">SEARCH</a> - ');
	document.write("<span style='color: #0000FF; text-decoration: underline;' onMouseOver=\"PopupBox('Menu0', this, -20, 10)\">Instruments\' list</span> - ");
	document.write('<a href="scheda_uk.phtml" onMouseOver="PopCloseAll()">Instruments\' card</a>');
	document.write('<div class="Menu" id="Menu0">');
	document.write('<a href="elenco_imm_uk.phtml">BY PICTURE</a>');		
	document.write('<BR><a href="testistrum_uk.phtml">BY TEXT</a>');	
	document.write('<br><a href="vetrina_uk.phtml">BY WINDOW</a>');
	document.write('<br><a href="elenco_data_uk.phtml">BY DATING</a>');
	document.write('<br><a href="fonti_det_uk.phtml">BY SOURCE</a>');
	document.write('<br><a href="elenco_lav_uk.phtml">BY WORK</a>');
	document.write('<br><a href="elenco_sett_uk.phtml">BY SECTOR</a>');
	document.write('<br><a href="elenco_stato_uk.phtml">BY STATE OF CONSERVATION</a>');
	document.write('</div>');
}

function ScriviUltimaData(){
	var datAgg = new Date(document.lastModified);
	with (datAgg) {	document.writeln(getDate(), '-', getMonth()+1, '-', getFullYear());}
}
