<?php
												
	$currency=get_option(THEME_NAME.'_currency_category');
	$search=get_option(THEME_NAME.'_search');
	$logo = get_option(THEME_NAME.'_logo');		
	
	$twitter = get_option(THEME_NAME."_twitter");
	$facebook = get_option(THEME_NAME."_facebook");
	$digg = get_option(THEME_NAME."_digg");
	$youtube = get_option(THEME_NAME."_youtube");
	$flickr = get_option(THEME_NAME."_flickr");
	if ( get_option( THEME_NAME."_rss_button" ) == "on" ) {							
		$rss = get_option(THEME_NAME."_rss_url");	
		if($rss == "") {
			$rss = get_bloginfo("rss_url");
		}
	} else { 
		$rss = false; 
	}	
	
	$breaking_news_cat = get_option(THEME_NAME."_breaking_news_cat");										
	$breaking_news = get_option(THEME_NAME."_breaking_news");										
	$social_header = get_option(THEME_NAME."_social_header");										
?>
			<!-- BEGIN .main-content-wrapper -->
			<div class="main-content-wrapper">

				<!-- BEGIN .main-content -->
				<div class="main-content">
				
					<!-- BEGIN .main-header -->
					<div class="main-header">
						<?php if($logo) { ?>
							<div class="logo">
								<a href="<?php echo home_url(); ?>"><img src="<?php echo $logo;?>" alt="<?php echo bloginfo('name'); ?>" width="166" height="28" /></a>
							</div>
						<?php } else { ?>
							<div class="text-logo">
								<?php echo bloginfo('name'); ?>
							</div>
						<?php } ?>
						<?php if($search=="on") { ?>
							<div class="search">
								<?php get_search_form(); ?>
							</div>
						<?php } ?>
						
						<div class="social">
						<?php if ( $social_header == "on" ) { ?>
							<?php if ( $digg ) { ?><a href="<?php echo $digg; ?>" target="_blank"><img src="<?php echo THEME_IMAGE_URL;?>ico-digg-1.png" alt="DIGG" width="19" height="19" /></a><?php } ?>
							<?php if ( $youtube ) { ?><a href="<?php echo $youtube; ?>" target="_blank"><img src="<?php echo THEME_IMAGE_URL;?>ico-youtube-1.png" alt="YouTube" width="19" height="19" /></a><?php } ?>
							<?php if ( $flickr ) { ?><a href="<?php echo $flickr; ?>" target="_blank"><img src="<?php echo THEME_IMAGE_URL;?>ico-flickr-1.png" alt="Flickr" width="19" height="19" /></a><?php } ?>
							<?php if ( $facebook ) { ?><a href="<?php echo $facebook; ?>" target="_blank"><img src="<?php echo THEME_IMAGE_URL;?>ico-facebook-1.png" alt="Facebook" width="19" height="19" /></a><?php } ?>
							<?php if ( $twitter ) { ?><a href="<?php echo $twitter; ?>" target="_blank"><img src="<?php echo THEME_IMAGE_URL;?>ico-twitter-1.png" alt="Twitter" width="19" height="19" /></a><?php } ?>
							<?php if ( $rss ) { ?><a href="<?php echo $rss; ?>" target="_blank"><img src="<?php echo THEME_IMAGE_URL;?>ico-rss-1.png" alt="RSS" width="19" height="19" /></a><?php } ?>
						<?php } ?>
						</div>
					
					<!-- END .main-header -->
					</div>

					<!-- BEGIN .main-menu-wrapper -->
					<div class="main-menu-wrapper">
						<span class="corner-left">&nbsp;</span>
							<?php			
								if ( function_exists( 'register_nav_menus' )) {
									$args = array(
										'container' => '',
										'theme_location' => 'top_menu',
										"link_before" => '<i>',
										"link_after" => '</i>' ,
										'depth' => 3,
										"echo" => false
									);
									echo add_menu_arrows(wp_nav_menu($args));
								}
							?>
					<!-- END .main-menu-wrapper -->
					</div>
				<?php if ( $breaking_news == "on" ) { ?>
					<!-- BEGIN .breaking-wrapper -->
					<div class="breaking-wrapper">
						<p><?php printf ( __('Breaking', THEME_NAME)); ?>:</p>
						<div class="horizontal-scroller">
							<div id="scrollingtext">
							<?php
								$args = array (
									'numberposts'     => 7,
									'offset'          => 0,
									'cat'             => $breaking_news_cat,
									'orderby'         => 'post_date',
									'order'           => 'DESC',
									'post_type'       => 'post',
									'post_status'     => 'publish' );
								
								$myposts = get_posts( $args );	
								foreach( $myposts as $post ) :	setup_postdata( $post ); 
							?>
								<img src="<?php echo THEME_IMAGE_URL;?>ico-list-bullet-1.png" alt="<?php the_title();?>" width="7" height="6" /><a href="<?php the_permalink(); ?>"><?php the_title();?></a>
							<?php endforeach; ?>
							</div>
						</div>
					<!-- END .breaking-wrapper -->
					</div>
				<?php } ?>