function replaceText(text){ while(text.lastIndexOf("&") > 0){ text = text.replace('&', '[i-Stats]'); } return text; } var web_referrer = replaceText(document.referrer); document.write('');