function change_d(ss) 
{   
  ss.form.address_to.value=ss.options[ss.selectedIndex].value;
};



function checkform(Form) 
{
   var descrErrore = "Errore:";
   var errore = false;

   // Controllo sul campo name
   if (trim(Form.nome.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"Nome\"";
      if (!errore) Form.nome.focus();
      errore = true;
   }

    if (trim(Form.messaggio.value).length==0) 
   {
      descrErrore += "\n- Devi inserire un commento";
      if (!errore) Form.messaggio.focus();
      errore = true;
   }
   
   if (errore) 
   {  window.alert(descrErrore);
      return false;
   }
   else 
   {
      return true;
   }

};


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

   // Controllo sul campo name
   if (trim(Form.nome.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"Nome\"";
      if (!errore) Form.nome.focus();
      errore = true;
   }
   
      // Controllo sul campo cognome
   if (trim(Form.nome.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"Cognome\"";
      if (!errore) Form.nome.focus();
      errore = true;
   }
   
   // Controllo sul campo e-mail
   if (trim(Form.email.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"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- Il campo \"E-Mail\" deve essere della forma nome@dominio.it";
         if (!errore) 
	 {
            Form.email.select();
            Form.email.focus();
         }
      errore = true;
      }
   }
   
   

    if (trim(Form.messaggio.value).length==0) 
   {
      descrErrore += "\n- Devi inserire un messaggio";
      if (!errore) Form.messaggio.focus();
      errore = true;
   }
   
   if (errore) 
   {
      window.alert(descrErrore);
      return false;
   }
   else 
   {
      return true;
   }

}














//controlla il form nel campo abbonamento
function checkform_a(Form) 
{
   var descrErrore = "Errore:";
   var errore = false;
 
   // Controllo sul campo name
   if (trim(Form.nome.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"Nome Cognome\"";
      if (!errore) Form.nome.focus();
      errore = true;
   }

   // Controllo sul campo via
   if (trim(Form.via.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"Via\"";
      if (!errore) Form.via.focus();
      errore = true;
   }
	 
    // Controllo sul campo cap
   if (trim(Form.cap.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"Cap\"";
      if (!errore) Form.cap.focus();
      errore = true;
   }
	 
	    // Controllo sul campo cittą
   if (trim(Form.citta.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"Cittą\"";
      if (!errore) Form.citta.focus();
      errore = true;
   }
	 
	    // Controllo sul campo Telefono
   if (trim(Form.telefono.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"Telefono\"";
      if (!errore) Form.telefono.focus();
      errore = true;
   }
	 

  // Controllo sul campo e-mail
   if (trim(Form.email.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"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- Il campo \"E-Mail\" deve essere della forma nome@dominio.it";
         if (!errore) 
	 {
            Form.email.select();
            Form.email.focus();
         }
      errore = true;
      }
   }
	 
	    // Controllo sul campo cap
   if (trim(Form.codfiscale.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"Codice fiscale - P.IVA\"";
      if (!errore) Form.codfiscale.focus();
      errore = true;
   }

	 
	 	    // Controllo sul campo cap
   if (!Form.privacy.checked) 
   {
      descrErrore += "\n- Non hai letto \"trattamento dei miei dati\"";
      if (!errore) Form.privacy.focus();
      errore = true;
   }
	 
 
	 	 	    // Controllo sul campo cap
   if (!Form.disclaimer.checked) 
   {
      descrErrore += "\n- Non hai letto \"disclaimer\"";
      if (!errore) Form.disclaimer.focus();
      errore = true;
   }
   

   
   if (errore) 
   {
      window.alert(descrErrore);
      return false;
   }
   else 
   {
      return true;
   }

}


//controlla il form nel campo abbonamento
function checkform_a_simple(Form) 
{
   var descrErrore = "Errore:";
   var errore = false;
 
   // Controllo sul campo name
   if (trim(Form.nome.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"Nome Cognome\"";
      if (!errore) Form.nome.focus();
      errore = true;
   }

   // Controllo sul campo via
   if (trim(Form.via.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"Via\"";
      if (!errore) Form.via.focus();
      errore = true;
   }
	 
    // Controllo sul campo cap
   if (trim(Form.cap.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"Cap\"";
      if (!errore) Form.cap.focus();
      errore = true;
   }
	 
	    // Controllo sul campo cittą
   if (trim(Form.citta.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"Cittą\"";
      if (!errore) Form.citta.focus();
      errore = true;
   }
	 
  // Controllo sul campo e-mail
   if (trim(Form.email.value).length==0) 
   {
      descrErrore += "\n- Non hai riempito il campo \"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- Il campo \"E-Mail\" deve essere della forma nome@dominio.it";
         if (!errore) 
	 {
            Form.email.select();
            Form.email.focus();
         }
      errore = true;
      }
   }
	 
	 	    // Controllo sul campo cap
   if (!Form.privacy.checked) 
   {
      descrErrore += "\n- Non hai letto \"trattamento dei miei dati\"";
      if (!errore) Form.privacy.focus();
      errore = true;
   }
	 
 
	 	 	    // Controllo sul campo cap
   if (!Form.disclaimer.checked) 
   {
      descrErrore += "\n- Non hai letto \"disclaimer\"";
      if (!errore) Form.disclaimer.focus();
      errore = true;
   }
   

   
   if (errore) 
   {
      window.alert(descrErrore);
      return false;
   }
   else 
   {
      return true;
   }

}