function trim(str) {return str.replace(/^\s+|\s+$/g, '');}
function trim_LName(str, MaxLen){if (str.length >= MaxLen) str = str.substring(0, MaxLen) + "..."; return str;}
function str_replace(search, replace, subject) {return subject.split(search).join(replace);}
function JS_Pause(ms){ var date = new Date(); var curDate = null; do { curDate = new Date(); } while(curDate-date < ms);}
document.write("<style type='text/css'>.noScript {display:none;}</style>");

function implode(glue, pieces){var i='',retVal='',tGlue=''; if(arguments.length===1){pieces=glue; glue='';} if(typeof(pieces) === 'object'){if(Object.prototype.toString.call(pieces) === '[object Array]'){return pieces.join(glue);} else {for (i in pieces){      retVal += tGlue + pieces[i]; tGlue = glue;} return retVal;}} else {return pieces;}}

function explode(dlr, string, limit) {//explode(' ','Kevin Van'); = {0:'Kevin',1:'van'}, explode('=','a=bc=d',2);  = ['a','bc=d'] 
var emptyArray = {0:''}; if (arguments.length < 2 || typeof arguments[0] == 'undefined' || typeof arguments[1] == 'undefined') {return null;} if (dlr === '' || dlr === false || dlr === null) {return false;} if (typeof dlr == 'function' || typeof dlr == 'object' || typeof string == 'function' || typeof string == 'object') {return emptyArray;} if (dlr === true) {dlr = '1';} if (!limit) {return string.toString().split(dlr.toString());} else {var splitted = string.toString().split(dlr.toString()); var partA = splitted.splice(0, limit - 1); var partB = splitted.join(dlr.toString()); partA.push(partB);  return partA;}}

function substr_replace (str, replace, start, length){if(start < 0){start=start+str.length;} length=length !== undefined ? length:str.length; if(length < 0){length = length + str.length - start;} return str.slice(0, start) + replace.substr(0, length) + replace.slice(length) + str.slice(start + length);}
