<!-- Hide from JavaScript-Impaired Browsers
function para()     { 
document.wrpro.pr1.value +='<p>\n';
}
function epara()     { 
document.wrpro.pr1.value +='</p>\n';
}
function libr()     { 
document.wrpro.pr1.value +='<br />\n';
}
function hrw()     { 
document.wrpro.pr1.value +='<hr />\n';
}
function sortit(a,b){
return(a-b) 
} 
function sortvalues(param){ 
if (window.print||(document.images&&!document.all)){ 
var inputvalues=document.wrpro.pr1.value.split(" ") if (param==0) inputvalues.sort()
else
inputvalues.sort(sortit)
document.wrpro.pr1.value=''
for (i=0;i<inputvalues.length-1;i++) 
document.wrpro.pr1.value=document.wrpro.pr1.value+inputvalues[i]+" 
" document.wrpro.pr1.value+=inputvalues[inputvalues.length-1] 
document.wrpro.B4.value='  Processed  ';
} 
}
function countit(){
var formcontent=document.wrpro.pr1.value
formcontent=formcontent.split(" ")
document.wrpro.wordcount3.value=formcontent.length
}
function dosz() {
fosz = document.wrpro.pr2.value;
document.wrpro.pr1.fontsize=fosz; 
document.wrpro.E2.fontsize=fosz; 
document.wrpro.E3.fontsize=fosz; 
}
function viewit() {
fsize = document.wrpro.pr3.value;
bgcl = document.wrpro.pr4.value;
txcl = document.wrpro.pr5.value;
wdth = document.wrpro.pr6.value;
hght = document.wrpro.pr7.value;
typ1 = document.wrpro.pr8.value;
dstf='<body bgcolor="'+bgcl+'" text="'+txcl+'">'
+'<sidebar width="'+wdth+'"></sidebar>'
+'<img src="/im/clear.gif" width="0"'
+' height="'+hght+'" border="0" />'
+'<basefont size="'+fsize+'"><'+typ1+'>'
+'</body>'; 
var temp=document.wrpro.pr1.value;  
if((navigator.appVersion.indexOf('WebTV;2.7') !=-1) 
|| (navigator.appVersion.indexOf('WebTV;2.8') !=-1) 
|| (navigator.appVersion.indexOf('WebTV;2.8.2') !=-1)) { 
location.href="#"; 
document.open(); 
document.write(dstf);
document.write(temp);
document.close();
} 
else {
temp=document.wrpro.pr1.value; 
preWindow = open("",
"preWindow","status=1,resizable=yes,menubar=1,toolbar=1,scrollbars=yes"); 
preWindow.document.open(); 
preWindow.document.write(dstf);
preWindow.document.write(temp); 
preWindow.document.close(); 
}
}
// smallify script 2003 rwedge 
// www.expandinghead.net
var ntxt = ''; 
var x = ''; 
var wl = ''; 
var k = 0; 
var stor = 0; 
function make_small() { 
x = document.wrpro.pr1.value; 
if (stor == 0) { 
document.wrpro.restore.value = x; 
stor = 1; 
} 
document.wrpro.pr1.value = ''; 
x = (x.replace(/^\W+/,'')).replace(/\W+$/,''); 
var nl = x.split('\n'); 
var nt = nl.length; 
for (eh = 0; eh < nt; eh++) { 
nl[eh] = nl[eh].replace(/^>/,''); 
wl = nl[eh].split(/\s+/g); 
wt = wl.length; 
var cnt = 10; 
if (wt =='undefined') { wt = 1; } 
nwt = wt; 
 while (k < wt) { 
 if (wt < 10 )  { cnt = wt; } 
 if (nwt < 10) { cnt = nwt; } 
   for (j = 0; j < cnt; j++) { 
   if ((wl[k] == "") || (wl[k] == "undefined")) { cnt = 0; } else ntxt += wl[k]+' '; 
   k++ 
   nwt-- 
 } 
 document.wrpro.pr1.value += '>'+ntxt+'\n'; 
 ntxt = ''; 
 j = 0; 
 } 
wl = ''; 
k = 0; 
 } 
re_ini(); 
} 
function re_ini() { 
x = ''; 
wl = ''; 
k = 0; 
} 
// This script and many more are available free online // at The JavaScript Source!!
// http://javascript.internet.com
function remove_XS_whitespace(item)
{
  var tmp = "";
  var item_length = item.value.length;
  var item_length_minus_1 = item.value.length - 1;
  for (index = 0; index < item_length; index++)
  {
    if (item.value.charAt(index) != ' ')
    {
      tmp += item.value.charAt(index);
    }
    else
    {
      if (tmp.length > 0)
      {
        if (item.value.charAt(index+1) != ' ' && index != item_length_minus_1)
        {
          tmp += item.value.charAt(index);
        }
      }
    }
  }
  item.value = tmp;
}
function lower() {
document.forms[0].elements[0].value = document.forms[0].elements[0].value.toLowerCase()
}
function caps() {
document.forms[0].elements[0].value = document.forms[0].elements[0].value.toUpperCase()
}
// Search and replace by R_E
// http://www.wtv-zone.com/endymion/
function replaceText() {
K1 = document.wrpro
all_text = K1.pr1.value;
old_word = K1.E2.value;
new_word = K1.E3.value;
working = true; if (confirm("This will replace ALL instances of:\n\n` " +old_word+ "´\n\nwith:\n\n` " +new_word+" ´\n\nAre you sure you want to continue?"))
left_index = 0;
while (working) {
J1 = all_text.indexOf(old_word, left_index);
if (J1==-1) {working = false; break}
all_text_left = all_text.substring(0, J1) 
J2 = J1+old_word.length;
all_text_right = all_text.substring(J2,
all_text.length);
all_text = all_text_left + new_word +
all_text_right;
left_index = J1+new_word.length;
}
document.wrpro.pr1.value = all_text
}
// End Hiding -->
