<ul  class="content_inner menu_items">
	{* define the function *} 
	{assign var="parentCount" value=0}
	{function name=categories level=0}
		{foreach from=$data item="productCategory"} 
			<li {if (!(isset($productCategory['children']) && is_array($productCategory['children']) && !empty($productCategory['children']))) || ($parentCount>=10 && $level==0)} class="no-child" {/if}>
			{if $parentCount>=10 && $level==0}
			{html->anchor  href="categories/" content="{$language.lblSeeAllCategories}"}
			</li>	
			{break}
			{/if}			
			{if $level==0}
			{assign var="parentCount" value=$parentCount+1}
			{/if}
				{if $level==1}
					{html->anchor href="{$productCategory.productCategoryID|sef_path:'catalog'}" content="{$productCategory.productCategoryName}"}
				{else if $level==0}
					{html->anchor href="/{$productCategory.productCategoryID|sef_path:'catalog'}" content="{$productCategory.productCategoryName}" class="icon-arrow-right"}
				{else}	
				{html->anchor href="/{$productCategory.productCategoryID|sef_path:'catalog'}" content="{$productCategory.productCategoryName}"}	
				{/if}
			{if isset($productCategory['children']) && is_array($productCategory['children']) && !empty($productCategory['children'])}
				{if $level<1}
					<div class="child">
		              <div class="sub_menu">
                         
					{/if}
                     {if ! $level <1 && $level<2}
                      <div class="child section3">
						<div class="sub_menu_sections">
							<div class="sub_menu_links">    
				            
                    {/if} 
                    <ul {if $level<1}class="sub_menu_list"{/if}{if $level==1}class="sub-menu-level2 clearfix"{/if} {if $level==2}class="sub-menu-level3"{/if}>
					{call name=categories data=$productCategory['children'] level=$level+1} 
					 </ul>
					 {if ! $level <1 && $level<2}
                            </div></div></div>
                    {/if}
				    {if $level<1}
                        </div></div>
					{/if}
                          
			{else}
				{if (is_array($productCategory)) && (isset($productCategory['menuItemID'])) && (is_numeric($productCategory['menuItemID']))}
				</li>	
				{/if}
			{/if}
		{/foreach}  
	{/function}
	{call categories data=$CategoryMenus} 
</ul>


		
