function apripop(url){ newwindow=window.open(url,'_wingas','height=640,width=800,scrollbars=yes,resizable=yes,menubar=yes,location=yes,toolbar=yes'); if (window.focus) {newwindow.focus()} } function confirmDeleteAndGo() { if (confirm("L'operazione di cancellazione è irreversibile. Vuoi continuare?")) { return true; } else { return false; } } function confirmDelete(formName) { if (confirm("L'operazione di cancellazione è irreversibile. Vuoi continuare?")) { window.document.forms[formName].submit(); } } function confirmDeleteMessage(formName, text) { if (confirm(text)) { window.document.forms[formName].submit(); } } function findAndSelect(formName,controlName,table) { var url; url = "/be/main.php?page=search&target="+table+"&fn="+formName+"&cn="+controlName+"&search=" + window.document.forms[formName].elements[controlName+"_cerca"].value; myWindow = window.open(url, "Elenco","dependent=yes,width=400,height=500,scrollbars=yes"); } function findAndSelect2(formName,controlName,table) { var url; url = "/be/main.php?page=link&onlypage=1&formname="+formName+"&textname="+controlName; myWindow = window.open(url, "Link","dependent=yes,width=400,height=500,scrollbars=yes"); } function findAndSelect3(formName,controlName,table) { var url; url = "/be/main.php?page=search_banner&target="+table+"&fn="+formName+"&cn="+controlName+"&search=" + window.document.forms[formName].elements[controlName+"_cerca"].value; myWindow = window.open(url, "Elenco","dependent=yes,width=400,height=500,scrollbars=yes"); } function setValueandSubmit(formName,controlName1,value1,text) { if (confirm(text)) { window.document.forms[formName].elements[controlName1].value = value1; window.document.forms[formName].submit(); } } function confirmAndSubmit(formName,text) { if (confirm(text)) { window.document.forms[formName].submit(); } } function setValue(formName,controlName1,value1,controlName2,value2) { window.opener.document.forms[formName].elements[controlName1].value = value1; window.opener.document.forms[formName].elements[controlName2].value = value2; window.close(); } function setLink(formName,textName,linkValue) { window.opener.document.forms[formName].elements[textName].value = linkValue; window.close(); } function vai(destination,ext) { if (ext==1) { w=window.open(destination,'_wingas','height=640,width=800,scrollbars=yes,resizable=yes,menubar=yes,location=yes,toolbar=yes'); if (window.focus) {w.focus();} } else window.document.location = destination; } function confirmAndGo(destination) { if (confirm("L'operazione di cancellazione è irreversibile. Vuoi continuare?")) { window.document.location = destination; } } function openDetail(url) { var nuovaFinestra; nuovaFinestra = window.open(url,'nuovaFinestra'); } function closeAndGo(url) { window.opener.document.location = url; window.close(); } function changeFocusOffset (InputObj, InputLen, offset) { if (InputObj.value.length == InputLen) { var i; for (i = 0; i < InputObj.form.length; i++) if (InputObj.form.elements[i].name == InputObj.name) break; i += offset; if (i < InputObj.form.length) InputObj.form.elements[i].focus(); } } function internalLink(formname, textname) { var url; url = "/be/main.php?page=link&formname="+formname+"&textname="+textname; myWindow = window.open(url, "Link","dependent=yes,width=300,height=640,scrollbars=yes,location=no"); } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i0) { idx = specName.indexOf(","); if (idx!=-1) { specEl = specName.substr(0,idx); specName = specName.substr(idx+1); } else { specEl = specName; specName = ''; }; eval(specEl+".style.display=(visibile?'inline':'none')"); } } function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } var catCoInserDiv= new Array(); catCoInserDiv['offrocasa']=true; catCoInserDiv['boxufficinegozi']=true; catCoInserDiv['venditacase']=true; catCoInserDiv['furgonicamper']=true; catCoInserDiv['autovendita']=true; catCoInserDiv['automoto']=true; catCoInserDiv['ricambiaccessori']=true; catCoInserDiv['moto']=true; catCoInserDiv['cittaarte']=true; catCoInserDiv['mare']=true; catCoInserDiv['montagna']=true; var intcatCoInserDiv= new Array(); intcatCoInserDiv['5']=true; intcatCoInserDiv['7']=true; intcatCoInserDiv['168']=true; intcatCoInserDiv['201']=true; intcatCoInserDiv['205']=true; intcatCoInserDiv['10']=true; intcatCoInserDiv['203']=true; intcatCoInserDiv['75']=true; intcatCoInserDiv['G76']=true; intcatCoInserDiv['G78']=true; intcatCoInserDiv['G81']=true; var MacroCatCoInserDiv= new Array(); MacroCatCoInserDiv['cittaarte']=true; MacroCatCoInserDiv['automotom']=true; MacroCatCoInserDiv['mare']=true; MacroCatCoInserDiv['montagna']=true; function getElement(id_elemento) { var elemento; if(document.getElementById) elemento = document.getElementById(id_elemento); else elemento = document.all[id_elemento]; return elemento; } function toggleVisibility(divToShow,valSel){ var x=document.getElementById(valSel); if (divToShow.disabled==true && catCoInserDiv[x.value]){ divToShow.disabled=false; } if(divToShow.disabled==false && !catCoInserDiv[x.value]){ divToShow.disabled=true; if(!divToShow.options[0].selected) {divToShow.options[0].selected = true;} } } function inttoggleVisibility(divToShow,valSel){ var x=document.getElementById(valSel); if (divToShow.disabled==true && intcatCoInserDiv[x.value]){ divToShow.disabled=false; } if(divToShow.disabled==false && !intcatCoInserDiv[x.value]){ divToShow.disabled=true; if(!divToShow.options[0].selected) {divToShow.options[0].selected = true;} } } function Visualizza() { var valore=document.getElementById('origine').value; if(valore == '') { document.getElementById('BE').style.display = "none"; document.getElementById('FE').style.display = "none"; document.getElementById('PA').style.display = "none"; document.getElementById('MB').style.display = "none"; document.getElementById('partner_pub').disabled=true; document.getElementById('utente_pub').display = "inline"; } if(valore == 'BE') { document.getElementById('BE').style.display = "inline"; document.getElementById('FE').style.display = "none"; document.getElementById('PA').style.display = "none"; document.getElementById('MB').style.display = "none"; document.getElementById('partner_pub').options[0].selected=true; document.getElementById('partner_pub').disabled=true; document.getElementById('utente_pub').disabled=false; } if(valore == 'FE') { document.getElementById('BE').style.display = "none"; document.getElementById('FE').style.display = "inline"; document.getElementById('PA').style.display = "none"; document.getElementById('MB').style.display = "none"; } if(valore == 'PA') { document.getElementById('BE').style.display = "none"; document.getElementById('FE').style.display = "none"; document.getElementById('PA').style.display = "inline"; document.getElementById('MB').style.display = "none"; document.getElementById('utente_pub').options[0].selected=true; document.getElementById('partner_pub').disabled=false; document.getElementById('utente_pub').disabled=true; } if(valore == 'MB') { document.getElementById('BE').style.display = "none"; document.getElementById('FE').style.display = "none"; document.getElementById('PA').style.display = "none"; document.getElementById('MB').style.display = "inline"; } } function viewazioni() { var valore=document.getElementById('tipooperazione').value; document.getElementById('vaiButton').style.display = "none"; if(valore == '') { document.getElementById('mbgruppi').style.display = "none"; document.getElementById('notifiche').style.display = "none"; } if(valore == 'addetichetta' || valore == 'deletichetta') { document.getElementById('mbgruppi').style.display = "inline"; document.getElementById('notifiche').style.display = "none"; } if(valore == 'sendnotifica') { document.getElementById('mbgruppi').style.display = "none"; document.getElementById('notifiche').style.display = "inline"; } } function viewElement(select,elementToShow) { var valore=document.getElementById(select).value; if(valore == '' || valore == 0) { document.getElementById(elementToShow).style.display = "none"; } else { document.getElementById(elementToShow).style.display = "inline"; } } function BAK_setCookie(cookieName, cookieValue, expires, path, domain, secure) { document.cookie = escape(cookieName) + '=' + escape(cookieValue) + (expires ? '; expires=' + expires.toGMTString() : '') + (path ? '; path=' + path : '') + (domain ? '; domain=' + domain : '') + (secure ? '; secure' : ''); }; function BAK_getCookie(cookieName) { var cookieValue = ''; var posName = document.cookie.indexOf(escape(cookieName) + '='); if (posName != -1) { var posValue = posName + (escape(cookieName) + '=').length; var endPos = document.cookie.indexOf(';', posValue); if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos)); else cookieValue = unescape(document.cookie.substring(posValue)); } return (cookieValue); } function setCookie(){ var scroll=typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement.scrollTop; document.cookie='yscroll' + "=" + scroll; } function caricaqtfe(luogo, cat, qt) { if ($('catalogqtfe')) { var url = '/be/main.php?page=carica_qtfe'; var params ='&nome_luogo='+luogo.value+'&code_cat='+cat.value; try { if ( qt != null && qt.value != "" && qt.value!=undefined) params += '&qt='+qt.value; } catch(e) {} getAjax('catalogqtfe',url+params ); } } function caricaimmobili(categoria, tipoimm) { var url = '/be/main.php?page=carica_immobili'; var params = '&code_link='+categoria; try { if (tipoimm != null && tipoimm.value != '' && tipoimm.value!=undefined) params += '&tipoimm='+tipoimm.value; } catch(e) {} getAjax('elencotipimmobili',url+params ); } function possibleconcessinaria (miacat){ noagenzie = new Array ('auto', 'auto-vendita', 'moto'); siconcessionaria = false; i = 0; while (i < noagenzie.length && !siconcessionaria ) { if ( noagenzie[i]==miacat ) siconcessionaria == true; i++; } return siconcessionaria; } function outUrlElenco(cittaok, catlink, word, qtlink, tipoimm, inserzionista) { var baseUrl ="http://"+cittaok+".bakecaincontrii.com/"+catlink; if (inserzionista.length>0) baseUrl += ('-'+inserzionista); baseUrl += '-0'; var url = ''; if (word!="") url += word; try { if (qtlink != null && qtlink.value != '' && qtlink.value!=undefined ) url += '00quartiere-'+qtlink.value; } catch(e) {} try { if (tipoimm != null && tipoimm.value != '' && tipoimm.value!=undefined ) url += '00tipo-'+tipoimm.value; } catch(e) {} outUrl = baseUrl + (url.length >0 ? '?'+url : ''); window.document.location = outUrl; } function dispProgress() { $('prog_text').show(); } var mapLoaded = false; function mostraMappa(valore) { if (!mapLoaded) { var url = '/be/public/inc/iframe.php'; var params = 'a='+valore; $('geocoord').show(); getAjax('geocoord',url+'?'+params); mapLoaded = true; } else $('geocoord').toggle(); } function progressAndDisable(elemento,eldisattiva) { $(elemento).setStyle('display','inline'); $(eldisattiva).setStyle('display','none'); } function getAjax(elemento,url,vis){ if(!vis)vis='block'; var req = new Request.HTML({url:url, onSuccess: function(html) { $(elemento).set('text', ''); $(elemento).adopt(html); $(elemento).setStyle("display", vis); }, onFailure: function() { $(elemento).set('text', 'The request failed.'); } }); req.send(); } try { Element.implement({ isDisplayed:function(){return this.getStyle("display")!="none";}, toggle:function(){return this[this.isDisplayed()?"hide":"show"]();}, hide:function(){var b;try{if("none"!=this.getStyle("display")){b=this.getStyle("display");}}catch(a){}return this.store("originalDisplay",b||"block").setStyle("display","none");}, show:function(a){return this.setStyle("display",a||this.retrieve("originalDisplay")||"block");} }); } catch(e) {} var lastOpened=''; lastOpenedUrl=''; function acAnteprima(idel){ if(lastOpened){ $(lastOpened).set('src','/be/custom/inc/img/zoomdone.png'); } lastOpened=idel; if(idel)$(idel).set('src','/be/custom/inc/img/zoomout.png'); } function toggleColor(objElement) { if (objElement.className=='normal1') objElement.className='focus1'; else objElement.className='normal1'; } /*nuove funzioni*/ function ControllaCF(cf) { var validi, i, s, set1, set2, setpari, setdisp; if( cf == '' ) return false; cf = cf.toUpperCase(); if( cf.length != 16 ) return false; validi = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; for( i = 0; i < 16; i++ ){ if( validi.indexOf( cf.charAt(i) ) == -1 ) return false; } set1 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; set2 = "ABCDEFGHIJABCDEFGHIJKLMNOPQRSTUVWXYZ"; setpari = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; setdisp = "BAKPLCQDREVOSFTGUHMINJWZYX"; s = 0; for( i = 1; i <= 13; i += 2 ) s += setpari.indexOf( set2.charAt( set1.indexOf( cf.charAt(i) ))); for( i = 0; i <= 14; i += 2 ) s += setdisp.indexOf( set2.charAt( set1.indexOf( cf.charAt(i) ))); if( s%26 != cf.charCodeAt(15)-'A'.charCodeAt(0) ) return false; return true; } function ControllaPIVA(pi) { if( pi == '' ) return false; if( pi.length != 11 ) return false; validi = "0123456789"; for( i = 0; i < 11; i++ ){ if( validi.indexOf( pi.charAt(i) ) == -1 ) return false; } s = 0; for( i = 0; i <= 9; i += 2 ) s += pi.charCodeAt(i) - '0'.charCodeAt(0); for( i = 1; i <= 9; i += 2 ){ c = 2*( pi.charCodeAt(i) - '0'.charCodeAt(0) ); if( c > 9 ) c = c - 9; s += c; } if( ( 10 - s%10 )%10 != pi.charCodeAt(10) - '0'.charCodeAt(0) ) return false; return true; }