<div id="sidebar">

<?php if ( grain_is_sidebar_active('primary-widget-area') ) : ?>
		<div id="primary" class="widget-area">
			<ul class="xoxo">
				<?php dynamic_sidebar('primary-widget-area'); ?>
			</ul>
		</div><!-- #primary .widget-area -->
<?php endif; ?>		
<?php if ( grain_get_option('layout', 'narrow-sidebar' ) == "wide-sidebar"): ?>	
<?php if ( grain_is_sidebar_active('secondary-widget-area') ) : ?>
		<div id="secondary" class="widget-area">
			<ul class="xoxo">
				<?php dynamic_sidebar('secondary-widget-area'); ?>
			</ul>
		</div><!-- #secondary .widget-area -->
<?php endif; ?>		

<?php if ( grain_is_sidebar_active('teritiary-widget-area') ) : ?>
		<div id="teritiary" class="widget-area">
			<ul class="xoxo">
				<?php dynamic_sidebar('teritiary-widget-area'); ?>
			</ul>
		</div><!-- #teritiary .widget-area -->
<?php endif; ?>	
<?php endif; ?>

</div>