Object.extend = function(destination, source) {
	for (property in source) {
		destination[property] = source[property];
	}
	return destination;
}

Object.extend(String.prototype, {
	toInt: function() {
		return parseInt(this, 10);
	},
	toFloat: function() {
		return parseFloat(this);
	},
	trim: function() {
		return this.replace(/^\s+|\s+$/g, '');
	},
	contains: function(string, s) {
		//return (s) ? (s + this + s).indexOf(s + string + s) > -1 : this.indexOf(string) > -1;
		return this.indexOf(s, string) != -1;
	},
	append: function(text) {
		return (this + text);
	},
	capitalize: function() {
		return this.replace(/\b[a-z]/g, function(match) {
			return match.toUpperCase();
		});
	},
	lcase: function() {
		return this.toLowerCase();
	},
	ucase: function() {
		return this.toUpperCase();
	}
});
Object.extend(Number.prototype, {
	toInt: function() {
		return parseInt(this);
	},
	toFloat: function() {
		return parseFloat(this);
	},
	round: function(precision) {
		precision = Math.pow(10, precision || 0);
		return Math.round(this * precision) / precision;
	}
});
