var Template = function(t) {
	if (t instanceof Array) {
		this._t = t.join('');
	} else if (typeof t == 'string') {
		this._t = t;
	} else {
		throw 'no template source';
	}
}

Template.prototype.render_for_json = function(json) {
	if (this._t) {
		var re = this._t + '';
		for (var key in json) {
			var val = json[key];
			var reg = new RegExp('\\$\\{' + key + '\\}', 'ig');
			re = re.replace(reg, val + '');
		}
		return re;
	}
}


