{% load i18n %}
<link type="text/css" rel="stylesheet" href="{{ MEDIA_URL }}css/searchform.css" />
<script type="text/javascript" src="{% url searchform_jsi18n %}?language={{ LANGUAGE_CODE }}"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.smartsearch.js"></script>
{% for script in form.extra_scripts %}<script type="text/javascript" src="{{ script }}"></script>
{% endfor %}
<script type="text/javascript">
(function ($) {

  $(document).ready(function () {

    $("#search_form").smartsearch({{ form.get_query_args_as_json|safe }}, {
        description_map: {
            {% for field, prefix in form.get_fields_with_query_arg_prefixes %}'{{ field }}': '{{ prefix }}'{% if not forloop.last %},{% endif %}
            {% endfor %}
        },
        use_tabs: {% if form.use_tabs %}true{% else %}false{% endif %}
    });
    {% if form.use_tabs %}
    $("#search_form a.search-section:first").click();
    {% endif %}
  });

})(jQuery);
</script>
