<?php defined("_JEXEC") or die();?>
<?php

$templateparams = JFactory::getApplication()->getTemplate(true)->params;
$site_logo = $templateparams->get('site_logo');

$doc = JFactory::getDocument();
$menu = JFactory::getApplication()->getMenu();

$activePage = $menu->getActive()->id;
$defaultPage = $menu->getDefault()->id;


///stylesheets
$doc->addStyleSheet(JUri::base().'templates/'.$doc->template.'/css/custom.css');
$doc->addStyleSheet(JUri::base().'templates/'.$doc->template.'/css/flexslider.css');

$doc->addStyleSheet(JUri::base().'templates/'.$doc->template.'/css/liSlidik.blackClasic.css');
$doc->addStyleSheet(JUri::base().'templates/'.$doc->template.'/css/liSlidik.css');
$doc->addStyleSheet(JUri::base().'templates/'.$doc->template.'/css/style.css');

//scripts
$doc->addScript(JUri::base().'templates/'.$doc->template.'/js/demo.js');
$doc->addScript(JUri::base().'templates/'.$doc->template.'/js/froogaloop.js');
$doc->addScript(JUri::base().'templates/'.$doc->template.'/js/functions.js');
$doc->addScript(JUri::base().'templates/'.$doc->template.'/js/jquery.easing.js');
$doc->addScript(JUri::base().'templates/'.$doc->template.'/js/jquery.fitvid.js');

$doc->addScript(JUri::base().'templates/'.$doc->template.'/js/jquery.liSlidik.js');

$doc->addScript(JUri::base().'templates/'.$doc->template.'/js/jquery.mousewheel.js');
$doc->addScript(JUri::base().'templates/'.$doc->template.'/js/jquerypp.custom.js');
$doc->addScript(JUri::base().'templates/'.$doc->template.'/js/modernizr.js');
$doc->addScript(JUri::base().'templates/'.$doc->template.'/js/modernizr.custom.17475.js');

$doc->addScript(JUri::base().'templates/'.$doc->template.'/js/shCore.js');
$doc->addScript(JUri::base().'templates/'.$doc->template.'/js/shBrushCss.js');
$doc->addScript(JUri::base().'templates/'.$doc->template.'/js/shBrushJScript.js');
$doc->addScript(JUri::base().'templates/'.$doc->template.'/js/shBrushXml.js');



	if($doc->countModules("position-0")) {
		$showMainMenu = TRUE;
	}
	
	if($doc->countModules("position-4 or position-5 or position-6")) {
		$showCenterService = TRUE;
	}
?>

<!DOCTYPE>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<jdoc:include type="head" />
</head>

<body>
<div class="karkas">
	<div class="header">
		<?php if($site_logo) :?>
			<a href="<?php echo JUri::base();?>"><img src="<?php echo JUri::base().$site_logo;?>" class="logo" alt="logo" /></a>
		<?php else :?>
			<a href="<?php echo JUri::base();?>"><img src="<?php echo JUri::base();?>templates/<?php echo $doc->template;?>/images/logo.png" class="logo" alt="logo" /></a>
		<?php endif; ?>
    	
        <?php if($showMainMenu) :?>
			<div class="menu">
				<jdoc:include type="modules" name="position-0" style="simple_mobile_empty" />
            <a href="#" id="pull">Меню</a>      
        	</div> 
		<?php endif;?> 
		   
    </div>
	<?php if($doc->countModules('position-1')) :?>
	 <div class="slider">
	 	<jdoc:include type="modules" name="position-1" style="simple_mobile_empty" />
		<p class="slider-shadow"></p>
	 </div>
	 <?php else : ?>
	 
	 <?php $n = rand(1,4);?>
	  
	  <div class="header-page-tittle" style="background:url('<?php echo JUri::base().'templates/'.$doc->template;?>/images/<?php echo $n;?>bg.jpg')">
    	<h1><?php echo $doc->getTitle();?></h1>
    	</div>	
	<?php endif; ?>
	
	<?php if($doc->countModules('position-2')) : ?>
		<jdoc:include type="modules" name="position-2" style="simple_mobile_empty" />
	<?php endif; ?>
	
	
	
	<?php if($activePage != $defaultPage) :?>
		
		<?php if($doc->countModules('position-12')) :?>
		
			<div class="content-main">
		
		<?php elseif($doc->countModules('position-3')) :?>
			
			<div class="portfolio-main">
			<jdoc:include type="modules" name="position-3" style="simple_mobile_empty" />
		
		<?php endif; ?>	
			<jdoc:include type="message"/>
			<jdoc:include type="component"/>
		<?php if($doc->countModules('position-12')) :?>
		<div class="right-bar-main">
			<jdoc:include type="modules" name="position-12" style="simple_mobile_widget" />
		</div>	
		<?php endif; ?>
		
		<?php if($doc->countModules('position-12 or position-3')) :?>
			</div>
		<?php endif; ?>
		
	<?php endif;?>
    
	
      <?php if($showCenterService) :?>
		  <div class="service-main">
		<jdoc:include type="modules" name="position-4" style="simple_mobile_service" />
		<jdoc:include type="modules" name="position-5" style="simple_mobile_service" />
		<jdoc:include type="modules" name="position-6" style="simple_mobile_service" />
		  </div>
	  <?php endif; ?>
      
	  <?php if($doc->countModules('position-7')) : ?>
	  	<div class="latest-progect-main">
	<jdoc:include type="modules" name="position-7" style="simple_mobile_latest" />
		</div>
	  <?php endif; ?>
	  
	   <?php if($doc->countModules('position-7 and position-8')) : ?>
	   	<hr class="orange-hr" />
	   <?php endif; ?>
	   
	   <?php if($doc->countModules('position-8')) : ?>
	  <div class="from-blog-main">
		<jdoc:include type="modules" name="position-8" style="simple_mobile_blog" />
		</div>
	  <?php endif; ?>
	  
	  <?php if($doc->countModules('position-9')) : ?>
	  	<jdoc:include type="modules" name="position-9" style="simple_mobile_empty" />
	  <?php endif; ?>
      
		<div class="newslettersign">
        	<h3>NEWSLETTER SIGNUP</h3>
            <form action="" method="">
            	<input type="text" name="first-name" placeholder="Your name" />
                <input type="email" name="email" placeholder="Your email" />
                <input type="image" src="<?php echo JUri::base().'templates/'.$doc->template;?>/images/joinus.jpg" name="go" />
            </form>
        </div>

        <div class="footer">
		<?php if($doc->countModules('position-13')) : ?>
			<p class="copy">
				<jdoc:include type="modules" name="position-13" style="simple_mobile_empty" />
			</p>
		<?php endif;?>
            <p class="social">
            	<a href="#"><img src="<?php echo JUri::base().'templates/'.$doc->template;?>/images/frss.jpg" alt="" /></a>
                <a href="#"><img src="<?php echo JUri::base().'templates/'.$doc->template;?>/images/fskype.jpg" alt="" /></a>
                <a href="#"><img src="<?php echo JUri::base().'templates/'.$doc->template;?>/images/ftwittr.jpg" alt="" /></a>
                <a href="#"><img src="<?php echo JUri::base().'templates/'.$doc->template;?>/images/ffacebook.jpg" alt="" /></a>
            </p>
            
			<?php if($doc->countModules('position-14')) : ?>
			<p class="ftr-nav">
				<jdoc:include type="modules" name="position-14" style="simple_mobile_empty" />
			</p>
			<?php endif;?>
			<!--<p class="ftr-nav">
            	<a href="#">Contacts</a> | <a href="#">Support</a> | <a href="#">Login</a>
            </p>-->
        </div>
</div>


  <script type="text/javascript">
    jQuery(function(){
      SyntaxHighlighter.all();
    });
	
	
	jQuery(function() {
		var pull 		= jQuery('#pull');
			menu 		= jQuery('.menu ul');
			menuHeight	= menu.height();
		jQuery(pull).on('click', function(e) {
			e.preventDefault();
			menu.slideToggle();
		});
		jQuery(window).resize(function(){
       		var w = jQuery(window).width();
       		if(w > 320 && menu.is(':hidden')) {
       			menu.removeAttr('style');
       		}
   		});
	});

  </script>
</body>
</html>
