<?php // begin sidebar ?>

<div id="sidebar">
		
	<ul id="sidebarwidgeted">
    
    <?php if(get_theme_mod('enews') == 'Yes') { ?>
                
        <li id="enews" class="widget">
			<div class="enews">
                <h4><?php _e("eNews &amp; Updates", 'studiopress'); ?></h4> 
				<form id="subscribe" action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=<?php echo get_theme_mod('enews_id'); ?>', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">
					<p>
						<?php _e("Sign up to receive breaking news", 'studiopress'); ?><br />
						<?php _e("as well as receive other site updates", 'studiopress'); ?>!
					</p>
					<input type="text" value="<?php _e("Enter your email address...", 'studiopress'); ?>" id="subbox" onfocus="if (this.value == '<?php _e("Enter your email address...", 'studiopress'); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e("Enter your email address...", 'studiopress'); ?>';}" name="email"/>
					<input type="hidden" value="<?php echo get_theme_mod('enews_id'); ?>" name="uri"/>
					<input type="hidden" name="loc" value="en_US"/>
					<input type="submit" value="<?php _e("GO", 'studiopress'); ?>" id="subbutton" />
				</form>	
                   
            </div>
        </li>

    <?php } else { ?>
	<?php } ?> 
    	
	<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar Top') ) : ?>
	
		<li id="recent-posts" class="widget">
            <h4><?php _e("Recent Posts", 'studiopress'); ?></h4>
                <ul>
                    <?php wp_get_archives('type=postbypost&limit=5'); ?> 
                </ul>
		</li>
		
	<?php endif; ?>
	
	</ul>
	
	<?php include(TEMPLATEPATH."/sidebar_left.php");?>
	
	<?php include(TEMPLATEPATH."/sidebar_right.php");?>
	
</div>

<?php // end sidebar ?>