<?php
/**
 * The template for displaying the header
 *
 * Displays all of the head element and everything up until the "site-content" div.
 *
 * @package WordPress
 * @subpackage Twenty_Fifteen
 * @since Twenty Fifteen 1.0
 */
?><!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
<?php
    $defaultLogo = get_template_directory_uri().'/images/logo-white.png';
    $defaultSticky = get_template_directory_uri().'/images/logo-blue.png';
    $favivonLogo = get_field('favicon_icon', 'option');
    $headerLogo  = get_field('header_logo', 'option');
    $stickyLogo  = get_field('sticky_logo', 'option');
    $bookOnlineText   = get_field('book_online_text', 'option');
    $bookOnlineLink   = get_field('book_online_link', 'option');
    $learnOnlineText  = get_field('learn_online_text', 'option');
    $learnOnlineLink  = get_field('learn_online_link', 'option');
    $loginText        = get_field('login_text', 'option');
    $loginRedirectTo  = get_field('login_redirect_to', 'option');
?>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="profile" href="http://gmpg.org/xfn/11">
	<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
	<link rel="shortcut icon" href="<?php if($favivonLogo): echo $favivonLogo; else: echo site_url().'/wp-content/uploads/2019/02/favicon.ico'; endif; ?>" />
	<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600" rel="stylesheet">
	
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-TC3FJHH');</script>
<!-- End Google Tag Manager -->
	
	<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
	<header class="main-header d-block clearfix">
        <div class="header-top-part d-block clearfix">
            <div class="pull-right quick-links">
                <div class="container-large">
                    <ul>
                        <li class="book-online">
                            <span>
                                <a href="<?php if($bookOnlineLink): echo $bookOnlineLink; else: echo 'javascript:void(0)'; endif; ?>" target="_blank"><?php if($bookOnlineText) : echo $bookOnlineText; else: echo 'Book online'; endif; ?></a>
                            </span>
                        </li>
                        <li class="learn-online">
                            <span>
                                <a href="<?php if($learnOnlineLink): echo $learnOnlineLink; else: echo 'javascript:void(0)'; endif; ?>" target="_blank"><?php if($learnOnlineText) : echo $learnOnlineText; else: echo 'Learn Online'; endif; ?></a>
                            </span>
                        </li>
                        <li class="worldmark-ac">
                            <span>
                                <a href="<?php if($loginRedirectTo): echo $loginRedirectTo; else: echo 'javascript:void(0)'; endif; ?>" target="_blank"><?php if($loginText) : echo $loginText; else: echo 'Login into your Worldmark account'; endif; ?></a>
                            </span>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="header-bt-part d-block clearfix">
            <div class="container-large">
                <div class="logo">
                    <a href="<?php echo site_url(); ?>">
                        <img src="<?php if($headerLogo): echo $headerLogo; else: echo $defaultLogo; endif; ?>" alt="<?php if($headerLogo) : echo pathinfo($headerLogo, PATHINFO_FILENAME); else: echo pathinfo($defaultLogo, PATHINFO_FILENAME); endif; ?>">
                        <img src="<?php if($stickyLogo): echo $stickyLogo; else: echo $defaultSticky; endif; ?>" alt="<?php if($stickyLogo) : echo pathinfo($stickyLogo, PATHINFO_FILENAME); else: echo pathinfo($defaultSticky, PATHINFO_FILENAME); endif; ?>">
                    </a>
                </div>
                <div class="top-menu">
                    <a href="javascript:void(0)" class="menuImage nav-icon"> <span></span> <span></span> <span></span> </a>
                    <div class="menu iphonNav" >
                        <?php
                            $defaults = array(
                                'menu' => 'Main Menu',
                                'container' => 'div',
                                'menu_class' => 'nav-item',
                                'echo' => true,
                                'fallback_cb' => 'wp_page_menu',
                                'items_wrap' => '<ul id="nav" >%3$s</ul>',
                                'item_spacing' => 'preserve',
                                'depth' => 0,
                                'theme_location' => 'primary-menu'
                            );
                            wp_nav_menu( $defaults); 
                        ?>
                    </div>
                </div>
            </div>
        </div>
    </header>