<?php
/**
* @package   yoo_master
* @author    YOOtheme http://www.yootheme.com
* @copyright Copyright (C) YOOtheme GmbH
* @license   http://www.gnu.org/licenses/gpl.html GNU/GPL
*/

// get template configuration
include($this['path']->path('layouts:template.config.php'));
	
?>
<!DOCTYPE HTML>
<html lang="<?php echo $this['config']->get('language'); ?>" dir="<?php echo $this['config']->get('direction'); ?>">

<head>
<?php echo $this['template']->render('head'); ?>
</head>

<link href='http://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>

<body id="page" class="page <?php echo $this['config']->get('body_classes'); ?>" data-config='<?php echo $this['config']->get('body_config','{}'); ?>'>

	<?php if ($this['modules']->count('absolute')) : ?>
	<div id="absolute">
		<?php echo $this['modules']->render('absolute'); ?>
	</div>
	<?php endif; ?>
	
	<div id="block-header">

		<?php if ($this['modules']->count('toolbar-l + toolbar-r') || $this['config']->get('date')) : ?>
		<div id="block-toolbar">
			<div class="wrapper <?php if($this['config']->get('block-toolbar')) echo 'max-width'.$this['config']->get('block-toolbar'); ?>">

				<div id="toolbar" class="clearfix">	
					<?php if ($this['modules']->count('toolbar-l') || $this['config']->get('date')) : ?>
					<div class="float-left">
					
						<?php if ($this['config']->get('date')) : ?>
						<time datetime="<?php echo $this['config']->get('datetime'); ?>"><?php echo $this['config']->get('actual_date'); ?></time>
						<?php endif; ?>
					
						<?php echo $this['modules']->render('toolbar-l'); ?>
						
					</div>
					<?php endif; ?>
						
					<?php if ($this['modules']->count('toolbar-r')) : ?>
					<div class="float-right"><?php echo $this['modules']->render('toolbar-r'); ?></div>
					<?php endif; ?>
				</div>
				
			</div>
		</div>
		<?php endif; ?>

		<?php if ($this['modules']->count('logo + menu')) : ?>
		<div id="block-headerbar">
			<div class="wrapper <?php if($this['config']->get('block-headerbar')) echo 'max-width'.$this['config']->get('block-headerbar'); ?>">

				<header id="header" class="clearfix">

					<?php if ($this['modules']->count('logo')) : ?>	
					<a id="logo" href="<?php echo $this['config']->get('site_url'); ?>"><?php echo $this['modules']->render('logo'); ?></a>
					<?php endif; ?>

					<?php if ($this['modules']->count('menu')) : ?>
					<div id="menubar">
						
						<?php if ($this['modules']->count('menu')) : ?>
						<nav id="menu"><?php echo $this['modules']->render('menu'); ?></nav>
						<?php endif; ?>
						
					</div>
					<?php endif; ?>	

				</header>

			</div>
		</div>
		<?php endif; ?>

	</div>

	                <?php if ($this['modules']->count('top-a')) : ?> 
                        <div id="block-top-a" class="<?php echo $this['config']->get('top-a-bg'); ?>">
                        <div class="block-top-a wrapper <?php if($this['config']->get('block-top-a')) echo 'max-width'.$this['config']->get('block-top-a'); ?>">
   
                        <section id="top-a" class="grid-block"><?php echo $this['modules']->render('top-a', array('layout'=>$this['config']->get('top-a'))); ?></section>
   
 
        </div>
        </div>
        <?php endif; ?>

	                <?php if ($this['modules']->count('top-b')) : ?> 
                        <div id="block-top-b" class="<?php echo $this['config']->get('top-b-bg'); ?>">
                        <div class="block-top-b wrapper <?php if($this['config']->get('block-top-b')) echo 'max-width'.$this['config']->get('block-top-b'); ?>">
   
                        <section id="top-b" class="grid-block"><?php echo $this['modules']->render('top-b', array('layout'=>$this['config']->get('top-b'))); ?></section>
   
 
        </div>
        </div>
        <?php endif; ?>

	                <?php if ($this['modules']->count('top-c')) : ?> 
                        <div id="block-top-c" class="<?php echo $this['config']->get('top-c-bg'); ?>">
                        <div class="block-top-c wrapper <?php if($this['config']->get('block-top-c')) echo 'max-width'.$this['config']->get('block-top-c'); ?>">
   
                        <section id="top-c" class="grid-block"><?php echo $this['modules']->render('top-c', array('layout'=>$this['config']->get('top-c'))); ?></section>
   
 
        </div>
        </div>
        <?php endif; ?>
		

        <div class="block-main wrapper <?php if($this['config']->get('block-main')) echo 'max-width'.$this['config']->get('block-main'); ?>">	

	
		<?php if ($this['modules']->count('innertop + innerbottom + sidebar-a + sidebar-b') || $this['config']->get('system_output')) : ?>
		<div id="main" class="grid-block">

			<div id="maininner" class="grid-box">

				<?php if ($this['modules']->count('innertop')) : ?>
				<section id="innertop" class="grid-block"><?php echo $this['modules']->render('innertop', array('layout'=>$this['config']->get('innertop'))); ?></section>
				<?php endif; ?>

				<?php if ($this['modules']->count('breadcrumbs')) : ?>
				<section id="breadcrumbs"><?php echo $this['modules']->render('breadcrumbs'); ?></section>
				<?php endif; ?>

				<?php if ($this['config']->get('system_output')) : ?>
				<section id="content" class="grid-block"><?php echo $this['template']->render('content'); ?></section>
				<?php endif; ?>

				<?php if ($this['modules']->count('innerbottom')) : ?>
				<section id="innerbottom" class="grid-block"><?php echo $this['modules']->render('innerbottom', array('layout'=>$this['config']->get('innerbottom'))); ?></section>
				<?php endif; ?>

			</div>
			<!-- maininner end -->
			
			<?php if ($this['modules']->count('sidebar-a')) : ?>
			<aside id="sidebar-a" class="grid-box"><?php echo $this['modules']->render('sidebar-a', array('layout'=>'stack')); ?></aside>
			<?php endif; ?>
			
			<?php if ($this['modules']->count('sidebar-b')) : ?>
			<aside id="sidebar-b" class="grid-box"><?php echo $this['modules']->render('sidebar-b', array('layout'=>'stack')); ?></aside>
			<?php endif; ?>

		</div>
		<?php endif; ?>
		<!-- main end -->

	</div></div>

	<?php if ($this['modules']->count('bottom-a')) : ?>
                        <div id="block-bottom-a" class="<?php echo $this['config']->get('bottom-a-bg'); ?>">
                        <div class="block-bottom-a wrapper <?php if($this['config']->get('block-bottom-a')) echo 'max-width'.$this['config']->get('block-bottom-a'); ?>">

		<section id="bottom-a" class="grid-block"><?php echo $this['modules']->render('bottom-a', array('layout'=>$this['config']->get('bottom-a'))); ?></section>

	</div></div>
	<?php endif; ?>

	<?php if ($this['modules']->count('bottom-b')) : ?>
                        <div id="block-bottom-b" class="<?php echo $this['config']->get('bottom-b-bg'); ?>">
                        <div class="block-bottom-b wrapper <?php if($this['config']->get('block-bottom-b')) echo 'max-width'.$this['config']->get('block-bottom-b'); ?>">

		<section id="bottom-b" class="grid-block"><?php echo $this['modules']->render('bottom-b', array('layout'=>$this['config']->get('bottom-b'))); ?></section>

	</div></div>
	<?php endif; ?>

	<?php if ($this['modules']->count('bottom-b2')) : ?>
                        <div id="block-bottom-b2" class="<?php echo $this['config']->get('bottom-b2-bg'); ?>">
                        <div class="block-bottom-b2 wrapper <?php if($this['config']->get('block-bottom-b2')) echo 'max-width'.$this['config']->get('block-bottom-b2'); ?>">

		<section id="bottom-b2" class="grid-block"><?php echo $this['modules']->render('bottom-b2', array('layout'=>$this['config']->get('bottom-b2'))); ?></section>

	</div></div>
	<?php endif; ?>

	<?php if ($this['modules']->count('bottom-c')) : ?>
                        <div id="block-bottom-c" class="<?php echo $this['config']->get('bottom-c-bg'); ?>">
                        <div class="block-bottom-c wrapper <?php if($this['config']->get('block-bottom-c')) echo 'max-width'.$this['config']->get('block-bottom-c'); ?>">

		<section id="bottom-c" class="grid-block"><?php echo $this['modules']->render('bottom-c', array('layout'=>$this['config']->get('bottom-c'))); ?></section>

	</div></div>
	<?php endif; ?>

	<?php if ($this['modules']->count('footer + debug') || $this['config']->get('warp_branding') || $this['config']->get('totop_scroller')) : ?>
	<div id="block-footer"><div class="wrapper">

		<footer id="footer">

			<?php if ($this['config']->get('totop_scroller')) : ?>
			<a id="totop-scroller" href="#page"></a>
			<?php endif; ?>

			<?php
				echo $this['modules']->render('footer');
				$this->output('warp_branding');
				echo $this['modules']->render('debug');
			?>

		</footer>
		
	</div></div>
	<?php endif; ?>
	
	<?php echo $this->render('footer'); ?>
	
</body>
</html>