﻿	/* Elf Qrin's function http://www.elfqrin.com/hacklab/index.php*/
	function pwgen() {
	var schr=document.getElementById('schr').value; var schrl=schr.length;
	var pwl=document.getElementById('pwl').value;
	
	var pw="";
	for (var i=1;i<=pwl;i++) {
		var r=rnd(1,schrl);
		pw+=schr.substring(r-1,r);
	}
	document.getElementById('pw').value=pw;
	}
	
	/* Elf Qrin's function http://www.elfqrin.com/hacklab/index.php*/
	function rnd(frN,toN) {
			var rN=Math.floor(Math.random()*(toN+1-frN))+frN;
		return rN;
	}
	
	/* Function from Guido Socher, guido at linuxfocus dot org, Copyright: GPL */
	function initArray() {
    		this.length = initArray.arguments.length;
    		for (var i = 0; i < this.length; i++)
       		 this[i] = initArray.arguments[i];
	}

	/* Function from Guido Socher, guido at linuxfocus dot org, Copyright: GPL */  
	function from10toradix(value,radix){
	    var retval = '';
	    var ConvArray = new initArray(0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F');
	    var intnum;
	    var tmpnum;
	    var i = 0;
	
	    intnum = parseInt(value,10);
	    if (isNaN(intnum)){
	        retval = 'NaN';
	    }else{
	        while (intnum > 0.9){
	            i++;
	            tmpnum = intnum;
	            // cancatinate return string with new digit:
	            retval = ConvArray[tmpnum % radix] + retval;  
	            intnum = Math.floor(tmpnum / radix);
	            if (i > 100){
	                // break infinite loops
	                retval = 'NaN';
	                break;
	            }
	        }
	    }
	    return retval;
	}
	
	/* Function from Gauthier de Valensart, Copyright: GPL */  
	function e(id)
	{
		return document.getElementById(id);
	}
	
	/* Function from Gauthier de Valensart, Copyright: GPL */  
	function comp(from)
	{
		switch(from)
		{
			case 'dec':
					e('bin').value = from10toradix(e('dec').value,2);
					e('hex').value = from10toradix(e('dec').value,16);
				break;
			case 'bin':
					e('dec').value = parseInt(e('bin').value, 2);
					e('hex').value = from10toradix(e('dec').value,16);
				break;
			case 'hex':
					e('bin').value = from10toradix(parseInt(e('hex').value, 16),2);
					e('dec').value = parseInt(e('hex').value, 16);
				break;
		}
	}
	
/* Md5 calculation from Paul Johnston and Greg Holt.*/
function md5cycle(x, k) {
var a = x[0], b = x[1], c = x[2], d = x[3];

a = ff(a, b, c, d, k[0], 7, -680876936);
d = ff(d, a, b, c, k[1], 12, -389564586);
c = ff(c, d, a, b, k[2], 17,  606105819);
b = ff(b, c, d, a, k[3], 22, -1044525330);
a = ff(a, b, c, d, k[4], 7, -176418897);
d = ff(d, a, b, c, k[5], 12,  1200080426);
c = ff(c, d, a, b, k[6], 17, -1473231341);
b = ff(b, c, d, a, k[7], 22, -45705983);
a = ff(a, b, c, d, k[8], 7,  1770035416);
d = ff(d, a, b, c, k[9], 12, -1958414417);
c = ff(c, d, a, b, k[10], 17, -42063);
b = ff(b, c, d, a, k[11], 22, -1990404162);
a = ff(a, b, c, d, k[12], 7,  1804603682);
d = ff(d, a, b, c, k[13], 12, -40341101);
c = ff(c, d, a, b, k[14], 17, -1502002290);
b = ff(b, c, d, a, k[15], 22,  1236535329);

a = gg(a, b, c, d, k[1], 5, -165796510);
d = gg(d, a, b, c, k[6], 9, -1069501632);
c = gg(c, d, a, b, k[11], 14,  643717713);
b = gg(b, c, d, a, k[0], 20, -373897302);
a = gg(a, b, c, d, k[5], 5, -701558691);
d = gg(d, a, b, c, k[10], 9,  38016083);
c = gg(c, d, a, b, k[15], 14, -660478335);
b = gg(b, c, d, a, k[4], 20, -405537848);
a = gg(a, b, c, d, k[9], 5,  568446438);
d = gg(d, a, b, c, k[14], 9, -1019803690);
c = gg(c, d, a, b, k[3], 14, -187363961);
b = gg(b, c, d, a, k[8], 20,  1163531501);
a = gg(a, b, c, d, k[13], 5, -1444681467);
d = gg(d, a, b, c, k[2], 9, -51403784);
c = gg(c, d, a, b, k[7], 14,  1735328473);
b = gg(b, c, d, a, k[12], 20, -1926607734);

a = hh(a, b, c, d, k[5], 4, -378558);
d = hh(d, a, b, c, k[8], 11, -2022574463);
c = hh(c, d, a, b, k[11], 16,  1839030562);
b = hh(b, c, d, a, k[14], 23, -35309556);
a = hh(a, b, c, d, k[1], 4, -1530992060);
d = hh(d, a, b, c, k[4], 11,  1272893353);
c = hh(c, d, a, b, k[7], 16, -155497632);
b = hh(b, c, d, a, k[10], 23, -1094730640);
a = hh(a, b, c, d, k[13], 4,  681279174);
d = hh(d, a, b, c, k[0], 11, -358537222);
c = hh(c, d, a, b, k[3], 16, -722521979);
b = hh(b, c, d, a, k[6], 23,  76029189);
a = hh(a, b, c, d, k[9], 4, -640364487);
d = hh(d, a, b, c, k[12], 11, -421815835);
c = hh(c, d, a, b, k[15], 16,  530742520);
b = hh(b, c, d, a, k[2], 23, -995338651);

a = ii(a, b, c, d, k[0], 6, -198630844);
d = ii(d, a, b, c, k[7], 10,  1126891415);
c = ii(c, d, a, b, k[14], 15, -1416354905);
b = ii(b, c, d, a, k[5], 21, -57434055);
a = ii(a, b, c, d, k[12], 6,  1700485571);
d = ii(d, a, b, c, k[3], 10, -1894986606);
c = ii(c, d, a, b, k[10], 15, -1051523);
b = ii(b, c, d, a, k[1], 21, -2054922799);
a = ii(a, b, c, d, k[8], 6,  1873313359);
d = ii(d, a, b, c, k[15], 10, -30611744);
c = ii(c, d, a, b, k[6], 15, -1560198380);
b = ii(b, c, d, a, k[13], 21,  1309151649);
a = ii(a, b, c, d, k[4], 6, -145523070);
d = ii(d, a, b, c, k[11], 10, -1120210379);
c = ii(c, d, a, b, k[2], 15,  718787259);
b = ii(b, c, d, a, k[9], 21, -343485551);

x[0] = add32(a, x[0]);
x[1] = add32(b, x[1]);
x[2] = add32(c, x[2]);
x[3] = add32(d, x[3]);

}

function cmn(q, a, b, x, s, t) {
a = add32(add32(a, q), add32(x, t));
return add32((a << s) | (a >>> (32 - s)), b);
}

function ff(a, b, c, d, x, s, t) {
return cmn((b & c) | ((~b) & d), a, b, x, s, t);
}

function gg(a, b, c, d, x, s, t) {
return cmn((b & d) | (c & (~d)), a, b, x, s, t);
}

function hh(a, b, c, d, x, s, t) {
return cmn(b ^ c ^ d, a, b, x, s, t);
}

function ii(a, b, c, d, x, s, t) {
return cmn(c ^ (b | (~d)), a, b, x, s, t);
}

function md51(s) {
txt = '';
var n = s.length,
state = [1732584193, -271733879, -1732584194, 271733878], i;
for (i=64; i<=s.length; i+=64) {
md5cycle(state, md5blk(s.substring(i-64, i)));
}
s = s.substring(i-64);
var tail = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0];
for (i=0; i<s.length; i++)
tail[i>>2] |= s.charCodeAt(i) << ((i%4) << 3);
tail[i>>2] |= 0x80 << ((i%4) << 3);
if (i > 55) {
md5cycle(state, tail);
for (i=0; i<16; i++) tail[i] = 0;
}
tail[14] = n*8;
md5cycle(state, tail);
return state;
}

/* there needs to be support for Unicode here,
 * unless we pretend that we can redefine the MD-5
 * algorithm for multi-byte characters (perhaps
 * by adding every four 16-bit characters and
 * shortening the sum to 32 bits). Otherwise
 * I suggest performing MD-5 as if every character
 * was two bytes--e.g., 0040 0025 = @%--but then
 * how will an ordinary MD-5 sum be matched?
 * There is no way to standardize text to something
 * like UTF-8 before transformation; speed cost is
 * utterly prohibitive. The JavaScript standard
 * itself needs to look at this: it should start
 * providing access to strings as preformed UTF-8
 * 8-bit unsigned value arrays.
 */
function md5blk(s) { /* I figured global was faster.   */
var md5blks = [], i; /* Andy King said do it this way. */
for (i=0; i<64; i+=4) {
md5blks[i>>2] = s.charCodeAt(i)
+ (s.charCodeAt(i+1) << 8)
+ (s.charCodeAt(i+2) << 16)
+ (s.charCodeAt(i+3) << 24);
}
return md5blks;
}

var hex_chr = '0123456789abcdef'.split('');

function rhex(n)
{
var s='', j=0;
for(; j<4; j++)
s += hex_chr[(n >> (j * 8 + 4)) & 0x0F]
+ hex_chr[(n >> (j * 8)) & 0x0F];
return s;
}

function hex(x) {
for (var i=0; i<x.length; i++)
x[i] = rhex(x[i]);
return x.join('');
}

function md5calc(s) {
return hex(md51(s));
}

/* this function is much faster,
so if possible we use it. Some IEs
are the only ones I know of that
need the idiotic second function,
generated by an if clause.  */

function add32(a, b) {
return (a + b) & 0xFFFFFFFF;
}

if (md5calc('hello') != '5d41402abc4b2a76b9719d911017c592') {
function add32(x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF),
msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
}

/*
 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
 * in FIPS PUB 180-1
 * Version 2.1a Copyright Paul Johnston 2000 - 2002.
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for details.
 */

/*
 * Configurable variables. You may need to tweak these to be compatible with
 * the server-side, but the defaults work in most cases.
 */
var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */
var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */
var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */

/*
 * These are the functions you'll usually want to call
 * They take string arguments and return either hex or base-64 encoded strings
 */
function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}

/*
 * Perform a simple self-test to see if the VM is working
 */
function sha1_vm_test()
{
  return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
}

/*
 * Calculate the SHA-1 of an array of big-endian words, and a bit length
 */
function core_sha1(x, len)
{
  /* append padding */
  x[len >> 5] |= 0x80 << (24 - len % 32);
  x[((len + 64 >> 9) << 4) + 15] = len;

  var w = Array(80);
  var a =  1732584193;
  var b = -271733879;
  var c = -1732584194;
  var d =  271733878;
  var e = -1009589776;

  for(var i = 0; i < x.length; i += 16)
  {
    var olda = a;
    var oldb = b;
    var oldc = c;
    var oldd = d;
    var olde = e;

    for(var j = 0; j < 80; j++)
    {
      if(j < 16) w[j] = x[i + j];
      else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
      var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
                       safe_add(safe_add(e, w[j]), sha1_kt(j)));
      e = d;
      d = c;
      c = rol(b, 30);
      b = a;
      a = t;
    }

    a = safe_add(a, olda);
    b = safe_add(b, oldb);
    c = safe_add(c, oldc);
    d = safe_add(d, oldd);
    e = safe_add(e, olde);
  }
  return Array(a, b, c, d, e);

}

/*
 * Perform the appropriate triplet combination function for the current
 * iteration
 */
function sha1_ft(t, b, c, d)
{
  if(t < 20) return (b & c) | ((~b) & d);
  if(t < 40) return b ^ c ^ d;
  if(t < 60) return (b & c) | (b & d) | (c & d);
  return b ^ c ^ d;
}

/*
 * Determine the appropriate additive constant for the current iteration
 */
function sha1_kt(t)
{
  return (t < 20) ?  1518500249 : (t < 40) ?  1859775393 :
         (t < 60) ? -1894007588 : -899497514;
}

/*
 * Calculate the HMAC-SHA1 of a key and some data
 */
function core_hmac_sha1(key, data)
{
  var bkey = str2binb(key);
  if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);

  var ipad = Array(16), opad = Array(16);
  for(var i = 0; i < 16; i++)
  {
    ipad[i] = bkey[i] ^ 0x36363636;
    opad[i] = bkey[i] ^ 0x5C5C5C5C;
  }

  var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
  return core_sha1(opad.concat(hash), 512 + 160);
}

/*
 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
 * to work around bugs in some JS interpreters.
 */
function safe_add(x, y)
{
  var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  return (msw << 16) | (lsw & 0xFFFF);
}

/*
 * Bitwise rotate a 32-bit number to the left.
 */
function rol(num, cnt)
{
  return (num << cnt) | (num >>> (32 - cnt));
}

/*
 * Convert an 8-bit or 16-bit string to an array of big-endian words
 * In 8-bit function, characters >255 have their hi-byte silently ignored.
 */
function str2binb(str)
{
  var bin = Array();
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < str.length * chrsz; i += chrsz)
    bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32);
  return bin;
}

/*
 * Convert an array of big-endian words to a string
 */
function binb2str(bin)
{
  var str = "";
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < bin.length * 32; i += chrsz)
    str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);
  return str;
}

/*
 * Convert an array of big-endian words to a hex string.
 */
function binb2hex(binarray)
{
  var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i++)
  {
    str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
           hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8  )) & 0xF);
  }
  return str;
}

/*
 * Convert an array of big-endian words to a base-64 string
 */
function binb2b64(binarray)
{
  var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i += 3)
  {
    var triplet = (((binarray[i   >> 2] >> 8 * (3 -  i   %4)) & 0xFF) << 16)
                | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
                |  ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
    for(var j = 0; j < 4; j++)
    {
      if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
      else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
    }
  }
  return str;
}

var END_OF_INPUT = -1;

var base64Chars = new Array(
    'A','B','C','D','E','F','G','H',
    'I','J','K','L','M','N','O','P',
    'Q','R','S','T','U','V','W','X',
    'Y','Z','a','b','c','d','e','f',
    'g','h','i','j','k','l','m','n',
    'o','p','q','r','s','t','u','v',
    'w','x','y','z','0','1','2','3',
    '4','5','6','7','8','9','+','/'
);

var reverseBase64Chars = new Array();
for (var i=0; i < base64Chars.length; i++){
    reverseBase64Chars[base64Chars[i]] = i;
}

var base64Str;
var base64Count;

function setBase64Str(str){
    base64Str = str;
    base64Count = 0;
}
function readBase64(){    
    if (!base64Str) return END_OF_INPUT;
    if (base64Count >= base64Str.length) return END_OF_INPUT;
    var c = base64Str.charCodeAt(base64Count) & 0xff;
    base64Count++;
    return c;
}

function encodeBase64(str){
    setBase64Str(str);
    var result = '';
    var inBuffer = new Array(3);
    var lineCount = 0;
    var done = false;
    while (!done && (inBuffer[0] = readBase64()) != END_OF_INPUT){
        inBuffer[1] = readBase64();
        inBuffer[2] = readBase64();
        result += (base64Chars[ inBuffer[0] >> 2 ]);
        if (inBuffer[1] != END_OF_INPUT){
            result += (base64Chars [(( inBuffer[0] << 4 ) & 0x30) | (inBuffer[1] >> 4) ]);
            if (inBuffer[2] != END_OF_INPUT){
                result += (base64Chars [((inBuffer[1] << 2) & 0x3c) | (inBuffer[2] >> 6) ]);
                result += (base64Chars [inBuffer[2] & 0x3F]);
            } else {
                result += (base64Chars [((inBuffer[1] << 2) & 0x3c)]);
                result += ('=');
                done = true;
            }
        } else {
            result += (base64Chars [(( inBuffer[0] << 4 ) & 0x30)]);
            result += ('=');
            result += ('=');
            done = true;
        }
        lineCount += 4;
        if (lineCount >= 76){
            result += ('\n');
            lineCount = 0;
        }
    }
    return result;
}

function readReverseBase64(){   
    if (!base64Str) return END_OF_INPUT;
    while (true){      
        if (base64Count >= base64Str.length) return END_OF_INPUT;
        var nextCharacter = base64Str.charAt(base64Count);
        base64Count++;
        if (reverseBase64Chars[nextCharacter]){
            return reverseBase64Chars[nextCharacter];
        }
        if (nextCharacter == 'A') return 0;
    }
    return END_OF_INPUT;
}

function ntos(n){
    n=n.toString(16);
    if (n.length == 1) n="0"+n;
    n="%"+n;
    return unescape(n);
}

function decodeBase64(str){
    setBase64Str(str);
    var result = "";
    var inBuffer = new Array(4);
    var done = false;
    while (!done && (inBuffer[0] = readReverseBase64()) != END_OF_INPUT
        && (inBuffer[1] = readReverseBase64()) != END_OF_INPUT){
        inBuffer[2] = readReverseBase64();
        inBuffer[3] = readReverseBase64();
        result += ntos((((inBuffer[0] << 2) & 0xff)| inBuffer[1] >> 4));
        if (inBuffer[2] != END_OF_INPUT){
            result +=  ntos((((inBuffer[1] << 4) & 0xff)| inBuffer[2] >> 2));
            if (inBuffer[3] != END_OF_INPUT){
                result +=  ntos((((inBuffer[2] << 6)  & 0xff) | inBuffer[3]));
            } else {
                done = true;
            }
        } else {
            done = true;
        }
    }
    return result;
}

function rot13(s){
	var alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM';
	var r ="";
	
	for (x = 0; x <= s.length; x++){
		var c = s.substring(x, x+1);
		var l = "upper";
		
		if (c >= 'A' && c <= 'Z'){ 
			l = "upper";
		}else{
			l = "lower";
		}
		
		c = c.toUpperCase();
		
		if (c >= 'A' && c <= 'Z'){
			c = alphabet.charAt(alphabet.indexOf(c) + 13);
			if (l == "lower"){
				c = c.toLowerCase()
			}
		}
		
		r+=c;
	}
	
	return r;
}
/* Copyright : Gauthier de Valensart. Licence GPL */
function gpsCheckSum(s){
	var t = 0;
	
	for(i=0; i<=s.length; i++)
	{
		t = t ^ s.charCodeAt(i);
	}
	
	return 	from10toradix(t, 16);
}

function htmlEntities(text)
{
text = text.replace(/"/g,'&quot;'); // 34 22
text = text.replace(/&/g,'&amp;'); // 38 26
text = text.replace(/\'/g,'&#39;'); // 39 27
text = text.replace(/</g,'&lt;'); // 60 3C
text = text.replace(/>/g,'&gt;'); // 62 3E
text = text.replace(/\^/g,'&circ;'); // 94 5E
text = text.replace(/‘/g,'&lsquo;'); // 145 91
text = text.replace(/’/g,'&rsquo;'); // 146 92
text = text.replace(/“/g,'&ldquo;'); // 147 93
text = text.replace(/”/g,'&rdquo;'); // 148 94
text = text.replace(/•/g,'&bull;'); // 149 95
text = text.replace(/–/g,'&ndash;'); // 150 96
text = text.replace(/—/g,'&mdash;'); // 151 97
text = text.replace(/˜/g,'&tilde;'); // 152 98
text = text.replace(/™/g,'&trade;'); // 153 99
text = text.replace(/š/g,'&scaron;'); // 154 9A
text = text.replace(/›/g,'&rsaquo;'); // 155 9B
text = text.replace(/œ/g,'&oelig;'); // 156 9C
text = text.replace(//g,'&#357;'); // 157 9D
text = text.replace(/ž/g,'&#382;'); // 158 9E
text = text.replace(/Ÿ/g,'&Yuml;'); // 159 9F
// text = text.replace(/ /g,'&nbsp;'); // 160 A0
text = text.replace(/¡/g,'&iexcl;'); // 161 A1
text = text.replace(/¢/g,'&cent;'); // 162 A2
text = text.replace(/£/g,'&pound;'); // 163 A3
//text = text.replace(/ /g,'&curren;'); // 164 A4
text = text.replace(/¥/g,'&yen;'); // 165 A5
text = text.replace(/¦/g,'&brvbar;'); // 166 A6
text = text.replace(/§/g,'&sect;'); // 167 A7
text = text.replace(/¨/g,'&uml;'); // 168 A8
text = text.replace(/©/g,'&copy;'); // 169 A9
text = text.replace(/ª/g,'&ordf;'); // 170 AA
text = text.replace(/«/g,'&laquo;'); // 171 AB
text = text.replace(/¬/g,'&not;'); // 172 AC
text = text.replace(/­/g,'&shy;'); // 173 AD
text = text.replace(/®/g,'&reg;'); // 174 AE
text = text.replace(/¯/g,'&macr;'); // 175 AF
text = text.replace(/°/g,'&deg;'); // 176 B0
text = text.replace(/±/g,'&plusmn;'); // 177 B1
text = text.replace(/²/g,'&sup2;'); // 178 B2
text = text.replace(/³/g,'&sup3;'); // 179 B3
text = text.replace(/´/g,'&acute;'); // 180 B4
text = text.replace(/µ/g,'&micro;'); // 181 B5
text = text.replace(/¶/g,'&para'); // 182 B6
text = text.replace(/·/g,'&middot;'); // 183 B7
text = text.replace(/¸/g,'&cedil;'); // 184 B8
text = text.replace(/¹/g,'&sup1;'); // 185 B9
text = text.replace(/º/g,'&ordm;'); // 186 BA
text = text.replace(/»/g,'&raquo;'); // 187 BB
text = text.replace(/¼/g,'&frac14;'); // 188 BC
text = text.replace(/½/g,'&frac12;'); // 189 BD
text = text.replace(/¾/g,'&frac34;'); // 190 BE
text = text.replace(/¿/g,'&iquest;'); // 191 BF
text = text.replace(/À/g,'&Agrave;'); // 192 C0
text = text.replace(/Á/g,'&Aacute;'); // 193 C1
text = text.replace(/Â/g,'&Acirc;'); // 194 C2
text = text.replace(/Ã/g,'&Atilde;'); // 195 C3
text = text.replace(/Ä/g,'&Auml;'); // 196 C4
text = text.replace(/Å/g,'&Aring;'); // 197 C5
text = text.replace(/Æ/g,'&AElig;'); // 198 C6
text = text.replace(/Ç/g,'&Ccedil;'); // 199 C7
text = text.replace(/È/g,'&Egrave;'); // 200 C8
text = text.replace(/É/g,'&Eacute;'); // 201 C9
text = text.replace(/Ê/g,'&Ecirc;'); // 202 CA
text = text.replace(/Ë/g,'&Euml;'); // 203 CB
text = text.replace(/Ì/g,'&Igrave;'); // 204 CC
text = text.replace(/Í/g,'&Iacute;'); // 205 CD
text = text.replace(/Î/g,'&Icirc;'); // 206 CE
text = text.replace(/Ï/g,'&Iuml;'); // 207 CF
text = text.replace(/Ð/g,'&ETH;'); // 208 D0
text = text.replace(/Ñ/g,'&Ntilde;'); // 209 D1
text = text.replace(/Ò/g,'&Ograve;'); // 210 D2
text = text.replace(/Ó/g,'&Oacute;'); // 211 D3
text = text.replace(/Ô/g,'&Ocirc;'); // 212 D4
text = text.replace(/Õ/g,'&Otilde;'); // 213 D5
text = text.replace(/Ö/g,'&Ouml;'); // 214 D6
text = text.replace(/×/g,'&times;'); // 215 D7
text = text.replace(/Ø/g,'&Oslash;'); // 216 D8
text = text.replace(/Ù/g,'&Ugrave;'); // 217 D9
text = text.replace(/Ú/g,'&Uacute;'); // 218 DA
text = text.replace(/Û/g,'&Ucirc;'); // 219 DB
text = text.replace(/Ü/g,'&Uuml;'); // 220 DC
text = text.replace(/Ý/g,'&Yacute;'); // 221 DD
text = text.replace(/Þ/g,'&THORN;'); // 222 DE
text = text.replace(/ß/g,'&szlig;'); // 223 DF
text = text.replace(/à/g,'&aacute;'); // 224 E0
text = text.replace(/á/g,'&aacute;'); // 225 E1
text = text.replace(/â/g,'&acirc;'); // 226 E2
text = text.replace(/ã/g,'&atilde;'); // 227 E3
text = text.replace(/ä/g,'&auml;'); // 228 E4
text = text.replace(/å/g,'&aring;'); // 229 E5
text = text.replace(/æ/g,'&aelig;'); // 230 E6
text = text.replace(/ç/g,'&ccedil;'); // 231 E7
text = text.replace(/è/g,'&egrave;'); // 232 E8
text = text.replace(/é/g,'&eacute;'); // 233 E9
text = text.replace(/ê/g,'&ecirc;'); // 234 EA
text = text.replace(/ë/g,'&euml;'); // 235 EB
text = text.replace(/ì/g,'&igrave;'); // 236 EC
text = text.replace(/í/g,'&iacute;'); // 237 ED
text = text.replace(/î/g,'&icirc;'); // 238 EE
text = text.replace(/ï/g,'&iuml;'); // 239 EF
text = text.replace(/ð/g,'&eth;'); // 240 F0
text = text.replace(/ñ/g,'&ntilde;'); // 241 F1
text = text.replace(/ò/g,'&ograve;'); // 242 F2
text = text.replace(/ó/g,'&oacute;'); // 243 F3
text = text.replace(/ô/g,'&ocirc;'); // 244 F4
text = text.replace(/õ/g,'&otilde;'); // 245 F5
text = text.replace(/ö/g,'&ouml;'); // 246 F6
text = text.replace(/÷/g,'&divide;'); // 247 F7
text = text.replace(/ø/g,'&oslash;'); // 248 F8
text = text.replace(/ù/g,'&ugrave;'); // 249 F9
text = text.replace(/ú/g,'&uacute;'); // 250 FA
text = text.replace(/û/g,'&ucirc;'); // 251 FB
text = text.replace(/ü/g,'&uuml;'); // 252 FC
text = text.replace(/ý/g,'&yacute;'); // 253 FD
text = text.replace(/þ/g,'&thorn;'); // 254 FE
text = text.replace(/ÿ/g,'&yuml;'); // 255 FF
return text;
}