<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     rwd_default
 * @copyright   Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
/**
 * @var Mage_Page_Block_Html_Header $this
 */
?>

<div class="header-language-background">
    <div class="header-language-container">
        <div class="store-language-container">
            <?php echo $this->getChildHtml('store_language') ?>
        </div>

        <?php echo $this->getChildHtml('currency_switcher') ?>

        <p class="welcome-msg"><?php echo $this->getChildHtml('welcome') ?> <?php echo $this->getAdditionalHtml() ?></p>
    </div>
</div>

<header id="header" class="page-header">
    <div class="page-header-container">
        <a class="logo" href="<?php echo $this->getUrl('') ?>">
            <img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" class="large" />
            <img src="<?php echo $this->getLogoSrcSmall() ?>" alt="<?php echo $this->getLogoAlt() ?>" class="small" />
        </a>

        <?php // In order for the language switcher to display next to logo on smaller viewports, it will be moved here.
              // See app.js for details ?>
        <div class="store-language-container"></div>

        <!-- Skip Links -->

        <div class="skip-links">
            <a href="#header-nav" class="skip-link skip-nav">
                <span class="icon"></span>
                <span class="label"><?php echo $this->__('Menu'); ?></span>
            </a>

            <a href="#header-search" class="skip-link skip-search">
                <span class="icon"></span>
                <span class="label"><?php echo $this->__('Search'); ?></span>
            </a>

            <!--<div class="account-cart-wrapper">
                <a href="<?php echo $this->helper('customer')->getAccountUrl(); ?>" data-target-element="#header-account" class="skip-link skip-account">
                    <span class="icon"></span>
                    <span class="label"><?php echo $this->__('Account'); ?></span>
                </a>

                
                   
                <div class="header-minicart">
                    <?php echo $this->getChildHtml('minicart_head'); ?>
                </div>
            </div>-->


        </div>

        <!-- Navigation -->

        <div id="header-nav" class="skip-content">
            <?php echo $this->getChildHtml('topMenu') ?>
        </div>

        <!-- Search -->

        <div id="header-search" class="skip-content">
            <?php echo $this->getChildHtml('topSearch') ?>
        </div>

        <!-- Account -->

        <div id="header-account" class="skip-contents">
            <?php echo $this->getChildHtml('topLinks') ?>
        </div>
		
            <div class="account-cart-wrapper">
             <div class="myorder"><a href="<?php echo Mage::getBaseUrl(); ?>sales/order/history/">My Orders</a></div>
                <div class="header-minicart">
                    <?php echo $this->getChildHtml('minicart_head'); ?>
                </div>
            </div>
    </div>
</header>

<?php if(Mage::getSingleton('cms/page')->getIdentifier() == 'home'  && Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms') { ?>
 <div class="home-submenu">
 <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('home-sub-menu')->toHtml(); ?>
 </div>

<?php
}
?>

<?php

     $layer = Mage::getSingleton('catalog/layer');
    $_category = $layer->getCurrentCategory();
     $currentCategoryId= $_category->getId();
	 
	 if($currentCategoryId!=2)
	 {
	   ?>
	     
    <div class="juice-submenu">
	
        <div class="col-xs-12 col-sm-2 col-md-2">
         <div class="pull-left">   
             <div class="catname">
    		 <?php echo  $_category->getName(); ?>
    		 </div>
         </div>
        </div>

        <div class="col-xs-12 col-sm-10 col-md-10"> 
	    
        <div class="pull-right">
        <div class="submenu">
          <ul >
	   <?php
        $categories = Mage::getModel('catalog/category')->getCategories($currentCategoryId);
       $i=1;
      foreach($categories as $category):
	  
	   $cat = Mage::getModel('catalog/category')->load($category->getId());
                $subcats = $cat->getChildren();
				
				if($subcats!='')
				{
				 $childclass='inactive';
				}else
				{
				 $childclass='';
				}
				
				if($cat->getIsActive()){
?>
				<li  id="<?php echo $category->getId() ?>" class="smenu menu<?php echo $category->getParentId() ?> lvl<?php echo $level; ?>-<?php echo $category->getParentId() ?> level-<?php echo $level; ?> <?php echo $childclass; ?>">
				<a href="<?php echo Mage::getBaseUrl(); ?>juices.html#<?php echo $i; ?><?php //echo $cat->getUrl() ?>"><?php echo $category->getName() ?></a></li>
				<?php
				$i++;
				?>
				
				<?php }?>
				<?php endforeach; ?>
				</ul>
				</div>

            </div>    
        </div>
       

	   <div class="clearfix"> </div>
	   <script>
	   jQuery('.smenu').click(function(){
	   	     
		 jQuery('.smenu').removeClass('active');
         jQuery('#'+this.id).addClass('active');	

        
		
	   })
	  
	   </script>
    </div>
                
		<?php
		}
		?>
<?php echo $this->getChildHtml('topContainer'); ?>


