<!DOCTYPE html>
<html lang="en">
  <head profile="http://a9.com/-/spec/opensearch/1.1/">
    <title>LIBER</title>
    <meta charset="utf-8">
    <link rel="shortcut icon" href="/static/favicon.ico">
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/css/home.css">
    <link rel="search"
          type="application/opensearchdescription+xml" 
          href="/opensearch.xml"
          title="Book search">
  </head>

  <body>
    <div class="site-wrapper">
      <div class="site-wrapper-inner">
        <div class="cover-container">

          <div class="inner cover">
            <h1 class="cover-heading">LIBER</h1>
            <p class="lead">
              Questa biblioteca contiene ebook e riviste in formato ePub e
              PDF; per la gestione sul tuo computer ti consigliamo 
              <a href="http://calibre-ebook.org/">Calibre</a>: un
              programma libero, open source e multipiattaforma capace
              di convertire i file PDF in formato ePub.
            </p>

            <p class="lead">
              <form class="form-inline" role="form" method="get"
                    autocomplete="off" action="/search">
                <input type="text" class="input-lg form-control"
                       id="search_field" data-provide="typeahead"
                       name="q" size="30" autofocus>
                <button type="submit" class="btn btn-lg btn-primary">
                  Cerca
                </button>
              </form>
            </p>
          </div>

        </div>
      </div>
    </div>

    <img id="bgimg" src="/static/img/lib3.jpg">

    {{template "_scripts.html" .}}
    <script>
$(function() {
    var bgImg = $("#bgimg");

    function resizeImg() {
      var imgwidth = bgImg.width();
      var imgheight = bgImg.height();

      var winwidth = $(window).width();
      var winheight = $(window).height();

      var widthratio = winwidth / imgwidth;
      var heightratio = winheight / imgheight;

      var widthdiff = heightratio * imgwidth;
      var heightdiff = widthratio * imgheight;

      var newwidth, newheight;
      if(heightdiff>winheight) {
          newwidth = winwidth;
          newheight = heightdiff;
      } else {
          newwidth = widthdiff;
          newheight = winheight;
      }
      var xoffset = (newwidth - winwidth) / 2,
        yoffset = (newheight - winheight) / 2;

      bgImg.css({
          width: newwidth+'px',
          height: newheight+'px',
          top: '-'+yoffset+'px',
          left: '-'+xoffset+'px'
      });
    } 
    resizeImg();
    bgImg.show();
    $(window).resize(function() {
      resizeImg();
    });
});

    </script>
  </body>
</html>