#**
 *  Provide elements for the <head> section of the HTML document
 *#

  ## An example of using an arbitrary request parameter
  <title>#param('title')</title>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>

  <script type="text/javascript" src="#{url_root}/js/lib/jquery-1.7.2.min.js"></script>
  <link rel="stylesheet" type="text/css" href="#{url_for_solr}/admin/file?file=/velocity/main.css&contentType=text/css"/>
  <link rel="stylesheet" href="#{url_for_solr}/admin/file?file=/velocity/jquery.autocomplete.css&contentType=text/css" type="text/css" />
  <link rel="icon" type="image/x-icon" href="#{url_root}/img/favicon.ico"/>
  <link rel="shortcut icon" type="image/x-icon" href="#{url_root}/img/favicon.ico"/>
  <script type="text/javascript" src="#{url_for_solr}/admin/file?file=/velocity/jquery.autocomplete.js&contentType=text/javascript"></script>


    <script>
    $(document).ready(function(){
      $("\#q").autocomplete('#{url_for_solr}/terms', {  ## backslash escaped #q as that is a macro defined in VM_global_library.vm
           extraParams:{
             'terms.prefix': function() { return $("\#q").val();},
             'terms.sort': 'count',
             'terms.fl': 'name',
             'wt': 'velocity',
             'v.template': 'suggest'
           }
         }
      ).keydown(function(e){
        if (e.keyCode === 13){
          $("#query-form").trigger('submit');
        }
      });

      // http://localhost:8983/solr/collection1/terms?terms.fl=name&terms.prefix=i&terms.sort=count&wt=velocity&v.template=suggest
    });

    </script>
