function calculateXiti(Xt_param) {
       if (window.xtparam!=null){Xt_param+=xtparam;} 
        try {Xt_r = top.document.referrer;} 
        catch(e) {Xt_r = document.referrer;} 
        Xt_h = new Date();      
           var xtorL=recupxtor("xtor");
                if(xtorL){
                     if(xtorL.indexOf("#")>-1)xtorL=xtorL.substring(0,xtorL.indexOf("#"));
                     wcookie("xtor",xtorL,false,_language +"/");
                 }
                 if(Getxtorcookie("xtor"))Xt_param+="&xto=" + Getxtorcookie("xtor").toUpperCase();
        Xt_i = '<img width="1" height="1" alt="" src="http://logi151.xiti.com/hit.xiti?'+Xt_param; 
      
        Xt_i += '&hl='+Xt_h.getHours()+'x'+Xt_h.getMinutes()+'x'+Xt_h.getSeconds(); 
        
        if(parseFloat(navigator.appVersion)>=4) {
            Xt_s=screen;
            Xt_i+='&r='+Xt_s.width+'x'+Xt_s.height+'x'+Xt_s.pixelDepth+'x'+Xt_s.colorDepth;
        }            
        
        return (Xt_i+'&ref='+Xt_r.replace(/[<>\"]/g, '').replace(/&/g, '$')+'" >');
}
/*
 * Permet de retourner l'url root du site
 * @param : urlHref doit etre du type http://www.aptonia.com ou http://aptonia.preview.dktetrix.net ou http://www.decathlon.fr ou http://fr.preview.dktetrix.net
 * @return : www.aptonia.com ou aptonia.preview.dktetrix.net ou decathlon.fr ou fr.preview.dktetrix.net
*/
function getRootUrl(urlHref){
    if(urlHref){
        var rootUrl = "" ;
        var urlSplit = urlHref.split("/") ;
        if(urlSplit.length > 1 && urlSplit[2]){
            rootUrl = urlSplit[2] ;
        }
        return rootUrl ;
    }
    else{
        return "" ;
    }
}
/*fonction  de vérification de l'url pour outils de stat*/
function getOnlineState(){
  var siteUrl = getRootUrl(document.location.href) ; //retourne www.aptonia.com par ex.
  if(siteUrl.indexOf(".com") > -1){
    return true ;
  }
  else{
    return false ;
  }
}


