<!DOCTYPE html>
<!--// OPEN HTML //-->
<html <?php language_attributes(); ?> class="no-js">
    <head>
        <?php
        $options = get_option('imic_options');
        /** Theme layout design * */
        $bodyClass = ($options['site_layout'] == 'boxed') ? ' boxed' : '';
        $style='';
       if($options['site_layout'] == 'boxed'){
            if (!empty($options['upload-repeatable-bg-image']['id'])) {
            $style = ' style="background-image:url(' . $options['upload-repeatable-bg-image']['url'] . '); background-repeat:repeat; background-size:auto;"';
        } else if (!empty($options['full-screen-bg-image']['id'])) {
            $style = ' style="background-image:url(' . $options['full-screen-bg-image']['url'] . '); background-repeat: no-repeat; background-size:cover;"';
        }
           else if(!empty($options['repeatable-bg-image'])) {
            $style = ' style="background-image:url(' . get_template_directory_uri() . '/images/patterns/' . $options['repeatable-bg-image'] . '); background-repeat:repeat; background-size:auto;"';
        }
        }
        ?>
        <!--// SITE TITLE //-->
        <title>
        <?php
			if ( defined('WPSEO_VERSION') ) {
				wp_title('');
			} else {
				bloginfo('name'); ?> <?php wp_title(' - ', true, 'left');
			}
		?>
        </title>
        <!--// SITE META //-->
        <meta charset="<?php bloginfo('charset'); ?>" />
        <!-- Mobile Specific Metas
        ================================================== -->
	<?php if ($options['switch-responsive'] == 1){ ?>
		<?php if ($options['switch-zoom-pinch'] == 1){ ?>
                <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0">
        <?php } else { ?>
                <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
        <?php } ?>
        <meta name="format-detection" content="telephone=no">
	<?php } ?>
        <!--// PINGBACK & FAVICON //-->
        <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    	<?php if (function_exists( 'wp_site_icon') && has_site_icon()) {
			echo '<link rel="shortcut icon" href="'.get_site_icon_url().'" />';
		}
		else
		{
			if (isset($options['custom_favicon']) && $options['custom_favicon'] != "") { ?><link rel="shortcut icon" href="<?php echo esc_url($options['custom_favicon']['url']); ?>" /><?php
			}
		}
		if (isset($options['iphone_icon']) && $options['iphone_icon'] != "")
		{ ?>
        	<link rel="apple-touch-icon-precomposed" href="<?php echo $options['iphone_icon']['url']; ?>"><?php
        }
		if (isset($options['iphone_icon_retina']) && $options['iphone_icon_retina'] != "")
		{ ?>
        	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php echo $options['iphone_icon_retina']['url']; ?>"><?php
        }
		if (isset($options['ipad_icon']) && $options['ipad_icon'] != "")
		{ ?>
        	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php echo $options['ipad_icon']['url']; ?>"><?php
        }
		if (isset($options['ipad_icon_retina']) && $options['ipad_icon_retina'] != "")
		{ ?>
        	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php echo $options['ipad_icon_retina']['url']; ?>"><?php
        }
        $offset = get_option('timezone_string');
		if($offset=='') { $offset = "Australia/Melbourne"; }
	date_default_timezone_set($offset);
	$header_style = $options['header_layout'];
	$footer_skin = $options['footer_skin'];
        ?>
        <!-- CSS
        ================================================== -->
        <!--[if lte IE 9]><link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/ie.css" media="screen" /><![endif]-->
        <?php //  WORDPRESS HEAD HOOK 
         wp_head(); ?>
		 <?php $SpaceBeforeHead = $options['space-before-head'];
            echo $SpaceBeforeHead;
         ?>
    </head>
    <!--// CLOSE HEAD //-->
    <body <?php body_class($bodyClass.' '.$header_style.' '.$footer_skin); echo $style;  ?>>
        <!--[if lt IE 7]>
	<p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
<![endif]-->
<div class="body"> 
<?php $menu_locations = get_nav_menu_locations();
if($header_style=="header-style4") { ?>
<div class="topbar">
    	<div class="container">
        	<div class="row">
            	<div class="col-md-6 col-sm-6">
                    <ul class="social-icons-colored">
                    <?php
					$socialSites = $options['header_social_links'];
                foreach ($socialSites as $key => $value) {
                    if (filter_var($value, FILTER_VALIDATE_URL)) {
						$string = substr($key, 3);
                        echo '<li class="'.$string.'"><a href="' . esc_url($value) . '" target="_blank"><i class="fa ' . $key . '"></i></a></li>';
                    }
                } ?>
                    </ul>
                </div>
                <?php if (!empty($menu_locations['top-menu'])) { ?>
            	<div class="col-md-6 col-sm-6">
                	<?php wp_nav_menu(array('theme_location' => 'top-menu', 'container' => '','items_wrap' => '<ul id="%1$s" class="top-navigation">%3$s</ul>')); ?>
                </div>
                <?php } ?>
            </div>
        </div>
    </div>
    <?php } ?>
	<!-- Start Site Header -->
	<header class="site-header">
    	<div class="container for-navi">
        	<div class="site-logo">
            <h1>
                <a href="<?php echo esc_url( home_url() ); ?>" <?php if(isset($options['logo_alt_text']) && $options['logo_alt_text'] != "") { ?>title="<?php echo esc_html($options['logo_alt_text']); ?>"<?php } ?>>
                <?php $logo_type = $options['logo_type'];
				if($logo_type==0) {
					$logo_icon = $options['logo_icon'];
					$logo_text = $options['logo_text'];
					echo '<div class="text-logo">';
					if($logo_icon!='') { 
                    echo '<span class="logo-icon"><i class="fa '.esc_attr($logo_icon).'"></i></span>'; }
                    if($logo_text!='') { 
					echo '<span class="logo-text">'.$logo_text.'</span>'; }
					echo '</div>';
              	}
				else { ?>
                	<div class="nsticky-logo">
					<img src="<?php echo esc_url($options['logo_upload']['url']); ?>" <?php if(isset($options['logo_alt_text']) && $options['logo_alt_text'] != "") { ?>alt="<?php echo esc_html($options['logo_alt_text']); ?>"<?php } ?> class="default-logo">
					<?php if (!empty($options['retina_logo_upload']['url'])) { ?>
						<img src="<?php echo esc_url($options['retina_logo_upload']['url']); ?>" <?php if (isset($options['logo_alt_text']) && $options['logo_alt_text'] != "") { ?>alt="<?php echo esc_html($options['logo_alt_text']); ?>"<?php } ?> class="retina-logo" width="<?php echo $options['retina_logo_width']; ?>" height="<?php echo $options['retina_logo_height']; ?>">
					<?php } else { ?>
						<img src="<?php echo esc_url($options['logo_upload']['url']); ?>" <?php if (isset($options['logo_alt_text']) && $options['logo_alt_text'] != "") { ?>alt="<?php echo esc_html($options['logo_alt_text']); ?>"<?php } ?> class="retina-logo" width="<?php echo $options['retina_logo_width']; ?>" height="<?php echo $options['retina_logo_height']; ?>">
                       <?php } ?>
                     </div>
                     <?php if (!empty($options['sticky_logo_upload']['url'])) { ?>
                        <div class="sticky-logo">
                            <!-- Sticky Header Logo Image -->
                            <img src="<?php echo esc_url($options['sticky_logo_upload']['url']); ?>" <?php if(isset($options['logo_alt_text']) && $options['logo_alt_text'] != "") { ?>alt="<?php echo esc_html($options['logo_alt_text']); ?>"<?php } ?> class="default-logo">
                        <?php if (!empty($options['sticky_retina_logo_upload']['url'])) { ?>
                            <img src="<?php echo esc_url($options['sticky_retina_logo_upload']['url']); ?>" <?php if (isset($options['logo_alt_text']) && $options['logo_alt_text'] != "") { ?>alt="<?php echo esc_html($options['logo_alt_text']); ?>"<?php } ?> class="retina-logo" width="<?php echo $options['sticky_retina_logo_width']; ?>" height="<?php echo $options['sticky_retina_logo_height']; ?>">
                        <?php } else { ?>
                            <img src="<?php echo esc_url($options['sticky_logo_upload']['url']); ?>" <?php if (isset($options['logo_alt_text']) && $options['logo_alt_text'] != "") { ?>alt="<?php echo esc_html($options['logo_alt_text']); ?>"<?php } ?> class="retina-logo" width="<?php echo $options['sticky_retina_logo_width']; ?>" height="<?php echo $options['sticky_retina_logo_height']; ?>">
                            <?php } ?>
                        </div>
					<?php }
				}?>
                </a>
            </h1>
            </div>
            
                <?php if ($options['enable-search'] == 1) {
                    imic_search_button_header();
                } ?>
                <?php if ($options['enable-cart'] == 1) {
                   echo imic_cart_button_header();
                } ?>
            <!-- Main Navigation -->
            <?php if (!empty($menu_locations['primary-menu'])) {
						echo '<nav class="main-navigation" role="navigation">';
                    	wp_nav_menu(array('theme_location' => 'primary-menu', 'container' => '','items_wrap' => '<ul id="%1$s" class="sf-menu">%3$s</ul>', 'walker' => new imic_mega_menu_walker)); 
						echo '</nav>'; } ?>
            <a href="#" class="visible-sm visible-xs" id="menu-toggle"><i class="fa fa-bars"></i></a>
    	</div>
	</header>