BITracerGenio=function( intTimeout,blnPmkInError,strPathCounter){ this.addEventOnLoad(window, 'load', function(){var formGenio=document.createElement('form');formGenio.setAttribute('id','frmBILinkRedirectGenio');formGenio.setAttribute('name','frmBILinkRedirectGenio');formGenio.setAttribute('method','post');formGenio.setAttribute('style','display:none');document.getElementsByTagName("body")[0].appendChild(formGenio);}); /*window.onload=function() {var formGenio=document.createElement('form');formGenio.setAttribute('id','frmBILinkRedirectGenio');formGenio.setAttribute('name','frmBILinkRedirectGenio');formGenio.setAttribute('method','post');formGenio.setAttribute('style','display:none');document.getElementsByTagName("body")[0].appendChild(formGenio);};*/ 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/bi_clk.gif';};this.debugBI=this.getUrlParameter("debugBI");this.pathGo="http://go.alice.it";this.blnPmkInError=blnPmkInError; } BITracerGenio.prototype={ addEventOnLoad:function(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,true);return true;}else{if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r;}else{return false;}}}, track:function(objLink,strContext,strAction,strPos,strObjType,strFqdn,strSrc,fncGoPage){ this.context=strContext; this.action=strAction; this.position=strPos; this.objType=strObjType; this.fqdn=strFqdn; this.trgSrc=strSrc; this.link=objLink.href; this.callBIGif(objLink,fncGoPage); return false; }, trackForm:function(objLinkForm,strContext,strAction,strPos,strObjType,strFqdn,strSrc,fncGoPage){ this.context=strContext; this.action=strAction; this.position=strPos; this.objType=strObjType; this.fqdn=strFqdn; this.trgSrc=strSrc; this.link=objLinkForm.action; this.callBIGif(objLinkForm,fncGoPage); return false; }, callBIGif:function(objLink,fncGoPage){ try{this.pmkForm=false;if(this.curTimeout!=null){clearTimeout(this.curTimeout);} this.objLink=objLink; var strUrlCounter=""; if((fncGoPage!=null)&&(fncGoPage!='undefined')){this.fncGoPage=fncGoPage;}else{this.fncGoPage=null;} var strPathCounter=this.pathCounter; if ((this.trgSrc=="")||(this.trgSrc==null)||(this.trgSrc=='undefined')){this.trgSrc=window.location.hostname;/*this.trgSrc=document.location.href*/} var lblType=""; if((this.objType!=null)&&(this.objType!='undefined')){lblType='&OBJTYPE='+this.objType;} if((this.fqdn!=null)&&(this.fqdn!='undefined')){lblType+='&FQDN=' + this.fqdn;} strUrlCounter=strPathCounter+'?RND='+Math.floor(1000000*Math.random())+'&CONTEXT=' + this.context + '&ACTION=' + this.action + '&POSID=' + this.position + '&TRGURL='+this.link+'&SRCURL='+this.trgSrc+lblType; 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); }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('frmBILinkRedirectGenio').target="_blank";document.getElementById('frmBILinkRedirectGenio').action=urlLink;document.getElementById('frmBILinkRedirectGenio').submit();return false;};if(this.objLink.target.toLowerCase()=="_top"){document.getElementById('frmBILinkRedirectGenio').target="_top";document.getElementById('frmBILinkRedirectGenio').action=urlLink;document.getElementById('frmBILinkRedirectGenio').submit();return false;};if(this.objLink.target.toLowerCase()=="_parent"){document.getElementById('frmBILinkRedirectGenio').target="_parent";document.getElementById('frmBILinkRedirectGenio').action=urlLink;document.getElementById('frmBILinkRedirectGenio').submit();return false;}};document.getElementById('frmBILinkRedirectGenio').target="_top";document.getElementById('frmBILinkRedirectGenio').action=urlLink;document.getElementById('frmBILinkRedirectGenio').submit();} }