// JavaScript Document
function controllaFrmContatti()
{
	check="OK";
	errore = "Attenzione!\n";
	
	if(document.frmContatti.nome.value.length < 3)
	{
		check = "NO";
		errore = errore + "- specificare il proprio nome\n";
	}
	
	if(document.frmContatti.email.length < 8 || document.frmContatti.email.value.indexOf("@") < 1 || document.frmContatti.email.value.indexOf(".") < 1)
	{
		check = "NO";
		errore = errore + "- email non valida\n";
	}
	
	if(document.frmContatti.messaggio.value.length < 10)
	{
		check = "NO";
		errore = errore + "- inserire il testo del messaggio";
	}
	
	if (check == "OK")
	{
		document.frmContatti.action = "contatti_invia.php";
		document.frmContatti.submit()
	}
	else
	{
		alert(errore);
	}

	
}
