// Entango Template JavaScript
/*jslint browser: true */ /*global ent, window */
if(ent.isUndefined(ent.template)){ent.addMember("template");}
if(ent.isObject(ent.template) && (ent.template.entango === true)){
if(ent.modules.ent_template !== true){
ent.modules.ent_template = true;
// historical
var Ent_Template = ent.template;
ent.template.ent_template_included = true;

ent.template.addMember = function(memberName,duplicateAlert,memberItem){
	if(ent.isString(memberName)){
		if(ent.isBoolean(duplicateAlert) && (duplicateAlert === true) && ent.template.hasOwnProperty(memberName)){window.alert(memberName + " has already been added to ent.template.");}
		else{
			if(ent.isUndefined(memberItem)){
				if(!ent.template.hasOwnProperty(memberName)){ent.template[memberName] = {};}
			}
			else{ent.template[memberName] = memberItem;}
			return ent.template[memberName];
		}
	}
	else{window.alert("ent.template can not have an empty member name.");return undefined;}
};
}}else{window.alert("ent.template already defined outside Entango code.");}


