<?php
/**
 * @version    $Id$
 * @package    IT_Theme_Framework
 * @author     InnoThemes Team <support@innothemes.com>
 * @copyright  Copyright (C) 2012 InnoThemes.com. All Rights Reserved.
 * @license    GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Websites: http://www.innothemes.com
 */

// Get theme options
global $it_options;
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>" />
	<title><?php wp_title( '|', true, 'right' ); ?><?php bloginfo( 'name' ); ?></title>
	<meta name="description" content="<?php bloginfo( 'description' ); ?>" />
<?php if ( in_array( 'smartphone', $it_options['responsive_layout'] ) || in_array( 'tablet', $it_options['responsive_layout'] ) ) : ?>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<?php endif;

if ( $it_options['icon_favicon'] ) : ?>
	<link rel="icon" href="<?php echo esc_url( $it_options['icon_favicon'] ); ?>" />
<?php endif;

if ( $it_options['apple_icon'] ) : ?>
	<link rel="apple-touch-icon" href="<?php echo esc_url( $it_options['apple_icon'] ); ?>" />
<?php endif; ?>
	<link rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>" type="text/css" />

	<!-- html5.js and respond.min.js for IE less than 9 -->
	<!--[if lt IE 9]>
	<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<script src="<?php echo esc_url( IT_THEME_URI ); ?>/assets/3rd-party/respond/respond.min.js"></script>
	<![endif]-->

<?php
wp_head();

// Print code at end of head section
echo '' . $it_options['code_at_end_of_head'] . "\n";
?>
</head>
<body <?php body_class(); ?>>
	<div id="it-container">
		<div id="it-wrapper">
			<?php if ( $it_options['header'] ) : ?>
			<header id="it-header">
				<div class="fixed">
					<div id="it-logo">
						<?php IT_Theme_Render::logo(); ?>
					</div><!--End div#it-logo-->
					<div id="it-right-header">
						<?php IT_Theme_Render::social_icons( 'header' ); ?>

						<nav id="it-topmenu">
<?php
if ( 'on' == @$_POST['wp_customize'] && '' != @$_POST['customized'] ) {
	if ( $it_options['top_menu'] ) {
		wp_nav_menu(
			array(
				'menu'        => $it_options['top_menu'],
				'items_wrap'  => '<ul id="it-top-menu">%3$s</ul>',
				'fallback_cb' => '',
			)
		);
	}
} else {
	wp_nav_menu(
		array(
			'theme_location' => 'top_menu',
			'items_wrap'     => '<ul id="it-top-menu">%3$s</ul>',
			'fallback_cb'    => '',
		)
	);
}
?>
						</nav><!--End nav#it-topmenu-->

						<?php if ( $it_options['search_box'] ) : ?>
						<div id="it-searchbox">
							<form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
								<input type="text" value="" name="s" id="s" placeholder="<?php esc_attr_e( $it_options['search_box_text'] ); ?>"/>
								<input type="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', IT_THEME_TEXTDOMAIN ); ?>" />
							</form>
							<span><?php esc_html_e( $it_options['phone_number'], IT_THEME_TEXTDOMAIN ); ?></span>
							<span><?php esc_html_e( $it_options['email_address'], IT_THEME_TEXTDOMAIN ); ?></span>
						</div><!--End div#it-searchbox-->
						<?php endif; ?>
					</div><!--End div#it-right-header-->

					<?php IT_Theme_Render::menu_main(); ?>

					<div class="clearbreak"></div>
				</div><!--End div.fixed-->
			</header><!--End div#it-header-->
			<?php endif; ?>
