<?php
/**
 * The Header template file
 */
$relic_options = get_option('relic_theme_options');
?>
<!DOCTYPE html>
<!--[if !(IE 7) | !(IE 8)  ]><!-->
<html <?php language_attributes(); ?>>
  <!--<![endif]--> 
  <head>
    <meta charset="<?php bloginfo('charset'); ?>">
    <meta name="viewport" content="width=device-width">
    <link rel="profile" href="http://gmpg.org/xfn/11">      
    <?php wp_head(); ?>
  </head>
  <body <?php body_class(); ?>> 
  <?php if ( function_exists( 'wp_body_open' ) ) { wp_body_open();   }  ?>      
    <header>      
        <div class="menubar">
          <div class="webpage-container container">
            <div class="row">
            <?php if (get_theme_mod('topheader_phone',$relic_options['phone']) || (get_theme_mod('topheader_email',$relic_options['email'])) ) { ?>
              <div class="col-md-6">
                <div class="contact-info">
                  <ul>
                    <?php if(get_theme_mod('topheader_phone',$relic_options['phone'])!='') { ?>						
                      <li><i class="fa fa-phone"></i><?php echo esc_html(get_theme_mod('topheader_phone',$relic_options['phone'])); ?></li>
                    <?php } ?>
                    <?php if (get_theme_mod('topheader_email',$relic_options['email'])!='') { ?>						
                      <li><i class="fa fa-envelope"></i><a href="mailto:<?php echo esc_attr(get_theme_mod('topheader_email',$relic_options['email'])); ?>"><?php echo esc_html(get_theme_mod('topheader_email',$relic_options['email'])); ?></a></li> 
                    <?php } ?>							                       
                  </ul>
                </div>
              </div>
            <?php } ?>
              <div class="col-md-6 <?php echo (get_theme_mod('topheader_phone',$relic_options['phone'])!='' || get_theme_mod('topheader_email',$relic_options['email'])!='') ? '' : 'col-md-offset-6'; ?>">
                <div class="social-link">
                  <ul>
                    <?php $TopHeaderSocialIconDefault = array(
                      array('url'=>$relic_options['fburl'],'icon'=>'fa-facebook'),
                      array('url'=>$relic_options['twitter'],'icon'=>'fa-twitter'),
                      array('url'=>$relic_options['gplus'],'icon'=>'fa-google-plus'),
                      array('url'=>$relic_options['linkedin'],'icon'=>'fa-linkedin'),
                      array('url'=>$relic_options['pinterest'],'icon'=>'fa-pinterest'),
                      array('url'=>$relic_options['rss'],'icon'=>'fa-rss'),
                      ); 
                      for($i=1; $i<=6; $i++) : 
                          if(get_theme_mod('TopHeaderSocialIconLink'.$i,'')!=''):?>
                         <li><a href="<?php echo esc_url(get_theme_mod('TopHeaderSocialIconLink'.$i)); ?>" target="_blank">
                              <i class="fa <?php echo esc_attr(get_theme_mod('TopHeaderSocialIcon'.$i,$TopHeaderSocialIconDefault[$i-1]['icon'])); ?>"></i>
                          </a></li>
                    <?php endif; endfor; ?>					                     
                  </ul>
                </div>
              </div>           
          </div>
         </div>
        </div>
     
      <div class="<?php echo (!is_page_template('page-templates/front-page.php')) ? 'menu-bar' : 'transparent-menubar'; ?>">
        <div class="header_bottom">
          <div class="container webpage-container">
            <div class="col-md-12 no-padding-lr"> 
              <div class="header_menu">               
                <div class="col-md-2 logo-display  no-padding-lr">                                    
                  <?php if(has_custom_logo()){
                           the_custom_logo();            
                      } 
                    if (display_header_text()) { ?>		  
                    <a class="home-link" style="color:#<?php echo esc_attr(get_header_textcolor()); ?>!important;" href="<?php echo esc_url(home_url('/')); ?>" title="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>" rel="home">
                      <h2 class="site-title"><?php bloginfo('name'); ?></h2>							
                    </a>
                    <h4 class="site-description"><?php bloginfo('description'); ?></h4>
                    <?php } ?>
                  <div class="navbar-header res-nav-header toggle-respon">
                    <?php if (has_nav_menu('primary')) { ?>
                      <button type="button" class="navbar-toggle" data-toggle="collapse" 
                              data-target="#example-navbar-collapse">
                        <span class="sr-only"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                      </button>
                    <?php } ?>
                  </div>
                </div>                              
                <div class="col-md-10 no-padding-lr">                  
                  <nav class="main_menu navigation-deafault" role="navigation">                
                    <?php
                    if (has_nav_menu('primary')) {
                      
                      wp_nav_menu(array(
                          'theme_location' => 'primary',
                          'container' => 'div',
                          'container_class' => 'collapse navbar-collapse nav_coll main-menu-ul no-padding-lr',
                          'container_id' => 'example-navbar-collapse',
                          'menu_class' => 'gg-navbar',
                          'echo' => true,
                          'items_wrap' => '<ul id="%1$s menu" class="%2$s main-menu">%3$s</ul>',
                          'depth' => 0
                      ));
                    }
                    ?>                                                
                  </nav>	             
                </div>
              </div>				
            </div>
          </div> 
        </div>
      </div>	
    </header>
    <?php
    $relic_header_image = get_header_image();
    if (!empty($relic_header_image)) {
      ?>
      <div class="webpage-container container custom-header">
        <img src="<?php echo esc_url($relic_header_image); ?>" class="header-image img-responsive" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" />
      </div>
    <?php } ?>
