{embed="includes/document_head" entry_title="{exp:channel:entries channel="pages" limit="1"}{title}{/exp:channel:entries}"}

<body>
<div id="wrapper">
		
{embed="includes/header"} 
		
	<div id="section-title"{exp:channel:entries channel="pages" status="open|closed|Hidden|Featured"}
	{reverse_related_entries channel="header_image"}
		style="background-image: url('{header_image}');"
	{/reverse_related_entries}
	{/exp:channel:entries}>
		{if segment_2!='' AND segment_3==''}<h2>{exp:structure:parent_title}</h2>
		{if:elseif segment_3!=''}<h2>{exp:structure:top_level_title}</h2>
		{if:else}<h2>{exp:structure:top_level_title}</h2>{/if}
	</div>

<div id="page">    
 	<div id="side">
        <div class="inner">
			<div id="subnav">
				<h2>{if segment_2!='' AND segment_3==''}<a href="{site_url}{segment_1}">{exp:structure:parent_title}</a>{if:elseif segment_3!=''}<a href="{site_url}{segment_1}">{exp:structure:top_level_title}</a>{if:else}<a href="{segment_2}">{exp:structure:top_level_title}</a>{/if}</h2>
				
			{exp:structure:nav_sub start_from="/{segment_1}" {if segment_2 !=''}limit_depth="2"{if:else}limit_depth="1"{/if} current_class="active"}

<a href="http://ausable.org/blog/feed" class="icon-rss">Subscribe to RSS Feed</a>
			</div>
			
			<!--  / CATEGORIES BOX \ --> 
            <div class="categoriesBox"> 

                <h3>Categories</h3> 
                <ul> 
                {exp:channel:category_archive channel="blog" show_empty="no" style="linear"}
				{categories}
					<li><a href="{path=blog-category/category/}">{category_name}</a></li>
				{/categories}
				{/exp:channel:category_archive}
                </ul> 
                
                <h3>Authors</h3> 
                <ul>
                {exp:query sql='SELECT count(t1.entry_id) AS total_posts, t2.screen_name, t2.member_id FROM exp_channel_titles AS t1 LEFT JOIN exp_members AS t2 ON (t2.member_id = t1.author_id) WHERE channel_id = 2 AND status != "closed" GROUP BY t2.screen_name, t2.member_id HAVING count(t1.entry_id > 0) ORDER BY count(t1.entry_id) DESC'}
					<li><a href="{path="blog/author/{member_id}"}">{screen_name} ({total_posts})</a></li>
				{/exp:query}
				</ul>


                <h3>Archives</h3> 
                <ul> 
				{exp:channel:month_links channel="blog" limit="50"}
					
						<li><a 
							{if segment_4==year AND segment_5==month_num}
								class="active"
							{/if}
							href="{path=blog-archive}"> {month} {year}
						</a></li>
					
				{/exp:channel:month_links}
                </ul> 

            </div> 
            <!--  \ CATEGORIES BOX / -->
		</div>
     </div>
     <div id="content">
          <div class="inner">	
        
        	
                 		{exp:channel:entries channel="pages" limit="1"}
							{if hide_title!='Yes'}<h1 style="float: left;">{title}</h1>{!--<a href="http://ausable.org/blog/feed" class="icon-rss">Subscribe to RSS Feed</a>--}{/if}

						{pages_copy}
						{/exp:channel:entries}
						
					
						{if segment_2=='blog' AND segment_3 !=''}
						
						<div class="testimonialBox">
							<div class="testimonials">
							
						{exp:channel:entries channel="blog" dynamic="on" limit="1"}
							<h1>{title}</h1>
							<h4><em>Posted by {author} {categories}in <a href="{path=/blog-category/category/}">{category_name}</a> {/categories} | {entry_date format="%M %d, %Y"}</em></h4>
							{body}

						{embed="includes/addthis"}

						{/exp:channel:entries}
						
						{!--{embed="blog/comments"}--}

</div></div>

						{/if}						
                            

						
						{if segment_2 =='blog' AND segment_3==''}{embed="blog/blog_list"}{/if}
						
						
        
   					 </div>
			     </div>
			<div class="clear"></div>
			</div>
			     {embed="includes/footer"}
			</div>
			{embed="includes/analytics"}
			</body>
			</html>