<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html lang="<?php echo LANGUAGE?>" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html lang="<?php echo LANGUAGE?>" class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html lang="<?php echo LANGUAGE?>" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="<?php echo LANGUAGE?>" class="no-js"> <!--<![endif]-->

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1" />
    <meta name="viewport" content="width=device-width" />
    
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600|Open+Sans+Condensed:300,300italic,700' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="<?php echo $this->getThemePath(); ?>/css/base.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo $this->getStyleSheet('typography.css')?>" />
    <link rel="stylesheet" type="text/css" href="<?php echo $this->getStyleSheet('main.css')?>" />
    
    <script src="<?php echo $this->getThemePath(); ?>/js/vendor/custom.modernizr.js"></script>
    
    <?php
	//Load prettyPhoto with "unique item handles", to avoid conflicts with other addons that use them
	$html = Loader::helper('html');
	$this->addHeaderItem($html->css($this->getThemePath() . '/js/prettyPhoto/css/prettyPhoto.css', null, array('handle' => 'jquery.prettyPhoto', 'version' => '3.1.5')));
	$this->addHeaderItem($html->javascript($this->getThemePath() . '/js/prettyPhoto/jquery.prettyPhoto.js', null, array('handle' => 'jquery.prettyPhoto', 'version' => '3.1.5')));
	
	Loader::element('header_required');
	?>
        
    <?php  if ($c->isEditMode()) { ?>
	<style type="text/css">
		body { position: static; }
	</style>
    <?php } ?>
    
    <?php $up = new Permissions(Page::getCurrentPage()) ?>
	<?php if($up->canAdminPage()): ?>
    <style type="text/css">
		.fixed { top: 49px; }
	</style>
    <?php endif; ?>

</head>

<body id="page<?php echo $c->getCollectionID() ?>" class="<?php echo $c->getCollectionTypeHandle() ?>">

	<header id="header" class="fixed" role="banner">
  <div class="row">
        <nav id="nav" class="top-bar" role="navigation">
            <ul class="title-area">
                <li class="name">
                    <?php $stack = Stack::getByName('Site Name');?>
                    <?php if($stack) $stack->display(); else echo '<a href="'. DIR_REL .'/" title="'. SITE .'">'. SITE .'</a>'; ?>
                </li>
                <li class="toggle-topbar menu-icon"><a href="#"><span><?php echo t('Menu')?></span></a></li>
            </ul><!-- .title-area ends -->
   		  	<section class="top-bar-section">
                <?php
				$bt = BlockType::getByHandle('autonav');
				$bt->controller->displayPages = 'top';
				$bt->controller->orderBy = 'display_asc';                    
				$bt->controller->displaySubPages = 'all'; 
				$bt->controller->displaySubPageLevels = 'all';
				$bt->render('templates/main_menu');
				?>
            </section><!-- .top-bar-section ends -->
        </nav><!-- #nav ends -->
  </div>
    </header><!-- #header ends -->
