<?php
	$sidebar_layout = get_post_meta($post->ID, 'pbt_single_layout', true);
	$loc = theme_option('sidebar_location1');
	if($sidebar_layout!=2) {
		if($loc==2 || $loc==4) {
			if(theme_option('sidebar_width1')!=0) get_sidebar(1); // calling the First Sidebar
		}
		if(theme_option('sidebar_width2')!=0) get_sidebar('second'); // calling the First Sidebar
	}
?>
	<br style="clear:both;" />
    <?php if(theme_option('extended_footer')!=2) get_sidebar('footer'); // include the Extended Footer Bar ?>
    </div> <!-- end #wrapper -->
	</div> <!-- end #content -->

    <!-- begin footer -->
    <div id="footer">
        <div id="footercontent">
        	<div class="fl">
				<?php if(theme_option('footer_text')) { 
                    echo stripslashes(theme_option('footer_text'));
                } 
				?>
            </div>
			<div class="footerright fr">
	            <?php printf(__('%s created by %s', "moderno"), '<a href="http://themes.bavotasan.com/our-themes/premium-themes/moderno/">Moderno</a>', '<a href="http://themes.bavotasan.com">Themes by bavotasan.com</a>'); ?>.
    	        <?php if(theme_option('footer_wordpress_link')==1) { printf(__("Powered by %s", "moderno"), '<a href="http://www.wordpress.org">WordPress</a>'); ?>.<?php } ?>
	       	    <a href="javascript:void(0)" class="backtotop"><img src="<?php echo THEME_URL; ?>/images/backtotop.png" alt="Back to Top" /></a>
        	</div>
			<?php if(theme_option('footer_ad')) { ?>
            <div id="footerad">
                <?php echo stripslashes(theme_option('footer_ad')); ?>
            </div>
            <?php } ?>
        </div> <!-- end #footercontent -->
    </div> <!-- end #footer -->
<?php wp_footer(); ?>
<!-- Moderno theme designed by Themes bu bavotasan.com - http://themes.bavotasan.com -->
</body>
</html>