
// Encode HTML in JavaScipt, on UTF8 Charset
// Use for Hide HTTP Referer on Form Post
// http://referer.us/hide-http-referer.html
// Similar to Server.HTMLEncode(ASP), HttpUtility.HtmlEncode(ASP.NET), htmlspecialchars(PHP)
// Syntax: HTMLString = normalString.encodeHTML()

String.prototype.encodeHTML = function() {
	return this.replace(/([^\x01-\x7E])/g, function(c){
		return '&#'+c.charCodeAt(0)+';'
	});
}
