<script>
$(document).ready(function(){
    
   	var div;
	$('.header-table').click(function(){
		div=$(this).parent();
		tt=$(this);
		if(!$(this).hasClass('active')){
			tt.addClass('active');
			div.find('.v_dsc').slideDown(function(){
				
			});
		} else {
			
			div.find('.v_dsc').slideUp(function(){
			tt.removeClass('active');	
			});
		}
	}); 
 
});
</script>
<div class="box">
  <div class="box-heading-manufacturer"><?php echo $heading_title; ?></div>
  <div class="box-content">
  <div >
    <ul class="box-category">
      <?php foreach ($categories as $category) { ?>
	  <div>
      <li>
        <?php if ($category['category_id'] == $category_id){ ?>
		<div class='header-table active'><?php echo $category['name']; ?></div>
        <?php if ($category['children']) { ?>
        <ul class="v_dsc onepanel">
		
          <?php foreach ($category['children'] as $child) { ?>
           <div class="sdvig"><li>
            <?php if ($child['category_id'] == $child_id) { ?>
            <a href="<?php echo $child['href']; ?>" class="active1"> - <?php echo $child['name']; ?></a>
            <?php } else { ?>
            <a href="<?php echo $child['href']; ?>"> - <?php echo $child['name']; ?></a>
            <?php } ?>
          </li></div>
          <?php } ?>
        </ul>
        <?php } ?>
        <?php } else if((empty($category['children']))){ ?>
		
       <div class="headertablea"><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></div>
	    <?php } else if((!empty($category['children']))){ ?>
		<div class="header-table"> <?php echo $category['name']; ?></div>
		 <?php } else if((empty($category['children']))){ ?>
		<?php } ?>
        <?php if ($category['children']) { ?>
        <ul class="v_dsc">
		
          <?php foreach ($category['children'] as $child) { ?>
          <div class="sdvig"> <li>
            <?php if ($child['category_id'] == $child_id) { ?>
            <a href="<?php echo $child['href']; ?>" class="active1"> - <?php echo $child['name']; ?></a>
            <?php } else { ?>
            <a href="<?php echo $child['href']; ?>"> - <?php echo $child['name']; ?></a>
            <?php } ?>
          </li></div>
          <?php } ?>
        </ul>
        <?php } ?>
      </li></div>
      <?php } ?>
    </ul>
  </div> </div>
</div>
