	//onsubmit="javascript:alert(document.form1.scelta.options[document.form1.scelta.selectedIndex].value);
	function myPopup(html, nome, height, width) {
		window.open( html, nome, "status = 1, height = "+height+", width = "+width+", resizable = 1, toolbar=no, location=no" )
	}

	function svuota()
	{
		var nome = document.getElementById("nom");
		var pass = document.getElementById("pass");
		nome.value = "";
		pass.value = "";
	}

	function crea(value)
	{
		var e = document.getElementById("pippo");
		var html = '<input id="nomealloggio" type="text" size="15" name="n_alloggio" maxlength="25" class="inputext" /></td><font size="-1"> Nome '+value+'</font><input type="radio" name="n_alloggio" value="Non Ricordo" onClick="disabilita();" /><font size="-1">Non ricordo</font><br><tr><td id="scelta"><font size="-1"><b>Lo consiglieresti:</b> </font></td><td id="prova"><input id="azz" name="scelta" type="radio" value="Si" /><font size="-1">S&igrave;</font><input name="scelta" type="radio" value="No" /><font size="-1">No</font></td></tr>';
		e.innerHTML = html;
	}
	
	function deleteInputText()
	{
		var e = document.getElementById("pippo");
		var html = '</td><td></td>';
		e.innerHTML = html;
	}
	
	function disabilita()
	{
		var d = document.getElementById("nomealloggio");
		//var alloggio = document.modulo.n_alloggio;
		d.value = "";
		//alloggio.value = "";
		d.disabled = true;
		d.style.backgroundColor = '#CCCCCC';
		//alloggio.disabled = true;
	}
	
	function cambiaImg()
	{
		var stagioni = document.modulo.lista_stagioni;
		var e = document.getElementById("img");
		if (stagioni.value == "Estate") {
			var html = "<img src='SgTripMaps2/img/estate.gif' />";
		}
		else if (stagioni.value == "Autunno") {
			var html = " <img src='http://www.spiritogolder.org/wp-includes/images/icons/autunno.gif' />";
		}
		else if (stagioni.value == "Inverno") {
			var html = " <img src='SgTripMaps2/img/inverno.gif' />";
		}
		else if (stagioni.value == "Primavera") {
			var html = " <img src='SgTripMaps2/img/primavera.gif' />";
		}
		else {
			var html = "<br><b>Seleziona una stagione</b>";
		}
		e.innerHTML = html;
	}
	
	function get_estensione(path) {
		posizione_punto=path.lastIndexOf(".");
		lunghezza_stringa=path.length;
		estensione=path.substring(posizione_punto+1,lunghezza_stringa);
		var estensione2 = estensione.toUpperCase();
		return estensione2;
	}
	
	function controlla_estensione(path){
		if(get_estensione(path)!="JPG"){ 
			alert("Il file deve avere estensione jpg");
			path = "";
		}
	}
	
	function cambiasfondo(colore, html, img)
	{
		document.getElementById('BOX').style.backgroundColor = colore;
		document.getElementById('livello').style.backgroundImage = "url("+html+")";
		document.getElementById('middle').style.backgroundImage = "url("+img+")";
	}
	
	
	function validate() {
		
		var indirizzo = unescape(String(this.location)); 				
		var params = new Array();
		params = indirizzo.split('&'); 
		
		var vac = params[1];
		
		if (vac == undefined)  {
			
		var path2 = document.getElementById('file').value;
		var prova = document.getElementById('modulo');
		var nome = document.modulo.utente.value;	
		var password = document.modulo.pwd.value;	
		var alloggio = document.modulo.alloggio;
		var localic = document.getElementById('loc');
		var localis = document.getElementById('loc2');
		var mot = document.getElementById('mot');
		var mot2 = document.getElementById('mot2');
		var scelta = document.modulo.scelta;
		var stagioni = document.modulo.lista_stagioni.value;
		var tempo = document.modulo.tempo;
		var trasp = document.modulo.trasp;
		var citta = document.modulo.indirizzo.value;
		var anno = document.modulo.anno.value;
		var durata = document.modulo.durata.value;
		var email = document.modulo.email.value;
		var voto = document.modulo.lista_menu.value;
		var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
	
		//Effettua il controllo sul campo NOME
		if ((nome == "") || (nome == "undefined")) {
		   alert("Il campo Nome e' obbligatorio.");
		   document.modulo.utente.focus();
		   document.modulo.utente.style.backgroundColor = '#FF0000';
	       return false;
		}
		//Effettua il controllo sul campo NOME
		else if ((password == "") || (password == "undefined")) {
		   alert("Il campo Password e' obbligatorio.");
		   document.modulo.pwd.focus();
		   document.modulo.pwd.style.backgroundColor = '#FF0000';
	       return false;
		}
		//Effettua il controllo sul campo EMAIL
		else if ((email != "") & ((!email_reg_exp.test(email) || (email == "") || (email == "undefined")))) {
		   alert("Inserire un indirizzo email corretto.");
		   document.modulo.email.focus();
		   document.modulo.email.style.backgroundColor = '#FF0000';
		   //modulo.email.select();
		   return false;
		}
		
		//Effettua il controllo sul campo IMMAGINE PERSONALE
		else if((path2 != "") & ((get_estensione(path2)!="JPG") )){ 
			alert("L'immagine personale deve avere estensione jpg");
		}
		
		//Effettua il controllo sul campo CITTA
		else if ((citta == "") || (citta == "undefined")) {
		   alert("Il campo Citta' e' obbligatorio.");
		   document.modulo.indirizzo.focus();
		   document.modulo.indirizzo.style.backgroundColor = '#FF0000';
		   return false;
		}
		
		//Effettua il controllo sul campo DURATA
		else if ((anno == "") || (anno == "undefined") || (anno.length < 4)) {
		   alert("Il campo Anno e' obbligatorio e deve avere almeno 4 cifre.");
		   document.modulo.anno.value = "";
		   document.modulo.anno.focus();
		   document.modulo.anno.style.backgroundColor = '#FF0000';
		   return false;
		}

		//Effettua il controllo sul campo DURATA
		else if ((isNaN(durata)) || (durata == "") || (durata == "undefined")) {
		   alert("Il campo Durata e' numerico ed obbligatorio.");
		   document.modulo.durata.value = "";
		   document.modulo.durata.focus();
		   document.modulo.durata.style.backgroundColor = '#FF0000';
		   return false;
		}
		//Effettua il controllo sul campo TEMPO
		else if ((tempo[0].checked == false) && (tempo[1].checked == false) && (tempo[2].checked == false)) {
   			alert("Il Tempo della Durata e' obbligatorio.");
   			return false;
		}
		
		else if ((stagioni == "") || (stagioni == "undefined")) {
		   alert("Il campo Stagione e' obbligatorio");
		   document.modulo.lista_stagioni.focus();
		   return false;
		}
		
		//Effettua il controllo sul campo TRASPORTO
		else if ((trasp[0].checked == false) && (trasp[1].checked == false) && (trasp[2].checked == false) && (trasp[3].checked == false) && (trasp[4].checked == false) && (trasp[5].checked == false) && (trasp[6].checked == false) && (trasp[7].checked == false)) {
   			alert("Il Mezzo Di Trasporto del viaggio e' obbligatorio.");
			trasp.focus();
   			return false;
		}
		//Effettua il controllo sul campo ALLOGGIO
		else if ((alloggio[0].checked == false) && (alloggio[1].checked == false) && (alloggio[2].checked == false) && (alloggio[3].checked == false) && (alloggio[4].checked == false) && (alloggio[5].checked == false)) {
   			alert("Il campo Alloggio e' obbligatorio.");
			alloggio.focus();
   			return false;
		}
		
		else if ((localic.value != "") & ((mot.value == "") || (mot.value == "undefined"))) {
		   alert("Inserire un Motivo al locale consigliato.");
		   mot.focus();
		   mot.style.backgroundColor = '#FF0000';
		   return false;
		}
		
			else if ((localis.value != "") & ((mot2.value == "") || (mot2.value == "undefined"))) {
		   alert("Inserire un Motivo al locale sconsigliato.");
		   mot2.focus();
		   mot2.style.backgroundColor = '#FF0000';
		   return false;
		}
		
		else if ((voto == "") || (voto == "undefined")) {
		   alert("Il campo Voto Finale Al Viaggio e' obbligatorio");
		   document.modulo.lista_menu.focus();
		   return false;
		}
		
		//Effettua il controllo sul campo ALLOGGIO
		/*else if ((alloggio[0].checked == true) || (alloggio[1].checked == true) || (alloggio[2].checked == true) || (alloggio[5].checked == true)) {
			
			//Effettua il controllo sul campo VALUTAZIONE ALLOGGIO
				if ((scelta[0].checked == false) && (scelta[1].checked == false)) {
   					alert("Il campo Valutazione alloggio e' obbligatorio.");
					return false;
				}		
		}*/
		
		else {
			prova.action = "?sezione=SgTripMaps2/myvacation2";
   			prova.submit();
		}
	
	} else {
	
		var prova = document.getElementById('modulo');		
		var alloggio = document.modulo.alloggio;
		var localic = document.getElementById('loc');
		var localis = document.getElementById('loc2');
		var mot = document.getElementById('mot');
		var mot2 = document.getElementById('mot2');
		var anno = document.modulo.anno.value;
		var stagioni = document.modulo.lista_stagioni.value;
		var tempo = document.modulo.tempo;
		var trasp = document.modulo.trasp;
		var citta = document.modulo.indirizzo.value;
		var durata = document.modulo.durata.value;
		var voto = document.modulo.lista_menu.value;
		vac = vac.replace("vacanza","trip");
		
		if ((citta == "") || (citta == "undefined")) {
		   alert("Il campo Citta' e' obbligatorio.");
		   document.modulo.indirizzo.focus();
		   document.modulo.indirizzo.style.backgroundColor = '#FF0000';
		   return false;
		}
		
		else if ((anno == "") || (anno == "undefined") || (anno.length < 4)) {
		   alert("Il campo Anno e' obbligatorio e deve avere almeno 4 cifre.");
		   document.modulo.anno.value = "";
		   document.modulo.anno.focus();
		   document.modulo.anno.style.backgroundColor = '#FF0000';
		   return false;
		}

		//Effettua il controllo sul campo DURATA
		else if ((isNaN(durata)) || (durata == "") || (durata == "undefined")) {
		   alert("Il campo Durata e' numerico ed obbligatorio.");
		   document.modulo.durata.value = "";
		   document.modulo.durata.focus();
		   document.modulo.durata.style.backgroundColor = '#FF0000';
		   return false;
		}
		//Effettua il controllo sul campo TEMPO
		else if ((tempo[0].checked == false) && (tempo[1].checked == false) && (tempo[2].checked == false)) {
   			alert("Il Tempo della Durata e' obbligatorio.");
   			return false;
		}
		else if ((stagioni == "") || (stagioni == "undefined")) {
		   alert("Il campo Stagione e' obbligatorio");
		   document.modulo.lista_stagioni.focus();
		   return false;
		}
		//Effettua il controllo sul campo TRASPORTO
		else if ((trasp[0].checked == false) && (trasp[1].checked == false) && (trasp[2].checked == false) && (trasp[3].checked == false) && (trasp[4].checked == false) && (trasp[5].checked == false) && (trasp[6].checked == false) && (trasp[7].checked == false)) {
   			alert("Il Mezzo Di Trasporto del viaggio e' obbligatorio.");
			trasp.focus();
   			return false;
		}
		//Effettua il controllo sul campo ALLOGGIO
		else if ((alloggio[0].checked == false) && (alloggio[1].checked == false) && (alloggio[2].checked == false) && (alloggio[3].checked == false) && (alloggio[4].checked == false) && (alloggio[5].checked == false)) {
   			alert("Il campo Alloggio e' obbligatorio.");
			alloggio.focus();
   			return false;
		}
		
		else if ((localic.value != "") & ((mot.value == "") || (mot.value == "undefined"))) {
		   alert("Inserire un Motivo al locale consigliato.");
		   mot.focus();
		   mot.style.backgroundColor = '#FF0000';
		   return false;
		}
		
			else if ((localis.value != "") & ((mot2.value == "") || (mot2.value == "undefined"))) {
		   alert("Inserire un Motivo al locale sconsigliato.");
		   mot2.focus();
		   mot2.style.backgroundColor = '#FF0000';
		   return false;
		}
		
		else if ((voto == "") || (voto == "undefined")) {
		   alert("Il campo Voto Finale Al Viaggio e' obbligatorio");
		   document.modulo.lista_menu.focus();
		   return false;
		}
		
		else {
			prova.action = "?sezione=SgTripMaps2/myvacation2&"+vac+"";
   			prova.submit();
		}
	}
	
	}
			
		function bianco(control) {
			
			control.style.backgroundColor = 'white';
			return false;
		}
	
		function aumid(id) {			
			id++;
			return id;
		}
		function dimid(id) {			
			id++;
			return id;
		}

	function mailUrl(sez, numero){
   		var m = "Segnalazione link rotto";
		window.location = "?sezione=homepage&mail=info@supergeppo.com&subject="+m+"&body="+sez+" link "+numero+"";
   }

	