
SAPO.namespace('Utility');SAPO.Utility.Templating=function()
{this.init();};SAPO.Utility.Templating.prototype={init:function()
{this.startTag='{\\$';this.endTag='\\$}';},gen:function(template,objectVars)
{if((template=this.analizeTemplate(template))&&typeof(objectVars)=='object'){template=unescape(template);for(var i in objectVars){if(objectVars[i]!=null){if(typeof(objectVars[i])=='string'||typeof(objectVars[i])=='number'){var re=new RegExp(""+this.startTag+i+this.endTag+"","gm");template=template.replace(re,objectVars[i]);}}}
var reClean=new RegExp(""+this.startTag+this.endTag+"","gm");template=template.replace(reClean,"")
return template;}else{return false;}},analizeTemplate:function(template)
{if(!template||typeof(template)=='undefined'){return false;}
if(typeof(template)=='object'){return template.innerHTML;}else if(typeof(template)=='string'){if(document.getElementById(template)){return document.getElementById(template).innerHTML;}else{return template;}}},debug:function()
{}};