function check_form_newsletter(){
  //alert(document.forms['newsletter'].indirizzo_email.value.length);
  if (document.forms['newsletter'].indirizzo_email.value.length == 0) {
      alert("ATTENTION !!! Check EMAIL.");
      document.forms['newsletter'].indirizzo_email.focus();
      return(0);
  } // end if

  document.forms[0].submit();

} // end function

function check_iscrizione_evento(){
  //alert(document.forms['iscrizione_evento'].email.value.length);

  if (document.forms['iscrizione_evento'].cognome.value.length == 0) {
      alert("ATTENTION !!! Check COGNOME.");
      document.forms['iscrizione_evento'].cognome.focus();
      return(0);
  } // end if

  if (document.forms['iscrizione_evento'].nome.value.length == 0) {
      alert("ATTENTION !!! Check NOME.");
      document.forms['iscrizione_evento'].nome.focus();
      return(0);
  } // end if

  if (document.forms['iscrizione_evento'].email.value.length == 0) {
      alert("ATTENTION !!! Check EMAIL.");
      document.forms['iscrizione_evento'].email.focus();
      return(0);
  } // end if

  document.forms['iscrizione_evento'].submit();

} // end function

function check_pagamento_paypal(){
  //alert(document.forms['abbonamento_paypal'].cognome.value);
  if ( (document.forms['abbonamento_paypal'].cognome.value.length == 0) ||
       (document.forms['abbonamento_paypal'].nome.value.length == 0) ||
       (document.forms['abbonamento_paypal'].indirizzo.value.length == 0) ||
       (document.forms['abbonamento_paypal'].citta.value.length == 0) ||
       (document.forms['abbonamento_paypal'].cap.value.length == 0) ||
       (document.forms['abbonamento_paypal'].provincia.value.length == 0) ||
       (document.forms['abbonamento_paypal'].telefono.value.length == 0) ||
       (document.forms['abbonamento_paypal'].indirizzo_email.value.length == 0) ) {
      alert('ATTENZIONE !!! Controlla i dati obbligatori indicati con il carattere *');
      //echo('<script language="javascript" type="text/javascript">javascript:history.back();</script>');
  } // end if
  document.forms['abbonamento_paypal'].first_name.value = document.forms['abbonamento_paypal'].nome.value;
  document.forms['abbonamento_paypal'].last_name.value = document.forms['abbonamento_paypal'].cognome.value;
  document.forms['abbonamento_paypal'].email.value = document.forms['abbonamento_paypal'].indirizzo_email.value;
  document.forms['abbonamento_paypal'].address1.value = document.forms['abbonamento_paypal'].indirizzo.value+', '+document.forms['abbonamento_paypal'].indirizzo_numero.value+' - '+document.forms['abbonamento_paypal'].provincia.value;
  document.forms['abbonamento_paypal'].address2.value = document.forms['abbonamento_paypal'].telefono.value+', '+document.forms['abbonamento_paypal'].fax.value;
  document.forms['abbonamento_paypal'].city.value = document.forms['abbonamento_paypal'].citta.value;
  document.forms['abbonamento_paypal'].zip.value = document.forms['abbonamento_paypal'].cap.value;
  //alert('tutto ok !');

  document.forms[0].submit();

} // end function

function abbonamento_check_studenti() {
  //alert(document.forms['abbonamento'].ordine_professionale.value);

  if ( (document.forms['abbonamento'].ordine_professionale.value.length == 0) &&
       (document.forms['abbonamento'].facolta.value.length == 0) ) {
    alert('ATTENZIONE !!! Per usufruire della tariffa scontata devi scegliere un Ordine o introdurre un Istituto paritetico.');
    return(0);
  } // end if

  if ( (document.forms['abbonamento'].matricola_1.value.length == 0) &&
       (document.forms['abbonamento'].matricola_2.value.length == 0) ) {
    alert('ATTENZIONE !!! Per usufruire della tariffa scontata devi introdurre una Matricola o Iscrizione valida.');
    return(0);
  } // end if

  if (document.forms['abbonamento'].ordine_professionale.value.length > 0) {
    var scuola = document.forms['abbonamento'].ordine_professionale.value;
  } else {
    var scuola = document.forms['abbonamento'].facolta.value;
    scuola = scuola.replace("'", ""); scuola = scuola.replace("'", ""); scuola = scuola.replace("'", "");
    scuola = scuola.replace('"', ''); scuola = scuola.replace('"', ''); scuola = scuola.replace('"', '');
    //alert(scuola);
  } // end if
  scuola = scuola.replace(' ', '_'); scuola = scuola.replace(' ', '_'); scuola = scuola.replace(' ', '_');

  if (document.forms['abbonamento'].matricola_1.value.length == 0) {
    var matricola = document.forms['abbonamento'].matricola_2.value;
  } else {
    var matricola = document.forms['abbonamento'].matricola_1.value;
  } // end if
  //matricola = matricola.replace("'", "");
  //matricola = matricola.replace('"', '');

  //alert (scuola);
  //alert (matricola);
  //alert ('tutto ok !');

  location.reload('index.php?page=abbonamento_riepilogo&abbonamento=2&scuola='+scuola+'&matricola='+matricola);

} // end function

function abbonamento_check_studenti_17() {
  
  if (document.forms['abbonamento'].facolta_17.value.length == 0) {
    alert('ATTENZIONE !!! Per usufruire della tariffa scontata devi introdurre una Universita\', Istituto o Socio AIAPP .');
    return(0);
  } // end if

  if (document.forms['abbonamento'].matricola_17.value.length == 0) {
    alert('ATTENZIONE !!! Per usufruire della tariffa scontata devi introdurre una Matricola o Iscrizione valida.');
    return(0);
  } // end if


  var scuola = document.forms['abbonamento'].facolta_17.value;
  scuola = scuola.replace("'", ""); scuola = scuola.replace("'", ""); scuola = scuola.replace("'", "");
  scuola = scuola.replace('"', ''); scuola = scuola.replace('"', ''); scuola = scuola.replace('"', '');
  //alert(scuola);
  scuola = scuola.replace(' ', '_'); scuola = scuola.replace(' ', '_'); scuola = scuola.replace(' ', '_');

  var matricola = document.forms['abbonamento'].matricola_17.value;
  //matricola = matricola.replace("'", "");
  //matricola = matricola.replace('"', '');

  //alert (scuola);
  //alert (matricola);
  //alert ('tutto ok !');

  location.reload('index.php?page=abbonamento_riepilogo&abbonamento=17&scuola='+scuola+'&matricola='+matricola);

} // end function

