String.prototype.replaceAll = function(cmp, rpc) {
	var str = this;
	while (str.indexOf(cmp) > -1) {
		str = str.replace(cmp, rpc);
	}
	return str;
};

String.prototype.trim = function() {
    return this.replace(/^\W+|\W+$/g, ""); 
};
