// funzione per accettare i cookie function accetta_privacy() { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', 'https://case24.it/accetta_cookie.php', true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { document.getElementById('cookie').style.display="none"; } } } } // imposta l'href per l'acquisto dei servizi dei privati function acquisto_servizio_privati(servizio, opzione, codice_cliente) { document.getElementById("servizio_"+servizio).href="login-acquisto-servizi-privati.php?servizio="+servizio+"&opzione="+opzione; } // imposta l'href per l'acquisto dei servizi function acquisto_servizio(servizio, opzione, codice_cliente) { document.getElementById("servizio_"+servizio).href="login-acquisto-servizi.php?servizio="+servizio+"&opzione="+opzione; } function carica_prezzi(valore) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', './include/ajax.php?tabella=aggiorna_prezzi&valore='+valore, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var res = xmlHttp.responseText; document.getElementById('select_prezzo').innerHTML=res } } } } function carica_prezzi_home(valore) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', './include/ajax.php?tabella=aggiorna_prezzi_home&valore='+valore, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var res = xmlHttp.responseText; document.getElementById('select_prezzo').innerHTML=res } } } } // funzione per aggiungere 1 al conto click della skin function contatore_skin() { valore=document.getElementById('valore_skin').value; var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', './include/ajax.php?tabella=aggiorna_skin&codice_skin='+valore, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var res = xmlHttp.responseText; } } } } // Funzione per attivare la skin se presente function attiva_skin(codice_comune) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', './include/ajax.php?tabella=skin&codice_comune='+codice_comune, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var res = xmlHttp.responseText; var box_diviso=res.split("#;#"); document.getElementById('link_skin').href=box_diviso[1]; document.getElementById('back_skin').style.backgroundImage="url('"+box_diviso[0]+"')"; document.getElementById('valore_skin').value=box_diviso[2]; if(box_diviso[1]!=undefined) { document.getElementById('visua_skin').style.display="block"; }else{ document.getElementById('visua_skin').style.display="none"; } } } } } function aggiorna_contatore_banner(id_banner) { var xmlHttp = getXmlHttpObject(); xmlHttp.open("GET", "https://case24.it/include/ajax_banner.php?aggiorna=1&id="+id_banner, true); xmlHttp.send(null); } // Funzione per visualizzare i banner function banner(banner, tabella, keyword, punti) { // creo gli id da aggiornare nei div var id_aggiornare; id_aggiornare=banner.replace("sponsor_", ""); // visualizzo la scritta loading...e nascondi lo spazio del banner document.getElementById('elaborazione_'+id_aggiornare).style.display="block"; document.getElementById(id_aggiornare).style.display="none"; var xmlHttp = getXmlHttpObject(); xmlHttp.open("GET", "https://case24.it/include/ajax_banner.php?tabella="+tabella+"&banner="+banner+"&"+keyword, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; //alert(resp); var parametri=resp.split("#;#"); if(parametri[0]!="") { //contenuto=""; contenuto=""; document.getElementById('elaborazione_'+id_aggiornare).style.display="none"; document.getElementById(id_aggiornare).style.display="block"; document.getElementById(id_aggiornare).innerHTML=contenuto; }else{ document.getElementById('elaborazione_'+id_aggiornare).style.display="none"; document.getElementById(id_aggiornare).style.display="none"; } } } } } // inserisci confronto function inserisci_confronto(codice_inserzione, codice_utente) { document.getElementById('inserisci_confronto').style.display="none"; document.getElementById('rimuovi_confronto').style.display="block"; var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', "../../../include/ajax_scheda_immobile.php?tabella=inserisci_confronto&codice_inserzione="+codice_inserzione+"&codice_utente="+codice_utente, true); xmlHttp.send(null); alert("Annuncio correttamente inserito nella lista di confronto"); } // Rimuovi confronto function rimuovi_confronto(codice_inserzione, codice_utente) { document.getElementById('rimuovi_confronto').style.display="none"; document.getElementById('inserisci_confronto').style.display="block"; var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', "../../../include/ajax_scheda_immobile.php?tabella=rimuovi_confronto&codice_inserzione="+codice_inserzione+"&codice_utente="+codice_utente, true); xmlHttp.send(null); alert("Annuncio correttamente rimosso dalla lista di confronto"); } // Nascondi telefono function nascondi_telefono() { document.getElementById('telefono_agenzia').style.display="none"; } // Visualizza telefono function visualizza_telefono_agenzia(codice_cliente) { document.getElementById('telefono_agenzia').style.display="block"; document.getElementById('visualizza_telefono').style.display="none"; // Aggiorno il campo visualizzazione_telefono tramite ajax var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', "./include/ajax.php?tabella=visualizzazione_telefono_agenzia&codice_cliente="+codice_cliente, true); xmlHttp.send(null); } // Carica gli annunci nella pagina dell'agenzia function carica_annunci_agenzia(codice_cliente, annunci_totali, pagina, variabili) { // faccio un explode sulle variabili document.getElementById("div_annunci").style.display="none"; document.getElementById("loading").style.display="block"; var xmlHttp = getXmlHttpObject(); xmlHttp.open("GET", "../../../include/ajax.php?funzione=annunci_agenzia&codice_cliente="+codice_cliente+"&annunci_totali="+annunci_totali+"&pagina="+pagina+variabili, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; document.getElementById("div_annunci").innerHTML=resp; document.getElementById("loading").style.display="none"; document.getElementById("div_annunci").style.display="block"; } } } } // Funzione per ripristinare la classe del div function nonEvidenzia(numero_riga) { document.getElementById(numero_riga).className="elencoAgenzie"; } // Funzione per evidenziare il div function evidenzia(numero_riga) { document.getElementById(numero_riga).className="elencoAgenzieEvidenzia"; } // Funzione per verificare la corretta compilazione dei dati contatti function verifica_contatti() { procedi=true; var valori_email=/[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; var valori_numerici=/[0-9._%-]/; document.getElementById('richieste').nome.className="text"; document.getElementById('richieste').cognome.className="text"; document.getElementById('richieste').email.className="text"; document.getElementById('richieste').indirizzo.className="text"; document.getElementById('richieste').cap.className="text02"; document.getElementById('richieste').provincia.className="text"; document.getElementById('richieste').comune.className="text"; document.getElementById('richieste').telefono.className="text"; document.getElementById('richieste').messaggio.className="note02"; if(document.getElementById('richieste').nome.value=="") { document.getElementById('richieste').nome.focus(); document.getElementById('richieste').nome.className="textErrore"; alert("ATTENZIONE! Inserire il nome o la ragione sociale"); procedi=false; }else if(document.getElementById('richieste').cognome.value==""){ document.getElementById('richieste').cognome.focus(); document.getElementById('richieste').cognome.className="textErrore"; alert("ATTENZIONE! Inserire il cognome o il nome del legale rappresentante"); procedi=false; }else if((document.getElementById('richieste').email.value=="")||(!document.getElementById('richieste').email.value.match(valori_email))){ document.getElementById('richieste').email.focus(); document.getElementById('richieste').email.className="textErrore"; alert("ATTENZIONE! Inserire un indirizzo e-mail valido"); procedi=false; }else if(document.getElementById('richieste').indirizzo.value==""){ document.getElementById('richieste').indirizzo.focus(); document.getElementById('richieste').indirizzo.className="textErrore"; alert("ATTENZIONE! Inserire l'indirizzo"); procedi=false; }else if((document.getElementById('richieste').cap.value=="")||(!document.getElementById('richieste').cap.value.match(valori_numerici))){ document.getElementById('richieste').cap.focus(); document.getElementById('richieste').cap.className="text02Errore"; alert("ATTENZIONE! Inserire il CAP"); procedi=false; }else if(document.getElementById('richieste').comune.value==""){ document.getElementById('richieste').comune.focus(); document.getElementById('richieste').comune.className="textErrore"; alert("ATTENZIONE! Inserire il comune"); procedi=false; }else if(document.getElementById('richieste').provincia.value==""){ document.getElementById('richieste').provincia.focus(); document.getElementById('richieste').provincia.className="textErrore"; alert("ATTENZIONE! Inserire la provincia"); procedi=false; }else if(document.getElementById('richieste').telefono.value==""){ document.getElementById('richieste').telefono.focus(); document.getElementById('richieste').telefono.className="textErrore"; alert("ATTENZIONE! Inserire il telefono"); procedi=false; }else if(document.getElementById('richieste').messaggio.value==""){ document.getElementById('richieste').messaggio.focus(); document.getElementById('richieste').messaggio.className="note02Errore"; alert("ATTENZIONE! Inserire il messaggio"); procedi=false; }else if(document.getElementById('richieste').privacy[1].checked==true){ alert("ATTENZIONE! Per inviare il modulo bisogna accettare il trattamento dei propri dati personali"); procedi=false; } if(procedi==true) { document.getElementById('richieste').submit(); } } // Funzione per verificare la corretta compilazione dei dati Newsletter function verifica_newsletter() { procedi=true; var valori_email=/[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; var valori_numerici=/[0-9._%-]/; document.getElementById('richieste').nome.className="text"; document.getElementById('richieste').cognome.className="text"; document.getElementById('richieste').email.className="text"; if(document.getElementById('richieste').nome.value=="") { document.getElementById('richieste').nome.focus(); document.getElementById('richieste').nome.className="textErrore"; alert("ATTENZIONE! Inserire il nome"); procedi=false; }else if(document.getElementById('richieste').cognome.value==""){ document.getElementById('richieste').cognome.focus(); document.getElementById('richieste').cognome.className="textErrore"; alert("ATTENZIONE! Inserire il cognome"); procedi=false; }else if((document.getElementById('richieste').email.value=="")||(!document.getElementById('richieste').email.value.match(valori_email))){ document.getElementById('richieste').email.focus(); document.getElementById('richieste').email.className="textErrore"; alert("ATTENZIONE! Inserire un indirizzo e-mail valido"); procedi=false; }else if(document.getElementById('richieste').privacy[0].checked!=true){ alert("ATTENZIONE! Per inviare il modulo bisogna accettare il trattamento dei propri dati personali"); procedi=false; } if(procedi==true) { document.getElementById('richieste').submit(); } } //funzione per verificare l'iscrizione al contest function verifica_contest() { procedi=true; var valori_email=/[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; var valori_numerici=/[0-9._%-]/; document.getElementById('richieste').nome.className="text"; document.getElementById('richieste').cognome.className="text"; document.getElementById('richieste').email.className="text"; if(document.getElementById('richieste').nome.value=="") { document.getElementById('richieste').nome.focus(); document.getElementById('richieste').nome.className="textErrore"; alert("ATTENZIONE! Inserire il nome"); procedi=false; }else if(document.getElementById('richieste').cognome.value==""){ document.getElementById('richieste').cognome.focus(); document.getElementById('richieste').cognome.className="textErrore"; alert("ATTENZIONE! Inserire il cognome"); procedi=false; }else if(document.getElementById('richieste').telefono.value==""){ document.getElementById('richieste').telefono.focus(); document.getElementById('richieste').telefono.className="textErrore"; alert("ATTENZIONE! Inserire un numero di telefono"); procedi=false; }else if(document.getElementById('richieste').provincia.value==""){ document.getElementById('richieste').provincia.focus(); document.getElementById('richieste').provincia.className="textErrore"; alert("ATTENZIONE! Selezionare la provincia"); procedi=false; }else if(document.getElementById('richieste').comune.value==""){ document.getElementById('richieste').comune.focus(); document.getElementById('richieste').comune.className="textErrore"; alert("ATTENZIONE! Selezionare il comune"); procedi=false; }else if((document.getElementById('richieste').email.value=="")||(!document.getElementById('richieste').email.value.match(valori_email))){ document.getElementById('richieste').email.focus(); document.getElementById('richieste').email.className="textErrore"; alert("ATTENZIONE! Inserire un indirizzo e-mail valido"); procedi=false; }else if(document.getElementById('dont_agree').checked==true){ alert("ATTENZIONE! Acconsentire al trattamento dei dati personali"); procedi=false; }else if(document.getElementById('richieste').maggiorenne.checked==false){ document.getElementById('richieste').maggiorenne.focus(); alert("ATTENZIONE! E' necessario dichiarare di essere maggiorenne"); procedi=false; }else if(document.getElementById('richieste').regolamento.checked==false){ document.getElementById('richieste').regolamento.focus(); alert("ATTENZIONE! E' necessario accettare il regolamento e le condizioni"); procedi=false; } if(procedi==true) { document.getElementById('richieste').submit(); } } // Funzione per la verifica dei commenti inseriti nella sezione blog/news function verifica_commenti() { procedi=true; document.commenti.nome.className="invia"; document.commenti.email.className="invia"; document.commenti.messaggio.style.border="1px solid #7f9db9"; var valori_email=/[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; if(document.commenti.nome.value=="") { document.commenti.nome.focus(); procedi=false; document.commenti.nome.className="inviaErrore"; alert("Inserire il nome"); }else if((document.commenti.email.value=="")||(!document.commenti.email.value.match(valori_email))){ procedi=false; document.commenti.email.focus(); document.commenti.email.className="inviaErrore"; alert("Attenzione! Inserire un indirizzo e-mail valido\nTi ricordiamo che l'indirizzo e-mail non verr� visualizzato nel commento."); }else if(document.commenti.messaggio.value==""){ procedi=false; document.commenti.messaggio.focus(); document.commenti.messaggio.style.border="2px solid #d21509"; alert("Attenzione! Inserire il testo del commento."); } if(procedi==true) { document.commenti.submit(); } } // funzione per eliminare le richieste/proposte di affidamento function elimina_richieste(tabella) { var email_eliminare=document.getElementById('formEliminazione').email.value; if(document.getElementById('formEliminazione').email.value=="") { alert("ATTENZIONE! Inserire un indirizzo e-mail valido."); }else{ var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', './include/ajax.php?tabella='+tabella+'&email='+email_eliminare, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; if(resp==1) { document.getElementById('formEliminazione').email.value=""; alert("La sua richiesta di rimozione � stata correttamente inviata."); }else{ alert("ATTENZIONE! Inserire un indirizzo e-mail valido."); } } } } } } // verifica richiesta immobili alle agenzie function verifica_proposta_immobile() { procedi=true; var valori_email=/[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; var valori_numerici=/[0-9._%-]/; document.getElementById('richieste').provincia.className="registratiReg"; document.getElementById('richieste').comune.className="registratiReg"; document.getElementById('richieste').tipo_immobile.className="registratiReg"; document.getElementById('richieste').numero_camere.className="registratiReg"; document.getElementById('richieste').numero_bagni.className="registratiReg"; document.getElementById('richieste').prezzo.className="textReg"; document.getElementById('richieste').superficie.className="textReg"; document.getElementById('richieste').nome.className="textReg"; document.getElementById('richieste').cognome.className="textReg"; document.getElementById('richieste').email.className="textReg"; document.getElementById('richieste').indirizzo.className="textReg"; document.getElementById('richieste').cap.className="textReg"; document.getElementById('richieste').provincia_utente.className="registratiReg"; document.getElementById('richieste').comune_utente.className="registratiReg"; document.getElementById('richieste').tel.className="textReg"; document.getElementById('td_privacy').style.background="#ffffff"; if(document.getElementById('richieste').provincia.value==""){ //document.getElementById('richieste').provincia.className="comuniErrore"; document.getElementById('richieste').provincia.focus(); alert("ATTENZIONE! Inserire la provincia dell'immobile"); procedi=false; }else if(document.getElementById('richieste').comune.value==""){ //document.getElementById('richieste').comune.className="comuniErrore"; document.getElementById('richieste').comune.focus(); alert("ATTENZIONE! Inserire il comune dell'immobile"); procedi=false; }else if(document.getElementById('richieste').tipo_immobile.value==""){ //document.getElementById('richieste').tipo_immobile.className="comuniErrore"; document.getElementById('richieste').tipo_immobile.focus(); alert("ATTENZIONE! Inserire la tipologia dell'immobile"); procedi=false; }else if((document.getElementById('richieste').numero_camere.value=="")&&(document.getElementById('richieste').tipo_immobile.value>=15)&&(document.getElementById('richieste').tipo_immobile.value<=20)){ //document.getElementById('richieste').numero_camere.className="comuniErrore"; document.getElementById('richieste').numero_camere.focus(); alert("ATTENZIONE! Inserire il numero di camere dell'immobile"); procedi=false; }else if((document.getElementById('richieste').numero_bagni.value=="")&&(document.getElementById('richieste').tipo_immobile.value>=15)&&(document.getElementById('richieste').tipo_immobile.value<=20)){ //document.getElementById('richieste').numero_bagni.className="comuniErrore"; document.getElementById('richieste').numero_bagni.focus(); alert("ATTENZIONE! Inserire il numero bagni dell'immobile"); procedi=false; }else if(document.getElementById('richieste').prezzo.value==""){ document.getElementById('richieste').prezzo.className="inviaErroreReg"; document.getElementById('richieste').prezzo.focus(); alert("ATTENZIONE! Inserire il prezzo dell'immobile"); procedi=false; }else if(document.getElementById('richieste').superficie.value==""){ document.getElementById('richieste').superficie.className="inviaErroreReg"; document.getElementById('richieste').superficie.focus(); alert("ATTENZIONE! Inserire la superficie dell'immobile"); procedi=false; }else if(document.getElementById('richieste').nome.value==""){ document.getElementById('richieste').nome.className="inviaErroreReg"; document.getElementById('richieste').nome.focus(); alert("ATTENZIONE! Inserisci il tuo nome"); procedi=false; }else if(document.getElementById('richieste').cognome.value==""){ document.getElementById('richieste').cognome.className="inviaErroreReg"; document.getElementById('richieste').cognome.focus(); alert("ATTENZIONE! Inserisci il tuo cognome"); procedi=false; }else if((document.getElementById('richieste').email.value=="")||(!document.getElementById('richieste').email.value.match(valori_email))){ document.getElementById('richieste').email.className="inviaErroreReg"; document.getElementById('richieste').email.focus(); alert("ATTENZIONE! Inserisci un indirizzo e-mail valido"); procedi=false; }else if(document.getElementById('richieste').indirizzo.value==""){ document.getElementById('richieste').indirizzo.className="inviaErroreReg"; document.getElementById('richieste').indirizzo.focus(); alert("ATTENZIONE! Inserisci il tuo indirizzo"); procedi=false; }else if((document.getElementById('richieste').cap.value=="")||(!document.getElementById('richieste').cap.value.match(valori_numerici))){ document.getElementById('richieste').cap.className="inviaErroreReg"; document.getElementById('richieste').cap.focus(); alert("ATTENZIONE! Inserisci il tuo cap di residenza"); procedi=false; }else if(document.getElementById('richieste').provincia_utente.value==""){ //document.getElementById('richieste').provincia_utente.className="comuniErrore"; document.getElementById('richieste').provincia_utente.focus(); alert("ATTENZIONE! Inserire la tue provincia di residenza"); procedi=false; }else if(document.getElementById('richieste').comune_utente.value==""){ //document.getElementById('richieste').comune_utente.className="comuniErrore"; document.getElementById('richieste').comune_utente.focus(); alert("ATTENZIONE! Inserire il tuo comune di residenza"); procedi=false; }else if((document.getElementById('richieste').tel.value=="")||(!document.getElementById('richieste').tel.value.match(valori_numerici))){ document.getElementById('richieste').tel.className="inviaErroreReg"; document.getElementById('richieste').tel.focus(); alert("ATTENZIONE! Inserisci il tuo numero di telefono nella forma prefisso.numero"); procedi=false; }else if(document.getElementById('richieste').newsletter.checked==false){ document.getElementById('td_privacy').style.background="#ffdada"; alert("ATTENZIONE! Per usufruire del servizio vendimi casa devi autorizzare case24.it ad inviare le tue informazioni a terze parti."); procedi=false; } /*else if(document.getElementById('richieste').privacy.checked==false){ alert("ATTENZIONE! Per usufruire del servizio vendimi casa devi autorizzare case24.it ad inviare le tue informazioni a terze parti."); procedi=false; }*/ if(procedi==true) { document.getElementById('richieste').submit(); } } // verifica richiesta immobili alle agenzie function verifica_richiesta_immobile() { procedi=true; var valori_email=/[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; var valori_numerici=/[0-9._%-]/; document.getElementById('richieste').provincia.className="registratiReg"; document.getElementById('richieste').comune.className="registratiReg"; document.getElementById('richieste').tipo_immobile.className="registratiReg"; document.getElementById('richieste').numero_bagni.className="registratiReg"; document.getElementById('richieste').prezzo_da.className="registratiReg02"; document.getElementById('richieste').prezzo_a.className="registratiReg02"; document.getElementById('richieste').superficie_da.className="registratiReg02"; document.getElementById('richieste').superficie_a.className="registratiReg02"; document.getElementById('richieste').nome.className="textReg"; document.getElementById('richieste').cognome.className="textReg"; document.getElementById('richieste').email.className="textReg"; document.getElementById('richieste').indirizzo.className="textReg"; document.getElementById('richieste').cap.className="textReg"; document.getElementById('richieste').provincia_utente.className="registratiReg"; document.getElementById('richieste').comune_utente.className="registratiReg"; document.getElementById('richieste').tel.className="textReg"; document.getElementById('td_privacy').style.background="#ffffff"; if(document.getElementById('richieste').provincia.value==""){ //document.getElementById('richieste').provincia.className="comuniErrore"; document.getElementById('richieste').provincia.focus(); alert("ATTENZIONE! Inserire la provincia dell'immobile"); procedi=false; }else if(document.getElementById('richieste').comune.value==""){ //document.getElementById('richieste').comune.className="comuniErrore"; document.getElementById('richieste').comune.focus(); alert("ATTENZIONE! Inserire il comune dell'immobile"); procedi=false; }else if(document.getElementById('richieste').tipo_immobile.value==""){ //document.getElementById('richieste').tipo_immobile.className="comuniErrore"; document.getElementById('richieste').tipo_immobile.focus(); alert("ATTENZIONE! Inserire la tipologia dell'immobile"); procedi=false; /*} else if(document.getElementById('richieste').numero_bagni.value==""){ //document.getElementById('richieste').numero_bagni.className="comuniErrore"; document.getElementById('richieste').numero_bagni.focus(); alert("ATTENZIONE! Inserire il numero bagni dell'immobile"); procedi=false;*/ }else if((document.getElementById('richieste').prezzo_da.value=="")&&(document.getElementById('richieste').prezzo_a.value=="")){ //document.getElementById('richieste').prezzo_da.className="smallSelectErrore"; //document.getElementById('richieste').prezzo_a.className="smallSelectErrore"; document.getElementById('richieste').prezzo_da.focus(); alert("ATTENZIONE! Inserire il range di prezzo dell'immobile"); procedi=false; }else if((document.getElementById('richieste').superficie_da.value=="")&&(document.getElementById('richieste').superficie_a.value=="")){ //document.getElementById('richieste').superficie_da.className="smallSelectErrore"; //document.getElementById('richieste').superficie_a.className="smallSelectErrore"; document.getElementById('richieste').superficie_da.focus(); alert("ATTENZIONE! Inserire la superficie dell'immobile"); procedi=false; }else if(document.getElementById('richieste').nome.value==""){ document.getElementById('richieste').nome.className="inviaErroreReg"; document.getElementById('richieste').nome.focus(); alert("ATTENZIONE! Inserisci il tuo nome"); procedi=false; }else if(document.getElementById('richieste').cognome.value==""){ document.getElementById('richieste').cognome.className="inviaErroreReg"; document.getElementById('richieste').cognome.focus(); alert("ATTENZIONE! Inserisci il tuo cognome"); procedi=false; /*}else if((document.getElementById('richieste').email.value=="")||(!document.getElementById('richieste').email.value.match(valori_email))){ document.getElementById('richieste').email.className="inviaErroreReg"; document.getElementById('richieste').email.focus(); alert("ATTENZIONE! Inserisci un indirizzo e-mail valido"); procedi=false; }else if(document.getElementById('richieste').indirizzo.value==""){ document.getElementById('richieste').indirizzo.className="inviaErroreReg"; document.getElementById('richieste').indirizzo.focus(); alert("ATTENZIONE! Inserisci il tuo indirizzo"); procedi=false;*/ /*} else if((document.getElementById('richieste').cap.value=="")||(!document.getElementById('richieste').cap.value.match(valori_numerici))){ document.getElementById('richieste').cap.className="inviaErroreReg"; document.getElementById('richieste').cap.focus(); alert("ATTENZIONE! Inserisci il tuo cap di residenza"); procedi=false;*/ }else if(document.getElementById('richieste').provincia_utente.value==""){ //document.getElementById('richieste').provincia_utente.className="comuniErrore"; document.getElementById('richieste').provincia_utente.focus(); alert("ATTENZIONE! Inserire la tua provincia di residenza"); procedi=false; }else if(document.getElementById('richieste').comune_utente.value==""){ //document.getElementById('richieste').comune_utente.className="comuniErrore"; document.getElementById('richieste').comune_utente.focus(); alert("ATTENZIONE! Inserire il tuo comune di residenza"); procedi=false; }else if((document.getElementById('richieste').tel.value=="")||(!document.getElementById('richieste').tel.value.match(valori_numerici))){ document.getElementById('richieste').tel.className="inviaErroreReg"; document.getElementById('richieste').tel.focus(); alert("ATTENZIONE! Inserisci il tuo numero di telefono nella forma prefisso.numero"); procedi=false; }else if(document.getElementById('richieste').newsletter.checked==false){ document.getElementById('td_privacy').style.background="#ffdada"; alert("ATTENZIONE! Per usufruire del servizio cercami casa devi autorizzare case24.it ad inviare le tue informazioni a terze parti."); procedi=false; } /*else if(document.getElementById('richieste').privacy.checked==false){ alert("ATTENZIONE! Per inviare il modulo devi accettare il trattamento dei tuoi dati personali"); procedi=false; }*/ if(procedi==true) { document.getElementById('richieste').submit(); } } // Registrazione utenti privati function registrazionePrivati() { procedi=true; document.getElementById('registrazione').nome.className="textReg"; document.getElementById('registrazione').cognome.className="textReg"; document.getElementById('registrazione').email.className="textReg"; var email=document.getElementById('registrazione').email.value; document.getElementById('registrazione').via.className="textReg"; document.getElementById('registrazione').cap.className="textReg"; var valori_email=/[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; // Verifico se l'e-mail � gi� in uso var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', "./include/ajax.php?funzione=controlloEmail&email="+email, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; if(resp==1) { procedi=false; document.getElementById('registrazione').email.focus(); document.getElementById('registrazione').email.className="inviaErroreReg"; alert("Attezione! Questa e-mail risulta gia' registrata.\nE' necessario utilizzare un altro indirizzo e-mail"); }else{ if(document.getElementById('registrazione').nome.value=="") { procedi=false; document.getElementById('registrazione').nome.focus(); document.getElementById('registrazione').nome.className="inviaErroreReg"; alert("Attenzione! Inserire il nome"); }else if(document.getElementById('registrazione').cognome.value==""){ procedi=false; document.getElementById('registrazione').cognome.focus(); document.getElementById('registrazione').cognome.className="inviaErroreReg"; alert("Attenzione! Inserire il cognome"); }else if((document.getElementById('registrazione').email.value=="")||(!document.getElementById('registrazione').email.value.match(valori_email))){ procedi=false; document.getElementById('registrazione').email.focus(); document.getElementById('registrazione').email.className="inviaErroreReg"; alert("Attenzione! Inserire un indirizzo e-mail valido"); }else if((document.getElementById('registrazione').telefono.value=="")||(isNaN(document.getElementById('registrazione').telefono.value))||(document.getElementById('registrazione').telefono.value=="undefined")){ procedi=false; document.getElementById('registrazione').telefono.focus(); document.getElementById('registrazione').telefono.className="inviaErroreReg"; alert("Attenzione! Inserire un numero di telefono valido e nella forma 'prefisso.numero' senza spazi"); }else if(document.getElementById('registrazione').provincia.value==""){ procedi=false; document.getElementById('registrazione').provincia.focus(); alert("Attenzione! Inserire la provincia"); }else if(document.getElementById('registrazione').comune.value==""){ procedi=false; document.getElementById('registrazione').comune.focus(); alert("Attenzione! Inserire il comune"); }else if(document.getElementById('registrazione').via.value==""){ procedi=false; document.getElementById('registrazione').via.focus(); document.getElementById('registrazione').via.className="inviaErroreReg"; alert("Attenzione! Inserire l'indirizzo"); }else if((document.getElementById('registrazione').cap.value=="")||(isNaN(document.getElementById('registrazione').cap.value))||(document.getElementById('registrazione').cap.value=="undefined")){ procedi=false; document.getElementById('registrazione').cap.focus(); document.getElementById('registrazione').cap.className="inviaErroreReg"; alert("Attenzione! Inserire il C.A.P."); } /*else if(document.getElementById('registrazione').privacy.checked==false){ procedi=false; alert("Attenzione! Per registrarsi è necessario accettare il trattamento dei dati personali"); }*/ if(procedi==true) { document.getElementById('registrazione').submit(); } } } } } } // Registrazione agenzie function registrazioneAgenzie() { procedi=true; document.getElementById('registrazione').nome.className="textReg"; document.getElementById('registrazione').nome_interno.className="textReg"; document.getElementById('registrazione').email.className="textReg"; var email=document.getElementById('registrazione').email.value; document.getElementById('registrazione').prefisso.className="textReg"; document.getElementById('registrazione').telefono.className="textReg"; document.getElementById('registrazione').codfisc_piva.className="textReg"; document.getElementById('registrazione').via.className="textReg"; document.getElementById('registrazione').cap.className="textReg"; var valori_email=/[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; // Verifico se l'e-mail � gi� in uso var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', "./include/ajax.php?funzione=controlloEmail&email="+email, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; if(resp==1) { procedi=false; document.getElementById('registrazione').email.focus(); document.getElementById('registrazione').email.className="inviaErroreReg"; alert("Attezione! Questa e-mail risulta gia' registrata.\nE' necessario utilizzare un altro indirizzo e-mail"); }else{ if(document.getElementById('registrazione').nome.value=="") { procedi=false; document.getElementById('registrazione').nome.focus(); document.getElementById('registrazione').nome.className="inviaErroreReg"; alert("Attenzione! Inserire il nome agenzia"); }else if((document.getElementById('registrazione').email.value=="")||(!document.getElementById('registrazione').email.value.match(valori_email))){ procedi=false; document.getElementById('registrazione').email.focus(); document.getElementById('registrazione').email.className="inviaErroreReg"; alert("Attenzione! Inserire un indirizzo e-mail valido"); }else if(document.getElementById('registrazione').nome_interno.value==""){ procedi=false; document.getElementById('registrazione').nome_interno.focus(); document.getElementById('registrazione').nome_interno.className="inviaErroreReg"; alert("Attenzione! Inserire la ragione sociale"); }else if(document.getElementById('registrazione').codfisc_piva.value==""){ procedi=false; document.getElementById('registrazione').codfisc_piva.focus(); document.getElementById('registrazione').codfisc_piva.className="inviaErroreReg"; alert("Attenzione! Inserire la partita IVA o il Codice Fiscale"); }else if((document.getElementById('registrazione').prefisso.value=="")||(isNaN(document.getElementById('registrazione').prefisso.value))||(document.getElementById('registrazione').prefisso.value=="undefined")){ procedi=false; document.getElementById('registrazione').prefisso.focus(); document.getElementById('registrazione').prefisso.className="inviaErroreReg"; alert("Attenzione! Inserire il prefisso"); }else if((document.getElementById('registrazione').telefono.value=="")||(isNaN(document.getElementById('registrazione').telefono.value))||(document.getElementById('registrazione').telefono.value=="undefined")){ procedi=false; document.getElementById('registrazione').telefono.focus(); document.getElementById('registrazione').telefono.className="inviaErroreReg"; alert("Attenzione! Inserire un numero di telefono valido e senza spazi"); }else if(document.getElementById('registrazione').provincia.value==""){ procedi=false; document.getElementById('registrazione').provincia.focus(); alert("Attenzione! Inserire la provincia"); }else if(document.getElementById('registrazione').comune.value=="" || isNaN(document.getElementById('registrazione').comune.value)){ procedi=false; document.getElementById('registrazione').comune.focus(); alert("Attenzione! Inserire il comune"); }else if(document.getElementById('registrazione').via.value==""){ procedi=false; document.getElementById('registrazione').via.focus(); document.getElementById('registrazione').via.className="inviaErroreReg"; alert("Attenzione! Inserire l'indirizzo"); }else if((document.getElementById('registrazione').cap.value=="")||(isNaN(document.getElementById('registrazione').cap.value))||(document.getElementById('registrazione').cap.value=="undefined")){ procedi=false; document.getElementById('registrazione').cap.focus(); document.getElementById('registrazione').cap.className="inviaErrore"; alert("Attenzione! Inserire il C.A.P."); }else if(document.getElementById('registrazione').privacy.checked==false){ procedi=false; alert("Attenzione! Per registrarsi � necessario accettare il trattamento dei dati personali"); } if(procedi==true) { document.getElementById('registrazione').submit(); } } } } } } // select comune in home page function comuni_home_page(codice_provincia, comune_select, tabindex, nome_form, elenco_zone_selezionate, home) { home = home || "0"; var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', "./include/ajax.php?edit=comune_home&codice_provincia="+codice_provincia+"&tabindex="+tabindex+"&nome_select="+comune_select+"&nome_form="+nome_form+"&home="+home, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; document.getElementById('div_codice_comune').innerHTML=resp; if(home == 0) { seleziona_zone_multiple(document.getElementById('comune_zona').value, elenco_zone_selezionate, 'gpa', nome_form); } } } } } // select provincia comune in scheda agenzia function select_comuni_scheda_agenzia(codice_provincia, comune_select, tabindex, nome_form) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', "../../../include/ajax.php?edit=comune_scheda_agenzia&codice_provincia="+codice_provincia+"&tabindex="+tabindex+"&nome_form="+nome_form, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; document.getElementById('div_codice_comune').innerHTML=resp; } } } } // compila il select con le zone // funzione per selezionare le zone function seleziona_zone_multiple(comune, zona, classe, nome_form) { if(nome_form == undefined) { nome_form="ricerca_comune"; } var oXHR = new XMLHttpRequest(); oXHR.open("GET" , "./include/ajax.php?action=seleziona_zone_multiple&comune="+comune+"&zona="+zona+"&classe="+classe+"&nome_form="+nome_form, true); oXHR.onreadystatechange=function() { if(oXHR.readyState==4) { if(oXHR.status==200) { if(oXHR.responseText!="") { var variabili_form=document.getElementById('zone'); variabili_form.innerHTML=oXHR.responseText; } } } } oXHR.send(null); } function chiudi_div_zone(nome_form) { if(nome_form =="undefined") { nome_form="ricerca_comune"; } if(document.getElementById(nome_form).valore_check_zone.value=='1') { document.getElementById('box').style.display='block'; document.getElementById(nome_form).valore_check_zone.value='0'; }else{ document.getElementById('box').style.display='none' document.getElementById(nome_form).valore_check_zone.value='1'; } } // visualizza nel textbox il nome delle zone selezionate. function salva_nome_zone(nome_form) { if(nome_form =="undefined") { nome_form="ricerca_comune"; } form = document.getElementById(nome_form); var elems = form.elements; var serialized = [], i, len = elems.length, str=''; for(i = 0; i < len; i += 1) { var element = elems[i]; var type = element.type; var name = element.name; var value = element.value; switch(type) { case 'checkbox': if(element.checked==true) { str = name + '=' + encodeURIComponent(value); serialized.push(str); } break; default: break; } } var stringa_ajax = serialized.join('&'); salva_nome_zone_02(stringa_ajax); } function salva_nome_zone_02(stringa_ajax) { var oXHR = new XMLHttpRequest(); oXHR.open("GET" , "./include/ajax.php?label_zone=1&"+stringa_ajax, true); oXHR.onreadystatechange=function() { if(oXHR.readyState==4) { if(oXHR.status==200) { contenuto=oXHR.responseText; if(contenuto!="") { document.getElementById('nomeZone').innerHTML=contenuto; }else{ document.getElementById('nomeZone').innerHTML="Clicca e seleziona le zone"; } } } } oXHR.send(null); } // Select comune/provincia function select_geografico(provincia, nome_select, tabindex, classe) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', "./include/ajax.php?edit=comune&provincia="+provincia+"&tabindex="+tabindex+"&nome_select="+nome_select+"&classe="+classe, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; document.getElementById('div_'+nome_select).innerHTML=resp; } } } } // Select comune/provincia ricerca agenzia function select_geografico_agenzie(provincia, comune_selezionato, nome_select, tabindex, classe) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', "./include/ajax.php?edit=comune&provincia="+provincia+"&tabindex="+tabindex+"&nome_select="+nome_select+"&comune_selezionato="+comune_selezionato+"&select_vuoto=1&classe="+classe, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; document.getElementById('div_'+nome_select).innerHTML=resp; } } } } // Select zona function select_geografico_zone(zona, comune, tabindex) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', "./include/ajax.php?edit=trova_zone&comune="+comune+"&tabindex="+tabindex+"&zona="+zona, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; document.getElementById('div_codice_zona').innerHTML=resp; } } } } // Select comune/provincia ricerca agenzia function select_geografico_agenzie_zone(provincia, comune_selezionato, nome_select, zona, tabindex) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', "./include/ajax.php?edit=comune&provincia="+provincia+"&tabindex="+tabindex+"&nome_select="+nome_select+"&comune_selezionato="+comune_selezionato+"&select_vuoto=1&attiva_zona=1&zona="+zona, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; document.getElementById('div_'+nome_select).innerHTML=resp; } } } } // Select comune/provincia ricerca agenzia function select_geografico_agenzie_02(provincia, comune_selezionato, nome_select, tabindex, punti) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', punti+"include/ajax.php?edit=comune&provincia="+provincia+"&tabindex="+tabindex+"&nome_select="+nome_select+"&comune_selezionato="+comune_selezionato+"&select_vuoto=1", true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; document.getElementById('div_'+nome_select).innerHTML=resp; } } } } // Select comune/provincia sezione immobili function select_geografico_immobili(provincia, comune_selezionato, nome_select, tabindex, punti) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', punti+"include/ajax.php?edit=comune_sez_immobili&provincia="+provincia+"&tabindex="+tabindex+"&nome_select="+nome_select+"&comune_selezionato="+comune_selezionato+"&select_vuoto=1", true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; document.getElementById('div_'+nome_select).innerHTML=resp; } } } } // suggestion in home page var myAjax = ajax(); function ajax() { var ajax = null; if (window.XMLHttpRequest) { try { ajax = new XMLHttpRequest(); } catch(e) {} } else if (window.ActiveXObject) { try { ajax = new ActiveXObject("Msxm12.XMLHTTP"); } catch (e) { try { ajax = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } return ajax; } function request(str) { if(str.length>3) { myAjax.open("POST", "./include/request_comuni.php"); myAjax.onreadystatechange = result; myAjax.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); myAjax.send("search="+str); } // Iposto a 0 il label per la visualizzazione e nascondo gli altri select document.getElementById('ricerca_comune').label_prezzo_da.value="0"; document.getElementById('ricerca_comune').label_prezzo_a.value="0"; document.getElementById('ricerca_comune').label_tipo_immobile.value="0"; document.getElementById('prezzo_da_div').style.display='none'; document.getElementById('prezzo_a_div').style.display='none'; document.getElementById('tipo_immobile_div').style.display='none'; } function request02(str) { if(str.length>3) { myAjax.open("POST", "../include/request_comuni.php"); myAjax.onreadystatechange = result; myAjax.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); myAjax.send("search="+str); } } function result() { if (myAjax.readyState == 4) { var liste = myAjax.responseText; var cible = document.getElementById('tag_update').innerHTML = liste; document.getElementById('tag_update').style.display = "block"; } } function selected(choice) { var cible = document.getElementById('s'); cible.value = choice; document.getElementById('tag_update').style.display = "none"; } // Fine suggestion in home page // Cambia la classe al campo comune_etichetta quando compilato function cambia_classe() { document.getElementById('ricerca_comune').comune_etichetta.className="home02"; } // Riscrive "As Es. Treviso" nel campo comune_etichetta se lasciato vuoto function controlla_comune() { if(document.getElementById('ricerca_comune').comune_etichetta.value=="") { document.getElementById('ricerca_comune').comune_etichetta.className="home"; document.getElementById('ricerca_comune').comune_etichetta.value="Ad es: Treviso"; } } function nascondi_div(valore) { document.getElementById(valore).style.display="none"; } function mostra_select(valore) { var procedi=false; if(valore=='prezzo_da_div') { if(document.getElementById('ricerca_comune').label_prezzo_da.value==0) { var mostra="prezzo_da_div"; var nascondi="prezzo_a_div"; var nascondi_02="tipo_immobile_div"; var nascondi_03="numero_camere_a_div"; var nascondi_04="numero_camere_da_div"; document.getElementById('ricerca_comune').label_prezzo_da.value="1"; document.getElementById('ricerca_comune').label_prezzo_a.value="0"; document.getElementById('ricerca_comune').label_tipo_immobile.value="0"; document.getElementById('ricerca_comune').label_numero_camere_a.value="0"; document.getElementById('ricerca_comune').label_numero_camere_da.value="0"; procedi=true; }else{ document.getElementById('prezzo_da_div').style.display='none'; procedi=false; document.getElementById('ricerca_comune').label_prezzo_da.value="0"; } }else if(valore=='prezzo_a_div'){ if(document.getElementById('ricerca_comune').label_prezzo_a.value==0) { var mostra="prezzo_a_div"; var nascondi="prezzo_da_div"; var nascondi_02="tipo_immobile_div"; var nascondi_03="numero_camere_a_div"; var nascondi_04="numero_camere_da_div"; document.getElementById('ricerca_comune').label_prezzo_a.value="1"; document.getElementById('ricerca_comune').label_prezzo_da.value="0"; document.getElementById('ricerca_comune').label_tipo_immobile.value="0"; document.getElementById('ricerca_comune').label_numero_camere_a.value="0"; document.getElementById('ricerca_comune').label_numero_camere_da.value="0"; procedi=true; }else{ document.getElementById('prezzo_a_div').style.display='none'; procedi=false; document.getElementById('ricerca_comune').label_prezzo_a.value="0"; } }else if(valore=="tipo_immobile_div"){ if(document.getElementById('ricerca_comune').label_tipo_immobile.value==0) { var nascondi="prezzo_a_div"; var nascondi_02="prezzo_da_div"; var mostra="tipo_immobile_div"; var nascondi_03="numero_camere_a_div"; var nascondi_04="numero_camere_da_div"; document.getElementById('ricerca_comune').label_tipo_immobile.value="1"; document.getElementById('ricerca_comune').label_prezzo_da.value="0"; document.getElementById('ricerca_comune').label_prezzo_a.value="0"; document.getElementById('ricerca_comune').label_numero_camere_a.value="0"; document.getElementById('ricerca_comune').label_numero_camere_da.value="0"; procedi=true; }else{ document.getElementById('tipo_immobile_div').style.display='none'; procedi=false; document.getElementById('ricerca_comune').label_tipo_immobile.value="0"; } }else if(valore=='numero_camere_a_div'){ if(document.getElementById('ricerca_comune').label_numero_camere_a.value==0) { var mostra="numero_camere_a_div"; var nascondi="prezzo_da_div"; var nascondi_02="tipo_immobile_div"; var nascondi_03="prezzo_a_div"; var nascondi_04="numero_camere_da_div"; document.getElementById('ricerca_comune').label_prezzo_a.value="0"; document.getElementById('ricerca_comune').label_prezzo_da.value="0"; document.getElementById('ricerca_comune').label_tipo_immobile.value="0"; document.getElementById('ricerca_comune').label_numero_camere_a.value="1"; document.getElementById('ricerca_comune').label_numero_camere_da.value="0"; procedi=true; }else{ document.getElementById('numero_camere_a_div').style.display='none'; procedi=false; document.getElementById('ricerca_comune').label_numero_camere_a.value="0"; } }else if(valore=='numero_camere_da_div'){ if(document.getElementById('ricerca_comune').label_numero_camere_da.value==0) { var mostra="numero_camere_da_div"; var nascondi="prezzo_da_div"; var nascondi_02="tipo_immobile_div"; var nascondi_03="numero_camere_a_div"; var nascondi_04="prezzo_a_div"; document.getElementById('ricerca_comune').label_prezzo_a.value="0"; document.getElementById('ricerca_comune').label_prezzo_da.value="0"; document.getElementById('ricerca_comune').label_tipo_immobile.value="0"; document.getElementById('ricerca_comune').label_numero_camere_a.value="0"; document.getElementById('ricerca_comune').label_numero_camere_da.value="1"; procedi=true; }else{ document.getElementById('numero_camere_da_div').style.display='none'; procedi=false; document.getElementById('ricerca_comune').label_numero_camere_da.value="0"; } } if(procedi==true) { document.getElementById(mostra).style.display='block'; document.getElementById(nascondi).style.display='none'; document.getElementById('tag_update').style.display='none'; document.getElementById(nascondi_02).style.display='none'; document.getElementById(nascondi_03).style.display='none'; document.getElementById(nascondi_04).style.display='none'; } } function tipo_immobile_func(valore, valore_testuale) { document.getElementById('ricerca_comune').tipo_immobile.value=valore; if(valore!="") { document.getElementById('tipo_immobile_span').innerHTML=valore_testuale; }else{ document.getElementById('tipo_immobile_span').innerHTML="Seleziona"; } document.getElementById('tipo_immobile_div').style.display="none"; } function salva_prezzo_da(valore) { document.getElementById('ricerca_comune').prezzo_da.value=valore; if(valore!="") { document.getElementById('prezzo_da_span').innerHTML="€ "+valore; }else{ document.getElementById('prezzo_da_span').innerHTML="da"; } document.getElementById('prezzo_da_div').style.display="none"; } function salva_prezzo_a(valore) { document.getElementById('ricerca_comune').prezzo_a.value=valore; if(valore!="") { document.getElementById('prezzo_a_span').innerHTML="€ "+valore; }else{ document.getElementById('prezzo_a_span').innerHTML="a"; } document.getElementById('prezzo_a_div').style.display="none"; } function salva_numero_camere_da(valore) { document.getElementById('ricerca_comune').numero_camere_da.value=valore; if(valore!="") { document.getElementById('numero_camere_da_span').innerHTML=valore; }else{ document.getElementById('numero_camere_da_span').innerHTML="da"; } document.getElementById('numero_camere_da_div').style.display="none"; } function salva_numero_camere_a(valore) { document.getElementById('ricerca_comune').numero_camere_a.value=valore; if(valore!="") { document.getElementById('numero_camere_a_span').innerHTML=valore; }else{ document.getElementById('numero_camere_a_span').innerHTML="da"; } document.getElementById('numero_camere_a_div').style.display="none"; } function carica_vetrina(partenza) { document.getElementById('vetrina_home').innerHTML="
"; var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', "./include/ajax.php?edit=vetrina_home&partenza="+partenza, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; document.getElementById('vetrina_home').innerHTML=resp; } } } } // FUNZIONE PER AJAX IN BASE AL BROWSER function getXmlHttpObject() { var xmlHttp=null; try { //Firefox e Opera xmlHttp=new XMLHttpRequest(); } catch(e) { //Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; }