if (!Array.prototype.filter){Array.prototype.filter = function(fun /*, thisp*/){var len = this.length;if (typeof fun != "function"){throw new TypeError();}var res = new Array();var thisp = arguments[1]; for (var i = 0; i < len; i++){ if (i in this){var val = this[i];if (fun.call(thisp, val, i, this)){res.push(val);}}}return res;};} BITracerBB=function(intTimeout,blnPmkInError,strPathCounter,strFormName){this.pmkForm=false;this.intTimeout=intTimeout;this.link=null;this.curTimeout=null;if((strPathCounter!='')&&(strPathCounter!=null)&&(strPathCounter!='undefined')){this.pathCounter=strPathCounter;}else{this.pathCounter='http://adimg.alice.it/tracks/bi/images/kpi.gif';};this.debugBI=this.getUrlParameter("debugBI");this.pathGo="http://go.alice.it";this.blnPmkInError=blnPmkInError;if((strFormName!='')&&(strFormName!=null)&&(strFormName!='undefined')){this.formName=strFormName;}else{this.formName='frmBILinkRedirect';}} BITracerBB.prototype={callBIGif:function(objLink,blnGo,thePmk,theClkc,strFascia,newStrPathCounter,fncGoPage){try{this.pmkForm=false;if(this.curTimeout!=null){clearTimeout(this.curTimeout);} this.objLink=objLink;this.link=objLink.href;var strUrlCounter="";if(((strFascia!=null)&&(strFascia!='undefined'))&&((thePmk!='')&&(thePmk!=null)&&(thePmk!='undefined'))){thePmk=thePmk+strFascia;} if((fncGoPage!=null)&&(fncGoPage!='undefined')){this.fncGoPage=fncGoPage;}else{this.fncGoPage=null;}if(blnGo==false){var strPathCounter=this.pathCounter;if((newStrPathCounter!='')&&(newStrPathCounter!=null)&&(newStrPathCounter!='undefined')){strPathCounter=newStrPathCounter;}strUrlCounter=strPathCounter+'?pmk='+thePmk+'&rand='+Math.floor(1000000*Math.random())+'&link='+this.link;if(this.debugBI=="true"){alert(strUrlCounter);}var objRequest=this; var returnsTimeout=function(){return objRequest.timeoutBI(thePmk);};var returns=function(){return objRequest.callBackBI();};var imgBi = document.createElement("IMG");imgBi.id="imgBi";imgBi.onload=returns;imgBi.src=strUrlCounter;document.body.appendChild(imgBi);this.curTimeout=setTimeout(returnsTimeout,this.intTimeout);}else if(blnGo==true){ strUrlCounter=this.pathGo+'/';if((theClkc!='')&&(theClkc!=null)&&(theClkc!='undefined')){strUrlCounter=strUrlCounter+theClkc;}strUrlCounter=strUrlCounter+'/';var strLink=this.link;if((thePmk!='')&&(thePmk!=null)&&(thePmk!='undefined')){var strPmk="pmk="+thePmk;if(this.link.indexOf("?")!=-1){strPmk="&"+strPmk;}else{strPmk="?"+strPmk;};strLink=this.link+strPmk;}strUrlCounter=strUrlCounter+strLink;if(this.debugBI=="true"){alert(strUrlCounter);}this.goUrl(strUrlCounter);}}catch(e){return true;}return false;}, callBackBI:function(){try{if(this.curTimeout!=null){clearTimeout(this.curTimeout);}if(this.fncGoPage!=null){this.fncGoPage();return false;};this.goUrl(this.link);}catch(e){if(this.fncGoPage!=null){this.fncGoPage();return false;};this.goUrl(this.link);}},timeoutBI:function(thePmk){try{if(this.curTimeout!=null){clearTimeout(this.curTimeout);}if(this.blnPmkInError){strPmk="pmk="+thePmk;if(this.link.indexOf("?")!=-1){strPmk="&"+strPmk;}else{strPmk="?"+strPmk;}if(this.fncGoPage!=null){this.fncGoPage();return false;};if(this.objLink.href.indexOf("#")==0){this.goUrl(this.link+strPmk);}else{document.location.href=this.objLink.href;}} else{if(this.fncGoPage!=null){this.fncGoPage();return false;};this.goUrl(this.link);}}catch(e){if(this.fncGoPage!=null){this.fncGoPage();return false;};this.goUrl(this.link);}},getUrlParameter:function(param){var val="";var qs=window.location.search;var start=qs.indexOf(param);if(start!=-1){start+=param.length+1;var end=qs.indexOf("&",start);if(end==-1){end=qs.length}val=qs.substring(start,end);}return val;}, goUrl:function(urlLink){objRequest=false;page_request=false;if(this.objLink.target!=""){if(this.objLink.target.toLowerCase()=="_blank"){document.getElementById(this.formName).target="_blank";document.getElementById(this.formName).action=urlLink;document.getElementById(this.formName).submit();return false;};if(this.objLink.target.toLowerCase()=="_top"){document.getElementById(this.formName).target="_top";document.getElementById(this.formName).action=urlLink;document.getElementById(this.formName).submit();return false;};if(this.objLink.target.toLowerCase()=="_parent"){document.getElementById(this.formName).target="_parent";document.getElementById(this.formName).action=urlLink;document.getElementById(this.formName).submit();return false;}};document.getElementById(this.formName).target="";document.getElementById(this.formName).action=urlLink;document.getElementById(this.formName).submit();}, callBIForm:function(objLinkForm,blnGoForm,thePmkForm,theClkcForm,strFasciaForm,newStrPathCounterForm,fncGoPageForm){if (!this.pmkForm){objLinkForm.href=objLinkForm.action;return this.callBIGif(objLinkForm,blnGoForm,thePmkForm,theClkcForm,strFasciaForm,newStrPathCounterForm,function(){this.pmkForm=true;fncGoPageForm();});this.pmkForm=true;}else{return true;}}, track:function (trObjLink,trPmk,trFnc){return this.callBIGif(trObjLink,false,trPmk,'',null,null,trFnc);}, trackForm:function (trObjLink,trPmk,trFnc){return this.callBIForm(trObjLink,false,trPmk,'',null,null,trFnc);} } var idSelectedBB="";var bbNotify=""; BottomBar = function() { this.BI = new BITracerBB(500,true,null,"frmBILinkRedirectBottomBar"); this.arrUrlDiv= new Array("","","","/common/iframe_mail/pf/iframe_mail_nolog.html","http://local.virgilio.it/html/common_local/iframe_local_2.html","/common/VIRGILIO/bottom_bar/iframe/iframe_notizie.html","","","","","",""); this.arrBBDiv = new Array("cont_canali","cont_canali_pers","box_personal_chn_bar","box_mail_bar","box_local_bar","box_news_bar","box_nick","box_comm_nolog","box_comm_log_Nonick","box_gestione","box_msgbox","box_status"); this.arrBBLnk = new Array("lnk_can","bxpersonal_chn","bxmail","bxlocal","bxnews","bxnick","bxcommnolog","bxcommlogNonick","bxgestione","bxmsgbox","bxstatus"); this.arrPersCanDisabled = new Array("1","2","3","4","5","6","7","8","9","10","11"); this.arrPersCanDefault = new Array("1","2","3","4","5","6","7","8","9","10","11"); this.arrLclBB=new Array("Local"); this.lclDomainBB="http://local.virgilio.it"; this.dtBB=new Date(); this.ckdtBB = new Date(); this.ckdtBB.setTime(this.dtBB.getTime() + 3600000*24*3650); this.bbSetting = this.getCookieBB("vSettingChanBar").split("|"); this.bbLogged = this.getCookieBB("PAAA_AUTHE"); this.bbLoggedType=""; this.timeoutLogged=null; if (this.bbLogged!=""){ this.arrBBLnk[2]="bxmailLog"; var tmpTypeLogged = this.getCookieBB("tinv"); if ((tmpTypeLogged=="1")||(tmpTypeLogged=="6")){ this.bbLoggedType="virgilio"; } if (tmpTypeLogged=="5"){ this.bbLoggedType="alice"; } } this.bbSearchT=""; this.paramHP=""; if (window.location.host=="www.virgilio.it"){ this.paramHP="?from=hpvirgilio&link=" + escape(top.window.location.href); } else { this.paramHP="?link=" + escape(top.window.location.href); } if ((window.location.host.toLowerCase().indexOf("community")!=-1)||(window.location.host.toLowerCase().indexOf("people")!=-1)){ this.arrUrlDiv[5] = "http://community.virgilio.it/common/VIRGILIO/bottom_bar/iframe/iframe_notizie_utf8.html"; } document.getElementById("ckUserCanPersAddName").onkeydown = this.captureEnter; document.getElementById("ckUserCanPersAddUrl").onkeydown = this.captureEnter; } BottomBar.prototype = { btt_close : function (ide,ade){ var elm = document.getElementById(ide); var elmlnk = document.getElementById(ade); elm.style.display='none'; elmlnk.className= ''; return false; }, etichetta : function (eti,objDisplay) { if (objDisplay!=null){ if(document.getElementById(objDisplay).style.display=="block") {return false;} } var etk = document.getElementById(eti); etk.style.display = 'block'; }, etichetta_close : function (etic) { var etkc = document.getElementById(etic);etkc.style.display = 'none'; }, openbox : function (bxs,axs){ if (ega != true){ var bxt = document.getElementById(bxs); bxt.style.display = 'block'; var axt = document.getElementById(axs);a xt.className = 'on'; ega = true; } else { var bxt = document.getElementById(bxs); bxt.style.display = 'none'; var axt = document.getElementById(axs); axt.className = ''; ega = false; } return false; }, setCookieBB : function (name,value,expires,path,domain,secure){document.cookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");}, getCookieBB : function (c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}return"";}, trim : function(stringa) {while (stringa.substring(0,1) == ' '){stringa = stringa.substring(1, stringa.length);}while (stringa.substring(stringa.length-1, stringa.length) == ' '){stringa = stringa.substring(0,stringa.length-1);}return stringa;}, loadLocalBB : function () { var lclCity = this.getCookieBB("vlocal_city"); lclCity=lclCity.replace("city()_idcity()_provincia()_idprovincia()_hostcity()_regione()",""); if (lclCity!=""){ this.arrLclBB = lclCity.split("_"); this.arrLclBB[0]=unescape(this.arrLclBB[0].replace("city(","").replace(")","")); this.arrLclBB[1]=this.arrLclBB[1].replace("idcity(","").replace(")",""); this.arrLclBB[2]=this.arrLclBB[2].replace("provincia(","").replace(")",""); this.arrLclBB[3]=this.arrLclBB[3].replace("idprovincia(","").replace(")",""); if (lclCity.indexOf("hostcity")!=-1){ this.arrLclBB[4]=this.arrLclBB[4].replace("hostcity(","").replace(")",""); this.lclDomainBB="http://"+ this.arrLclBB[4] + ".virgilio.it"; this.arrLclBB[5]=this.arrLclBB[5].replace("regione(","").replace(")",""); this.arrLclBB[4]=this.arrLclBB[5];}else{this.arrLclBB[4]=this.arrLclBB[4].replace("regione(","").replace(")",""); //this.lclDomainBB="http://"+ this.arrLclBB[0].replace(/à/g,"a").replace(/è/g,"e").replace(/é/g,"e").replace(/ì/g,"i").replace(/ò/g,"o").replace(/ù/g,"u").replace(/ /g,"-").replace(/'/g,"") + ".virgilio.it"; } } }, loadBB : function (bbEmailNumMsg,bbEmailNumMsgAlice,bbEmailNumMsgVirgilio) { /*this.bbEmailNumMsg=bbEmailNumMsg; this.bbEmailNumMsgAlice=bbEmailNumMsgAlice; this.bbEmailNumMsgVirgilio=bbEmailNumMsgVirgilio;*/ if(typeof bbEmailNumMsg == 'undefined'){this.bbEmailNumMsg="ON";}else{this.bbEmailNumMsg=bbEmailNumMsg;} if(typeof bbEmailNumMsgAlice == 'undefined'){this.bbEmailNumMsgAlice="OFF";}else{this.bbEmailNumMsgAlice=bbEmailNumMsgAlice;} if(typeof bbEmailNumMsgVirgilio == 'undefined'){this.bbEmailNumMsgVirgilio="ON";}else{this.bbEmailNumMsgVirgilio=bbEmailNumMsgVirgilio;} this.loadLocalBB(); this.loadPersChannel(); if(this.arrLclBB[0]!="Local"){ var strCityLocal=this.arrLclBB[0]; if (strCityLocal.length>13) { strCityLocal=strCityLocal.substr(0,10)+"..."; } document.getElementById("alt_local").innerHTML="Virgilio " + strCityLocal; document.getElementById("alt_local").style.textTransform="capitalize"; this.arrUrlDiv[4]="/common/VIRGILIO/bottom_bar/iframe/iframe_local_settato.html"; document.getElementById("box_local_bar_iframe").style.height="100px"; } this.minimizeBB(false); this.newsNotify(); document.getElementById("bottom_bar").style.display="block"; if (this.lclDomainBB!="http://local.virgilio.it"){ document.getElementById("bxlocal").onclick=function(){return objBottomBar.BI.track(document.getElementById('bxlocal') ,'tb_local_gocity',function(){objBottomBar.etichetta_close('alt_local'); objBottomBar.openAllBB('box_local_bar','bxlocal');});}; } this.emailStatus(); }, emailStatus:function(){ if (this.bbLogged!=""){ this.emailStatusLogged(); var tmpTimeoutBottomBar = this; this.timeoutLogged=setInterval(function(){ if (tmpTimeoutBottomBar.getCookieBB("PAAA_AUTHE")==""){ tmpTimeoutBottomBar.emailStatusNoLogged(); clearInterval(tmpTimeoutBottomBar.timeoutLogged); tmpTimeoutBottomBar.emailStatus(); } },100); } else { var tmpTimeoutBottomBar = this; this.timeoutLogged=setInterval(function(){ if (tmpTimeoutBottomBar.getCookieBB("PAAA_AUTHE")!=""){ tmpTimeoutBottomBar.emailStatusLogged(); clearInterval(tmpTimeoutBottomBar.timeoutLogged); tmpTimeoutBottomBar.emailStatus(); } },300); } }, emailStatusLogged:function(){ this.bbLogged = this.getCookieBB("PAAA_AUTHE"); this.bbLoggedType=""; if (this.bbLogged!=""){ var tmpTypeLogged = this.getCookieBB("tinv"); if ((tmpTypeLogged=="1")||(tmpTypeLogged=="6")){ this.bbLoggedType="virgilio"; } if (tmpTypeLogged=="5"){ this.bbLoggedType="alice"; } } this.emailNumberMsg(); this.arrBBLnk[2]="bxmailLog"; document.getElementById("bxmailLog").className=document.getElementById("bxmail").className; document.getElementById("bxmail").style.display="none"; document.getElementById("bxmailLog").style.display="block"; document.getElementById("box_mail_bar_iframe").style.height="64px"; }, emailNumberMsg:function(){ // TODO AV : var bbEmailNumMsg="ON"; if(typeof this.bbEmailNumMsg == 'undefined'){this.bbEmailNumMsg="OFF";} if(typeof this.bbEmailNumMsgAlice == 'undefined'){this.bbEmailNumMsgAlice="ON";} if(typeof this.bbEmailNumMsgVirgilio == 'undefined'){this.bbEmailNumMsgVirgilio="ON";} if (this.bbLogged!=""){ if (this.bbEmailNumMsg!="ON") { document.getElementById("ntfciframe").style.display="none"; document.getElementById("bxmailLog").getElementsByTagName("SPAN")[0].style.marginTop="5px"; } else { if ((document.getElementById("minBB").style.display!="block")&&(document.getElementById("ntfciframe").src=="")){ if (this.bbLoggedType=="alice"){ if (this.bbEmailNumMsgAlice!="ON") { document.getElementById("ntfciframe").style.display="none"; document.getElementById("bxmailLog").getElementsByTagName("SPAN")[0].style.marginTop="5px"; }else{ document.getElementById("ntfciframe").src="http://portale.rossoalice.alice.it/ps/PostLoginBarra.do"; } } if (this.bbLoggedType=="virgilio"){ if (this.bbEmailNumMsgVirgilio!="ON") { document.getElementById("ntfciframe").style.display="none"; document.getElementById("bxmailLog").getElementsByTagName("SPAN")[0].style.marginTop="5px"; }else{ document.getElementById("ntfciframe").src="http://box.webmailvtin.alice.it/BoxMail/boxmail?mini=ok"; } } } } } }, emailStatusNoLogged:function(){ if(top.document.location.hostname.indexOf("www.virgilio.it")!=-1) { top.document.location.reload(); } document.getElementById("box_mail_bar_iframe").src = this.arrUrlDiv[3] + this.paramHP; this.arrBBLnk[2]="bxmail"; document.getElementById("bxmailLog").style.display="none"; document.getElementById("bxmail").className=document.getElementById("bxmailLog").className; document.getElementById("box_mail_bar_iframe").style.height="120px"; document.getElementById("bxmail").style.display="block"; }, setBBLink : function (){ var dt=new Date(); dt.setDate(dt.getDate() + 1); var ckdt = new Date(dt.getFullYear(),dt.getMonth(),dt.getDate()); this.setCookieBB("bbVirgilio","prova",ckdt,"/","virgilio.it"); }, bbSearch : function (typeS){ if(this.bbSearchT!=""){ document.getElementById("lnSea"+this.bbSearchT).style.fontWeight="normal"; document.getElementById("qs"+this.bbSearchT).style.display="none"; document.getElementById("lnSea"+typeS).style.fontWeight="bold"; document.getElementById("qs"+typeS).value=document.getElementById("qs"+this.bbSearchT).value; } document.getElementById("lnSea"+typeS).style.fontWeight="bold"; document.getElementById("qs"+typeS).style.display="block"; document.getElementById("qs"+typeS).focus(); this.bbSearchT=typeS;return false; }, openAllBB : function (idDivBB,idLnkBB){ document.getElementById("cont_canali_pers").style.display="none";document.getElementById("cont_servizi_pers").style.display="none"; for(var k=0;k'+strName+''; document.getElementById("ckUserCanPers").innerHTML=document.getElementById("ckUserCanPers").innerHTML+strInsert; this.setCookieChanUser(); this.enablePersCh(); } else{ alert("Attenzione! Inserire un nome ed un url validi."); } }, setCookieChanUser: function () { var objChSel = document.getElementsByName("ckCanUser"); var strSelectCh="";var strSepCh=""; for (var h=0;h