String.prototype.ltrim=function(){if(this==""){return this}if(this.replace(/^\s+/g,"").length==0){return""}var a=/^\s+./g;if(a.test(this)){return this.substr(this.match(a).lastIndex-1,this.length)}else{return this}};String.prototype.rtrim=function(){if(this==""){return this}if(this.replace(/^\s+/g,"").length==0){return""}var a=/\s+$/g;if(a.test(this)){return this.substr(0,this.match(a).index)}else{return this}};String.prototype.trim=function(){return this.ltrim().rtrim()};String.prototype.left=function(a){if(this==null||this==""||a>=this.length){return this}else{return this.substr(0,a)}};String.prototype.right=function(a){if(this==null||this==""||a>=this.length){return this}else{return this.substr(this.length-a,a)}};String.prototype.startWith=function(d,c){if(d==""){return true}if(this==null||this==""||d.length>this.length){return false}else{var b=(c==undefined||c==null||c?"g":"gi");var a=new RegExp("^"+d+".",b);return a.test(this)}};String.prototype.endWith=function(d,c){if(d==""){return true}if(this==null||this==""||d==""||d.length>this.length){return false}else{var b=(c==undefined||c==null||c?"g":"gi");var a=new RegExp("."+d+"$",b);return a.test(this)}};String.prototype.Replace=function(e,a,d){if(this==null||e==a){return this}var c=(d==undefined||d==null||d?"g":"gi");var b=new RegExp(e,c);return this.replace(b,a)};String.prototype.Coalesce=function(a){if(this==""){return""}else{return(this+a)}};String.prototype.ToInt32=function(a){if(this==""||this==null){return 0}try{if(null!=a){return parseInt(this,a)}else{return parseInt(this,10)}}catch(b){alert("Can't convert '"+escape(this)+"' to Int32!");return 0}};