// JavaScript Document
// VERIFICA EMAIL
function isEmail(what)
{
   var i=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
   if(!i.test(what.value)) { alert("L'indirizzo e-mail non e' valido."); what.focus(); return false}   
   return true;
}

function controllaFormRichiestaInfo(theForm)
{
if (theForm.nome.value == "")
	{
		alert("Per favore inserisci il tuo Nome e Cognome.");
		theForm.nome.focus();
		return (false);
	}

if (theForm.comune.value == "")
	{
		alert("Per favore inserisci il tuo Comune.");
		theForm.comune.focus();
		return (false);
	}	
	
if (theForm.provincia.value == "")
	{
		alert("Per favore inserisci la tua Provincia.");
		theForm.provincia.focus();
		return (false);
	}	

if (theForm.mail.value == "")
	{
		alert("Per favore inserisci il tuo indirizzo E-Mail");
		theForm.mail.focus();
		return (false);
	}
	
if(!isEmail(theForm.mail)) return false;

if (theForm.telefono.value == "")
	{
		alert("Per favore inserisci il tuo numero di Telefono.");
		theForm.telefono.focus();
		return (false);
	}	
	

if (theForm.messaggio.value == "")
	{
		alert("Per favore inserisci la tua Richiesta.");
		theForm.messaggio.focus();
		return (false);
	}

if (theForm.privacy.checked == false)
	{
		alert("E' necessario acconsentire al trattamento dei propri dati personali");
		theForm.privacy.focus();
		return (false);
	}		



	//return (true);
}

function frmT(input){
	input.style.backgroundColor='transparent'
}

function frmW(input){
	input.style.backgroundColor='#E4FFA8'
}



