<?php if ($this->canShowBlock()): ?>
    <?php $_searchFilter = Mage::helper('catalin_seo')->getSearchFilter(); ?>
    <?php if (!$this->getRequest()->isAjax()): ?>
    <div id="layered-navigation">
    <?php endif; ?>
    <div class="block block-layered-nav<?php if (!$this->getLayer()->getState()->getFilters()): ?> block-layered-nav--no-filters<?php endif; ?>">
        <div class="block-title">
            <strong><span><?php echo $this->__('Shop By') ?></span></strong>
        </div>
        <div class="block-content toggle-content">
            <?php echo $this->getStateHtml() ?>
            <?php if ($this->getLayer()->getState()->getFilters()): ?>
                <div class="actions"><a href="<?php echo $this->urlEscape($this->getClearUrl()) ?>"><?php echo $this->__('Clear All') ?></a></div>
            <?php endif; ?>
            <?php if($this->canShowOptions()): ?>
                <p class="block-subtitle block-subtitle--filter"><?php echo $this->__('Filter') ?></p>
                <dl id="narrow-by-list">
                    <?php $_filters = $this->getFilters() ?>
                    <?php foreach ($_filters as $_filter): ?>
                        <?php if($_filter->getItemsCount()): ?>
                            <dt><?php echo $this->__($_filter->getName()) ?></dt>
                            <?php if($_searchFilter !== false): ?>
                            <dt class="attribute_value_search_box<?php if($_searchFilter !== true): ?> enabled<?php endif; ?>"><input type="text" placeholder="<?php echo $this->__('Search for option'); ?>" /></dt>
                            <?php endif;?>
                            <dd><?php echo $_filter->getHtml() ?></dd>
                        <?php endif; ?>
                    <?php endforeach; ?>
                </dl>
                <script type="text/javascript">decorateDataList('narrow-by-list')</script>
            <?php endif; ?>
        </div>
    </div>
    <?php if (!$this->getRequest()->isAjax()): ?>
    </div>
    <?php endif; ?>
<?php endif; ?>
