// Script © by U-L-T-R-A ultra@ultex-net 2001
function shosize() {
Chars = wordpad.data.value;
   wordpad.chars.value = Chars.length;
Words = Chars.split(/\s+/);
   wordpad.words.value = Words.length;
if (Words.length == 1) {
   wordpad.words.value = 0; }
   setTimeout('shosize()',100);
}
function SandR(action) {
data = wordpad.data.value;
if (action == 'do') {
   rep = wordpad.replace.value;
   srch = wordpad.search.value;
   msg = 'Replaced all instances of:\n'+srch;
}
if (action == 'undo') {
if (!wordpad.replace.value) {
   alert(srch+' can not be restored because it was replaced with nothing!');
   void; }
else {
   srch = wordpad.replace.value;
   rep = wordpad.search.value;
   msg = 'Restored all instances of:\n'+rep; }
}
check = true;
left_index = 0;
while (check) {
   A = data.indexOf(srch, left_index);
if (A == -1) {
   check = false; break;
}
   data_left = data.substring(0, A) 
   B = A + srch.length;
   data_right = data.substring(B, data.length);
   data = data_left + rep + data_right;
   left_index = A + rep.length;
}
   wordpad.data.value = data;
   alert(msg);
}
function view(data) {
   location='#top';
   document.write('<html>
<body bgcolor=ffffff text=000000 fontsize=medium hspace=5 vspace=5>
<pre>'+data+'<\/pre>
<\/body>
<\/html>');
}