  function inviaRichiestaFranchising(theForm)
  {
    var message = "";
    /*if (isEmpty(theForm.ragionesociale.value))
    {
      message += "-  Ragione Sociale è un campo obbligatorio.\n";
    }*/
    /*if (isEmpty(theForm.amministratore.value))
    {
      message += "-  Anagrafica Amministratore è un campo obbligatorio.\n";
    }*/
    /*if (isEmpty(theForm.telefonoamministratore.value))
    {
      message += "-  Telefono Amministratore è un campo obbligatorio.\n";
    }*/
    if (isEmpty(theForm.partitaiva.value))
    {
      message += "-  Partita Iva è un campo obbligatorio.\n";
    }
    else if (!isValidItalianTaxNumber(theForm.partitaiva.value))
    {
      message += "-  Partita Iva non valida.\n";
    }
    if (isEmpty(theForm.attivita.value))
    {
      message += "-  Attività è un campo obbligatorio.\n";
    }
   /*if (isEmpty(theForm.capitale.value))
    {
      message += "-  Capitale Sociale è un campo obbligatorio.\n";
    }*/
    if (isEmpty(theForm.indirizzo.value))
    {
      message += "-  Indirizzo è un campo obbligatorio.\n";
    }
    if (isEmpty(theForm.citta.value))
    {
      message += "-  Città è un campo obbligatorio.\n";
    }
    if (isEmpty(theForm.cap.value))
    {
      message += "-  CAP è un campo obbligatorio.\n";
    }
    if (isEmpty(theForm.provincia.value))
    {
      message += "-  Provincia è un campo obbligatorio.\n";
    }
   /* if (isEmpty(theForm.telefono.value))
    {
      message += "-  Telefono è un campo obbligatorio.\n";
    }*/
    /*if (!isValidDate(theForm.datainizioattivita$day.value, theForm.datainizioattivita$month.value, theForm.datainizioattivita$year.value))
    {
      message += "-  Data Inizio Attività non valida.\n";
    }*/
   /* if (isEmpty(theForm.addettitotali.value))
    {
      message += "-  Addetti Totali è un campo obbligatorio.\n";
    }*/
    /*else if (!eNumero(theForm.addettitotali.value))
    {
      message += "-  Addetti Totali non è valido.\n";
    }*/
    /*if (isEmpty(theForm.numeroveicoli.value))
    {
      message += "-  Veicoli Utilizzabili Per Il Noleggio è un campo obbligatorio.\n";
    }*/
    /*else if (!eNumero(theForm.numeroveicoli.value))
    {
      message += "-  Veicoli Utilizzabili Per Il Noleggio non è valido.\n";
    }*/
    if (isEmpty(theForm.email.value))
    {
      message += "-  Email Azienda è un campo obbligatorio.\n";
    }
    else if (!isValidEmailAddress(theForm.email.value))
    {
      message += "-  Email Azienda non valida.\n";
    }
    if (isEmpty(theForm.referente.value))
    {
      message += "-  Anagrafica Referente è un campo obbligatorio.\n";
    }
    /*if (isEmpty(theForm.telefonoreferente.value))
    {
      message += "-  Telefono Diretto Referente è un campo obbligatorio.\n";
    }*/
    /*if (isEmpty(theForm.cellularereferente.value))
    {
      message += "-  Cellulare Referente è un campo obbligatorio.\n";
    }*/
    /*if (isEmpty(theForm.emailreferente.value))
    {
      message += "-  Email Referente è un campo obbligatorio.\n";
    }*/
    /*else if (!isValidEmailAddress(theForm.emailreferente.value))
    {
      message += "-  Email Referente non valida.\n";
    }*/
    if(!theForm.privacy.checked)
    {
      message += "-  Consenso Trattamento Dati Personali è un campo obbligatorio.\n";
    }

    if(isEmpty(message))
    {
      setupCaseAutomobilistiche(theForm);
      theForm.submit();
    }
    else
    {
      message = ' Si sono verificati i seguenti errori :\n\n' + message;      
      alert (message);
    }
  }

  function setupCaseAutomobilistiche(theForm)
  {
    value = "";
    if((theForm.marchio != null) && (theForm.marchio != undefined))
    {
      selectoptions = theForm.marchio.options;
      if((selectoptions != null) && (selectoptions != undefined) && (selectoptions.length > 0))
      {
        for(i = 0; i < selectoptions.length; i++)
        {
          if(selectoptions[i].selected)
          {
            value += (selectoptions[i].value + ";");
          }          
        }
        if(!isEmpty(value))
        {
          value = value.substring(0, (value.length - 1));
        }
      }
    }    
    if((theForm.caseautomobilistiche != null) && (theForm.caseautomobilistiche != undefined))
    {
      theForm.caseautomobilistiche.value = value;
    }
  }

  function checkerror(iserrore)
  {
    if("true" == iserrore)
    {
      alert("Si è verificato un errore durante l'invio del modulo di richiesta.");
    }
  }
