[{if !$oView->getArticleCount()}]
    [{block name="d3_cfg_extsearch_search_noarticlemessage"}]
        <h3>[{oxcontent ident="d3extsearch_noarticlefound" field="oxtitle"}]</h3>
        [{oxcontent ident="d3extsearch_noarticlefound"}]
    [{/block}]
[{/if}]

[{if $oView->d3GetCMSList()}]
    [{block name="d3_cfg_extsearch_search_cms_results"}]
        <div class="box d3_extsearch_navigation baseframe">
            <h3>
                [{oxmultilang ident="D3_EXTSEARCH_EXT_CMSHEADLINE"}]
            </h3>
            <div class="content list">
            <!--
            [{* Darstellung als Detaileinträge untereinander
                   <ul style="margin: 2px;">
                       [{foreach from=$oView->d3GetCMSList() item="oContent"}]
                           [{assign var="TitleCharCount" value=$oContent->oxcontents__oxtitle->value|count_characters}]
                           [{math equation="100-s" s=$TitleCharCount assign="iTextLength"}]
                           <li>
                               <a href="[{$oContent->getLink()}]"><b>[{$oContent->oxcontents__oxtitle->value}]</b> - [{$oContent->oxcontents__oxcontent->value|strip_tags|oxtruncate:$iTextLength:"..."}]</a><br>
                           </li>
                       [{/foreach}]
                   </ul>
            *}]
            -->

                [{foreach from=$oView->d3GetCMSList() item="oContent"}]
                    [{assign var="TitleCharCount" value=$oContent->oxcontents__oxtitle->value|count_characters}]
                    [{math equation="100-s" s=$TitleCharCount assign="iTextLength"}]
                    <div class="item">
                        <a href="[{$oContent->getLink()}]">[{$oContent->oxcontents__oxtitle->value}]</a>
                    </div>
                [{/foreach}]
                <div class="clearitem"></div>
            </div>
        </div>
    [{/block}]
[{/if}]

[{assign var="similarSearch" value=$oView->getSearchResultStatusMessage()}]
[{if $similarSearch}]
    [{block name="d3_cfg_extsearch_search_similar_messages"}]
        <div class="d3_extsearch_navigation baseframe">
            <div class="message">
                [{if $similarSearch == 'similar'}]
                    [{oxmultilang ident="D3_EXTSEARCH_EXT_NOARTMSG"}] [{$oView->getUsedParams()}]
                [{elseif $similarSearch == 'combined'}]
                    [{oxmultilang ident="D3_EXTSEARCH_EXT_LESSARTMSG"}]
                [{/if}]
            </div>
        </div>
    [{/block}]
[{/if}]

[{if $blSearchPluginLink == 1}]
    [{block name="d3_cfg_extsearch_search_plugin"}]
        <div class="box d3_extsearch_navigation baseframe">
            <h3>
                [{oxmultilang ident="D3_EXTSEARCH_EXT_PLUGINHEADLINE"}]
            </h3>
            <div class="content list">
                <SCRIPT type="text/javascript">
                    function installSearchEngine() {
                        if (window.external && ("AddSearchProvider" in window.external)) {
                            window.external.AddSearchProvider("[{$sSearchPluginURL}]");
                        } else {
                            alert('[{oxmultilang ident="D3_EXTSEARCH_EXT_PLUGINBROWSERERROR"}]');
                        }
                    }
                </SCRIPT>
                [{oxmultilang ident="D3_EXTSEARCH_EXT_PLUGININSTALLMSG"}]
                <div style="text-align: center; padding-top: 5px;"><a class="login_button" style="padding: 2px;" onclick="installSearchEngine();">[{oxmultilang ident="D3_EXTSEARCH_EXT_PLUGININSTALLBTN"}]</a></div>
            </div>
        </div>
    [{/block}]
[{/if}]

[{if $mod_d3_extsearch && $oView->d3HasjQuerySlider()}]
    [{block name="d3_cfg_extsearch_search_jqsliderscript"}]
        [{include file="d3_ext_search_slider.tpl"}]
        [{assign var="sCssInc" value=$oViewConf->getModuleUrl('d3_extsearch', 'out/src/css/d3_ext_search_slider.css')}]
        [{oxstyle include=$sCssInc}]
    [{/block}]
[{/if}]

[{if $aSemanticHits || $oView->d3getCategoryList()|count ||
$sSelectedCatId || $oView->d3getVendorList()|count ||
$sSelectedVendorId || $oView->d3getManufacturerList()|count ||
$sSelectedManufacturerId || $oView->d3getPriceSteps() ||
$oView->d3GetAttributeList()}]
    [{block name="d3_cfg_extsearch_search_filters"}]
        <div class="box d3_extsearch_navigation baseframe">
            <h3>
                [{oxmultilang ident="D3_EXTSEARCH_EXT_SEARCHBOX"}]
            </h3>
            <div class="content list">

                <form action="[{$oViewConf->getSelfActionLink()}]" method="post" id="d3searchfilterform" autocomplete="off">
                    [{$oViewConf->getHiddenSid()}]
                    <input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
                    <input type="hidden" name="searchparam" value="[{$oView->getSearchParamForHtml()}]">
                    <input type="hidden" name="fnc" value="">
                    <input type="hidden" name="isextsearch" value="true">
                    [{foreach from=$oView->getNavigationParams() key="keyname" item="value"}]
                        [{if $keyname != 'searchcnid' && $keyname != 'searchvendor' && $keyname != 'searchmanufacturer'}]
                            <input type="hidden" name="[{$keyname}]" value="[{$value}]">
                        [{/if}]
                    [{/foreach}]
                    [{assign var="d3HasFilter" value=false}]

                    [{block name="d3_inc_ext_search__filter"}]
                        [{if $aSemanticHits}]
                            [{block name="d3_inc_ext_search__filter_semantic"}]
                                <div class="item semantic">
                                    <label for="semanticlist">
                                        [{oxmultilang ident="D3_EXTSEARCH_EXT_YOUMEAN"}]
                                    </label><br>
                                    <SELECT id="semanticlist" name="semanticlist" onchange="d3_extsearch_popup.popup.load(); this.form.submit();">
                                        <OPTION value="" class="desc" selected="selected">[{oxmultilang ident="D3_EXTSEARCH_EXT_CHOOSECAT"}]</OPTION>
                                        [{foreach from=$aSemanticHits item="sSemantic"}]
                                            <OPTION value="[{$sSemantic->sLink}]">[{$sSemantic->sWord}]</OPTION>
                                        [{/foreach}]
                                    </SELECT>
                                </div>
                                [{assign var="d3HasFilter" value=true}]
                            [{/block}]
                        [{/if}]

                        [{if $oView->d3getCategoryList()|count || $sSelectedCatId}]
                            [{block name="d3_inc_ext_search__filter_category"}]
                                <div class="item category">
                                    <label for="searchcnid">
                                        [{oxmultilang ident="D3_EXTSEARCH_EXT_CATEGORIES"}]
                                    </label><br>
                                    <SELECT id="searchcnid" name="searchcnid" onchange="d3_extsearch_popup.popup.load(); this.form.submit();">
                                        [{if $sSelectedCatId}]
                                            <OPTION class="desc" value="">[{oxmultilang ident="D3_EXTSEARCH_EXT_SEARCHINCATEGORIES"}]</OPTION>
                                            <OPTION value="[{$sSelectedCatId}]" selected="selected">[{$sSelectedCat}]</OPTION>
                                        [{else}]
                                            <OPTION class="desc" value="" selected="selected">[{oxmultilang ident="D3_EXTSEARCH_EXT_CHOOSECAT"}]</OPTION>
                                            [{foreach from=$oView->d3getCategoryList() item="category"}]
                                                <OPTION value="[{$category->getId()}]">[{$category->oxcategories__oxtitle->getRawValue()}][{if $category->getFieldData('counter')}] ([{$category->getFieldData('counter')}])[{/if}]</OPTION>
                                            [{/foreach}]
                                        [{/if}]
                                    </SELECT>
                                </div>
                                [{assign var="d3HasFilter" value=true}]
                            [{/block}]
                        [{/if}]

                        [{if $oView->d3getVendorList()|count || $sSelectedVendorId}]
                            [{block name="d3_inc_ext_search__filter_vendor"}]
                                <div class="item vendor">
                                    <label for="searchvendor">
                                        [{oxmultilang ident="D3_EXTSEARCH_EXT_VENDORS"}]
                                    </label><br>
                                    <SELECT id="searchvendor" name="searchvendor" onchange="d3_extsearch_popup.popup.load(); this.form.submit();">
                                        [{if $sSelectedVendorId}]
                                            <OPTION class="desc" value="">[{oxmultilang ident="D3_EXTSEARCH_EXT_SEARCHINVENDORS"}]</OPTION>
                                            <OPTION value="[{$sSelectedVendorId}]" selected="selected">[{$sSelectedVendor}]</OPTION>
                                        [{else}]
                                            <OPTION class="desc" value="" selected="selected">[{oxmultilang ident="D3_EXTSEARCH_EXT_CHOOSEVENDOR"}]</OPTION>
                                            [{foreach from=$oView->d3getVendorList() item="vendor"}]
                                                <OPTION value="[{$vendor->getId()}]">[{$vendor->oxvendor__oxtitle->getRawValue()}][{if $vendor->getFieldData('counter')}] ([{$vendor->getFieldData('counter')}])[{/if}]</OPTION>
                                            [{/foreach}]
                                        [{/if}]
                                    </SELECT>
                                </div>
                                [{assign var="d3HasFilter" value=true}]
                            [{/block}]
                        [{/if}]

                        [{if $oView->d3getManufacturerList()|count || $sSelectedManufacturerId}]
                            [{block name="d3_inc_ext_search__filter_manufacturer"}]
                                <div class="item manufacturer">
                                    <label for="searchmanufacturer">
                                        [{oxmultilang ident="D3_EXTSEARCH_EXT_MANUFACTURERS"}]
                                    </label><br>
                                    <SELECT id="searchmanufacturer" name="searchmanufacturer" onchange="d3_extsearch_popup.popup.load(); this.form.submit();">
                                        [{if $sSelectedManufacturerId}]
                                            <OPTION class="desc" value="">[{oxmultilang ident="D3_EXTSEARCH_EXT_SEARCHINMANUFACTURERS"}]</OPTION>
                                            <OPTION value="[{$sSelectedManufacturerId}]" selected="selected">[{$sSelectedManufacturer}]</OPTION>
                                        [{else}]
                                            <OPTION class="desc" value="" selected="selected">[{oxmultilang ident="D3_EXTSEARCH_EXT_CHOOSEMANUFACTURER"}]</OPTION>
                                            [{foreach from=$oView->d3getManufacturerList() item="manufacturer"}]
                                                <OPTION value="[{$manufacturer->getId()}]">[{$manufacturer->oxmanufacturers__oxtitle->getRawValue()}][{if $manufacturer->getFieldData('counter')}] ([{$manufacturer->getFieldData('counter')}])[{/if}]</OPTION>
                                            [{/foreach}]
                                        [{/if}]
                                    </SELECT>
                                </div>
                                [{assign var="d3HasFilter" value=true}]
                            [{/block}]
                        [{/if}]

                        [{oxscript add="function toggleMultiAttrib(blChecked, sId) {
                            if (blChecked) {
                                document.getElementById('d3searchattrib__multi__' + sId).style.display = 'block';
                                document.getElementById('d3searchattrib__' + sId).style.display = 'none';
                                document.getElementById('d3searchattrib__multiselector__' + sId).style.display = 'none';
                            }
                        }"}]

                        [{if $oView->d3GetAttributeList()}]
                            [{foreach from=$oView->d3GetAttributeList() name=search key=key item=oAttribute}]
                                [{block name="d3_inc_ext_search__filter_attribute"}]
                                    [{assign var="sIdKey" value=$key|replace:".":""}]
                                    <div class="item attribute" id="atid_[{$key}]">
                                        <label for="d3searchattrib__[{$key}]">
                                            [{$oAttribute->title}]:
                                        </label><br>
                                        <SELECT id="d3searchattrib__[{$key}]" name="d3searchattrib[[{$key}]]" onchange="d3_extsearch_popup.popup.load(); this.form.submit();">
                                            [{if $oAttribute->selected}]
                                                <OPTION class="desc" value="">[{oxmultilang ident="D3_EXTSEARCH_EXT_ATTRIBSDESELECT1"}] [{$oAttribute->title}] [{oxmultilang ident="D3_EXTSEARCH_EXT_ATTRIBSDESELECT2"}]</OPTION>
                                            [{else}]
                                                <OPTION class="desc" value="" selected="selected">[{oxmultilang ident="D3_EXTSEARCH_EXT_ATTRIBSNOSELECTION1"}] [{$oAttribute->title}] [{oxmultilang ident="D3_EXTSEARCH_EXT_ATTRIBSNOSELECTION2"}]</OPTION>
                                            [{/if}]
                                            [{foreach from=$oAttribute->_aList name="attrvalues" key="valuekey" item="oAttrValue"}]
                                                <OPTION class="[{if $oAttrValue->highlighted}]highlight [{/if}]" value="[{$oAttrValue->rawvalue}]" [{if $oAttrValue->selected}] selected[{/if}] [{if false == $oAttrValue->isSelectable}] disabled[{/if}]>[{$oAttrValue->value}] [{if $oAttrValue->count}]([{$oAttrValue->count}])[{/if}]</OPTION>
                                            [{/foreach}]
                                        </SELECT>

                                        <div id="d3searchattrib__multi__[{$key}]" style="display: none;">
                                            [{foreach from=$oAttribute->_aList name=attrvalues key=valuekey item=oAttrValue}]
                                                <input name="d3searchattribmulti[[{$key}]][[{$oAttrValue->rawvalue}]]" type="hidden" value="[{$oView->d3GetDeselectValue()}]">
                                                <input name="d3searchattribmulti[[{$key}]][]" type="checkbox" value="[{$oAttrValue->rawvalue}]" id="cb[{$key}][{$oAttrValue->rawvalue}]" [{if $oAttrValue->selected}] checked[{/if}] [{if false == $oAttrValue->isSelectable}] disabled[{/if}]>
                                                <label for="cb[{$key}][{$oAttrValue->rawvalue}]">
                                                    [{$oAttrValue->value}] [{if $oAttrValue->count}]([{$oAttrValue->count}])[{/if}]
                                                </label><br>
                                            [{/foreach}]
                                            <button type="submit" class="submitButton largeButton" onclick="d3_extsearch_popup.popup.load();">[{oxmultilang ident="D3_EXTSEARCH_EXT_ASSIGNFILTER"}]</button>

                                            <button id="d3searchattrib__multiclear__[{$sIdKey}]" type="submit" class="submitButton largeButton" onclick="d3_extsearch_popup.popup.load();">[{oxmultilang ident="D3_EXTSEARCH_EXT_UNASSIGNFILTER"}]</button>
                                            [{oxscript add="$('#d3searchattrib__multiclear__$sIdKey').click(function(){
                                                $(this).parent().children('input:checkbox').each(function() {
                                                    $(this).removeAttr('checked');
                                                });
                                            });"}]
                                        </div>

                                        <div id="d3searchattrib__multiselector__[{$key}]">
                                            <input type="checkbox" name="d3searchattribmultiselector[[{$key}]]" id="d3searchattribmultiselector[[{$key}]]" onclick="toggleMultiAttrib(this.checked, '[{$key}]');">
                                            <label for="d3searchattribmultiselector[[{$key}]]">
                                                [{$oView->getMultipleSelectionTranslation($oAttribute->title)}]
                                            </label>
                                        </div>

                                        [{if $oView->d3AttributeFilterUseMultipleValues($key)}]
                                            [{assign var="sToggleScript" value="toggleMultiAttrib(true, '"|cat:$key|cat:"'); document.getElementById('d3searchattribmultiselector["|cat:$key|cat:"]').checked = 'checked';"}]
                                            [{oxscript add=$sToggleScript}]
                                        [{/if}]
                                    </div>
                                    [{assign var="d3HasFilter" value=true}]
                                [{/block}]
                            [{/foreach}]
                        [{/if}]

                        [{if $oView->d3getPriceSteps() || $sSelectedPriceStep}]
                            [{block name="d3_inc_ext_search__filter_price"}]
                                [{assign var="currency" value=$oView->getActCurrency()}]
                                <div class="item priceselector">
                                    <label for="priceselector">
                                        [{oxmultilang ident="D3_EXTSEARCH_EXT_PRICECATS"}]:
                                    </label><br>
                                    [{if $oView->d3HasjQuerySlider()}]
                                        <div style="text-align: center; display: none;" id="d3extsearchpriceinfo"><span id="d3extsearch_priceinfomin">[{$oView->getPriceSliderInfoMinValue()}]</span> [{$currency->sign}] - <span id="d3extsearch_priceinfomax">[{$oView->getPriceSliderInfoMaxValue()}]</span> [{$currency->sign}]</div>
                                        <div style="display: block;" id="d3extsearchpricefields">
                                            <input type="hidden" name="d3psov[min]" value="[{$oView->getPriceSliderOriginalMinValue()}]">
                                            <input type="hidden" name="d3psov[max]" value="[{$oView->getPriceSliderOriginalMaxValue()}]">
                                            <input size="10" maxlength="20" type="text" name="priceselector[min]" value="[{$oView->getPriceSliderInputMinValue()}]" id="d3extsearch_pricefieldmin" style="width: 50px;"> [{$currency->sign}] -
                                            <input size="10" maxlength="20" type="text" name="priceselector[max]" value="[{$oView->getPriceSliderInputMaxValue()}]" id="d3extsearch_pricefieldmax" style="width: 50px;"> [{$currency->sign}]
                                        </div>
                                        <script type="text/javascript">document.getElementById('d3extsearchpriceinfo').style.display = 'block'; document.getElementById('d3extsearchpricefields').style.display = 'none';</script>
                                        <div id="d3extsearch_priceslider" class="ui-slider">
                                            <div class="ui-slider-handle" id="d3extsearch_priceslider1"></div>
                                            <div class="ui-slider-handle" id="d3extsearch_priceslider2" style="left:300px;"></div>
                                        </div>
                                    [{else}]
                                        <SELECT id="priceselector" name="priceselector" onchange="d3_extsearch_popup.popup.load(); this.form.submit();">
                                            <OPTION value="[{$sSelectedPriceStep}]" class="desc" selected="selected">[{oxmultilang ident="D3_EXTSEARCH_EXT_CHOOSEPRICE"}]</OPTION>
                                            [{foreach from=$oView->d3getPriceSteps() item="price"}]
                                                <OPTION value="[{$price->addParam}]">[{oxmultilang ident="D3_EXTSEARCH_EXT_PRICEFROM"}] [{$price->iFMin}] [{$currency->sign}] [{oxmultilang ident="D3_EXTSEARCH_EXT_PRICETO"}] [{$price->iFMax}] [{$currency->sign}][{if $price->iCount != ''}] ([{$price->iCount}])[{/if}]</OPTION>
                                            [{/foreach}]
                                            [{if $sSelectedPriceStep}]
                                                <OPTION value="" class="desc">[{oxmultilang ident="D3_EXTSEARCH_EXT_DESELECTPRICE"}]</OPTION>
                                            [{/if}]
                                        </SELECT>
                                    [{/if}]
                                </div>
                                [{assign var="d3HasFilter" value=true}]
                            [{/block}]
                        [{/if}]

                        <noscript>
                            <div class="fullitem">
                                <span class="btn">
                                    <input type="submit" value="[{oxmultilang ident="D3_EXTSEARCH_EXT_START_SEARCH"}]">
                                </span>
                            </div>
                        </noscript>

                        [{if $d3HasFilter}]
                            [{block name="d3_inc_ext_search__filter_clear"}]
                                <div class="fullitem">
                                    <button type="submit" class="submitButton largeButton" onclick="document.getElementById('d3searchfilterform').fnc.value = 'd3ClearFilter'; d3_extsearch_popup.popup.load();">[{oxmultilang ident="D3_EXTSEARCH_EXT_CLEARFILTER"}]</button>
                                </div>
                            [{/block}]
                        [{/if}]

                        <div class="clearitem"></div>
                    [{/block}]
                </form>
            </div>
        </div>
    [{/block}]
[{/if}]

[{if $oView->hasFilterParams()}]
    [{block name="d3_cfg_extsearch_search_index"}]
        <div class="d3_extsearch_navigation baseframe fit">
            [{include file="d3_ext_search_filter.tpl" d3fdesc="D3_EXTSEARCH_EXT_ALL"|oxmultilangassign d3fparam="all"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="A"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="B"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="C"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="D"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="E"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="F"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="G"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="H"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="I"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="J"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="K"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="L"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="M"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="N"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="O"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="P"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="Q"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="R"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="S"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="T"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="U"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="V"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="W"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="X"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="Y"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="Z"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="1"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="2"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="3"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="4"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="5"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="6"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="7"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="8"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="9"}]
            [{include file="d3_ext_search_filter.tpl" d3fparam="0"}]
        </div>
    [{/block}]
[{/if}]