function mostra_div( id_true, id_false1 ) { if (document.getElementById){ if(document.getElementById(id_true).style.display == 'none') { document.getElementById(id_true).style.display = 'block'; if(document.getElementById(id_false1)) { document.getElementById(id_false1).style.display = 'none'; } } } } function carica_province_verifica() { strURL='ajax/province_verifica.php'; var xmlHttpProvVerifica = false; var self = this; // Xhr per Mozilla/Safari/Ie7 if (window.XMLHttpRequest) { self.xmlHttpProvVerifica = new XMLHttpRequest(); } // per tutte le altre versioni di IE else if (window.ActiveXObject) { self.xmlHttpProvVerifica = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpProvVerifica.open('POST', strURL, true); self.xmlHttpProvVerifica.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); self.xmlHttpProvVerifica.onreadystatechange = function() { if (self.xmlHttpProvVerifica.readyState == 4) { updatepage_province_verifica(self.xmlHttpProvVerifica.responseText); carica_localita_verifica(); document.getElementById("esito_verifica").innerHTML = ''; } else { //updatepage_regioni( ); } } self.xmlHttpProvVerifica.send(getquerystring_verifica()); } function updatepage_province_verifica(str) { document.getElementById("province_verifica").innerHTML = str; } function carica_localita_verifica() { strURL='ajax/localita_verifica.php'; var xmlHttpLocVerifica = false; var self = this; // Xhr per Mozilla/Safari/Ie7 if (window.XMLHttpRequest) { self.xmlHttpLocVerifica = new XMLHttpRequest(); } // per tutte le altre versioni di IE else if (window.ActiveXObject) { self.xmlHttpLocVerifica = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpLocVerifica.open('POST', strURL, true); self.xmlHttpLocVerifica.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); self.xmlHttpLocVerifica.onreadystatechange = function() { if (self.xmlHttpLocVerifica.readyState == 4) { updatepage_localita_verifica(self.xmlHttpLocVerifica.responseText); //carica_esito_verifica(); document.getElementById("esito_verifica").innerHTML = ''; } else { //updatepage_regioni( ); } } self.xmlHttpLocVerifica.send(getquerystring_verifica()); } function updatepage_localita_verifica(str) { document.getElementById("localita_verifica").innerHTML = str; } function carica_esito_verifica() { strURL='ajax/esito_verifica.php'; var xmlHttpEsitoVerifica = false; var self = this; // Xhr per Mozilla/Safari/Ie7 if (window.XMLHttpRequest) { self.xmlHttpEsitoVerifica = new XMLHttpRequest(); } // per tutte le altre versioni di IE else if (window.ActiveXObject) { self.xmlHttpEsitoVerifica = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpEsitoVerifica.open('POST', strURL, true); self.xmlHttpEsitoVerifica.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); self.xmlHttpEsitoVerifica.onreadystatechange = function() { if (self.xmlHttpEsitoVerifica.readyState == 4) { updatepage_esito_verifica(self.xmlHttpEsitoVerifica.responseText); } else { //updatepage_regioni( ); } } self.xmlHttpEsitoVerifica.send(getquerystring_verifica()); } function updatepage_esito_verifica(str) { document.getElementById("esito_verifica").innerHTML = str; } function getquerystring_verifica() { var form = document.forms['theform']; qstr = ''; if(document.getElementById("COD_REGIONE_VERIFICA")) qstr = qstr + '&COD_REGIONE_VERIFICA=' + escape(document.getElementById("COD_REGIONE_VERIFICA").value); if(document.getElementById("COD_PROVINCIA_VERIFICA")) qstr = qstr + '&COD_PROVINCIA_VERIFICA=' + escape(document.getElementById("COD_PROVINCIA_VERIFICA").value); if(document.getElementById("COD_LOCALITA_VERIFICA")) qstr = qstr + '&COD_LOCALITA_VERIFICA=' + escape(document.getElementById("COD_LOCALITA_VERIFICA").value); return qstr; } function carica_profilo () { carica_anagrafica(); carica_residenza(); } function carica_anagrafica() { carica_regioni('ajax/regioni.php'); } function carica_residenza() { carica_regioni_res('ajax/regioni_res.php'); } function getquerystring_localita() { var form = document.forms['theform']; qstr = ''; if(document.getElementById("COD_NAZIONE")) qstr = qstr + '&COD_NAZIONE=' + escape(document.getElementById("COD_NAZIONE").value); if(document.getElementById("COD_REGIONE")) qstr = qstr + '&COD_REGIONE=' + escape(document.getElementById("COD_REGIONE").value); if(document.getElementById("COD_PROVINCIA")) qstr = qstr + '&COD_PROVINCIA=' + escape(document.getElementById("COD_PROVINCIA").value); if(document.getElementById("COD_LOCALITA")) qstr = qstr + '&COD_LOCALITA=' + escape(document.getElementById("COD_LOCALITA").value); if(document.getElementById("LOCALITA_ESTERA")) qstr = qstr + '&LOCALITA_ESTERA=' + escape(document.getElementById("LOCALITA_ESTERA").value); return qstr; } function carica_regioni(strURL , no_load_province) { var xmlHttpREG = false; var self = this; // Xhr per Mozilla/Safari/Ie7 if (window.XMLHttpRequest) { self.xmlHttpREG = new XMLHttpRequest(); } // per tutte le altre versioni di IE else if (window.ActiveXObject) { self.xmlHttpREG = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpREG.open('POST', strURL, true); self.xmlHttpREG.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); self.xmlHttpREG.onreadystatechange = function() { if (self.xmlHttpREG.readyState == 4) { updatepage_regioni(self.xmlHttpREG.responseText); if(no_load_province) { } else { carica_province('ajax/province.php'); } } else { updatepage_regioni(""); } } self.xmlHttpREG.send(getquerystring_localita()); } function updatepage_regioni(str) { document.getElementById("REGIONI").innerHTML = str; } function carica_province(strURL , no_load_localita) { var xmlHttpPROV = false; var self = this; // Xhr per Mozilla/Safari/Ie7 if (window.XMLHttpRequest) { self.xmlHttpPROV = new XMLHttpRequest(); } // per tutte le altre versioni di IE else if (window.ActiveXObject) { self.xmlHttpPROV = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpPROV.open('POST', strURL, true); self.xmlHttpPROV.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); self.xmlHttpPROV.onreadystatechange = function() { if (self.xmlHttpPROV.readyState == 4) { updatepage_province(self.xmlHttpPROV.responseText); if(no_load_localita) { } else { carica_localita('ajax/localita.php'); } } else { updatepage_province(""); } } self.xmlHttpPROV.send(getquerystring_localita()); } function updatepage_province(str) { document.getElementById("PROVINCE").innerHTML = str; } function carica_localita(strURL) { var xmlHttpLOC = false; var self = this; // Xhr per Mozilla/Safari/Ie7 if (window.XMLHttpRequest) { self.xmlHttpLOC = new XMLHttpRequest(); } // per tutte le altre versioni di IE else if (window.ActiveXObject) { self.xmlHttpLOC = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpLOC.open('POST', strURL, true); self.xmlHttpLOC.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); self.xmlHttpLOC.onreadystatechange = function() { if (self.xmlHttpLOC.readyState == 4) { updatepage_localita(self.xmlHttpLOC.responseText); } else { updatepage_localita(""); } } self.xmlHttpLOC.send(getquerystring_localita()); } function updatepage_localita(str) { document.getElementById("LOCALITA").innerHTML = str; } function carica_regioni_res(strURL , no_load_province) { var xmlHttpREG_RES = false; var self = this; // Xhr per Mozilla/Safari/Ie7 if (window.XMLHttpRequest) { self.xmlHttpREG_RES = new XMLHttpRequest(); } // per tutte le altre versioni di IE else if (window.ActiveXObject) { self.xmlHttpREG_RES = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpREG_RES.open('POST', strURL, true); self.xmlHttpREG_RES.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); self.xmlHttpREG_RES.onreadystatechange = function() { if (self.xmlHttpREG_RES.readyState == 4) { updatepage_regioni_res(self.xmlHttpREG_RES.responseText); if(no_load_province) { } else { carica_province_res('ajax/province_res.php'); } } else { updatepage_regioni_res(""); } } self.xmlHttpREG_RES.send(getquerystring_localita_res()); } function updatepage_regioni_res(str) { document.getElementById("REGIONI_RES").innerHTML = str; } function carica_province_res(strURL , no_load_localita) { var xmlHttpPROV_RES = false; var self = this; // Xhr per Mozilla/Safari/Ie7 if (window.XMLHttpRequest) { self.xmlHttpPROV_RES = new XMLHttpRequest(); } // per tutte le altre versioni di IE else if (window.ActiveXObject) { self.xmlHttpPROV_RES = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpPROV_RES.open('POST', strURL, true); self.xmlHttpPROV_RES.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); self.xmlHttpPROV_RES.onreadystatechange = function() { if (self.xmlHttpPROV_RES.readyState == 4) { updatepage_province_res(self.xmlHttpPROV_RES.responseText); if(no_load_localita){ } else { carica_localita_res('ajax/localita_res.php'); } } else { updatepage_province_res(""); } } self.xmlHttpPROV_RES.send(getquerystring_localita_res()); } function updatepage_province_res(str) { document.getElementById("PROVINCE_RES").innerHTML = str; } function carica_localita_res(strURL) { var xmlHttpLOC_RES = false; var self = this; // Xhr per Mozilla/Safari/Ie7 if (window.XMLHttpRequest) { self.xmlHttpLOC_RES = new XMLHttpRequest(); } // per tutte le altre versioni di IE else if (window.ActiveXObject) { self.xmlHttpLOC_RES = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpLOC_RES.open('POST', strURL, true); self.xmlHttpLOC_RES.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); self.xmlHttpLOC_RES.onreadystatechange = function() { if (self.xmlHttpLOC_RES.readyState == 4) { updatepage_localita_res(self.xmlHttpLOC_RES.responseText); } else { updatepage_localita_res(""); } } self.xmlHttpLOC_RES.send(getquerystring_localita_res()); } function updatepage_localita_res(str) { document.getElementById("LOCALITA_RES").innerHTML = str; } function getquerystring_localita_res() { var form = document.forms['theform']; qstr = ''; /*if(document.getElementById("COD_NAZIONE_RES")) qstr = qstr + '&COD_NAZIONE_RES=' + escape(document.getElementById("COD_NAZIONE_RES").value);*/ qstr = qstr + '&COD_NAZIONE_RES=' + 300;//limito la registrazione ai residenti in italia if(document.getElementById("COD_REGIONE_RES")) qstr = qstr + '&COD_REGIONE_RES=' + escape(document.getElementById("COD_REGIONE_RES").value); if(document.getElementById("COD_PROVINCIA_RES")) qstr = qstr + '&COD_PROVINCIA_RES=' + escape(document.getElementById("COD_PROVINCIA_RES").value); if(document.getElementById("COD_LOCALITA_RES")) qstr = qstr + '&COD_LOCALITA_RES=' + escape(document.getElementById("COD_LOCALITA_RES").value); if(document.getElementById("LOCALITA_ESTERA_RES")) qstr = qstr + '&LOCALITA_ESTERA_RES=' + escape(document.getElementById("LOCALITA_ESTERA_RES").value); return qstr; } function carica_salva_profilo() { var form = document.forms['theform']; var C0 = form.COD_NAZIONE_TEMP.value; var C1 = form.COD_REGIONE_TEMP.value; var C2 = form.COD_PROVINCIA_TEMP.value; var C3 = form.COD_LOCALITA_TEMP.value; var C4 = form.LOCALITA_ESTERA_TEMP.value; qstr = 'ajax/regioni.php?COD_NAZIONE=' + escape(C0) + '&COD_REGIONE=' + escape(C1) + '&COD_PROVINCIA=' + escape(C2) + '&COD_LOCALITA=' + escape(C3); carica_regioni( qstr , 1); qstr = 'ajax/province.php?COD_NAZIONE=' + escape(C0) + '&COD_REGIONE=' + escape(C1) + '&COD_PROVINCIA=' + escape(C2) + '&COD_LOCALITA=' + escape(C3); carica_province( qstr , 1); qstr = 'ajax/localita.php?COD_NAZIONE=' + escape(C0) + '&COD_REGIONE=' + escape(C1) + '&COD_PROVINCIA=' + escape(C2) + '&COD_LOCALITA=' + escape(C3)+ '&LOCALITA_ESTERA=' + escape(C4); carica_localita( qstr ); //var C5 = form.COD_NAZIONE_RES_TEMP.value; var C5 = 300; var C6 = form.COD_REGIONE_RES_TEMP.value; var C7 = form.COD_PROVINCIA_RES_TEMP.value; var C8 = form.COD_LOCALITA_RES_TEMP.value; var C9 = form.LOCALITA_ESTERA_RES_TEMP.value; qstr = 'ajax/regioni_res.php?COD_NAZIONE_RES=' + escape(C5) + '&COD_REGIONE_RES=' + escape(C6) + '&COD_PROVINCIA_RES=' + escape(C7) + '&COD_LOCALITA_RES=' + escape(C8); carica_regioni_res( qstr , 1); qstr = 'ajax/province_res.php?COD_NAZIONE_RES=' + escape(C5) + '&COD_REGIONE_RES=' + escape(C6) + '&COD_PROVINCIA_RES=' + escape(C7) + '&COD_LOCALITA_RES=' + escape(C8); carica_province_res( qstr , 1); qstr = 'ajax/localita_res.php?COD_NAZIONE_RES=' + escape(C5) + '&COD_REGIONE_RES=' + escape(C6) + '&COD_PROVINCIA_RES=' + escape(C7) + '&COD_LOCALITA_RES=' + escape(C8)+ '&LOCALITA_ESTERA_RES=' + escape(C9); carica_localita_res( qstr ); } function carica_salva_profilo_attivazione() { var form = document.forms['theform']; var C2 = form.COD_PROVINCIA_TEMP.value; var C3 = form.COD_LOCALITA_TEMP.value; qstr = 'ajax/localita.php?COD_PROVINCIA=' + escape(C2) + '&COD_LOCALITA=' + escape(C3); carica_localita_attivazione( qstr ); }