<div id="sidebar">
<?php if (get_option('flex_sidebar_visibility') == "no") { ?>
<?php if (get_option('flex_adsense_loc2') == "yes" && !get_option('flex_adsense_loc2banner')) { ?>
<div style="display:block; margin:10px 0 15px 0; text-align:center;">
<?php
$adsize = get_option('flex_adsense_loc2size');
$adtype = get_option('flex_adsense_loc2type');
$adchannel = get_option('flex_adsense_loc2channel');
include('adsense.php'); ?>
</div>
<?php } else if (get_option('flex_adsense_loc2') == "yes" && get_option('flex_adsense_loc2banner')) { ?>
<div style="display:block; margin:10px 0 15px 0; text-align:center;">
<?php echo stripslashes(get_option('flex_adsense_loc2banner')); ?>
</div>
<?php } ?>
<?php } else { ?>
<div id="sidebar-top">
<?php if (get_option('flex_adsense_loc2') == "yes" && !get_option('flex_adsense_loc2banner')) { ?>
<div style="display:block; margin:10px 0 15px 0; text-align:center;">
<?php
$adsize = get_option('flex_adsense_loc2size');
$adtype = get_option('flex_adsense_loc2type');
$adchannel = get_option('flex_adsense_loc2channel');
include('adsense.php'); ?>
</div>
<?php } else if (get_option('flex_adsense_loc2') == "yes" && get_option('flex_adsense_loc2banner')) { ?>
<div style="display:block; margin:10px 0 15px 0; text-align:center;">
<?php echo stripslashes(get_option('flex_adsense_loc2banner')); ?>
</div>
<?php } ?>
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Right Sidebar') ) : else : ?>
<div class="widget">
<div class="toptitle">
<h5>Right Sidebar</h5>
</div>
<ul>
<li>This is the Right Sidebar widget location.</li>
<li>Either activate widgets in this location or turn this location off in the theme options.</li>
</ul>
</div>
<?php endif; ?>
</div>
<div class="clear"></div>
<?php } ?>
<?php if (get_option('flex_ssb_loc') == "right" || get_option('flex_ssb_loc') == "both" || !get_option('flex_ssb_loc')) { ?>
<?php if ((get_option('flex_lsidebar_show') == "yes" && get_option('flex_ssb_loc') == "right") || !get_option('flex_lsidebar_show')) { ?>
<div id="sidebar-left">
<?php if (get_option('flex_adsense_loc3') == "yes" && !get_option('flex_adsense_loc3banner')) { ?>
<div style="display:block; margin:15px 0 15px 0; text-align:center;">
<?php
$adsize = get_option('flex_adsense_loc3size');
$adtype = get_option('flex_adsense_loc3type');
$adchannel = get_option('flex_adsense_loc3channel');
include('adsense.php'); ?>
</div>
<?php } else if (get_option('flex_adsense_loc3') == "yes" && get_option('flex_adsense_loc3banner')) { ?>
<div style="display:block; margin:15px 0 15px 0; text-align:center;">
<?php echo stripslashes(get_option('flex_adsense_loc3banner')); ?>
</div>
<?php } ?>
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Sub-sidebar Left Side') ) : else : ?>
<h5>Sub-sidebar Left</h5>
<ul>
<li>This is the Sub-sidebar Left location.</li>
<li>Either activate widgets in this location or turn this location off in the theme options.</li>
</ul>
<?php endif; ?>
<br/>
</div>
<?php } ?>
<?php if ((get_option('flex_rsidebar_show') == "yes" && get_option('flex_ssb_loc') == "right") || (get_option('flex_rsidebar_show') == "yes" && get_option('flex_ssb_loc') == "both") || !get_option('flex_rsidebar_show')) { ?>
<div id="sidebar-right">
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Sub-sidebar Right Side') ) : else : ?>
<h5>Sub-sidebar Right</h5>
<ul>
<li>This is the Sub-sidebar Right location.</li>
<li>Either activate widgets in this location or turn this location off in the theme options.</li>
</ul>
<?php endif; ?>
</div>
<?php } ?>
<?php } ?>
<?php if (get_option('flex_sidebar_bsl') == "right sidebar") { get_sidebar('bottom'); }?>
</div>