function CheckLength(txta,chrs,maxchars)
{ with (document.modulo)
{ var chars=txta.value
if (chars.length > maxchars)
{ txta.value=chars.substr(0,maxchars);
txta.blur(); }
chrs.value=maxchars-txta.value.length; } 
}
  
function validateForm(form) {  
if ( (form.nome.value == "") ) { 
alert("Attenzione! Il campo NOME è obbligatorio!");
form.nome.focus();  
return false;}
if ( (form.messaggio.value == "") ) { 
alert("Attenzione! Devi inserire la richiesta!");
form.messaggio.focus();  
return false;}
if ( (form.telefono.value == "") ) { 
alert("Attenzione! Il campo TELEFONO è obbligatorio!");
form.telefono.focus();  
return false;}
if  ( form.email.value.indexOf( "@") == -1 )
{ alert( "Inserisci un indirizzo valido per la e-mail" ); 
return false; }
if ( form.email.value.indexOf( ".") == -1 )
{ alert( "Inserisci un indirizzo valido per la e-mail" ); 
return false; }
if ( (form.privacy.checked == false) ) { 
alert("Attenzione! Devi autorizzare il trattamento dei tuoi dati!");
form.privacy.focus();  
return false;}
return true;}  
