function uUml() {
   return "&#252";	
}

function UUml() {
   return "&#220";	
}

function oUml() {
   return "&#246";	
}

function OUml() {
   return "&#214";	
}

function aUml() {
   return "&#228";	
}

function AUml() {
   return "&#196";	
}

function sharpS() {
   return "&#223"	 
}

function lt2Arrow() {
   return "&#171"	 
}

function rt2Arrow() {
   return "&#187"	 
}

function apos() {
   return "&#39"	 
}

function quot() {
   return "&#34"	 
}

function amp() {
   return "&#38"	 
}

function sect() {
   return "&#167"	 
}


function ltArrow() {
   return "&#60"	 
}

function rtArrow() {
   return "&#62"	 
}



function replaceStr(str, fnd, repl) {
      var newStr = "";
      var newpos = 0;
      var oldpos = 0;
      var len = 0;
      while (true) {
         newpos = str.indexOf(fnd, newpos + len);
         if (newpos == -1) {
            return newStr + str.substring(oldpos + len);
         }
         newStr = newStr + str.substring(oldpos + len, newpos) + repl;
         oldpos = newpos;
         len = fnd.length;
      }
   }


function escapeHTML(inVal) {
	 if (inVal==null || inVal=="") {
	 	  return inVal;
	 }	
	
   var aUml=228;
   var AUml=196;
   var oUml=246;
   var OUml=214;
   var uUml=252;
   var UUml=220;
   var sUml=223;      
   var quot=34;
   var apos=39;
   var amp=38;
   var lt=60;
   var gt=62;
   var sect=167;   
   
   
   var uCode=0;
   var outVal=inVal;
    
   outVal=replaceStr(outVal, String.fromCharCode(amp),"&#38");    
   outVal=replaceStr(outVal, String.fromCharCode(aUml),"&#228");
   outVal=replaceStr(outVal, String.fromCharCode(AUml),"&#196");
   outVal=replaceStr(outVal, String.fromCharCode(oUml),"&#246");      
   outVal=replaceStr(outVal, String.fromCharCode(OUml),"&#214");      
   outVal=replaceStr(outVal, String.fromCharCode(uUml),"&#252");      
   outVal=replaceStr(outVal, String.fromCharCode(UUml),"&#220");      
   outVal=replaceStr(outVal, String.fromCharCode(sUml),"&#223");      
   outVal=replaceStr(outVal, String.fromCharCode(quot),"&#34");      
   outVal=replaceStr(outVal, String.fromCharCode(apos),"&#39");         
   outVal=replaceStr(outVal, String.fromCharCode(lt),"&#60");            
   outVal=replaceStr(outVal, String.fromCharCode(gt),"&#62");               
   outVal=replaceStr(outVal, String.fromCharCode(sect),"&#167"); 
      
           
   //for (i=0; i<outVal.length; i++) {
   //   uCode=outVal.charCodeAt(i);
   //   alert(uCode);
   //}
      
   return outVal;
}
