function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externalLinks;







function Modulo_GIS()
{

   re=/\s+$|^\s+/g;
document.modulo_gis.cognome.value=document.modulo_gis.cognome.value.replace(re,"");
document.modulo_gis.nome.value=document.modulo_gis.nome.value.replace(re,"");
document.modulo_gis.email.value=document.modulo_gis.email.value.replace(re,"");
document.modulo_gis.domanda.value=document.modulo_gis.domanda.value.replace(re,"");

if ((document.modulo_gis.cognome.value=="")||(document.modulo_gis.cognome.value=="inserisci il tuo cognome")) {
alert ("Cognome mancante");
document.modulo_gis.cognome.focus();
return false;
}

if ((document.modulo_gis.nome.value=="")||(document.modulo_gis.nome.value=="inserisci il tuo nome")) {
alert ("Nome mancante");
document.modulo_gis.nome.focus();
return false;
}

if ((document.modulo_gis.email.value=="")||(document.modulo_gis.email.value=="inserisci la tua email")) {
alert ("Email mancante");
document.modulo_gis.email.focus();
return false;
}

if ((document.modulo_gis.email.value.indexOf("@")==-1)||(document.modulo_gis.email.value.indexOf(".")==-1)) {
alert("Email non valida");
document.modulo_gis.email.focus();
return false;
}

if ((document.modulo_gis.domanda.value=="")||(document.modulo_gis.domanda.value=="il tuo quesito")) {
alert ("Domanda mancante");
document.modulo_gis.domanda.focus();
return false;
}


}























function Modulo_Registrazione()
{

   re=/\s+$|^\s+/g;
document.modulo_registrazione.cognome_utente.value=document.modulo_registrazione.cognome_utente.value.replace(re,"");
document.modulo_registrazione.nome_utente.value=document.modulo_registrazione.nome_utente.value.replace(re,"");
document.modulo_registrazione.email_utente.value=document.modulo_registrazione.email_utente.value.replace(re,"");
document.modulo_registrazione.pseudo_utente.value=document.modulo_registrazione.pseudo_utente.value.replace(re,"");
document.modulo_registrazione.password_utente.value=document.modulo_registrazione.password_utente.value.replace(re,"");
document.modulo_registrazione.password_utente_conf.value=document.modulo_registrazione.password_utente_conf.value.replace(re,"");



if ((document.modulo_registrazione.email_utente.value=="")||(document.modulo_registrazione.email_utente.value=="inserisci la tua email")) {
alert ("Email mancante");
document.modulo_registrazione.email_utente.focus();
return false;
}

if ((document.modulo_registrazione.email_utente.value.indexOf("@")==-1)||(document.modulo_registrazione.email_utente.value.indexOf(".")==-1)) {
alert("Email non valida");
document.modulo_registrazione.email_utente.focus();
return false;
}


if (document.modulo_registrazione.password_utente.value=="") {
alert ("Password mancante");
document.modulo_registrazione.password_utente.focus();
return false;
}

if (document.modulo_registrazione.password_utente.value.length<6) {
alert ("Scegliere una password di almeno 6 caratteri");
document.modulo_registrazione.password_utente.focus();
return false;
}


if (document.modulo_registrazione.password_utente_conf.value=="") {
alert ("Conferma password mancante");
document.modulo_registrazione.password_utente_conf.focus();
return false;
}

if (document.modulo_registrazione.password_utente_conf.value.length<6) {
alert ("Minimo 6 caratteri");
document.modulo_registrazione.password_utente_conf.focus();
return false;
}


if (document.modulo_registrazione.password_utente.value!=document.modulo_registrazione.password_utente_conf.value) {
alert ("Avete digitato due passwords diverse!");
document.modulo_registrazione.password_utente.focus();
return false;
}




if ((document.modulo_registrazione.pseudo_utente.value=="")||(document.modulo_registrazione.pseudo_utente.value=="scegli un pseudonimo")||(document.modulo_registrazione.pseudo_utente.value.length<2)) {
alert ("Pseudonimo mancante (minimo 2 caratteri)");
document.modulo_registrazione.pseudo_utente.focus();
return false;
}

if ((document.modulo_registrazione.cognome_utente.value=="")||(document.modulo_registrazione.cognome_utente.value=="inserisci il tuo cognome")||(document.modulo_registrazione.cognome_utente.value.length<2)) {
alert ("Cognome mancante");
document.modulo_registrazione.cognome_utente.focus();
return false;
}

if ((document.modulo_registrazione.nome_utente.value=="")||(document.modulo_registrazione.nome_utente.value=="inserisci il tuo nome")||(document.modulo_registrazione.nome_utente.value.length<2)) {
alert ("Nome mancante");
document.modulo_registrazione.nome_utente.focus();
return false;
}

}















function Modulo_Contatti()
{

   re=/\s+$|^\s+/g;
document.modulo_contatti.cognome.value=document.modulo_contatti.cognome.value.replace(re,"");
document.modulo_contatti.nome.value=document.modulo_contatti.nome.value.replace(re,"");
document.modulo_contatti.email.value=document.modulo_contatti.email.value.replace(re,"");
document.modulo_contatti.messaggio.value=document.modulo_contatti.messaggio.value.replace(re,"");
document.modulo_contatti.provincia.value=document.modulo_contatti.provincia.value.replace(re,"");


if ((document.modulo_contatti.cognome.value=="")||(document.modulo_contatti.cognome.value=="inserisci il tuo cognome")) {
alert ("Cognome mancante");
document.modulo_contatti.cognome.focus();
return false;
}

if ((document.modulo_contatti.nome.value=="")||(document.modulo_contatti.nome.value=="inserisci il tuo nome")) {
alert ("Nome mancante");
document.modulo_contatti.nome.focus();
return false;
}

if ((document.modulo_contatti.provincia.value=="")||(document.modulo_contatti.provincia.value=="inserisci la tua provincia")) {
alert ("Provincia mancante");
document.modulo_contatti.provincia.focus();
return false;
}



if ((document.modulo_contatti.email.value=="")||(document.modulo_contatti.email.value=="inserisci la tua email")) {
alert ("Email mancante");
document.modulo_contatti.email.focus();
return false;
}

if ((document.modulo_contatti.email.value.indexOf("@")==-1)||(document.modulo_contatti.email.value.indexOf(".")==-1)) {
alert("Email non valida");
document.modulo_contatti.email.focus();
return false;
}


if ((document.modulo_contatti.messaggio.value=="")||(document.modulo_contatti.messaggio.value=="il tuo messaggio")) {
alert ("Messaggio mancante");
document.modulo_contatti.messaggio.focus();
return false;
}

}











function Modulo_Corsi()
{

   re=/\s+$|^\s+/g;
document.modulo.titolo_corso.value=document.modulo.titolo_corso.value.replace(re,"");
document.modulo.docente_corso.value=document.modulo.docente_corso.value.replace(re,"");
document.modulo.numero_max.value=document.modulo.numero_max.value.replace(re,"");
document.modulo.testo.value=document.modulo.testo.value.replace(re,"");
document.modulo.costo.value=document.modulo.costo.value.replace(re,"");
document.modulo.numero_incontri.value=document.modulo.numero_incontri.value.replace(re,"");


if ((document.modulo.titolo_corso.value=="")||(document.modulo.titolo_corso.value=="titolo")) {
alert ("Titolo mancante");
document.modulo.titolo_corso.focus();
return false;
}

if ((document.modulo.docente_corso.value=="")||(document.modulo.docente_corso.value=="docente")) {
alert ("Docente mancante");
document.modulo.docente_corso.focus();
return false;
}

if ((document.modulo.numero_max.value=="")||(document.modulo.numero_max.value=="numero")) {
alert ("Numero max partecipanti mancante");
document.modulo.numero_max.focus();
return false;
}

if ((document.modulo.testo.value=="")||(document.modulo.testo.value=="note")) {
alert ("Testo mancante");
document.modulo.testo.focus();
return false;
}

if ((document.modulo.costo.value=="")||(document.modulo.costo.value=="costo")) {
alert ("Costo mancante");
document.modulo.costo.focus();
return false;
}


if ((document.modulo.numero_incontri.value=="")||(isNaN(document.modulo.numero_incontri.value))) {
alert ("Numero incontri mancante");
document.modulo.numero_incontri.focus();
return false;
}


}
















function Modulo_Sedi_Corsi()
{

   re=/\s+$|^\s+/g;
document.modulo.sede.value=document.modulo.sede.value.replace(re,"");


if (document.modulo.sede.value=="") {
alert ("Sede mancante");
document.modulo.sede.focus();
return false;
}



var n = document.modulo.numero_incontri.value;


	for (var i=1; i<=n; i++) {

   re=/\s+$|^\s+/g;
eval("document.modulo.giorno_incontro"+i+".value=document.modulo.giorno_incontro"+i+".value.replace(re,\"\")");
eval("document.modulo.mese_incontro"+i+".value=document.modulo.mese_incontro"+i+".value.replace(re,\"\")");
eval("document.modulo.anno_incontro"+i+".value=document.modulo.anno_incontro"+i+".value.replace(re,\"\")");
eval("document.modulo.ora_inizio"+i+".value=document.modulo.ora_inizio"+i+".value.replace(re,\"\")");
eval("document.modulo.ora_fine"+i+".value=document.modulo.ora_fine"+i+".value.replace(re,\"\")");
eval("document.modulo.presso"+i+".value=document.modulo.presso"+i+".value.replace(re,\"\")");


if (eval("document.modulo.giorno_incontro"+i+".value==''")||eval("document.modulo.giorno_incontro"+i+".value=='gg'")) {
alert ("Giorno incontro "+i+" mancante");
eval("document.modulo.giorno_incontro"+i+".focus()");
return false;
}


if (eval("isNaN(document.modulo.giorno_incontro"+i+".value)")||eval("document.modulo.giorno_incontro"+i+".value<1")||eval("document.modulo.giorno_incontro"+i+".value>31")) {
alert ("Giorno incontro "+i+" sbagliato");
eval("document.modulo.giorno_incontro"+i+".focus()");
return false;
}





if (eval("document.modulo.mese_incontro"+i+".value==''")||eval("document.modulo.mese_incontro"+i+".value=='mm'")) {
alert ("Mese incontro "+i+" mancante");
eval("document.modulo.mese_incontro"+i+".focus()");
return false;
}

if (eval("isNaN(document.modulo.mese_incontro"+i+".value)")||eval("document.modulo.mese_incontro"+i+".value<1")||eval("document.modulo.mese_incontro"+i+".value>12")) {
alert ("Mese incontro "+i+" sbagliato");
eval("document.modulo.mese_incontro"+i+".focus()");
return false;
}





if (eval("document.modulo.anno_incontro"+i+".value==''")||eval("document.modulo.anno_incontro"+i+".value=='aaaa'")) {
alert ("Anno incontro "+i+" mancante");
eval("document.modulo.anno_incontro"+i+".focus()");
return false;
}

if (eval("isNaN(document.modulo.anno_incontro"+i+".value)")||eval("document.modulo.anno_incontro"+i+".value<2000")||eval("document.modulo.anno_incontro"+i+".value>2100")) {
alert ("Anno incontro "+i+" sbagliato");
eval("document.modulo.anno_incontro"+i+".focus()");
return false;
}





if (eval("document.modulo.ora_inizio"+i+".value==''")) {
alert ("Ora inizio incontro "+i+" mancante");
eval("document.modulo.ora_inizio"+i+".focus()");
return false;
}

if (eval("document.modulo.ora_fine"+i+".value==''")) {
alert ("Ora fine incontro "+i+" mancante");
eval("document.modulo.ora_fine"+i+".focus()");
return false;
}

if (eval("document.modulo.presso"+i+".value==''")) {
alert ("Luogo incontro "+i+" mancante");
eval("document.modulo.presso"+i+".focus()");
return false;
}

	}

}

























function Inserimento_News()
{

   re=/\s+$|^\s+/g;
document.modulo.titolo.value=document.modulo.titolo.value.replace(re,"");
document.modulo.testo.value=document.modulo.testo.value.replace(re,"");



if ((document.modulo.titolo.value=="")||(document.modulo.titolo.value=="titolo")) {
alert ("Titolo mancante");
document.modulo.titolo.focus();
return false;
}



if ((document.modulo.testo.value=="")||(document.modulo.testo.value=="testo")) {
alert ("Testo mancante");
document.modulo.testo.focus();
return false;
}




}










function Segnalazione_News()
{

   re=/\s+$|^\s+/g;
document.modulo.cognome.value=document.modulo.cognome.value.replace(re,"");
document.modulo.nome.value=document.modulo.nome.value.replace(re,"");
document.modulo.email.value=document.modulo.email.value.replace(re,"");
document.modulo.testo.value=document.modulo.testo.value.replace(re,"");



if ((document.modulo.cognome.value=="")||(document.modulo.cognome.value=="inserisci il tuo cognome")) {
alert ("Cognome mancante");
document.modulo.cognome.focus();
return false;
}

if ((document.modulo.nome.value=="")||(document.modulo.nome.value=="inserisci il tuo nome")) {
alert ("Nome mancante");
document.modulo.nome.focus();
return false;
}


if ((document.modulo.email.value=="")||(document.modulo.email.value=="inserisci la tua email")) {
alert ("Email mancante");
document.modulo.email.focus();
return false;
}

if ((document.modulo.email.value.indexOf("@")==-1)||(document.modulo.email.value.indexOf(".")==-1)) {
alert("Email non valida");
document.modulo.email.focus();
return false;
}


if ((document.modulo.testo.value=="")||(document.modulo.testo.value=="la tua segnalazione")) {
alert ("Segnalazione mancante");
document.modulo.testo.focus();
return false;
}




}








function Segnalazione_Links()
{

   re=/\s+$|^\s+/g;
document.modulo.cognome.value=document.modulo.cognome.value.replace(re,"");
document.modulo.nome.value=document.modulo.nome.value.replace(re,"");
document.modulo.email.value=document.modulo.email.value.replace(re,"");
document.modulo.nome_sito.value=document.modulo.nome_sito.value.replace(re,"");
document.modulo.url_sito.value=document.modulo.url_sito.value.replace(re,"");


if ((document.modulo.cognome.value=="")||(document.modulo.cognome.value=="inserisci il tuo cognome")) {
alert ("Cognome mancante");
document.modulo.cognome.focus();
return false;
}

if ((document.modulo.nome.value=="")||(document.modulo.nome.value=="inserisci il tuo nome")) {
alert ("Nome mancante");
document.modulo.nome.focus();
return false;
}


if ((document.modulo.email.value=="")||(document.modulo.email.value=="inserisci la tua email")) {
alert ("Email mancante");
document.modulo.email.focus();
return false;
}

if ((document.modulo.email.value.indexOf("@")==-1)||(document.modulo.email.value.indexOf(".")==-1)) {
alert("Email non valida");
document.modulo.email.focus();
return false;
}


if ((document.modulo.nome_sito.value=="")||(document.modulo.nome_sito.value=="inserisci il nome del sito")) {
alert ("Nome del sito mancante");
document.modulo.nome_sito.focus();
return false;
}

if ((document.modulo.url_sito.value=="")||(document.modulo.url_sito.value=="inserisci l'indirizzo del sito")) {
alert ("URL del sito mancante");
document.modulo.url_sito.focus();
return false;
}


}






function citta_per_lettera(lettera) {

var p = null;

if(window.XMLHttpRequest) {// Firefox   
p = new XMLHttpRequest();
}   
else if(window.ActiveXObject) { // Internet Explorer   
p = new ActiveXObject("Microsoft.XMLHTTP");
}  
else { // XMLHttpRequest non supporté par le navigateur   
alert("Il tuo browser non accetta gli oggetti XMLHTTPRequest...");   
return false;
}

    p.open("POST","ajax_citta_per_lettera.php", true);
    p.setRequestHeader("Content-type","application/x-www-form-urlencoded");

var variabili="lettera="+lettera;
    p.send(variabili);

p.onreadystatechange = function() { 
	if(p.readyState == 4) {
    	if ( p.status != "200" ) {
      alert("Errore " + p.status);
    	} else {
document.getElementById("scelta_citta").innerHTML=p.responseText;
    	}
	}
}

}




function citta_per_lettera_cr(lettera) {

var p = null;

if(window.XMLHttpRequest) {// Firefox   
p = new XMLHttpRequest();
}   
else if(window.ActiveXObject) { // Internet Explorer   
p = new ActiveXObject("Microsoft.XMLHTTP");
}  
else { // XMLHttpRequest non supporté par le navigateur   
alert("Il tuo browser non accetta gli oggetti XMLHTTPRequest...");   
return false;
}

    p.open("POST","ajax_citta_per_lettera_cr.php", true);
    p.setRequestHeader("Content-type","application/x-www-form-urlencoded");

var variabili="lettera="+lettera;
    p.send(variabili);

p.onreadystatechange = function() { 
	if(p.readyState == 4) {
    	if ( p.status != "200" ) {
      alert("Errore " + p.status);
    	} else {
document.getElementById("scelta_citta").innerHTML=p.responseText;
    	}
	}
}

}


function controllo_primo_accesso() {

   re=/\s+$|^\s+/g;
document.getElementById("cognome_socio").value=document.getElementById("cognome_socio").value.replace(re,"");
document.getElementById("nome_socio").value=document.getElementById("nome_socio").value.replace(re,"");
document.getElementById("email_socio").value=document.getElementById("email_socio").value.replace(re,"");

if(document.getElementById("cognome_socio").value=="") {alert("Cognome mancante"); document.getElementById("cognome_socio").focus(); return false;}
if(document.getElementById("nome_socio").value=="") {alert("Nome mancante"); document.getElementById("nome_socio").focus(); return false;}
if(document.getElementById("luogo_nascita").value=="0") {alert("Luogo di nascita mancante"); document.getElementById("luogo_nascita").focus(); return false;}
if(document.getElementById("email_socio").value=="") {alert("Email mancante"); document.getElementById("email_socio").focus(); return false;}

var cognome_socio=document.getElementById("cognome_socio").value;
var nome_socio=document.getElementById("nome_socio").value;
var luogo_nascita=document.getElementById("luogo_nascita").value;
var sesso_socio=document.getElementById("sesso_socio").value;
var giorno_nascita=document.getElementById("giorno_nascita").value;
var mese_nascita=document.getElementById("mese_nascita").value;
var anno_nascita1=document.getElementById("anno_nascita1").value;
var anno_nascita2=document.getElementById("anno_nascita2").value;
var anno_nascita3=document.getElementById("anno_nascita3").value;
var cf_socio=document.getElementById("cf_socio").value;
var mail=document.getElementById("email_socio").value;

var anno_nascita=anno_nascita1+anno_nascita2+anno_nascita3;
var y=new Date();
y=y.getFullYear();
var anno_limite=y-18;
if(anno_nascita>=anno_limite) {
alert("Devi avere più di 18 anni"); return false;
}

var arobase = mail.indexOf("@");
   var point = mail.lastIndexOf(".");
   if((arobase < 3)||(point + 2 > mail.length)||(point < arobase+3)) {
document.getElementById("email_socio").focus();
alert("Email non valida");
return false;
   }
   
   
var p = null;

if(window.XMLHttpRequest) {// Firefox   
p = new XMLHttpRequest();
}   
else if(window.ActiveXObject) { // Internet Explorer   
p = new ActiveXObject("Microsoft.XMLHTTP");
}  
else { // XMLHttpRequest non supporté par le navigateur   
alert("Il tuo browser non accetta gli oggetti XMLHTTPRequest...");   
return false;
}

    p.open("POST","ajax_primo_accesso.php", false);
    p.setRequestHeader("Content-type","application/x-www-form-urlencoded");

var variabili="email_socio="+mail+"&cf_socio="+cf_socio+"&cognome_socio="+cognome_socio+"&nome_socio="+nome_socio+"&luogo_nascita="+luogo_nascita+"&sesso_socio="+sesso_socio+"&giorno_nascita="+giorno_nascita+"&mese_nascita="+mese_nascita+"&anno_nascita1="+anno_nascita1+"&anno_nascita2="+anno_nascita2+"&anno_nascita3="+anno_nascita3;

    p.send(variabili);

if(p.responseText==1) {alert("Email già presente in archivio"); return false;}
if(p.responseText==2) {alert("Codice fiscale incongruente"); return false;}


}




function Tesseramento()
{


   re=/\s+$|^\s+/g;

document.tesseramento.indirizzo_recapito.value=document.tesseramento.indirizzo_recapito.value.replace(re,"");
document.tesseramento.comune_recapito_eee.value=document.tesseramento.comune_recapito_eee.value.replace(re,"");
document.tesseramento.cap_recapito.value=document.tesseramento.cap_recapito.value.replace(re,"");
document.tesseramento.anno_diploma.value=document.tesseramento.anno_diploma.value.replace(re,"");
document.tesseramento.comune_diploma.value=document.tesseramento.comune_diploma.value.replace(re,"");
document.tesseramento.azienda.value=document.tesseramento.azienda.value.replace(re,"");
document.tesseramento.nazione_recapito.value=document.tesseramento.nazione_recapito.value.replace(re,"");

if (document.tesseramento.tipo_associato.value=="") {
alert ("Tipo associato mancante");
document.tesseramento.tipo_associato.focus();
return false;
}

if (document.tesseramento.indirizzo_recapito.value=="") {
alert ("Indirizzo mancante");
document.tesseramento.indirizzo_recapito.focus();
return false;
}

if ((document.tesseramento.eccezione_estero[1].checked==true)&&(document.tesseramento.tipo_associato.value=="B")) {
alert ("Iscrizione impossibile");
return false;
}

if ((document.tesseramento.eccezione_estero[1].checked==true)&&(document.tesseramento.nazione_recapito.value=="")) {
alert ("Nazione mancante");
document.tesseramento.nazione_recapito.focus();
return false;
}

if ((document.tesseramento.eccezione_estero[0].checked==true)&&(document.tesseramento.comune_recapito.value=="0")) {
alert ("Comune mancante");
document.tesseramento.comune_recapito.focus();
return false;
}

if ((document.tesseramento.eccezione_estero[1].checked==true)&&(document.tesseramento.comune_recapito_eee.value=="")) {
alert ("Comune mancante");
document.tesseramento.comune_recapito_eee.focus();
return false;
}

if (document.tesseramento.cap_recapito.value=="") {
alert ("CAP mancante");
document.tesseramento.cap_recapito.focus();
return false;
}

if (isNaN(document.tesseramento.cap_recapito.value)) {
alert ("CAP incongruente");
document.tesseramento.cap_recapito.focus();
return false;
}

if (document.tesseramento.cap_recapito.value.length!="5") {
alert ("CAP incongruente");
document.tesseramento.cap_recapito.focus();
return false;
}


if (document.tesseramento.titolo_studio.value=="") {
alert ("Titolo di studio mancante");
document.tesseramento.titolo_studio.focus();
return false;
}


if ((document.tesseramento.tipo_associato.value=="A")&&(document.tesseramento.diploma.value=="")) {
alert ("Titolo abilitante mancante");
document.tesseramento.diploma.focus();
return false;
}
if ((document.tesseramento.tipo_associato.value=="A")&&(document.tesseramento.diploma.value=="E")&&(document.tesseramento.diploma_riconversione.value=="")) {
alert ("Titolo pregresso mancante");
document.tesseramento.diploma_riconversione.focus();
return false;
}


if ((document.tesseramento.tipo_associato.value=="A")&&(document.tesseramento.anno_diploma.value=="")) {
alert ("Anno di conseguimento del diploma mancante");
document.tesseramento.anno_diploma.focus();
return false;
}

if ((document.tesseramento.tipo_associato.value=="A")&&(document.tesseramento.mese_diploma.value=="0")) {
alert ("Mese di conseguimento del diploma mancante");
document.tesseramento.mese_diploma.focus();
return false;
}

if ((document.tesseramento.tipo_associato.value=="A")&&(isNaN(document.tesseramento.anno_diploma.value))) {
alert ("Anno di conseguimento del diploma sbagliato");
document.tesseramento.anno_diploma.focus();
return false;
}

if ((document.tesseramento.tipo_associato.value=="A")&&(document.tesseramento.anno_diploma.value.length!="4")) {
alert ("Anno di conseguimento del diploma sbagliato");
document.tesseramento.anno_diploma.focus();
return false;
}

if ((document.tesseramento.tipo_associato.value=="A")&&(document.tesseramento.comune_diploma.value=="")) {
alert ("campo \"conseguito presso\" mancante");
document.tesseramento.comune_diploma.focus();
return false;
}

if((document.tesseramento.tipo_associato.value=="A")&&(document.getElementById("provincia_diploma").value=="")) {
alert("Provincia diploma mancante");
return false;
}


if ((document.tesseramento.tipo_associato.value=="A")&&(document.tesseramento.tipo_impiego.value=="")) {
alert ("Tipo di impiego mancante");
document.tesseramento.tipo_impiego.focus();
return false;
}


if ((document.tesseramento.tipo_associato.value=="A")&&(document.tesseramento.tipo_impiego.value!="L")&&(document.tesseramento.azienda.value=="")) {
alert ("Azienda mancante");
document.tesseramento.azienda.focus();
return false;
}



if ((document.tesseramento.tipo_associato.value=="A")&&(document.tesseramento.tipo_impiego.value!="L")&&(document.tesseramento.provincia_impiego.value=="")) {
alert ("Provincia mancante");
document.tesseramento.provincia_impiego.focus();
return false;
}




	if((document.getElementById("p_si").checked==false)&&(document.getElementById("p_no").checked==false)) {
alert("Informazione sulla privacy mancante");
return false;
}



// diploma = Laurea in fisioterapia :
if(document.getElementById('diploma').value=='D') {
	
	if(document.getElementById("anno_prima_immatricolazione").value=="") {
	alert("Anno prima immatricolazione mancante"); return false;
	}
	if(isNaN(document.getElementById("anno_prima_immatricolazione").value)) {
	alert("Anno prima immatricolazione sbagliato"); return false;
	}

	if(document.getElementById("voto").value=="") {
	alert("Voto mancante"); return false;
	}
	if(isNaN(document.getElementById("voto").value)) {
	alert("Voto sbagliato"); return false;
	}

	if(document.getElementById("su").value=="") {
	alert("Voto massimo mancante"); return false;
	}
	if(isNaN(document.getElementById("su").value)) {
	alert("Voto massimo sbagliato"); return false;
	}

	if(parseInt(document.getElementById("voto").value)>parseInt(document.getElementById("su").value)) {
	alert("Voto incongruente"); return false;
	}

	
	
	
}


// diploma = Laurea estera :
if(document.getElementById('diploma').value=='N') {
	
	if((document.getElementById("ue_si").checked==false)&&(document.getElementById("ue_no").checked==false)) {
	alert("Zona (UE - Extra UE) mancante"); return false;
	}
	
	if(document.getElementById("nazione_diploma").value=="") {
	alert("Nazione diploma mancante"); return false;
	}
	
	if (document.tesseramento.data_conseguimento.value=="") {
alert ("Data conseguimento laurea estera mancante");
document.tesseramento.data_conseguimento.focus();
return false;
	}
	else {

var y=new Date();
y=y.getFullYear();

var d=document.tesseramento.data_conseguimento.value;

     var amin=1900; // année mini
     var amax=y; // année maxi
     var separateur="/"; // separateur entre jour/mois/annee
     var separateur2="-"; // separateur entre jour/mois/annee
     var j=(d.substring(0,2));
     var m=(d.substring(3,5));
     var a=(d.substring(6));
     var ok=1;
     if ( ((isNaN(j))||(j<1)||(j>31)) && (ok==1) ) {
        alert("Il giorno non è corretto."); ok=0;
document.tesseramento.data_conseguimento.focus();
return false;
     }
     if ( ((isNaN(m))||(m<1)||(m>12)) && (ok==1) ) {
        alert("Il mese non è corretto."); ok=0;
document.tesseramento.data_conseguimento.focus();
return false;
     }
     if ( ((isNaN(a))||(a<amin)||(a>amax)) && (ok==1) ) {
        alert("L'anno non è corretto."); ok=0;
document.tesseramento.data_conseguimento.focus();
return false;
     }
     if ( (((d.substring(2,3)!=separateur)||(d.substring(5,6)!=separateur))&&((d.substring(2,3)!=separateur2)||(d.substring(5,6)!=separateur2))) && (ok==1) ) {
        alert("Utilizzate il separatore "+separateur+" o "+separateur2); ok=0;
document.tesseramento.data_conseguimento.focus();
return false;
     }
     if (ok==1) {

     }

	}
	
	
	
	
	if(document.getElementById("localita_laurea_estera").value=="") {
	alert("Località laurea estera mancante"); return false;
	}
	
	
	if (document.tesseramento.data_riconoscimento.value=="") {
alert ("Data riconoscimento laurea estera mancante");
document.tesseramento.data_riconoscimento.focus();
return false;
	}
	else {

var y=new Date();
y=y.getFullYear();

var d=document.tesseramento.data_riconoscimento.value;

     var amin=1900; // année mini
     var amax=y; // année maxi
     var separateur="/"; // separateur entre jour/mois/annee
     var separateur2="-"; // separateur entre jour/mois/annee
     var j=(d.substring(0,2));
     var m=(d.substring(3,5));
     var a=(d.substring(6));
     var ok=1;
     if ( ((isNaN(j))||(j<1)||(j>31)) && (ok==1) ) {
        alert("Il giorno non è corretto."); ok=0;
document.tesseramento.data_riconoscimento.focus();
return false;
     }
     if ( ((isNaN(m))||(m<1)||(m>12)) && (ok==1) ) {
        alert("Il mese non è corretto."); ok=0;
document.tesseramento.data_riconoscimento.focus();
return false;
     }
     if ( ((isNaN(a))||(a<amin)||(a>amax)) && (ok==1) ) {
        alert("L'anno non è corretto."); ok=0;
document.tesseramento.data_riconoscimento.focus();
return false;
     }
     if ( (((d.substring(2,3)!=separateur)||(d.substring(5,6)!=separateur))&&((d.substring(2,3)!=separateur2)||(d.substring(5,6)!=separateur2))) && (ok==1) ) {
        alert("Utilizzate il separatore "+separateur+" o "+separateur2); ok=0;
document.tesseramento.data_riconoscimento.focus();
return false;
     }
     if (ok==1) {

     }

	}
	
	
}


}

function Tesseramento_step1b() {
	
if((document.t_step1b.id_regione[0].checked==false)&&(document.t_step1b.id_regione[1].checked==false)) {alert("Regione mancante"); return false;}
	
}

function Tesseramento_step2() {
	var v=0;
	for(i=0;i<document.t_step2.tipo_pagamento.length;i++) {
		if(document.t_step2.tipo_pagamento[i].checked==true) {v=1;}
	}
	
if(v==0) {alert("Tipo di pagamento mancante"); return false;}
	
}


