String.prototype.trim=function(){return this.replace(/^\s*|\s*$/g,'');};String.prototype.ltrim=function(){return this.replace(/^\s*/g,'');};String.prototype.rtrim=function(){return this.replace(/\s*$/g,'');};function smartClassName(existing_classname,new_class,replaced_class){if(!document.getElementsByTagName){return null;}if(!existing_classname){existing_classname=' ';}if(!existing_classname||!new_class||typeof existing_classname!="string"||typeof new_class!="string"){return null;}existing_classname=' '+existing_classname.replace(/^\s*|\s*$/g,'')+' ';new_class=new_class.replace(/^\s*|\s*$/g,'');var new_classname=existing_classname;if(replaced_class&&existing_classname.indexOf(' '+replaced_class+' ')!=-1&&typeof replaced_class=="string"){new_classname=existing_classname.replace(' '+replaced_class.replace(/^\s*|\s*$/g,'')+' ',' ');}if(new_classname.indexOf(' '+new_class+' ')==-1){new_classname=new_classname+new_class;}return new_classname.replace(/^\s*|\s*$/g,'');};function searchUp(elm,findElm){if(typeof(elm)=='string'){elm=xGetElementById(elm);}while(elm.nodeName.toLowerCase()!=findElm&&elm.nodeName.toLowerCase()!='body')elm=elm.parentNode;return elm;};function AskQuestion(question,onyes,onno){var where_to=confirm(question);if(where_to==true){if(onyes&&onyes!=""){window.location=onyes;}}else{if(onno&&onno!=""){window.location=onno;}}};function addslashes(str){str=str.replace(/\\/g,'\\\\');str=str.replace(/\'/g,'\\\'');str=str.replace(/\"/g,'\\"');str=str.replace(/\0/g,'\\0');return str;};function stripslashes(str){str=str.replace(/\\\\/g,'\\');str=str.replace(/\\'/g,'\'');str=str.replace(/\\"/g,'"');str=str.replace(/\\0/g,'\0');return str;};function addEvent(elm,evtype,fn,usecapture){if(elm.addEventListener){elm.addEventListener(evtype,fn,usecapture);return true;}else if(elm.attachEvent){var r=elm.attachEvent("on"+evtype,fn);return r;}else{elm["on"+evtype]=fn;}}