{% extends host_template %}
{% load i18n %}

{% block extra_head %}
{{ block.super }}
<script type="text/javascript">
$(function() {
    // clear input on focus
    $('.cleardefault').focus(function() {
        if( this.value == this.title ) {
           this.value = '';
        }
    });

    // if field is empty afterward, add text again
    $('.cleardefault').blur(function() {
        if(!this.value.length) {
          this.value = this.title;
        }
    });
});
</script>
{% endblock %}

{% block content %}
<div class="content-view site search-box">
  <form action="/search/" method="get">
    {% for model in CYCLOPE_BASE_CONTENT_TYPES %}
    <input type="hidden" name="models" value="{{model.get_app_label}}.{{model.get_object_name}}" />
    {% endfor %}
    <input type="text" value="{% trans "Site wide search" %}" title="{% trans "Site wide search" %}" name="q" class="cleardefault"/>
    <input type="submit" value=" " class="submit"/>
  </form>
</div>
{% endblock %}
