function controllo_utente(testobreve,testorubrica) { if(document.formAnnuncio.InserzionistaPrivato.value==0) { controlla_rif_agenzia_submit(testobreve,testorubrica); } else { verificaAnnuncio(testobreve,testorubrica); } } function controlla_rif_agenzia_submit(testobreve,testorubrica) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', './include/ajax.php?edit=valida_rif_agenzia&rif_agenzia='+document.formAnnuncio.rif_agenzia.value+'&codice_inserzione='+document.formAnnuncio.codice_inserzione.value+'&codice_cliente='+document.formAnnuncio.codice_cliente.value, 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) { alert("ATTENZIONE:Il codice riferimento agenzia e' duplicato"); document.formAnnuncio.rif_agenzia.className="evidenza"; document.formAnnuncio.rif_agenzia.focus(); return false; } else { verificaAnnuncio(testobreve,testorubrica); } } } } } function valida_rif_agenzia(rif_agenzia,codice_inserzione,codice_cliente) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', './include/ajax.php?edit=valida_rif_agenzia&rif_agenzia='+rif_agenzia+'&codice_inserzione='+codice_inserzione+'&codice_cliente='+codice_cliente, 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('alert_rif_agenzia').innerHTML="ATTENZIONE:codice riferimento duplicato"; document.getElementById('alert_rif_agenzia').style.display="block"; } else if(resp==0) { document.getElementById('alert_rif_agenzia').innerHTML=""; document.getElementById('alert_rif_agenzia').style.display="none"; } } } } } function compila_camere(tipologia_immobile) { if(tipologia_immobile==15) { num_option=document.getElementById('numero_camere').options.length; for(a=num_option;a>=0;a--) { document.getElementById('numero_camere').options[a]=null; } for(a=0;a<2;a++) { document.getElementById('numero_camere').options[a]=new Option('',a,false,false); document.getElementById('numero_camere').options[a].innerHTML = a; } document.formAnnuncio.numero_camere.selectedIndex=1; document.formAnnuncio.numero_camere_bis.value=1; document.formAnnuncio.numero_camere.disabled=true; } else if(tipologia_immobile==16) { num_option=document.getElementById('numero_camere').options.length; for(a=num_option;a>=0;a--) { document.getElementById('numero_camere').options[a]=null; } for(a=0;a<3;a++) { document.getElementById('numero_camere').options[a]=new Option('',a,false,false); document.getElementById('numero_camere').options[a].innerHTML = a; } document.formAnnuncio.numero_camere.selectedIndex=2; document.formAnnuncio.numero_camere_bis.value=2; document.formAnnuncio.numero_camere.disabled=true; } else if(tipologia_immobile==17) { num_option=document.getElementById('numero_camere').options.length; for(a=num_option;a>=0;a--) { document.getElementById('numero_camere').options[a]=null; } for(a=0;a<4;a++) { document.getElementById('numero_camere').options[a]=new Option('',a,false,false); document.getElementById('numero_camere').options[a].innerHTML = a; } document.formAnnuncio.numero_camere.selectedIndex=3; document.formAnnuncio.numero_camere_bis.value=3; document.formAnnuncio.numero_camere.disabled=true; } else if(tipologia_immobile==18) { //preparo le camere da 4 a 99 num_option=document.getElementById('numero_camere').options.length; for(a=num_option;a>=0;a--) { document.getElementById('numero_camere').options[a]=null; } for(a=0;a<96;a++) { b=a+4 document.getElementById('numero_camere').options[a]=new Option('',b,false,false); document.getElementById('numero_camere').options[a].innerHTML = b; } document.formAnnuncio.numero_camere.selectedIndex=0; document.formAnnuncio.numero_camere.disabled=false; } else { for(a=0;a<99;a++) { document.getElementById('numero_camere').options[a]=new Option('',a,false,false); if(a==0) { document.getElementById('numero_camere').options[a].innerHTML = "Seleziona"; } else { document.getElementById('numero_camere').options[a].innerHTML = a; } if(a==document.formAnnuncio.numero_camere_old.value) { document.getElementById('numero_camere').options[a].selected=true; } } document.formAnnuncio.numero_camere.disabled=false; } } function misura_ipe(tipologia_immobile) { if(tipologia_immobile==15 || tipologia_immobile==16 || tipologia_immobile==17 || tipologia_immobile==18 || tipologia_immobile==19 || tipologia_immobile==20 || tipologia_immobile==22 || tipologia_immobile==24 || tipologia_immobile==25 || tipologia_immobile==26) { document.getElementById('misura_ipe').innerHTML = " kWh/mq annui"; } else if(tipologia_immobile==21 || tipologia_immobile==23 || tipologia_immobile==27) { document.getElementById('misura_ipe').innerHTML = " kWh/mc annui"; } } function pubblica_per_riviste(codice_inserzione, codice_cliente) { var campo="pubblica_valore_"+codice_inserzione; var nomeForm="pubblica_form_"+codice_inserzione; var valore_definitivo=(eval("document."+nomeForm+"."+campo+".value")); var valore_get=0; if(valore_definitivo=="0") { eval("document."+nomeForm+"."+campo+".value=1"); valore_get=1; }else{ eval("document."+nomeForm+"."+campo+".value=0"); } var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', "./include/ajax.php?edit=seleziona_annuncio_export&codice_inserzione="+codice_inserzione+"&valore="+valore_get+"&codice_cliente="+codice_cliente, true); xmlHttp.send(null); } function restrictinput(maxlength,e,placeholder) { if (window.event&&event.srcElement.value.length>=maxlength) return false else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength) { var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys if (pressedkey.test(String.fromCharCode(e.which))) e.stopPropagation() } } function ContoMaiuscole(testo,etichetta_campo) { var contatore=0; var percentuale=parseInt(testo.length*0.1); for (var i = 0 ; ipercentuale) { alert ("ATTENZIONE:Inserire il campo "+etichetta_campo+" rigorosamente in minuscolo."); return false; } else { var contatore1=0; for (var i = 0 ; i2) { alert ("ATTENZIONE:Inserire il campo "+etichetta_campo+" rigorosamente in minuscolo."); return false; } } return true; } } function displaylimit(thename, theid, thelimit) { var theform=theid!=""? document.getElementById(theid) : thename var numero_caratteri; //alert(eval(thename).value.length); if(eval(thename).value.length==0) { numero_caratteri=thelimit; } else { numero_caratteri=thelimit-(eval(thename).value.length); } var limit_text='Hai ancora '+numero_caratteri+' caratteri disponibili' if (document.all||ns6) document.write(limit_text) if (document.all) { eval(theform).onkeypress=function() { return restrictinput(thelimit,event,theform) } eval(theform).onkeyup=function() { countlimit(thelimit,event,theform) } } else if (ns6) { document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); document.body.addEventListener('keyup', function(event) {countlimit(thelimit,event,theform) }, true); } } function countlimit(maxlength,e,placeholder) { var theform=eval(placeholder) var lengthleft=maxlength-theform.value.length var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder) if (window.event||e.target&&e.target==eval(placeholder)) { if(lengthleft<0) { theform.value=theform.value.substring(0,maxlength); } placeholderobj.innerHTML=lengthleft if (lengthleft<0) { alert ("ATTENZIONE:E' stato raggiunto il massimo dei caratteri consentiti."); } } } // Verifico che sia compilato almeno un campo per la ricerca immobile function verificaRicerca(riviste) { // Riviste indica se l'utente ha o meno la pubblicazione // In base a questo parametro gestisco la verifica if(riviste==0) { if((document.ricerca.codice_inserzione.value=="")&&(document.ricerca.rif_agenzia.value=="")&&(document.ricerca.tipo_immobile.value=="")&&(document.ricerca.codice_provincia_inserzione.value=="")&&(document.ricerca.codice_comune_inserzione.value=="")) { alert("Selezionare almeno un parametro per la ricerca"); }else{ document.ricerca.submit(); } }else{ if((document.ricerca.codice_inserzione.value=="")&&(document.ricerca.rif_agenzia.value=="")&&(document.ricerca.tipo_immobile.value=="")&&(document.ricerca.codice_provincia_inserzione.value=="")&&(document.ricerca.codice_comune_inserzione.value=="")&&(document.ricerca.pubblicato_su.value=="")) { alert("Selezionare almeno un parametro per la ricerca"); }else{ document.ricerca.submit(); } } } // Verifico la correttezza dei dati inseriti. function verificaAnnuncio(testobreve,testorubrica) { procedi=true; document.formAnnuncio.codice_provincia_inserzione.className="evidenza02"; document.formAnnuncio.codice_comune_inserzione.className="evidenza02"; document.formAnnuncio.tipo_immobile.className="evidenza02"; document.formAnnuncio.prezzo.className="evidenza02"; if(document.formAnnuncio.codice_provincia_inserzione.value=="") { procedi=false; alert("Selezionare la provincia"); document.formAnnuncio.codice_provincia_inserzione.className="evidenza"; document.formAnnuncio.codice_provincia_inserzione.focus(); }else if(document.formAnnuncio.codice_comune_inserzione.value==""){ procedi=false; alert("Selezionare il comune"); document.formAnnuncio.codice_comune_inserzione.className="evidenza"; document.formAnnuncio.codice_comune_inserzione.focus(); }else if(document.formAnnuncio.rif_agenzia.value=="" && document.formAnnuncio.InserzionistaPrivato.value=="0"){ procedi=false; alert("Inserire il Codice riferimento agenzia"); document.formAnnuncio.rif_agenzia.className="evidenza"; document.formAnnuncio.rif_agenzia.focus(); }else if((document.formAnnuncio.prezzo.value=="" || document.formAnnuncio.prezzo.value=="0") && document.formAnnuncio.info_in_agenzia[0].checked){ procedi=false; alert("E' necessario inserire il prezzo per pubblicare l'annuncio su Casa.it"); document.formAnnuncio.prezzo.className="evidenza"; document.formAnnuncio.prezzo.focus(); }else if(document.formAnnuncio.tipo_immobile.value==""){ procedi=false; alert("Selezionare la tipologia"); document.formAnnuncio.tipo_immobile.className="evidenza"; document.formAnnuncio.tipo_immobile.focus(); }else if(document.formAnnuncio.numero_camere.value=="" || document.formAnnuncio.numero_camere.value=="0"){ //il numero di camere è obbligatorio //solo se l'immobile è un residenziale(categorie 15/16/17/18/19/20/24/25/26) if(document.formAnnuncio.tipo_immobile.value=="15" || document.formAnnuncio.tipo_immobile.value=="16" || document.formAnnuncio.tipo_immobile.value=="17" || document.formAnnuncio.tipo_immobile.value=="18" || document.formAnnuncio.tipo_immobile.value=="19" || document.formAnnuncio.tipo_immobile.value=="20" || document.formAnnuncio.tipo_immobile.value=="24" || document.formAnnuncio.tipo_immobile.value=="25" || document.formAnnuncio.tipo_immobile.value=="26") { procedi=false; alert("Per gli immobili residenziali il numero di camere e' obbligatorio"); document.formAnnuncio.numero_camere.className="evidenza"; document.formAnnuncio.numero_camere.focus(); } }else if(document.formAnnuncio.superficie.value=="" || document.formAnnuncio.superficie.value=="0"){ //la superficie è obbligatoria //solo se l'immobile è un residenziale(categorie 15/16/17/18/19/20/24/25/26) if(document.formAnnuncio.tipo_immobile.value=="15" || document.formAnnuncio.tipo_immobile.value=="16" || document.formAnnuncio.tipo_immobile.value=="17" || document.formAnnuncio.tipo_immobile.value=="18" || document.formAnnuncio.tipo_immobile.value=="19" || document.formAnnuncio.tipo_immobile.value=="20" || document.formAnnuncio.tipo_immobile.value=="24" || document.formAnnuncio.tipo_immobile.value=="25" || document.formAnnuncio.tipo_immobile.value=="26") { procedi=false; alert("Per gli immobili residenziali la superficie e' obbligatoria"); document.formAnnuncio.superficie.className="evidenza"; document.formAnnuncio.superficie.focus(); } } if(testobreve=="1"){ if(!ContoMaiuscole(document.formAnnuncio.TestoBreve.value,'Descrizione per Fotocase24')){ procedi=false; }else{ var testo_obj=document.getElementById("TestoBreve"); var testo=testo_obj.value; if(testo.length>190) { alert ("ATTENZIONE:E' stato raggiunto il massimo dei caratteri consentiti per il campo Descrizione per Fotocase24."); procedi=false; } } } if(testorubrica=="1"){ if(!ContoMaiuscole(document.formAnnuncio.TestoRubrica.value,'Descrizione per Rubriche')){ procedi=false; }else{ var testo_obj=document.getElementById("TestoRubrica"); var testo=testo_obj.value; if(testo.length>260) { alert ("ATTENZIONE:E' stato raggiunto il massimo dei caratteri consentiti per il campo Descrizione per Rubriche."); procedi=false; } } } if(procedi==true) { document.formAnnuncio.submit(); } } // Visualizza la tabella con gli optional function optional() { if(document.formAnnuncio.optional_valore.value==0){ $visualizza("div_optional"); $update("optional_valore", 1, true); }else{ $nascondi("div_optional"); $update("optional_valore", 0, true); } } function select_zone(zona_selezionata,codice_comune_inserzione,tabindex) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', './include/ajax.php?edit=select_zona&zona_selezionata='+zona_selezionata+'&codice_comune_inserzione='+codice_comune_inserzione+'&tabindex='+tabindex, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; // Creo il div con dentro il select della zona var option = document.createElement("div"); option.value = resp; $update("div_select", option.value); } } } } // crea il select comuni function select_geografico(etichetta, valore_etichetta, valore_selezionato, zona, tabindex) { var xmlHttp = getXmlHttpObject(); xmlHttp.open("GET", "./include/ajax.php?funzione=select_geografico&etichetta="+etichetta+"&zona="+zona+"&valore_etichetta="+valore_etichetta+"&valore_selezionato="+valore_selezionato+"&tabindex="+tabindex, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; $update("div_geografico", resp); $nascondi("div_geografico_vuoto"); $visualizza("div_geografico"); } } } } function select_order_direction(order_by,order_direction) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', 'include/ajax.php?edit=select_order_direction&order_by='+order_by+'&order_direction='+order_direction, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var resp = xmlHttp.responseText; // Creo il div con dentro il select dell'order_direction if(resp) { var option = document.createElement("div"); option.value = resp; $update("div_select_order_direction", option.value); } } else { alert(xmlHttp.responseText); } } } } // Funzione per la cancellazione delle foto function editPics(codice_utente, codice_inserzione, edit) { var a=confirm("Cancellare la foto?"); if(a) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', './include/ajax.php?action=delete_pics&codice_utente='+codice_utente+'&codice_inserzione='+codice_inserzione+'&edit='+edit, true); xmlHttp.send(null); $nascondi('immagine_foto_'+edit); $nascondi('bottone_foto_'+edit); $visualizza('cancellata_'+edit); } } // Visualizza il form di login nella pagina login.php function visualizza_form() { $visualizza('visualizza_form_login'); } // ACCESSO AREA RISERVATA // Funzione per la verifica della login richiamata da verifica_login() function avvia_login(usr, password) { var xmlHttp = getXmlHttpObject(); password=password.replace("+", "XXXX"); xmlHttp.open('GET', 'area_clienti/include/ajax.php?tabella=utenti&username='+usr+'&password='+password, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var res = xmlHttp.responseText; if(res) { // se feedback = 0 login + sessione + redirect var feedback=res; if(feedback==0) { location.href = "area_clienti/index.php"; }else if(feedback==1){ // feedback = 1 - Dati errati alert("ATTENZIONE!! Verificare i dati inseriti"); }else if(feedback==2){ // feedback = 2 - Account scaduto alert("ATTENZIONE! Account scaduto. Contattare l'assistenza"); }else{ alert("ATTENZIONE! Account non attivo. Contattare l'assistenza"); } } } } } } function verifica_login(id) { var procedi=true; document.getElementById('formLogin_'+id).username.className="myCaseInsert"; document.getElementById('formLogin_'+id).pwd.className="myCaseInsert"; var usr=document.getElementById('formLogin_'+id).username.value; var password=document.getElementById('formLogin_'+id).pwd.value; if(document.getElementById('formLogin_'+id).username.value=="") { procedi=false; document.getElementById('formLogin_'+id).username.focus(); document.getElementById('formLogin_'+id).username.className="inviaErroreAccesso"; alert("ATTENZIONE! Inserire l'username"); }else if(document.getElementById('formLogin_'+id).pwd.value==""){ procedi=false; document.getElementById('formLogin_'+id).pwd.focus(); document.getElementById('formLogin_'+id).pwd.className="inviaErroreAccesso"; alert("ATTENZIONE! Inserire la password"); } if(procedi==true) { avvia_login(usr, password); } } // Controllo campi prima di invio e-mail ad assistenza function richiesta_assistenza() { procedi=true; document.assistenza.oggetto.className="evidenza02"; document.assistenza.messaggio.style.background="#ffffff"; if(document.assistenza.oggetto.value=="") { document.assistenza.oggetto.focus(); document.assistenza.oggetto.className="evidenza"; alert("Inserire l'oggetto del messaggio"); procedi=false; }else if(document.assistenza.messaggio.value==""){ document.assistenza.messaggio.focus(); document.assistenza.messaggio.style.background="#caf0ff"; alert("Inserire il testo del messaggio"); procedi=false; } if(procedi==true) { document.assistenza.submit(); } } // Verifica la correttezza dei campi impostati nel profilo prima di salvarli function verificaProfilo() { var procedi; procedi=true; // Setto il valore di default dalle classe degli input document.formProfilo.nome.className="evidenza02"; document.formProfilo.via.className="evidenza02"; document.formProfilo.cap.className="evidenza02"; document.formProfilo.tel.className="evidenza02"; document.formProfilo.email.className="evidenza02"; document.formProfilo.pwd.className="evidenza02"; document.formProfilo.codice_provincia_utente.className="evidenza02"; document.formProfilo.codice_comune_utente.className="evidenza02"; // Verifico la corretta compilazione dei campi. if(document.formProfilo.InserzionistaPrivato.value==0) { if(document.formProfilo.FirmaSms.value.length>25) { alert("ATTENZIONE : il campo FIRMA PER RIVISTA deve essere lungo al massimo 25 caratteri."); procedi=false; }else if(document.formProfilo.tel.value.length>27){ alert("ATTENZIONE : il campo TELEFONO deve essere lungo al massimo 27 caratteri."); procedi=false; } } if(document.formProfilo.nome.value==""){ document.formProfilo.nome.focus(); document.formProfilo.nome.className="evidenza"; alert("Inserire il nome!"); procedi=false; } else if(document.formProfilo.via.value==""){ document.formProfilo.via.focus(); document.formProfilo.via.className="evidenza"; alert("Inserire la via!"); procedi=false; } else if(document.formProfilo.cap.value==""){ document.formProfilo.cap.focus(); document.formProfilo.cap.className="evidenza"; alert("Inserire il CAP!"); procedi=false; } else if(document.formProfilo.tel.value==""){ document.formProfilo.tel.focus(); document.formProfilo.tel.className="evidenza"; alert("Inserire il numero di telefono!"); procedi=false; } else if(document.formProfilo.email.value==""){ document.formProfilo.email.focus(); document.formProfilo.email.className="evidenza"; alert("Inserire l'e-mail!"); procedi=false; } else if(document.formProfilo.pwd.value==""){ document.formProfilo.pwd.focus(); document.formProfilo.pwd.className="evidenza"; alert("Inserire la password"); procedi=false; } else if(document.formProfilo.codice_provincia_utente.value==""){ document.formProfilo.codice_provincia_utente.focus(); document.formProfilo.codice_provincia_utente.className="evidenza"; alert("Selezionare la provincia"); procedi=false; }else if(document.formProfilo.codice_comune_utente.value==""){ document.formProfilo.codice_comune_utente.focus(); document.formProfilo.codice_comune_utente.className="evidenza"; alert("Selezionare la città"); procedi=false; } // Se tutti i campi son compilati correttamente invio il modulo if(procedi==true) { document.formProfilo.submit(); } } //pubblica gli annunci per soluzioneportali function pubblica_sp(parametro,numero_annunci_totali) { var pezzi=parametro.split("_"); var codice_inserzione=pezzi[0]; var codice_cliente=pezzi[1]; var id_portale=pezzi[2]; var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', './include/ajax.php?tabella=annunci_portali_sp&codice_inserzione='+codice_inserzione+'&id_portale='+id_portale+'&codice_cliente='+codice_cliente, true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var annunci_selezionati = xmlHttp.responseText; var numero_annunci=document.getElementById("contatore_annunci_pagina"); for(i=0;i<(numero_annunci.value);i=i+1) { nome_variabile="quantita_"+id_portale+"_"+(i+1); if(numero_annunci_totali>-1) { $update(nome_variabile,annunci_selezionati+" sel. su "+numero_annunci_totali+" disp."); } } if(numero_annunci_totali>-1) { if(numero_annunci_totali<=annunci_selezionati) { //ha selezionato tutti gli annunci disponibili per la testata //devo ciclare tutti i checkbox //e mettere su disabled quelli non checked for(j=0;j<(numero_annunci.value);j=j+1) { id_checkbox=(j+1)+"_"+id_portale; obj_checkbox=document.getElementById(id_checkbox); if(obj_checkbox.checked==false) { obj_checkbox.disabled=true; } } } else { for(j=0;j<(numero_annunci.value);j=j+1) { id_checkbox=(j+1)+"_"+id_portale; obj_checkbox=document.getElementById(id_checkbox); if(obj_checkbox.checked==false && obj_checkbox.disabled==true) { obj_checkbox.disabled=false; } } } } } } } } // 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; } // Apre il popup function open_scroll(url,w,h) { var zoom; if(zoom) { zoom.close(); } zoom=window.open(url,'pop','height='+h+',width='+w+'location=no,resizable=no,scrollbars=no'); } // Apre il popup con scroll function open_scroll_02(url,w,h) { var zoom; if(zoom) { zoom.close(); } zoom=window.open(url,'pop','height='+h+',width='+w+'location=no,resizable=no,scrollbars=yes'); } // Questa funzione apre il div che contiene i campi per la galleria fotografica function galleriaFotografica(){ if(document.formAnnuncio.galleria_valore.value==0){ $visualizza("galleria"); document.formAnnuncio.galleria_valore.value=1; }else{ $nascondi("galleria"); document.formAnnuncio.galleria_valore.value=0; } } // Controlla i campi nel profilo Firma Sms function controlla_campi() { } function confermaeliminatutti() { if (confirm("Confermi l'operazione?Verranno eliminati tutti gli annunci.")) { document.elimina_tutti.submit(); }; } function confermadeseleziona(nomeform) { if (confirm("Confermi l'operazione?Verranno deselezionati tutti gli annunci della testata selezionata.")) { eval('document.'+nomeform+'.submit()'); }; } function confermaseleziona(nomeform) { if (confirm("Confermi l'operazione?Verranno pubblicati tutti gli annunci disponibili sulla testata selezionata.")) { eval('document.'+nomeform+'.submit()'); }; } function confermaseleziona_sp(id_portale,codice_cliente,numero_annunci_totali) { if (confirm("Confermi l'operazione?Verranno pubblicati tutti gli annunci disponibili sul portale selezionato.")) { seleziona_sp(id_portale,codice_cliente,numero_annunci_totali); }; } function seleziona_sp(id_portale,codice_cliente,numero_annunci_totali) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', './include/ajax.php?tabella=annunci_portali_sp&id_portale='+id_portale+'&codice_cliente='+codice_cliente+'&subaz=seleziona_tutti', true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var pezzi=xmlHttp.responseText.split("-"); //il primo pezzo è annunci_selezionati //gli altri sono i checkbox da checkare var annunci_selezionati = pezzi[0]; var numero_annunci=document.getElementById("contatore_annunci_pagina"); for(i=0;i<(numero_annunci.value);i=i+1) { nome_variabile="quantita_"+id_portale+"_"+(i+1); if(numero_annunci_totali>-1) { $update(nome_variabile,annunci_selezionati+" sel. su "+numero_annunci_totali+" disp."); } id_checkbox=(i+1)+"_"+id_portale; obj_checkbox=document.getElementById(id_checkbox); for(j=1;j-1) { if(obj_checkbox.checked==false) { obj_checkbox.disabled=true; } } } } } } } function confermadeseleziona_sp(id_portale,codice_cliente,numero_annunci_totali) { if (confirm("Confermi l'operazione?Verranno deselezionati tutti gli annunci del portale selezionato.")) { deseleziona_sp(id_portale,codice_cliente,numero_annunci_totali); }; } function deseleziona_sp(id_portale,codice_cliente,numero_annunci_totali) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', './include/ajax.php?tabella=annunci_portali_sp&id_portale='+id_portale+'&codice_cliente='+codice_cliente+'&subaz=deseleziona_tutti', true); xmlHttp.onreadystatechange = stateChanged; xmlHttp.send(null); function stateChanged() { if(xmlHttp.readyState == 4) { //Stato OK if (xmlHttp.status == 200) { var numero_annunci=document.getElementById("contatore_annunci_pagina"); for(i=0;i<(numero_annunci.value);i=i+1) { nome_variabile="quantita_"+id_portale+"_"+(i+1); if(numero_annunci_totali>-1) { $update(nome_variabile,"0 sel. su "+numero_annunci_totali+" disp."); } id_checkbox=(i+1)+"_"+id_portale; obj_checkbox=document.getElementById(id_checkbox); obj_checkbox.checked=false; obj_checkbox.disabled=false; } } } } } function check_gestionale(codice_cliente) { var xmlHttp = getXmlHttpObject(); xmlHttp.open('GET', './include/ajax.php?edit=check_gestionale&codice_cliente='+codice_cliente, true); xmlHttp.send(null); } var horizontal_offset="9px" //horizontal offset of hint box from anchor link var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change. var ie=document.all var ns6=document.getElementById&&!document.all function getposOffset(what, offsettype) { var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop; var parentEl=what.offsetParent; while (parentEl!=null) { totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop; parentEl=parentEl.offsetParent; } return totaloffset; } function iecompattest() { return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body } function clearbrowseredge(obj, whichedge) { var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1 if (whichedge=="rightedge") { var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40 dropmenuobj.contentmeasure=dropmenuobj.offsetWidth if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure) edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset) } else { var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18 dropmenuobj.contentmeasure=dropmenuobj.offsetHeight if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure) edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight } return edgeoffset } function showhint(menucontents, obj, e, tipwidth) { if ((ie||ns6) && document.getElementById("hintbox")) { dropmenuobj=document.getElementById("hintbox") dropmenuobj.innerHTML=menucontents dropmenuobj.style.left=dropmenuobj.style.top=-500 if (tipwidth!="") { dropmenuobj.widthobj=dropmenuobj.style dropmenuobj.widthobj.width=tipwidth } dropmenuobj.x=getposOffset(obj, "left") dropmenuobj.y=getposOffset(obj, "top") dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px" dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px" dropmenuobj.style.visibility="visible" obj.onmouseout=hidetip } } function hidetip(e) { dropmenuobj.style.visibility="hidden" dropmenuobj.style.left="-500px" } function createhintbox() { var divblock=document.createElement("div") divblock.setAttribute("id", "hintbox") document.body.appendChild(divblock) } if (window.addEventListener) window.addEventListener("load", createhintbox, false) else if (window.attachEvent) window.attachEvent("onload", createhintbox) else if (document.getElementById) window.onload=createhintbox