function trim(str) {
return (str + '').replace(/(\s+)$/g, '').replace(/\s+/g, '');
}
function HTMLEncode(text){
if(test=="")return("");
text = text.replace(/&/ig, "&");
text = text.replace(/>/ig, ">");
text = text.replace(/'/ig, "'");
text = text.replace(/</ig, "<");
text = text.replace(/"/ig, """); // "
text = text.replace(/\t/ig," ");
text = text.replace(/\r/ig,"");
text = text.replace(/\n\n/ig,"<p>");
text = text.replace(/\n/ig,"<br/>");
text = text.replace(/\x20/ig," ");
return text ;
}
$js_path = "/js/";
function js_include($script) {
var script = document.createElement('script');
script.src = $js_path + $script;
script.type = 'text/javascript';
var head = document.getElementsByTagName('head').item(0);
head.appendChild(script);
}