if(!Search||Search==undefined||typeof (Search)!="object"){var Search={};}String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(_1,_2){if(!_2){_2=function(a,b){return a==b;};}for(var i=0;i<this.length;i++){if(_2(this[i],_1)){return i;}}return -1;};}if(!Array.prototype.map){Array.prototype.map=function(fx){for(var i=0;i<this.length;i++){this[i]=fx(this[i]);}};}if(!Array.prototype.reduce){Array.prototype.reduce=function(_8){var _9=this.length;if(typeof _8!="function"){throw new TypeError();}if(_9==0&&arguments.length==1){throw new TypeError();}var i=0;if(arguments.length>=2){var rv=arguments[1];}else{do{if(i in this){rv=this[i++];break;}if(++i>=_9){throw new TypeError();}}while(true);}for(;i<_9;i++){if(i in this){rv=_8.call(null,rv,this[i],i,this);}}return rv;};}if(!Array.prototype.filter){Array.prototype.filter=function(_c){var _d=this.length;if(typeof _c!="function"){throw new TypeError();}var _e=new Array();var _f=arguments[1];for(var i=0;i<_d;i++){if(i in this){var val=this[i];if(_c.call(_f,val,i,this)){_e.push(val);}}}return _e;};}var sd=document.domain.split(".");sd.shift();Search.host=sd.join(".");var sd=document.domain.split(".");sd.shift();Search.domain=sd.join(".");Search.host=document.domain;Search.from_mapping={"ricerca":"h_web","ricercaimmagini":"h_imm","ricercanews":"h_new","ricercavideo":"h_vid","ricercagruppi":"h_gru"};var port_parts=document.location.href.split(":");try{Search.port=port_parts[2].split("/")[0];}catch(e){Search.port=80;}Search.debug_enabled=true;var $=function(id){return document.getElementById(id);};Search.getParam=function(p,_14){var _15="[\\?&]"+p+"=([^&#]*)";var reg=new RegExp(_15);var url=window.location.href;var res=reg.exec(url);if(res==null||res==""){return _14||"";}else{return res[1];}};Search.isArray=function(obj){if(!obj){return false;}return obj.constructor==Array;};Search.debug=function(msg){if(Search.debug_enabled&&$("debug")){$("debug").innerHTML=$("debug").innerHTML+"<br>"+msg;}};Search.Events={addEvent:function(elm,_1c,fn,_1e){if(!elm){return;}if(elm.addEventListener){elm.addEventListener(_1c,fn,_1e);return true;}else{if(elm.attachEvent){var r=elm.attachEvent("on"+_1c,fn);return r;}else{elm["on"+_1c]=fn;}}},stopEvent:function(evt){var e=evt||window.event;if(!e){return;}if(e.preventDefault){e.preventDefault();e.stopPropagation();}else{e.returnValue=false;e.cancelBubble=true;}},removeEvent:function(elm,_23,fn,_25){if(elm.removeEventListener){elm.removeEventListener(_23,fn,_25);return true;}else{if(elm.removeEvent){var r=elm.removeEvent("on"+_23,fn);return r;}else{elm["on"+_23]=function(){};}}},target:function(evt){return window.event?window.event.srcElement:evt.target;},toElement:function(evt){var evt=window.event||evt;return (evt.relatedTarget)?evt.relatedTarget:evt.toElement;}};Search.Cookie={get:function(_29){var _2a=_29+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" "){c=c.substring(1,c.length);}if(c.indexOf(_2a)==0){return c.substring(_2a.length,c.length);}}return null;},set:function(_2e,_2f,_30,_31){if(_31){var _32=new Date();_32.setTime(_32.getTime()+(_31*8640000));var _33="; expires="+_32.toGMTString();}else{var _33="";}document.cookie=_2f+"="+_30+_33+"; path=/; domain="+_2e;},erase:function(_34,_35){this.set(_34,_35,"",-1);},enabled:function(){Search.Cookie.set(Search.host,"probe","ok",1);var _36=Search.Cookie.get("probe")=="ok";Search.Cookie.set(Search.host,"probe","",-1);return _36;}};Search.UI={toggle:function(_37){if(!_37||!$(_37)){return;}var st=$(_37).style;st.display=st.display!="block"?"block":"none";},hide:function(_39){if(!_39||!$(_39)){return;}var st=$(_39).style;if(st.display!="none"){st.display="none";}},hideAll:function(_3b){_3b.map(Search.UI.hide);},show:function(_3c){if(!_3c||!$(_3c)){return;}var st=$(_3c).style;st.display="block";}};Search.make_handler=function(_3e,arg){return function(evt){_3e(arg);};};getNodeAttribute=function(el,_42){return el.attname||el.getAttributeNode(_42)&&el.getAttributeNode(_42).value;};function getTextValues(_43){var _44=[];var els=_43.getElementsByTagName("input");for(var i=0;i<els.length;i++){if(els[i].type=="text"){_44.push(els[i].value);}}return _44.join(" ");}Search.ri=function(i){var MW=78,MH=86;i.width=MW;return;};Search.go=function(_4a,_4b){qs=$("trova").qs.value;dv=$("trova").dv?$("trova").dv.value:"";var a=encodeURIComponent||escape;if(_4a){page=_4a.split("/");page=page.pop();if(page!="aziende"&&page!="persone"&&page!="annunci"&&page!="results.php"){qs=getTextValues($("trova"));dv="";}}qs=_4b?a(qs):escape(qs);dv=_4b?a(dv):escape(dv);_4a=_4a||"http://ricerca.alice.it/ricerca";if(_4a.indexOf("/local.alice.it")!=-1){uri="?cosa="+qs.replace("&","%26");}else{uri="?qs="+qs.replace("&","%26");}if(dv){uri+="&dv="+dv.replace("&","%26");}var _4d=Search.from_mapping[Search.host.split(".")[0]]||"";if(_4d){uri+="&f="+_4d;}document.location.href=_4a+uri;};Search.go_utf8=function(_4e){Search.go(_4e,true);};Search.track=function(_4f){var url="http://images.alice.it/kpi.gif?chnl=src";for(k in _4f){url+="&"+k+"="+_4f[k];}url+="&ci="+Math.floor(1000000*Math.random());var img=new Image();img.onerror=null;img.onload=null;img.src=url;};Search.Altro={btn:"s_altro",menu:"tab-altro-cont-header",item_prefix:"s_",selected_class:"this-tab",srv:"altro",init:false,main:function(){if(Search.Altro.init){return;}var btn=$(Search.Altro.btn);if(!btn){Search.debug("ooops.. button (id:"+Search.Altro.btn+") not found");return;}btn.onclick=function(){Search.Altro.toggle();};Search.Events.addEvent(document,"click",Search.Altro.hide,true);Search.Altro.init=true;},focus:function(){var _53=$("trova");if(Search.isArray(_53)&&_53.length>1){_53=_53[0];}if(!_53){return;}var qs=_53.qs;if(qs){if(qs.type!="hidden"){qs.focus();}}},toggle:function(){Search.UI.toggle(Search.Altro.menu);Search.Events.stopEvent();},hide:function(){Search.UI.hide(Search.Altro.menu);},highlight:function(){var _55=Search.Altro.item_prefix+document.domain.split(".")[0];if($(_55)){hl=getNodeAttribute($(_55),"hl");if(hl){$(hl).className+="  "+Search.Altro.selected_class;}$(_55).className+="  "+Search.Altro.selected_class;}Search.Altro.main();Search.Altro.focus();},track:function(evt){Search.track({"srv":Search.Altro.srv});}};Search.invia=function(u,w,h,_5a){var w=w||320;var h=h||400;var _5a=_5a||"no";window.open(u,"","toolbar=no,status=no,scrollbars="+_5a+",location=no,menubar=no,directories=no,width="+w+",height="+h);};Search.redir=function(){if(Search.onw==""){document.location.href=Search.dest;}if(Search.onw=="WTA"){window.open("http://rover.ebay.com/rover/1/724-10296-4030-255/4?mpre="+escape(Search.dest),"");}if(Search.onw=="WRA"){features="scrollbars=no,resizable=no,status=yes";if(screen.width==800&&screen.height==600){features="scrollbars=yes,resizable=no,status=yes";}window.open(Search.dest,"",features);}};Search.clck=function(u,k,o){if(k==""){return true;}Search.dest=u;Search.onw=o;var src="http://go.virgilio.it/kpi.gif?k="+escape(k)+"&rand="+Math.floor(1000000*Math.random());var img=new Image();img.onerror=Search.redir;img.onload=Search.redir;img.src=src;return true;};Search.track_hp=function(){Search.track({"srv":"wc","type":"c","id":"hps"});};var jQuery=jQuery||"";if(jQuery==""){Search.Events.addEvent(window,"load",Search.Altro.highlight,false);}else{jQuery(document).ready(function(){Search.Altro.highlight();});}Search.dest="";Search.onw="";Search.ss=function(url){window.status=url;return true;};Search.cs=function(){window.status="";return true;};Search.wra=function(u){features="scrollbars=no,resizable=no,status=yes";if(screen.width==800&&screen.height==600){features="scrollbars=yes,resizable=no,status=yes";}window.open(u,"",features);};Search.apri=function(u){window.open(u,"","toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width=400,height=540");};
