{#
    basic/searchbox.html
    ~~~~~~~~~~~~~~~~~~~~

    Sphinx sidebar template: quick search box.

    :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.

    BD: changed the search tip message.
#}
{%- if pagename != "search" and builder != "singlehtml" %}
<div id="searchbox" style="display: none" role="search">
  <h3>{{ _('Quick search') }}</h3>
    <form class="search" action="{{ pathto('search') }}" method="get">
      <input type="text" name="q" />
      <input type="submit" value="{{ _('Go') }}" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    {{ _('Enter search terms or a macro, type, or function name.') }}
    </p>
</div>
<script>
var showingBox = false;

var hideOrShow = function() {
  var searchBox = document.getElementById("searchbox");
  var width = window.innerWidth;
  if (searchBox) {
    if ( width > 900 ) {
      if (! showingBox) {
        searchBox.style.display="inherit";
        showingBox = true;
      } 
    } else {
      if (showingBox) {
       searchBox.style.display="none";
       showingBox = false;
      }
    }
  }
};

hideOrShow();

window.addEventListener("resize", hideOrShow);
</script>
{%- endif %}
