<div id="content">

	<% function renderTemplate(contentBlock) { %>
		<% if (contentBlock.anchor) { %>
			<a name="<%= contentBlock.anchor %>" id="<%= contentBlock.anchor %>" class="anchor"></a>
		<% } %>
		<% if (contentBlock.type === "textBlock") { %>
			<%- include("elements/contentBlocks/textBlock", {contentBlock: contentBlock}) %>
		<% } %>
		<% if (contentBlock.type === "valueProposition") { %>
			<%- include("elements/contentBlocks/valueProposition.ejs", {contentBlock: contentBlock}); %>
		<% } %>
		<% if (contentBlock.type === "table") { %>
			<%- include("elements/contentBlocks/table", {contentBlock: contentBlock}); %>
		<% } %>
		<% if (contentBlock.type === "buttonBlock") { %>
			<%- include("elements/contentBlocks/buttonBlock", {contentBlock: contentBlock}); %>
		<% } %>
		<% if (contentBlock.type === "regSelect") { %>
			<%- include("elements/contentBlocks/regSelect", {contentBlock: contentBlock}); %>
		<% } %>

		<% if (contentBlock.type === "threeValueProps") { %>
				<%- include("elements/contentBlocks/threeValueProps", {contentBlock: contentBlock}); %>
		<% } %>
			
		<!-- Meta content blocks -->
		<% if (contentBlock.type === "toggleVisible") { %>
			<div class="wrap wrap-toggleVisible">
				<% if(contentBlock.title) { %>
					<h2><%- contentBlock.title %></h2>	
				<% } %>

				<div id="<%= contentBlock.id %>_toggle" class="toggleVisible" onclick="toggleVisible(this)">
					toggle
				</div>

				<div id="<%= contentBlock.id %>" class="">

					<% renderTemplate(contentBlock.contentBlock) %>
				</div>
			</div>
		<% } %>

		<% if (contentBlock.type === "tab") { %>
			<div id="<%= contentBlock.id %>" class="tabbedContentBlocks">
				
				<% if(contentBlock.title) { %>
					<h2><%- contentBlock.title %></h2>	
				<% } %>
				
				<% var tabi = 0 %>
				<ul>
					<% contentBlock.tabs.forEach(function(tab) { %>
						<li id="<%= contentBlock.id %>_tab_<%= tabi %>" <% if(tabi == 0) { %> class="active"  <% } else { %> class="" <% } %> onclick="selectTab(this, <%= contentBlock.tabs.length %>)" ><%= tab %></li>
						<% tabi = tabi + 1 %>
					<%	}) %>
				</ul>

				<% var tabi = 0 %>

				<% contentBlock.contentBlocks.forEach(function(innerContentBlock) { %>
					<div id="<%= contentBlock.id %>_block_<%= tabi %>" <% if(tabi == 0) { %> class="active"  <% } else { %> class="" <% } %>>
						<% renderTemplate(innerContentBlock) %>
					</div>
					<% tabi = tabi + 1 %>
				<%	}) %>
			</div>

		<% } %>
	<% } %>

	<div class="contentBlocks">
		<% contentBlocks.forEach(function(contentBlock) { %>
			<% renderTemplate(contentBlock) %>
		<%	}) %>
	</div>

</div>
