String.prototype.ltrim=function(){return this.replace(/^\s*/,"");};
String.prototype.rtrim=function(){return this.replace(/\s*$/,"");};
String.prototype.trim=function(){return this.rtrim().ltrim();};
String.prototype.endswith=function(c){return this.substr(this.length-c.length)==c;};
String.prototype.startswith=function(e){return this.substr(0,e.length)==e;};
String.prototype.encode=function(){var returnString;returnString=escape(this);returnString=returnString.replace(/\+/g,"%2B");return returnString;};
String.prototype.decode=function(){return unescape(this);};
String.prototype.format=function(){	var s=this;	for(var i=0;i<arguments.length;i++){s=s.replace("{"+i+"}",arguments[i]);}return s;};

Array.prototype.indexOf=function(R){for(var i=0;i<this.length;i++){if(this[i]==R)return i;}return -1;};
Array.prototype.exists=function(S){return this.indexOf(S)!=-1;};
Array.prototype.add=Array.prototype.queue=function(T){this.push(T);};
Array.prototype.contains=function(V){var index=this.indexOf(V);return index>=0;};
Array.prototype.insert=function(W,X){this.splice(W,0,X);};
Array.prototype.clone=function(){var clonedArray=[];var length=this.length;for(var index=0;index<length;index++){clonedArray[index]=this[index];}return clonedArray;};
Array.prototype.removeAt=function(Y){return this.splice(Y,1);};
Array.prototype.remove=function(o){var i=this.indexOf(o);if(i>-1)this.splice(i,1);return i>-1;};
Array.prototype.clear=function(){if(this.length>0)this.splice(0,this.length);};
