//controlla il form nel campo contatti
function checkform_contatti(Form) 
{
   var descrErrore = "Errore:";
   var errore = false;

   // Controllo sul campo name
   if (trim(Form.nome.value).length==0) 
   {
      descrErrore += "\n- Insert \"Name\"";
      if (!errore) Form.nome.focus();
      errore = true;
   }
   
      // Controllo sul campo cognome
   if (trim(Form.cognome.value).length==0) 
   {
      descrErrore += "\n- Insert \"Surname\"";
      if (!errore) Form.nome.focus();
      errore = true;
   }
   
   // Controllo sul campo e-mail
   if (trim(Form.email.value).length==0) 
   {
      descrErrore += "\n- Insert \"E-Mail\"";
      if (!errore) Form.email.focus();
      errore = true;
   }
   else 
   {
      // controllo forma dell'email
      if (Form.email.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1) 
      {
         descrErrore += "\n- Insert \"E-Mail\" like name@domain.com";
         if (!errore) 
	 {
            Form.email.select();
            Form.email.focus();
         }
      errore = true;
      }
   }
   
   

    if (trim(Form.info.value).length==0) 
   {
      descrErrore += "\n- Insert a message";
      if (!errore) Form.info.focus();
      errore = true;
   }
   
   if (errore) 
   {
      window.alert(descrErrore);
      return false;
   }
   else 
   {
      return true;
   }

}


