
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.mail.value=="")
	{
		alert("Tutti i campi sono obbligatori");
		return false;
	}else{
	
		if(theForm.messaggio.value!="Messaggio"){
			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";
				dati += "Messaggio:\n" + theForm.messaggio.value +"\r\n";
				
				theForm.ordine.value=dati;
				//---------- inserire qui l'indirizzo al quale caricare il file email.php --------------
				theForm.action="http://www.pupa-art.net/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.messaggio.name+" è obbligatorio");
			return false;
		}
	}

}
