// JavaScript Document
var simpleTemplateParser={STP:{},parseTemplate:function(b,a,c,d){var e=this.STP;e.template=b;e.object=a;e.regexOptions=$pick(c,"ig");e.wrappers=$pick(d,{before:"%",after:"%"});return e.result=this.runParser(e.object,e.template,e.regexOptions)},runParser:function(b,a,c){for(value in b){switch($type(b[value])){case"string":a=this.tmplSubst(value,b[value],a,c);break;case"number":a=this.tmplSubst(value,b[value],a,c);break;case"object":a=this.runParser(b[value]);break;case"array":a=this.tmplSubst(value,b[value].toString(),a,c);break}}return a},tmplSubst:function(b,d,a,c){return a.replace(new RegExp(this.STP.wrappers.before+b+this.STP.wrappers.after,"gi"),d)}};