/**
 * @author trtik
 */

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