{% if (registry.has('theme_options') == constant('true')) %} 
	{% set theme_options = registry.get('theme_options') %} 
	<div class="box box-with-categories {% if (theme_options.get( 'category_box_style' ) == '3') %} {{ 'category-box-type-4 category-box-type-2' }} {% endif %} {% if (theme_options.get( 'category_box_style' ) == '2') %} {{ 'category-box-type-3 category-box-type-2' }} {% endif %} {% if (theme_options.get( 'category_box_style' ) == '1') %} {{ 'category-box-type-2' }} {% endif %} box-no-advanced">
	  <div class="box-heading">{{ heading_title }}</div>
	  <div class="strip-line"></div>
	  <div class="box-content box-category">
	    <ul class="accordion" id="accordion-category">
	      {% set i = 0 %} {% for category in categories %} 
	      {% set i = i + 1 %} 
	      {% set first = category['category_id'] %} 
	      <li class="panel">
	        {% if (category['category_id'] == category_id) %} 
	        <a href="{{ category['href'] }}" class="active">{{ category['name'] }}</a>
	        {% else %} 
	        <a href="{{ category['href'] }}">{{ category['name'] }}</a>
	        {% endif %} 

	        {% set categories_2 = theme_options.getCategories(category['category_id']) %} 
	        {% if (categories_2) %} 
	        <span class="head"><a style="float:right;padding-right:5px" class="accordion-toggle{% if (category['category_id'] != category_id) %} {{ ' collapsed' }} {% endif %}" data-toggle="collapse" data-parent="#accordion-category" href="#category{{ i }}"><span class="plus">+</span><span class="minus">-</span></a></span>
	        {% if (categories_2 is not empty) %} 
	        <div id="category{{ i }}" class="panel-collapse collapse {% if (category['category_id'] == category_id) %} {{ 'in' }} {% endif %}" style="clear:both">
	        	<ul>
			       {% for child in categories_2 %} {% set second = child['category_id'] %} 
			        <li>
			         {% if (child['category_id'] == child_id) %} 
			         <a href="{{ child['href'] }}" class="active">{{ child['name'] }}</a>
			         {% else %} 
			         <a href="{{ child['href'] }}">{{ child['name'] }}</a>
			         {% endif %} 
			         {% set categories_3 = theme_options.getCategories(child['category_id']) %} 
			         {% if (categories_3|length > 0) %} 
			         	<span class="head"><a style="float:right;padding-right:5px" class="accordion-toggle {% if (child['category_id'] != child_id) %}collapsed{% endif %}" data-toggle="collapse" data-parent="#accordion-category2" href="#category{{ i ~ child['category_id'] }}"><span class="plus">+</span><span class="minus">-</span></a></span>
			         	<div id="category{{ i ~ child['category_id'] }}" class="panel-collapse collapse {% if (child['category_id'] == child_id) %} {{ 'in' }} {% endif %}" style="clear:both">
				         	<ul>
				         	{% for subcategory in categories_3 %} 
				         		{% set link = first ~ '_' ~ second ~ '_' ~ subcategory['category_id'] %} 
				         		<li><a href="{{ theme_options.link(link) }}" {% if (link == theme_options.getVariable('path')) %} {{ 'class="active"' }} {% endif %}>&nbsp; {{ subcategory['name'] }}</a></li>
				         	{% endfor %} 
				         	</ul>
				         </div>
			         {% endif %} 
			        </li>
			       {% endfor %} 
		        </ul>
	        </div>
	        {% endif %} 
	        {% endif %} 
	      </li>
	      {% endfor %} 
	    </ul>
	  </div>
	</div>
{% endif %} 