﻿window.undefined = window.undefined;
String.prototype.trimLeft = function(){return this.replace(/^[ ]+/, '');}
String.prototype.trimRight = function(){return this.replace(/[ ]+$/, '');};
String.prototype.trim = function(){return this.trimLeft().trimRight();};
String.prototype.format = function(args_etc){if(arguments.length==0){return this;}; var fnReplace=function(str, strReplace, index){return str.replace(new RegExp("\{[" + index + "]\}", "ig"), strReplace);}; var alist = (args_etc != null && typeof(args_etc)=="object" && args_etc.constructor.toString().substr(0,17).indexOf("Array()") > 0) ? args_etc : arguments; var string = this; for (var i=0; i<alist.length; i++) {string = fnReplace(string, alist[i], i);} return string;};

