<?php
/**
 * Common Template - tpl_header.php
 *
 * @package Bootstrap
 */
?>

<?php
if ($messageStack->size('header') > 0) {
  echo $messageStack->output('header');
}
if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
  echo htmlspecialchars(urldecode($_GET['error_message']), ENT_COMPAT, CHARSET, TRUE);
}
if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
  echo htmlspecialchars($_GET['info_message'], ENT_COMPAT, CHARSET, TRUE);
}
?>

<?php if (!isset($flag_disable_header) || !$flag_disable_header) : ?>

<header id="masthead" class="site-header">

  <div class="top-navigation">
    <div class="inner-container">
      <div class="row">
        <div class="site-tagline col-md-6"><?php echo htmlspecialchars_decode($genesis_options['site_promo_text']); ?></div>
        <div class="aux-menu-wrap col-md-6 clearfix">
          <?php require($template->get_template_dir('tpl_aux_menu.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_aux_menu.php'); ?>
        </div>
      </div>
    </div>
  </div>

  <div class="site-branding">
    <div class="inner-container clearfix">
      <div class="logo-wrap pull-left">
        <?php if(zen_not_null($genesis_options['site_logo_url'])) : ?>
          <?php if( $this_is_home_page ) : ?>
            <h1 class="logo"><?php echo '<a href="' . HTTPS_SERVER . DIR_WS_CATALOG . '"><img class="img-responsive" src="' . $genesis_options['site_logo_url'] . '" alt="' . HEADER_ALT_TEXT . '"></a>'; ?></h1>
          <?php else: ?>
            <p class="logo"><?php echo '<a href="' . HTTPS_SERVER . DIR_WS_CATALOG . '"><img class="img-responsive" src="' . $genesis_options['site_logo_url'] . '" alt="' . HEADER_ALT_TEXT . '"></a>'; ?></p>
          <?php endif; ?>
        <?php else : ?>
          <?php if( $this_is_home_page ) : ?>
            <h1 class="logo"><?php echo '<a href="' . HTTPS_SERVER . DIR_WS_CATALOG . '"><img class="img-responsive" src="' . $template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE . '" alt="' . HEADER_ALT_TEXT . '"></a>'; ?></h1>
          <?php else: ?>
            <p class="logo"><?php echo '<a href="' . HTTPS_SERVER . DIR_WS_CATALOG . '"><img class="img-responsive" src="' . $template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE . '" alt="' . HEADER_ALT_TEXT . '"></a>'; ?></p>
          <?php endif; ?>
        <?php endif; ?>
      </div>
      <!--<div class="search-header pull-right">
        <?php//echo zen_draw_form('quick_find_header', zen_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', $request_type, false), 'get', 'class="clearfix"'); ?>
          <?php //echo zen_draw_hidden_field('main_page',FILENAME_ADVANCED_SEARCH_RESULT); ?>
          <?php// echo zen_draw_hidden_field('search_in_description', '1') . zen_hide_session_id(); ?>
          <input class="pull-right" id="the-search" type="search" name="keyword" placeholder="<?php echo HEADER_SEARCH_DEFAULT_TEXT; ?>">
        </form> 
      </div>-->
    </div>
  </div>

  <nav id="site-navigation" class="main-navigation">
    <span id="main-menu-btn" class="hide" data-toggle="collapse" data-target="#main-menu"><i class="fa fa-bars"></i> <?php echo TEXT_MENU; ?></span>
    <?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
  </nav>

</header>
  <?php if( zen_not_null( $genesis_options['header_sticky'] ) ) : ?>
  <script>
    jQuery(document).ready(function($){
      'use strict';
      var sticky = new Waypoint.Sticky({
        element: $('#site-navigation')[0],
        stuckClass: 'nav-fixed'
      });
    });
  </script>
  <?php endif; ?>
<?php endif; ?>