{if $priceRanges.MAXIMUM|default:'' neq $priceRanges.MINIMUM|default:''}
{assign var="priceRangeEnabled" value="1"}
{/if}
{assign var="attributeList" value=$attributeList|default:0}
{if $attributeList|count|default:0>0}	
{assign var="attrSearchEnabled" value="1"}
{/if}

{if $priceRangeEnabled|default:'' eq '1' || $attrSearchEnabled|default:'' eq '1'}
<div class="leftlistBx refine-search">
   	<span class="light-bg fill"></span>

    <div class="light-bg padding  refine-head">
                    {html->anchor caption="Clear all" class="clearAllSearch pull-right"}	
                    <h6>{$language.lblRefine} Your Results	
                    </h6>
                       <div class ="refined-box-content"></div>
                </div>
	<div class="whiteBx refine-content clearfix pos-rel"> 
	<ul class="nav">
        {if $listActiveBrands|count|default:0 > 0 }
    <li><a data-toggle="tab" href="#home">{$language.lblBrands}</a></li>
        {/if}
    <li class="active"><a data-toggle="tab" href="#menu1">{$language.lblPriceRange}	</a></li>
    <li><a data-toggle="tab" href="#menu2">{$language.lblDiscount}	</a></li>
        {if $attrSearchEnabled|default:'' eq '1'}
    {foreach from=$attributeList key="attributeID" item="attributes"}
        <li><a data-toggle="tab" href="#menu3_{$attributeID|default:''}">{$attributes.attrName}</a></li>
    {/foreach}
        {/if}
  </ul>
      <div class="tab-content light-bg ">
	{if $listActiveBrands|count|default:0 > 0 }
        {*{html->anchor caption="Clear All" id="clearBrands" class="pull-right"}*}
	<div class="listMenu tab-pane" id="home">
		{if $listActiveBrands|count|default:0>5}
			{form->textbox name="filterBrands" class="filterBrands form-control" placeholder=$language.lblRefineBrands}
		{/if}
		
		
		<ul>
			<li class="li_brandIDs">
			{form->checkbox 
				options=$listActiveBrands 
				name="brandIDs" 
				class="checkbox_brandIDs" 
				label="true" 
				seperator="</li><li class='li_brandIDs'>"}
			</li>
		</ul>						
		</div>	
	
	{/if}
	{if $priceRangeEnabled|default:'' eq '1'}
        {*{html->anchor caption=$language.lblReset class="clearPriceRange pull-right"}*}

	<div class="listMenu tab-pane active" id="menu1">
	<div class="pricerange-bx">
		<p align="center">
			<!-- {form->textbox name="price-amount" disabled="disabled"} -->
			<div id="price-amount"></div>
			{if isset($priceMinQueryString) && $priceMinQueryString }
			{form->hidden refinehead=$language.lblPriceRange name="price-amount-min" value=$priceMinQueryString}
			{else}
			{form->hidden refinehead=$language.lblPriceRange name="price-amount-min" value=$priceRanges.MINIMUM|default:''}
			{/if}
			{if isset($priceMaxQueryString) && $priceMaxQueryString}
			{form->hidden refinehead=$language.lblPriceRange name="price-amount-max" value=$priceMaxQueryString}
			{else}
			{form->hidden refinehead=$language.lblPriceRange name="price-amount-max" value=$priceRanges.MAXIMUM|default:''}
			{/if}
		</p>
		<div id="price-range"></div>
		<br/>
	</div>
	</div>
	{/if}
	
    {*{html->anchor caption=$language.lblReset class="clearDiscountRange pull-right"}*}

	<div class="listMenu tab-pane" id="menu2">
	<ul>
		{foreach $listDiscountSchema as $listDiscountSchemaKey => $listDiscountSchemaValue}
			<li>
			{form->radio refinehead=$language.lblDiscount refineval=$language[$listDiscountSchemaValue] class="searchDiscountRange" id="searchDiscountRange_{$listDiscountSchemaKey}" name="searchDiscountRange" value="{$listDiscountSchemaKey}"}
			<label class="attributeSearchLabel" for="searchDiscountRange_{$listDiscountSchemaKey}">
				{$language[$listDiscountSchemaValue]}</label>
			</li>
		{/foreach}							
	</ul>						
	</div>						
	
	{if $attrSearchEnabled|default:'' eq '1'}
	{assign var="attrCounter" value="1"}
	{assign var="attrCount" value=$attributeList|count|default:0}
    {if $attributeList|count|default:0>0}    
	{foreach from=$attributeList key="attributeID" item="attributes"}
        
    {*{html->anchor caption=$language.lblClear class="clearAttributeSearch pull-right" rel=$attributeID}*}
        
		<div class="listMenu tab-pane" id="menu3_{$attributeID|default:''}">
		{$attributes['attributeID']|default:''}
		{if $attributes.attrOptions|count>5}
		{form->textbox name="attrSearchFilter" class="attrSearchFilter form-control" placeholder=$language.lblRefine}
		{/if}							
		<ul class="attrOptionList">
		{foreach from=$attributes.attrOptions|default:array() key="attrOptionID" item="attrOptions"}							
			<li>
				{assign var="attrKey" value=$attributes.attributeKey|default:''} 
				{if $attrQueryStringArray[$attrKey]|default:'' && in_array($attrOptionID,$attrQueryStringArray[$attrKey])}
				{assign var="attrOptChecked" value="checked"} 
				{else}
				{assign var="attrOptChecked" value=""} 
				{/if}
				{form->checkbox refinehead=$attributes.attrName refineval=$attrOptions id="searchAttrOptID_{$attrOptionID}" class="searchAttrOptID" name="searchAttrOptID[]" value={$attrOptionID} checked={$attrOptChecked} rel=$attributeID}
				<label class="attributeSearchLabel" id="searchAttrLabel_{$attrOptionID}" for="searchAttrOptID_{$attrOptionID}">{$attrOptions}</label>
			</li>															
		{/foreach}
		</ul>							
		</div>
		{assign var="attrCounter" value=$attrCounter+1}
	{/foreach}
	{/if}{/if}	
	</div>
</div>
  <div class="apply_botton text-center">
    <div class="col-xs-6">
      <a id="applyNow" class="btn btn-primary btn-sm applyNow btn-block">{$language.lblApply}</a>
    </div>
    <div class="col-xs-6">
      <a id="applyCancel" class="btn btn-default btn-sm applyNow btn-block">{$language.lblCancel}</a>
    </div>
  </div>
</div>
	{/if}
