
function replaceText(text){
  while(text.lastIndexOf("&") > 0){
    text = text.replace('&', "[**]");
  }
  return text;
}

 var web_referrer = escape(replaceText(document.referrer));
 var page = replaceText(location.href);
<!--
istat = new Image(1,1);
istat.src = "http://www.laser-centrum-brno.cz/stats/counter.php?sw="+screen.width + "x" + screen.height+"&sc="+screen.colorDepth+"&referer="+web_referrer+"&page="+page;
//document.write(istat.src);

//-->

