Продолжение:
<script type="text/javascript">
var oldButtons = document.getElementById("buttons");
function PasteTab(){javascript:pst3('','','','[tab]','');}
var newButtons = '<a href="javascript:PasteTab();"><img src="http://forum24.ru/gif/img/more.gif" width="16" height="16" border="0" alt="Отступ" title="Отступ"></a>';
var But = oldButtons.innerHTML + newButtons;
document.getElementById("buttons").innerHTML = But;
function FindReplace (word, img) {
var elements = document.body.getElementsByTagName('*');
var element, html, i = 0;
var regE = new RegExp (word,'ig');
var leng = elements.length;
(function closing() {
element = elements[i]
html = element.innerHTML;
if( html.search(regE)== -1){
end();
return;
}
console.log(html.replace(regE,img))
element.innerHTML = html.replace(regE,img);
function end () {
if (i > leng-1) return;
console.log(i > leng-1)
i++;
setTimeout(closing,0);
}
end();
}());
}
FindReplace('tab','<img src="http://i294.photobucket.com/albums/mm119/lazarncane/1.gif" >')
var a = 'sss';
alert('hi');
</script>
</BODY></HTML>
<script type="text/javascript"><!--
QipLoadCounter.fromServer=8;
--></script><script type="text/javascript"><!--
document.write('<img src="http://lstats.qip.ru/images/1px.gif?r='+Math.random()+'" onload="QipLoadCounter.simpleLoad(this);" />');
--></script>
[/JS]