String.prototype.format = function(format) {
	return this.replace(/{([^{}]*)}/g,
		function(a, b) {
			var r = format[b];
			return typeof r === 'string' || typeof r === 'number' ? r : a;
		}
	);
};

