<!DOCTYPE html>
<html <?php language_attributes(); ?> prefix="og: http://ogp.me/ns#">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title><?php
	global $page, $paged;
	wp_title( '|', true, 'right' );
	bloginfo( 'name' );
	$site_description = get_bloginfo( 'description', 'display' );
	if ( $site_description && ( is_home() || is_front_page() ) )
		echo " | $site_description";
	if ( $paged >= 2 || $page >= 2 )
		echo ' | ' . sprintf( __( 'Page %s', 'magnews' ), max( $paged, $page ) );
	?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />

<?php wp_head(); ?>
</head>
<?php global $is_IE ?>
<body id="top" <?php body_class(); ?>>
	<div class="background-cover"></div>
	<div class="wrapper<?php if(magnews_get_option( 'theme_layout' ) == 'full') echo ' full-site'; if(magnews_get_option( 'columns_num' ) == '2c') echo ' layout-2c'; ?>">
		<?php if(!magnews_get_option( 'top_menu' )): ?>
		<div class="top-nav <?php echo magnews_get_option( 'top_left' ); ?>">
			<div class="container">
				<div class="search-block">
					<form method="get" id="searchform" action="<?php echo home_url(); ?>/">
						<input class="search-button" type="submit" value="<?php if( !$is_IE ) _e( 'Search' , 'magnews' ) ?>" />	
						<input type="text" id="s" name="s" value="<?php _e( 'Search...type and hit enter!' , 'magnews' ) ?>" onfocus="if (this.value == '<?php _e( 'Search...type and hit enter!' , 'magnews' ) ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'Search...type and hit enter!' , 'magnews' ) ?>';}"  />
					</form>
				</div><!-- .search-block /-->			
				<?php
					wp_nav_menu( array( 'container_class' => 'top-menu', 'theme_location' => 'top-menu', 'fallback_cb' => 'magnews_nav_fallback'  ) );
				?>	
			</div>
		</div><!-- .top-menu /-->
		<?php endif; ?>		

		<header>
		<div class="header-content">
<?php $logo_margin =''; if( magnews_get_option( 'logo_margin' )) $logo_margin = ' style="margin-top:'.magnews_get_option( 'logo_margin' ).'px"';  ?>
			<div class="logo"<?php echo $logo_margin ?>>
			<?php if( !is_singular() ) echo '<h1>'; else echo '<h2>'; ?>
<?php if( magnews_get_option('logo_setting') == 'title' ): ?>
				<?php if (magnews_get_option('logo_text_color')) $logo_color = magnews_get_option('logo_text_color'); ?><a href="<?php echo home_url()  ?>" <?php if (isset($logo_color)) { ?>style="color:<?php echo $logo_color; } ?>"><?php bloginfo('name'); ?></a>
				<br/><span><?php bloginfo( 'description' ); ?></span>
				<?php else : ?>
				<?php if( magnews_get_option( 'logo' ) ) $logo = magnews_get_option( 'logo' );
						else $logo = get_stylesheet_directory_uri().'/images/logo.png';
				?>
				<a title="<?php bloginfo('name'); ?>" href="<?php echo home_url(); ?>/">
					<img src="<?php echo $logo ; ?>" alt="<?php bloginfo('name'); ?>" /><strong><?php bloginfo('name'); ?> <?php bloginfo( 'description' ); ?></strong>
				</a>
<?php endif; ?>
			<?php if( !is_singular() ) echo '</h1>'; else echo '</h2>'; ?>
			</div><!-- .logo /-->
			<?php magnews_banner('banner_top' , '<div class="ads-top">' , '</div>' ); ?>
			<div class="clear"></div>
		</div>	
		<?php $stick = ''; ?>
		<?php if( magnews_get_option( 'stick_nav' ) ) $stick = 'class="fixed-enabled"' ?>
			<nav id="main-nav"<?php echo $stick; ?>>
				<div class="container">				
				<?php wp_nav_menu( array( 'container_class' => 'main-menu', 'theme_location' => 'primary' ,'fallback_cb' => 'magnews_nav_fallback'  ) ); ?>
				
				</div>
			</nav><!-- .main-nav /-->
		</header><!-- #header /-->
		
		<div class="container">	
	
<?php 
$sidebar = '';
if( magnews_get_option( 'sidebar_pos' ) == 'left' ) $sidebar = ' sidebar-left';
elseif( magnews_get_option( 'sidebar_pos' ) == 'nleft' ) $sidebar = ' sidebar-narrow-left';
elseif( magnews_get_option( 'sidebar_pos' ) == 'nright' ) $sidebar = ' sidebar-narrow-right';

if( is_single() || is_page() ){
	$get_meta = get_post_custom($post->ID);
	
	if( !empty($get_meta["magnews_sidebar_pos"][0]) ){
		$sidebar_pos = $get_meta["magnews_sidebar_pos"][0];

		if( $sidebar_pos == 'left' ) $sidebar = ' sidebar-left';
		elseif( $sidebar_pos == 'full' ) $sidebar = ' full-width';
		elseif( $sidebar_pos == 'right' ) $sidebar = ' sidebar-right';
		elseif( $sidebar_pos == 'nright' ) $sidebar = ' sidebar-narrow-right';
		elseif( $sidebar_pos == 'nleft' ) $sidebar = ' sidebar-narrow-left';
	}
}
?>
	<div id="main-content" class="container<?php echo $sidebar ; ?>">