
if(ScriptRegister==null)var ScriptRegister=[];ScriptRegister.CrusherNetExtensions=true;String.prototype.left=function(count){if(count<=0)
return"";else if(count>this.length)
return this;else
return this.substring(0,count);}
String.prototype.right=function(count){if(count<=0)
return"";else if(count>this.length)
return this;else
return this.substring(this.length-count);}
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,"");}
String.prototype.contains=function(t){return this.indexOf(t)>=0?true:false}
Array.prototype.sortNum=function(){return this.sort(function(a,b){return a-b;});}
StringBuffer=function(){this.buffer=[];}
StringBuffer.prototype.append=function(str){this.buffer.push(str);}
StringBuffer.prototype.toString=function(){return this.buffer.join("");}
Math.formatNumber=function(pnumber,decimals,prefix){prefix=prefix||'';if(isNaN(pnumber)){return 0};if(pnumber==''){return 0};var snum=new String(pnumber);var sec=snum.split('.');var whole=parseFloat(sec[0]);var result='';if(sec.length>1){var dec=new String(sec[1]);dec=String(parseFloat(sec[1])/Math.pow(10,(dec.length-decimals)));dec=String(whole+Math.round(parseFloat(dec))/Math.pow(10,decimals));var dot=dec.indexOf('.');if(dot==-1){dec+='.';dot=dec.indexOf('.');}
while(dec.length<=dot+decimals){dec+='0';}
result=dec;}else{var dot;var dec=new String(whole);dec+='.';dot=dec.indexOf('.');while(dec.length<=dot+decimals){dec+='0';}
result=dec;}
return prefix+result;}