<?php
// no direct file access
if(count(get_included_files())==1) die(header("Location: ../index.php",TRUE,301));
?><!DOCTYPE html>
<html lang="en-CA">
   <head>
		<?php
		  if (function_exists('simplepagehead')) { 
		  simplepagehead('/', 1, 0, 0); 
		} else {
			// Fallback if simplepagehead is not available. The functions page_titel, page_description and page_keywords deliver the values from the general settings and/or the page settings; the charset is usually set to UTF-8.
			?>
			<title><?php page_title(); ?></title>
			<meta http-equiv="Content-Type" content="text/html; charset=<?php if(defined('DEFAULT_CHARSET')) { echo DEFAULT_CHARSET; } else { echo 'utf-8'; }?>" />
			<meta name="description" content="<?php page_description(); ?>" />
			<meta name="keywords" content="<?php page_keywords(); ?>" />		
			<?php
			}
			// Generate vistor statistic if module is installed. WB_PATH is a constant which contents the absolute path to the WBCE CMS files  in the server's file system.
		if (file_exists(WB_PATH.'/modules/wbstats/count.php')) { 
			include (WB_PATH.'/modules/wbstats/count.php'); 
		} 
		?>
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="stylesheet" href="<?php echo TEMPLATE_DIR; ?>/css/components.css">
		<link rel="stylesheet" href="<?php echo TEMPLATE_DIR; ?>/css/icons.css">
		<link rel="stylesheet" href="<?php echo TEMPLATE_DIR; ?>/css/responsee.css">      

		<link rel="stylesheet" href="<?php echo TEMPLATE_DIR; ?>/css/template.css">
		
		<?php
		$font[] = 'https://fonts.googleapis.com/css?family=Bree+Serif|Lobster&display=swap';
		$font_format = 'woff'; // optional values 'woff' / 'woff2' / 'woff2-unicode'
		include 'google_fonts.php';
		?>
		
		<?php if (!file_exists(WB_PATH.'/modules/cookieconsent/include.php')) { ?>

		<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css" />
		<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
		<script>
		window.addEventListener("load", function(){
		window.cookieconsent.initialise({
		  "palette": {
			"popup": {
			  "background": "#216942",
			  "text": "#b2d192"
			},
			"button": {
			  "background": "#afed71"
			}
		  },
		  "showLink": false,
		  "theme": "edgeless",
		  "content": {
			"message": "This Website uses &quot;cookies&quot; to send you the right information.",
			"dismiss": "Okay!"
		  }
		})});
		</script>
		
		<?php		
		} // file_exists cookie_consent
		
		register_frontend_modfiles('css');
		register_frontend_modfiles('jquery');
		register_frontend_modfiles('js');
		
		
		 $mainnav = show_menu2(
			$aMenu          = 1,
			$aStart         = SM2_ROOT,
			$aMaxLevel      = SM2_ALL,
			$aOptions       = SM2_ALL|SM2_PRETTY|SM2_BUFFER,
			$aItemOpen      = '<li><a [if (class!=menu-expand) {href="[url]" class="[class]" target="[target]"}]>[menu_title]</a>',
			$aItemClose     = '</li>',
			$aMenuOpen      = '<ul>',
			$aMenuClose     = '</ul>',
			$aTopItemOpen   = false,
			$aTopMenuOpen   = '<ul class="chevron">'
		  );	
		  
		  if (FRONTEND_LOGIN) {
			  if (is_numeric($wb->get_session('USER_ID'))) {
				  $loginlink = '<li><a href="'.LOGOUT_URL.'"><i class="icon-sli-lock-open"></i></a></li><li><a href="'.PREFERENCES_URL.'"><i class="icon-sli-settings"></i></a></li>';
			  } else {	  
				$loginlink = '<li><a href="'.LOGIN_URL.'"><i class="icon-sli-lock"></i></a></li>';
			  }
		  } else {
			  $loginlink = '';
		  }
		  
		  $metanav = show_menu2(
			$aMenu          = 2,
			$aStart         = SM2_ROOT,
			$aMaxLevel      = SM2_START,
			$aOptions       = SM2_ALL|SM2_BUFFER,
			$aItemOpen      = '<li><a href="[url]" class="[class]" target="[target]">[menu_title]</a>',
			$aItemClose     = '</li>',
			$aMenuOpen      = '<ul>',
			$aMenuClose     = $loginlink.'</ul>',
			$aTopItemOpen   = false,
			$aTopMenuOpen   = '<ul>'
		  );	
		
		
		require_once __DIR__.'/info.php';
		foreach($block as $k=>$v){
			ob_start(); 
			page_content($k); 
			$block[$k] = ob_get_clean();
		}
		
		if(defined('TOPIC_BLOCK2') AND TOPIC_BLOCK2 != '') { 
		 	$block[2] = TOPIC_BLOCK2;
		}
	 ?>
		
   </head>
   
   <body class="size-1140">
      <a id="go_to_top"></a>
      <header>
		<div class="line">
			<?php if (SHOW_SEARCH) { ?>
			<div class="s-12 m-6">
				<form class="wbcesuche" name="search" action="<?php echo WB_URL; ?>/search/index.php" method="get">
				<input type="hidden" name="referrer" value="<?php echo defined('REFERRER_ID') ? REFERRER_ID : PAGE_ID; ?>" />
				<input type="text" name="string" class="search" placeholder="<?php echo $TEXT['SEARCH']; ?>" />
				<input type="submit" name="wb_search" value="&#xe090;" />
			</form>
			</div>
			<?php } ?>
			<div class="s-12 <?php if (SHOW_SEARCH) { ?>m-6<?php } ?> text-right metanav">
				<?php if ($metanav!="") {
					echo  $metanav;
				} else {
					echo '<ul>'.$loginlink.'</ul>';
				}
				?>
			</div>
		</div>
         <div class="line">
            <div class="box margin-bottom">
               <div class="s-12 ">
                 <h1><a href="<?php echo WB_URL; ?>"><?php echo WEBSITE_TITLE; ?></a></h1>
               </div>
            </div>
         </div>
         <!-- TOP NAV -->  
         <div class="line">
            <nav class="margin-bottom">
               <p class="nav-text">Navigation</p>
               <div class="top-nav s-12">
                 <?php echo $mainnav; ?>
               </div>               
            </nav>
         </div>
      </header>
      <section class="contentbox">
         
          
         <div class="line">
            <div class="margin">
               <?php if ($block[3]!='') { echo $block[3]; } ?>
            </div>
         </div>
         
         <div class="line">
            <div class="box margin-bottom">
               <div class="margin">
				   <?php if ($block[2]!='') {  ?>
                  <article class="s-12 m-7 l-8">
                    <h1><?php echo PAGE_TITLE; ?></h1>
                    <?php echo $block[1]; ?>
                  </article>
                  <!-- ASIDE NAV -->
                  <div class="s-12 m-5 l-4">
                    <?php echo $block[2]; ?>
                  </div>
				   <?php } else { ?>
				    <article class="s-12">
                    <h1><?php echo PAGE_TITLE; ?></h1>
                    <?php echo $block[1]; ?>
					</article>
				   <?php } ?>
               </div>
            </div>
         </div>
            <div class="line">
            <div class="margin">
               <?php if ($block[4]!='') { echo $block[4]; } ?>
            </div>
         </div>
      </section>
      <!-- FOOTER -->
      <footer class="line">
         <div class="box">
            <div class="s-12 l-6">
               <?php echo WEBSITE_HEADER; ?>
            </div>
            <div class="s-12 l-6 text-right">
              <?php echo WEBSITE_FOOTER; ?>
            </div>
         </div>
		 <div class="text-center backtotop">
			<a href="#go_to_top">&ndash; <i class="icon-sli-arrow-up"></i> &ndash;</a>
		 </div>
      </footer>                                                                   
      <script type="text/javascript" src="<?php echo TEMPLATE_DIR; ?>/js/responsee.js"></script>               
     
   </body>
</html>