function NewFormCheck(form){
// funzione necessaria per la verifica dei dati provenienti da un FORM
// inserire nel FORM il campo <input type="button" onClick="NewFormCheck('nomeForm');">
// senza questo valore il controllo non funziona correttamente
	var ffocus, Char;
	var theForm = eval ("document." + form);
	var msgErr = "";
	//var ore = theForm.ore.value;
	//var minuti = theForm.minuti.value;
	var giorno = theForm.giorno.value;
	var mese = theForm.mese.value;
	var anno = theForm.anno.value;

/*
	if (theForm.ore.value == ""){
		msgErr = "Non hai inserito l'ora!";
		ffocus = eval("document." + form + ".ore");
	}
	if(isNaN(ore)){
		msgErr = "L'ora che hai inserito non è un numero!";
		ffocus = eval("document." + form + ".ore");
	}
	if(isNaN(minuti)){
		msgErr = "L'ora che hai inserito non è un numero!";
		ffocus = eval("document." + form + ".minuti");
	}
	if(ore > 23){
		msgErr = "Hai inserito un'ora non corretta!";
		ffocus = eval("document." + form + ".ore");
	}
	if(minuti > 59){
		msgErr = "Hai inserito un'ora non corretta!";
		ffocus = eval("document." + form + ".minuti");
	}
	if (theForm.titolo.value == "") {
		msgErr = "Non hai inserito il titolo!";
		ffocus = eval("document." + form + ".titolo");
	}
	if (theForm.relatore.value == "") {
		msgErr = "Non hai inserito il relatore!";
		ffocus = eval("document." + form + ".relatore");
	}
	if (theForm.testo_ita.value == "") {
		msgErr = "Non hai inserito nessun testo in italiano!";
		ffocus = eval("document." + form + ".testo_ita");
	}
	if (theForm.testo_eng.value == "") {
		msgErr = "Non hai inserito nessun testo in inglese!";
		ffocus = eval("document." + form + ".testo_ita");
	}
*/

// nuova form 
	if (theForm.giorno.value == ""){
		msgErr = "Non hai inserito il giorno!";
		ffocus = eval("document." + form + ".giorno");
	}
	if(isNaN(giorno)){
		msgErr = "Il giorno che hai inserito non è un numero!";
		ffocus = eval("document." + form + ".giorno");
	}
	if(giorno > 31){
		msgErr = "Il giorno che hai inserito non è valido!";
		ffocus = eval("document." + form + ".giorno");
	}
/*
	if (theForm.mese.value == ""){
		msgErr = "Non hai inserito il mese!";
		ffocus = eval("document." + form + ".mese");
	}
	if(isNaN(mese)){
		msgErr = "Il mese che hai inserito non è un numero!";
		ffocus = eval("document." + form + ".mese");
	}
*/
/*
	if(mese > 12){
		msgErr = "Il mese che hai inserito non è valido!";
		ffocus = eval("document." + form + ".mese");
	}
	if (theForm.anno.value == ""){
		msgErr = "Non hai inserito l'anno!";
		ffocus = eval("document." + form + ".anno");
	}
	if(isNaN(anno)){
		msgErr = "L'anno che hai inserito non è un numero!";
		ffocus = eval("document." + form + ".anno");
	}
*/
	if (theForm.titolo_it.value == "") {
		msgErr = "Non hai inserito il titolo in italiano!";
		ffocus = eval("document." + form + ".titolo_it");
	}
/*
	if (theForm.sottotitolo_it.value == "") {
		msgErr = "Non hai inserito il sottotitolo in italiano!";
		ffocus = eval("document." + form + ".sottotitolo_it");
	}
*/
/*
	if (theForm.titolo_eng.value == "") {
		msgErr = "Non hai inserito il titolo in inglese!";
		ffocus = eval("document." + form + ".titolo_eng");
	}
*/
/*
	if (theForm.sottotitolo_eng.value == "") {
		msgErr = "Non hai inserito il sottotitolo in inglese!";
		ffocus = eval("document." + form + ".sottotitolo_eng");
	}
*/
/*
	if (theForm.destinatari_it.value == "") {
		msgErr = "Non hai inserito i destinatari in italiano!";
		ffocus = eval("document." + form + ".sottotitolo_it");
	}
*/
/*
	if (theForm.destinatari_eng.value == "") {
		msgErr = "Non hai inserito i destinatari in inglese!";
		ffocus = eval("document." + form + ".sottotitolo_eng");
	}
*/
/*
	if (theForm.coordinatori.value == "") {
		msgErr = "Non hai inserito i coordinatori!";
		ffocus = eval("document." + form + ".coordinatori");
	}
	if (theForm.collaborazione.value == "") {
		msgErr = "Non hai inserito le collaborazioni!";
		ffocus = eval("document." + form + ".collaborazione");
	}
*/
/*
	if (theForm.sponsor.value == "") {
		msgErr = "Non hai inserito lo sponsor!";
		ffocus = eval("document." + form + ".sponsor");
	}
*/
/*
	if (theForm.dettagli_it.value == "") {
		msgErr = "Non hai inserito i dettagli in italiano!";
		ffocus = eval("document." + form + ".dettagli_it");
	}
	if (theForm.dettagli_eng.value == "") {
		msgErr = "Non hai inserito i dettagli in inglese!";
		ffocus = eval("document." + form + ".dettagli_eng");
	}
*/
	if (msgErr == "") {
		theForm.submit();
	} else {
		alert (msgErr);
		ffocus.focus();
	}
}


function NewFormCheck2(form){
// funzione necessaria per la verifica dei dati provenienti da un FORM
// inserire nel FORM il campo <input type="button" onClick="NewFormCheck('nomeForm');">
// senza questo valore il controllo non funziona correttamente
	var ffocus, Char;
	var theForm = eval ("document." + form);
	var msgErr = "";
	var ore = theForm.ore.value;
	var minuti = theForm.minuti.value;
/*
	if (theForm.ore.value == ""){
		msgErr = "Non hai inserito l'ora!";
		ffocus = eval("document." + form + ".ore");
	}
	if(isNaN(ore)){
		msgErr = "L'ora che hai inserito non è un numero!";
		ffocus = eval("document." + form + ".ore");
	}
	if(isNaN(minuti)){
		msgErr = "L'ora che hai inserito non è un numero!";
		ffocus = eval("document." + form + ".minuti");
	}
	if(ore > 23){
		msgErr = "Hai inserito un'ora non corretta!";
		ffocus = eval("document." + form + ".ore");
	}
	if(minuti > 59){
		msgErr = "Hai inserito un'ora non corretta!";
		ffocus = eval("document." + form + ".minuti");
	}
*/
	if (theForm.titolo_it.value == "") {
		msgErr = "Non hai inserito il titolo in italiano!";
		ffocus = eval("document." + form + ".titolo_it");
	}

	if (theForm.titolo_eng.value == "") {
		//msgErr = "Non hai inserito il titolo in inglese!";
		theForm.titolo_eng.value = theForm.titolo_it.value;
		ffocus = eval("document." + form + ".titolo_eng");
	}
	if (theForm.testo_it.value == "") {
		msgErr = "Non hai inserito il testo in italiano!";
		ffocus = eval("document." + form + ".titolo_it");
	}

	if (theForm.testo_eng.value == "") {
		//msgErr = "Non hai inserito il titolo in inglese!";
		theForm.testo_eng.value = theForm.testo_it.value;
		ffocus = eval("document." + form + ".titolo_eng");
	}
/*
	if (theForm.relatore_it.value == "") {
		msgErr = "Non hai inserito il relatore in italiano!";
		ffocus = eval("document." + form + ".relatore_it");
	}
*/
/*
	if (theForm.relatore_eng.value == "") {
		msgErr = "Non hai inserito il relatore in inglese!";
		ffocus = eval("document." + form + ".relatore_eng");
	}
*/
/*
	if (theForm.testo_it.value == "") {
		msgErr = "Non hai inserito nessun testo in italiano!";
		ffocus = eval("document." + form + ".testo_ita");
	}
	if (theForm.testo_eng.value == "") {
		msgErr = "Non hai inserito nessun testo in inglese!";
		ffocus = eval("document." + form + ".testo_ita");
	}
*/
	if (msgErr == "") {
		theForm.submit();
	} else {
		alert (msgErr);
		ffocus.focus();
	}
}

// onClick="NewShow('n');"
function NewShow(n){
	//var mybutton = eval("document.getElementById('showbtn" + n + "')");
	//var theTable = eval("document.getElementById('mytable" + n + "')");
	var mybutton = eval("document.all('showbtn" + n + "')");
	var theTable = eval("document.all('mytable" + n + "')");
	
	if(mybutton.value == "Mostra agenda"){
		//theTable.style.visibility = "visible";
		theTable.style.display = "block";
		mybutton.value = "Nascondi agenda";
	}
	else{
		//theTable.style.visibility = "invisible";
		theTable.style.display = "none";
		mybutton.value = "Mostra agenda";
	}
}
function NewShowDett(n){
	// var mybutton = eval("document.getElementById('showbtn" + n + "')");
	// var theTable = eval("document.getElementById('mytable" + n + "')");
	// var theNewTable = eval("document.getElementById('myNewtable" + n + "')");
	var mybutton = eval("document.all('showbtn" + n + "')");
	var theTable = eval("document.all('mydiv" + n + "')");
	var theNewTable = eval("document.all('myNewdiv" + n + "')");
//	alert ("mytable>>> " + theTable + "mynewtable>>> " + theNewTable);
	
	if(theNewTable != null){
		if(mybutton.value == "dettagli"){
			theTable.style.display = "block";
			theNewTable.style.display = "block";
			mybutton.value = "nascondi";
		}
		else{
			theTable.style.display = "none";
			theNewTable.style.display = "none";
			mybutton.value = "dettagli";
		}
	}
	
	else{
		if(mybutton.value == "dettagli"){
			theTable.style.display = "block";
			mybutton.value = "nascondi";
		}
		else{
			theTable.style.display = "none";
			mybutton.value = "dettagli";
		}
	}

}

function NewShowDettEn(n){
	// var mybutton = eval("document.getElementById('showbtn" + n + "')");
	// var theTable = eval("document.getElementById('mytable" + n + "')");
	// var theNewTable = eval("document.getElementById('myNewtable" + n + "')");
	var mybutton = eval("document.all('showbtn" + n + "')");
	var theTable = eval("document.all('mydiv" + n + "')");
	var theNewTable = eval("document.all('myNewdiv" + n + "')");
//	alert ("mytable>>> " + theTable + "mynewtable>>> " + theNewTable);
	
	if(theNewTable != null){
		if(mybutton.value == "details"){
			theTable.style.display = "block";
			theNewTable.style.display = "block";
			mybutton.value = "hide";
		}
		else{
			theTable.style.display = "none";
			theNewTable.style.display = "none";
			mybutton.value = "details";
		}
	}
	
	else{
		if(mybutton.value == "details"){
			theTable.style.display = "block";
			mybutton.value = "hide";
		}
		else{
			theTable.style.display = "none";
			mybutton.value = "details";
		}
	}

}

function cambiaAzione(azione,form){
	var MioCampo = document.all('azione');
	MioCampo.value = azione;
	var theForm = eval ("document." + form);
	theForm.submit();
}

function cambialingua(lng, id){
	var msg = (lng + "  " + id);
	document.location.replace("myNewContent.asp?idParent=" + id + "&" + "lingua=" + lng);
	
	//alert (msg);
}

function imgPopUp(theURL, winName, features){
	window.open(theURL, winName, features);
}

function MenuShowDett(n,menutype,id,lng){
	var i = 0;
	var myDiv = "";
	while(i < 6){
		myDiv = eval("document.all('menu" + i + "')");
		if(myDiv != null){
			myDiv.style.display = "none";
		}
		i++;
	}
	showbnt(n,menutype,id,lng);
}

function showbnt(n,menutype,id,lng){
	var theDiv = eval("document.all('menu" + n + "')");
	if(theDiv.style.display == "none"){
		theDiv.style.display = "block";
	}
	else{
		theDiv.style.display = "none";
	}
}