<nav class="allsort clearfix" id="menu-container">
   <ul id="nav">
    <?php foreach ($categories as $k=>$category) { ?>
       <li class="item nav-<?php echo $k+1; ?>">
                <a href="<?php echo $category['href']; ?>"><span><?php echo $category['name']; ?></span><i class="icon-chevron-right"></i></a>
			  <div class="sub-menu">
				<div class="subitem">					
					<?php  foreach ($category['columns'] as $category_column) { ?>		
				 	
				     	<dl>
		                     <?php foreach ($category_column as $level_2_category){?>	
		                     			                      
		                     	<dt><a href="<?php echo $level_2_category['href']; ?>"><?php echo $level_2_category['name']; ?></a></dt>		       
		                     	<?php if (count($level_2_category['child_3'])>0){?>	
		                     	<dd>
					                <?php foreach ($level_2_category['child_3'] as $level_3_category){?>
							        <em><a href="<?php echo $level_3_category['href']; ?>"><?php echo $level_3_category['name'];?></a></em>					          
							       	<?php }?>
					          	</dd>	
						        <?php }?>	
						      <?php }?>
		                 </dl>
                     <?php } ?>  
			    </div>
			 </div>
	    </li>	   
 <?php }?>
 </ul>
</nav>
<section class="mobile visible-xs mp_sidebar">
    <nav id="mp-menu" class="mp-menu mp-cover mp-level">
          <ul id="nav-mobile">
            <?php foreach ($categories as $k=>$category) { ?>
                  <li class="level0 nav-<?php echo $k+1; ?> level-top parent"><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
            <?php }?>
           </ul>
    </nav>
</section>
<script type=text/javascript> 
	$(function(){
		$("#nav .item:last").addClass("last");
		$("#nav li").hover(function() {
			$(this).siblings('li').removeClass('active');
			$(this).addClass('active')
			},function(){
			$(this).removeClass('active');			
    	});
	})
</script>

