//tealium universal tag - utag.102 ut4.0.201812092052, Copyright 2018 Tealium.com Inc. All Rights Reserved.
try{(function(id,loader){var u={};utag.o[loader].sender[id]=u;if(utag===undefined){utag={};}if(utag.ut===undefined){utag.ut={};}if(utag.ut.loader===undefined){u.loader=function(o){var a,b,c,l;a=document;if(o.type==="iframe"){b=a.createElement("iframe");b.setAttribute("height","1");b.setAttribute("width","1");b.setAttribute("style","display:none");b.setAttribute("src",o.src);}else if(o.type==="img"){utag.DB("Attach img: "+o.src);b=new Image();b.src=o.src;return;}else{b=a.createElement("script");b.language="javascript";b.type="text/javascript";b.async=1;b.charset="utf-8";b.src=o.src;}if(o.id){b.id=o.id;}if(typeof o.cb==="function"){if(b.addEventListener){b.addEventListener("load",function(){o.cb();},false);}else{b.onreadystatechange=function(){if(this.readyState==="complete"||this.readyState==="loaded"){this.onreadystatechange=null;o.cb();}};}}l=o.loc||"head";c=a.getElementsByTagName(l)[0];if(c){utag.DB("Attach to "+l+": "+o.src);if(l==="script"){c.parentNode.insertBefore(b,c);}else{c.appendChild(b);}}};}else{u.loader=utag.ut.loader;}
u.ev={'view':1};u.initialized=false;u.map={"js_page.IQ_pxAppId":"IQ_pxAppId","js_page.IQ_pxRootUrl":"IQ_pxRootUrl"};u.extend=[function(a,b){try{if(1){b['js_page.IQ_pxRootUrl']='/px/xhr'}}catch(e){utag.DB(e)}},function(a,b,c,d,e,f,g){d=b['ut.domain'];if(typeof d=='undefined')return;c=[{'(\W|^)idealista.com(\W|$)':'PXm4C135aU'},{'(\W|^)idealista.it(\W|$)':'PXk8l5V12H'},{'(\W|^)idealista.pt(\W|$)':'PXOnEy1sGO'}];var m=false;for(e=0;e<c.length;e++){for(f in c[e]){g=new RegExp(f,'i');if(g.test(d)){b['js_page.IQ_pxAppId']=c[e][f];m=true};};if(m)break};}];u.send=function(a,b){if(u.ev[a]||u.ev.all!==undefined){var c,d,e,f,i;u.data={"base_url":"/px/client/main.min.js","IQ_pxAppId":"","IQ_pxRootUrl":""};for(c=0;c<u.extend.length;c++){try{d=u.extend[c](a,b);if(d==false)return}catch(e){}};for(d in utag.loader.GV(u.map)){if(b[d]!==undefined&&b[d]!==""){e=u.map[d].split(",");for(f=0;f<e.length;f++){u.data[e[f]]=b[d];}}}
window._pxAppId=u.data.IQ_pxAppId;window._pxRootUrl=u.data.IQ_pxRootUrl;u.loader_cb=function(){u.initialized=true;};if(!u.initialized){u.loader({"type":"script","src":u.data.base_url,"cb":u.loader_cb,"loc":"script","id":'utag_102'});}else{u.loader_cb();}
}};utag.o[loader].loader.LOAD(id);})("102","idealista.es-portal");}catch(error){utag.DB(error);}
