<ul id="menu4">
	{{function name="menu4_recursion" list=$aMenu sub=1}}
		{{foreach from=$list item=aData}}
			<li id="menu4_{{$aData.iPage}}" {{if $aData.bProductItem || $aData.bParent || $aData.iStatus == 0}}class="{{if $aData.bProductItem}}product_item{{/if}} {{if $aData.bParent}}parent{{/if}} {{if $aData.iStatus == 0}}admin{{/if}}"{{/if}}><a href="{{$aData.sLinkName}}" {{if $aData.bSelected}}class="selected"{{/if}}>{{$aData.sName}}{{if !empty($aData.iProductsCount)}}<span class="products-count">&nbsp;({{$aData.iProductsCount}})</span>{{/if}}</a>
				{{if count($aData.sub) > 0}}
					<ul class="sub{{$sub}}">
						{{menu4_recursion list=$aData.sub sub=$sub+1}}
					</ul>
				{{/if}}
			</li>
		{{/foreach}}
	{{/function}}
	{{menu4_recursion list=$aMenu sub=1}}
</ul>