/********************************************
*  mostra_livello(obj_mostra)               *
* ----------------------------------------- *
* Funzione per mostrare un livello nascosto *
* obj_mostra = id del div nascosto          *
********************************************/
/*
function mostra_livello(obj_mostra){
	document.getElementById(obj_mostra).style.display = "block";
}

function mostra_livello_cambia_stile(obj_mostra, obj_cambia_stile){
	// visualizza livello nascosto
	document.getElementById(obj_mostra).style.display = "block";
	// imposta a current la voce di menù selezionata
	document.getElementById(obj_cambia_stile).setAttribute("class","current");
}
*/

function ClearText(obj){
	var objSel = document.getElementById(obj.id);
	objSel.value = '';
}

/* ------------------------------------------------------ *
 *                                                        *
 *    Funzione  mostra_livello(obj_mostra)                *
 *                                                        *
 * ------------------------------------------------------ *   
 * Funzione per mostrare un livello nascosto HTML         *
 * 'obj_mostra' = livello nascosto                        *
 * ------------------------------------------------------ */
 
function mostra_livello(obj_mostra){
		document.getElementById(obj_mostra).style.display = "block";
	}


/* ------------------------------------------------------ *
 *                                                        *
 *    Funzione  nascondi_livello(obj_mostra)              *
 *                                                        *
 * ------------------------------------------------------ *   
 * Funzione per nascondere un livello nascosto HTML       *
 * 'obj_mostra' = livello da nascondere                   *
 * ------------------------------------------------------ */


function nascondi_livello(obj_mostra){
	document.getElementById(obj_mostra).style.display = "none";
}

/********************************************
*  SwitchMenu(obj)                          *
* ----------------------------------------- *
* Gestione menù di sinistra                 *
********************************************/
if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.menu_int{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("principale").getElementsByTagName("span");
		if(el.style.display != "block"){
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="menu_int")
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

/* ------------------------------------------------------ *
 *                                                        *
 *    Funzione  submit_form(formName, url, method)         *
 *                                                        *
 * ------------------------------------------------------ *   
 * Funzione per effettuare il submit di un form           *
 * 'formName' = form di cui si vuole effettuare il submit *
 * 'url' = action di destinazione del form                *
 * 'method' = post o get                                  *
* ------------------------------------------------------ */

function submit_form(formName, url, method){
	var form = document.forms[formName];
	form.method = method;
	form.action = url;
	form.submit();
}
