naviki.Template = {
	/*
	 * Formats a template with the specified markerarray
	 */
	 substituteMarkerArray : function(subpart, markerarray) {
		template = subpart;
		for (var marker in markerarray){
			regex = new RegExp(marker, "g");
			template = template.replace(regex, markerarray[marker]);
		}
		return template;
	 }, 
	 
	 getSubpart : function(subpartname) {
		 template = naviki.TEMPLATE_CONTENT;
		 startIdx = template.indexOf(subpartname);
		 endIdx = template.lastIndexOf(subpartname);
		 return '<!-- ' + subpartname + template.substr(startIdx, endIdx-startIdx) + subpartname + '-->';
	 }
};
