
	function menu(oMenu)
	{
		// Imposta tutti i menù come non selezionati
		var ogg_p = document.getElementsByTagName('a');
		var idname;
		for(var i=0; i<ogg_p.length; i++) {
			idname = ogg_p[i].id;
			if (idname.indexOf('qlnk')==0)
			{
				document.getElementById(idname).className = '';
			}
		}		
		// Imposta il menù passato come selezionato
		document.getElementById(oMenu).className = 'current';
		// Chiamo la pagina
		subPage(oMenu);
	}

	function uplFile(sPvalue, sFvalue, sIDvalue, sOpz)
	{
		// Verifico che sia stata specificato un file immagine - Devo verificare se il campo esiste, altrimenti non funziona !
		var img_file;
		if (!document.getElementById('img_file')) { img_file = ""; } else { img_file = document.getElementById('img_file').value; }
		
		if (img_file=="" && sIDvalue=="")
		{
			alert("Specificare un file immagine!");
		}
		else
		{
			// Elabora i dati - se l'opzione è 'del' chiedo conferma
			if (sOpz=='del')
			{
				myVar=confirm("ELIMINARE L'IMMAGINE SELEZIONATA ?\n\nFai clic su OK per confermare, altrimenti fai clic su Annulla");
				if(myVar=="0") { alert('Operazione annullata!'); sOpz =''; }
			}
							
			url="admuplimg.asp?p=" + sPvalue + "&f=" + sFvalue + "&id=" + sIDvalue + "&opz=" + sOpz;
			document.frmImage.method = "post";
			document.frmImage.action = url;
			document.frmImage.submit();			
		}
	}
	
	function subPage(svalue)
	{
		url="page=" + svalue;
		document.frmPage.method = "post";
		document.frmPage.action = "index.asp?" + url;
		document.frmPage.submit();	
	}

	function subEditImage(sPvalue, sFvalue, sIDvalue)
	{
		var url    = "gimage.asp?p=" + sPvalue + "&f=" + sFvalue + "&id=" + sIDvalue;
		document.location.href = url;
	}
