function checkDataDoSubmit() {
  
  var errors = "";

 if (
    document.getElementById( 'txtCognome' ).value == '' ||
    document.getElementById( 'txtNome' ).value == '' ||
    document.getElementById( 'txtIndirizzoEMail' ).value == ''
  )
    errors += "\n- non tutti i campi obbligatori sono stati compilati";
  
  if (
    document.getElementById( 'chkPrivacy' ).checked == false
  )
    errors += "\n- e' necessario dare il consenso al trattamento dei dati personali";
  
  if ( ! checkEmailFormatLight( document.getElementById( 'txtIndirizzoEMail' ).value, true ) )
    errors += "\n- il formato dell'indirizzo e-Mail non è corretto";

  if ( errors != "" )
  {
    alert("ATTENZIONE:\n" + errors);
    return;
  }

  document.getElementById('txtCognome').value = document.getElementById('ddlSex').value + " " + document.getElementById('txtCognome').value;
  document.forms[0].submit();
}

function closeWindow() {
  window.close();
}


