
function visualizza(obj){
	if(obj.value==""){
		obj.value=obj.name;
	}
}

function canc(obj){
	if(obj.value==obj.name){
		obj.value="";
	}
}

function nam(obj){
	if(obj.value==""){
		obj.value=obj.name;
	}
}


function controlla()
{
	theForm=document.form1;


	if (theForm.nome.value=="" || theForm.nome.value=="Nome" || theForm.cognome.value=="" || theForm.cognome.value=="Cognome" || theForm.mail.value=="" || theForm.consenso.value=="")
	{
		alert("Tutti i campi in marrone sono obbligatori");
		return false;
	}else{
	
		if(theForm.consenso.checked!=""){
			
			mail=theForm.mail.value;
			if(mail.indexOf(".")>0 && mail.indexOf("@")>0){
				dati = "Nome:\t" + theForm.nome.value +"\r\n";
				dati += "Cognome:\t" + theForm.cognome.value +"\r\n";
				dati += "Indirizzo:\t" + theForm.indirizzo.value +"\r\n";
				dati += "Telefono:\t" + theForm.tel.value +"\r\n";
				dati += "E-mail:\t" + theForm.mail.value +"\r\n";
				dati += "Data di Nascita:\t" + theForm.data_nascita.value +"\r\n";
				dati += "DECR.LGS PRIVACY N.196/2003:\t" + theForm.consenso.value +"\r\n";

				//if(theForm.richiesta.value!=""){
					//dati += "Richiesta:\n" + theForm.richiesta.value +"\r\n";
				//}else{
					//dati += "Nessuna Richiesta\r\n";
				//}
				
				theForm.ordine.value=dati;
				//---------- inserire qui l'indirizzo al quale caricare il file email.php --------------
				theForm.action="http://www.carducci38.com/email.php";
				//----------------------------------
				theForm.submit();
			
	
			//my_window= window.open ("","mywindow1","scoll=1,status=1,width=350,height=500,resize=yes");
			//my_window.document.write(theForm.ordine.value);
	
			//alert(theForm.ordine.value);
			}else{
				alert("Indirizzo e-mail errato\ncontrollare!");
				return false;
			}
		}else{
			
			alert("Il campo "+theForm.consenso.value+" è obbligatorio");
			return false;
		}
	}

}