trebuild documentation - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
 (HTM) git clone git://src.adamsgaard.dk/sphere
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 54bb1feed1f0e59ee7a81ca5693d21c44b343b67
 (DIR) parent 1e6f5ae916b9d9664d7db00e9975753606971b21
 (HTM) Author: Anders Damsgaard <andersd@riseup.net>
       Date:   Thu,  7 Sep 2017 13:09:04 -0700
       
       rebuild documentation
       
       Diffstat:
         M doc/html/.buildinfo                 |       4 ++--
         M doc/html/_sources/index.txt         |       4 ++--
         M doc/html/_sources/introduction.txt  |      35 +++++++++++++++++--------------
         M doc/html/_static/basic.css          |      99 ++++++++++++++++++++++++++-----
         M doc/html/_static/comment-bright.png |       0 
         M doc/html/_static/comment-close.png  |       0 
         M doc/html/_static/comment.png        |       0 
         M doc/html/_static/default.css        |     258 +------------------------------
         M doc/html/_static/doctools.js        |      73 ++++++++++++++++++++++++-------
         M doc/html/_static/down-pressed.png   |       0 
         M doc/html/_static/down.png           |       0 
         M doc/html/_static/file.png           |       0 
         M doc/html/_static/jquery.js          |   15523 ++++++++++++++++---------------
         M doc/html/_static/minus.png          |       0 
         M doc/html/_static/plus.png           |       0 
         M doc/html/_static/pygments.css       |       7 +++++++
         M doc/html/_static/searchtools.js     |     466 +++++++++++++++++++++----------
         M doc/html/_static/sidebar.js         |      15 ++++++++++++---
         M doc/html/_static/underscore.js      |    1452 +++++++++++++++++++------------
         M doc/html/_static/up-pressed.png     |       0 
         M doc/html/_static/up.png             |       0 
         M doc/html/_static/websupport.js      |      32 ++++++++++++++++----------------
         M doc/html/cfd.html                   |     240 +++++++++++++++----------------
         M doc/html/dem.html                   |     140 +++++++++++++++----------------
         M doc/html/genindex.html              |     322 +++++++++++++++++++++++++++----
         M doc/html/index.html                 |      85 ++++++++++++++++---------------
         M doc/html/introduction.html          |     196 +++++++++++++++++--------------
         M doc/html/objects.inv                |       0 
         M doc/html/py-modindex.html           |      44 ++++++++++++++-----------------
         M doc/html/python_api.html            |    1619 +++++++++++++++++++++++++------
         M doc/html/search.html                |      31 +++++++++++++++----------------
         M doc/html/searchindex.js             |       4 ++--
         M doc/html/sphere_internals.html      |     268 +++++++------------------------
         M doc/pdf/sphere.pdf                  |       0 
         M doc/sphinx/index.rst                |       4 ++--
         M doc/sphinx/introduction.rst         |      35 +++++++++++++++++--------------
       
       36 files changed, 11615 insertions(+), 9341 deletions(-)
       ---
 (DIR) diff --git a/doc/html/.buildinfo b/doc/html/.buildinfo
       t@@ -1,4 +1,4 @@
        # Sphinx build info version 1
        # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
       -config: 572cfe56c7acc603f39739a18d514093
       -tags: fbb0d17656682115ca4d033fb2f83ba1
       +config: fe70a33065653dc9f13fbefebe7ac2f6
       +tags: 645f666f9bcd5a90fca523b33c5a78b7
 (DIR) diff --git a/doc/html/_sources/index.txt b/doc/html/_sources/index.txt
       t@@ -14,7 +14,7 @@ supervision of David Lundbek Egholm and Jan A. Piotrowski, all of the Department
        of Geoscience, Aarhus University, Denmark. The author welcomes interested third
        party developers. This document is a work in progress.
        
       -Contact: Anders Damsgaard, `<http://cs.au.dk/~adc>`_,
       +Contact: Anders Damsgaard, `<https://adamsgaard.dk>`_,
        `<anders.damsgaard@geo.au.dk>`_
        
        
       t@@ -27,7 +27,7 @@ Contents
           dem
           cfd
           python_api
       -   .. sphere_internals
       +   sphere_internals
        
        
        
 (DIR) diff --git a/doc/html/_sources/introduction.txt b/doc/html/_sources/introduction.txt
       t@@ -1,5 +1,5 @@
       -Introduction
       -============
       +Introduction and Installation
       +=============================
        
        The ``sphere``-software is used for three-dimensional discrete element method 
        (DEM) particle simulations. The source code is written in C++, CUDA C and
       t@@ -37,11 +37,11 @@ The build requirements are:
          * `CMake <http://www.cmake.org>`_, version 2.8 or newer
          * The `GNU Compiler Collection <http://gcc.gnu.org/>`_ (GCC)
          * The `Nvidia CUDA toolkit <https://developer.nvidia.com/cuda-downloads>`_,
       -    version 5.0 or newer
       +    version 8.0 or newer
        
        In Debian GNU/Linux, these dependencies can be installed by running::
        
       - $ sudo apt-get install build-essential cmake nvidia-cuda-toolkit
       + $ sudo apt-get install build-essential cmake nvidia-cuda-toolkit clang-3.8
        
        Unfortunately, the Nvidia Toolkit is shipped under a non-free license. In order
        to install it in Debian GNU/Linux, add ``non-free`` archives to your
       t@@ -50,7 +50,7 @@ to install it in Debian GNU/Linux, add ``non-free`` archives to your
        The runtime requirements are:
        
          * A `CUDA-enabled GPU <http://www.nvidia.com/object/cuda_gpus.html>`_ with
       -    compute capability 1.1 or greater.
       +    compute capability 2.0 or greater.
          * A Nvidia CUDA-enabled GPU and device driver
        
        Optional tools, required for simulation setup and data processing:
       t@@ -113,11 +113,6 @@ Building ``sphere``
        ``sphere`` is built using ``cmake``, the platform-specific C/C++ compilers,
        and ``nvcc`` from the Nvidia CUDA toolkit.
        
       -If you plan to run ``sphere`` on a Kepler GPU, execute the following commands
       -from the root directory::
       -
       - $ cmake . && make
       -
        If you instead plan to execute it on a Fermi GPU, change ``set(GPU_GENERATION
        1)`` to ``set(GPU_GENERATION 0`` in ``CMakeLists.txt``.
        
       t@@ -132,19 +127,27 @@ sample subdirectory ``common/inc/helper_math.h`` into the sphere ``src/``
        directory, and run ``cmake`` and ``make`` again. Due to license restrictions,
        sphere cannot be distributed with this file.
        
       +If you plan to run ``sphere`` on a Kepler GPU, execute the following commands
       +from the root directory::
       +
       + $ cmake . && make
       +
       +NOTE: If your system does not have a GCC compiler (e.g. GCC-5 for CUDA 8) 
       +compatible with the installed CUDA version, try using ``clang-3.8`` instead::
       +
       + $ export CC=$(which clang-3.8) && export CXX=$(which clang++-3.8) && cmake . && make
       +
        After a successfull installation, the ``sphere`` executable will be located
        in the root folder. To make sure that all components are working correctly,
        execute::
        
         $ make test
        
       -All instructions required for building ``sphere`` are provided in a number of
       -``Makefile``'s. To generate the main ``sphere`` command-line executable, go to
       -the root directory, and invoke CMake and GNU Make::
       -
       - $ cmake . && make
       +Disclaimer: On some systems the Navier-Stokes related tests will fail.  If you 
       +do encounter these problems, but do not plan on using the Navier Stokes solver 
       +for fluid dynamics, carry on.
        
       -If successfull, the Makefiles will create the required data folders, object
       +If successful the Makefiles will create the required data folders, object
        files, as well as the ``sphere`` executable in the root folder. Issue the
        following commands to check the executable::
        
 (DIR) diff --git a/doc/html/_static/basic.css b/doc/html/_static/basic.css
       t@@ -4,7 +4,7 @@
         *
         * Sphinx stylesheet -- basic theme.
         *
       - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
       + * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
         * :license: BSD, see LICENSE for details.
         *
         */
       t@@ -52,6 +52,8 @@ div.sphinxsidebar {
            width: 230px;
            margin-left: -100%;
            font-size: 90%;
       +    word-wrap: break-word;
       +    overflow-wrap : break-word;
        }
        
        div.sphinxsidebar ul {
       t@@ -83,12 +85,9 @@ div.sphinxsidebar #searchbox input[type="text"] {
            width: 170px;
        }
        
       -div.sphinxsidebar #searchbox input[type="submit"] {
       -    width: 30px;
       -}
       -
        img {
            border: 0;
       +    max-width: 100%;
        }
        
        /* -- search page ----------------------------------------------------------- */
       t@@ -186,6 +185,13 @@ div.genindex-jumpbox {
        
        /* -- general body styles --------------------------------------------------- */
        
       +div.body p, div.body dd, div.body li, div.body blockquote {
       +    -moz-hyphens: auto;
       +    -ms-hyphens: auto;
       +    -webkit-hyphens: auto;
       +    hyphens: auto;
       +}
       +
        a.headerlink {
            visibility: hidden;
        }
       t@@ -196,7 +202,10 @@ h3:hover > a.headerlink,
        h4:hover > a.headerlink,
        h5:hover > a.headerlink,
        h6:hover > a.headerlink,
       -dt:hover > a.headerlink {
       +dt:hover > a.headerlink,
       +caption:hover > a.headerlink,
       +p.caption:hover > a.headerlink,
       +div.code-block-caption:hover > a.headerlink {
            visibility: visible;
        }
        
       t@@ -313,6 +322,13 @@ table.docutils {
            border-collapse: collapse;
        }
        
       +table caption span.caption-number {
       +    font-style: italic;
       +}
       +
       +table caption span.caption-text {
       +}
       +
        table.docutils td, table.docutils th {
            padding: 1px 8px 1px 5px;
            border-top: 0;
       t@@ -343,6 +359,25 @@ table.citation td {
            border-bottom: none;
        }
        
       +/* -- figures --------------------------------------------------------------- */
       +
       +div.figure {
       +    margin: 0.5em;
       +    padding: 0.5em;
       +}
       +
       +div.figure p.caption {
       +    padding: 0.3em;
       +}
       +
       +div.figure p.caption span.caption-number {
       +    font-style: italic;
       +}
       +
       +div.figure p.caption span.caption-text {
       +}
       +
       +
        /* -- other body styles ----------------------------------------------------- */
        
        ol.arabic {
       t@@ -401,14 +436,14 @@ dl.glossary dt {
            margin: 0;
        }
        
       -.refcount {
       -    color: #060;
       -}
       -
        .optional {
            font-size: 1.3em;
        }
        
       +.sig-paren {
       +    font-size: larger;
       +}
       +
        .versionmodified {
            font-style: italic;
        }
       t@@ -459,6 +494,13 @@ pre {
            overflow-y: hidden;  /* fixes display issues on Chrome browsers */
        }
        
       +span.pre {
       +    -moz-hyphens: none;
       +    -ms-hyphens: none;
       +    -webkit-hyphens: none;
       +    hyphens: none;
       +}
       +
        td.linenos pre {
            padding: 5px 0px;
            border: 0;
       t@@ -474,22 +516,51 @@ table.highlighttable td {
            padding: 0 0.5em 0 0.5em;
        }
        
       -tt.descname {
       +div.code-block-caption {
       +    padding: 2px 5px;
       +    font-size: small;
       +}
       +
       +div.code-block-caption code {
       +    background-color: transparent;
       +}
       +
       +div.code-block-caption + div > div.highlight > pre {
       +    margin-top: 0;
       +}
       +
       +div.code-block-caption span.caption-number {
       +    padding: 0.1em 0.3em;
       +    font-style: italic;
       +}
       +
       +div.code-block-caption span.caption-text {
       +}
       +
       +div.literal-block-wrapper {
       +    padding: 1em 1em 0;
       +}
       +
       +div.literal-block-wrapper div.highlight {
       +    margin: 0;
       +}
       +
       +code.descname {
            background-color: transparent;
            font-weight: bold;
            font-size: 1.2em;
        }
        
       -tt.descclassname {
       +code.descclassname {
            background-color: transparent;
        }
        
       -tt.xref, a tt {
       +code.xref, a code {
            background-color: transparent;
            font-weight: bold;
        }
        
       -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
       +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
            background-color: transparent;
        }
        
 (DIR) diff --git a/doc/html/_static/comment-bright.png b/doc/html/_static/comment-bright.png
       Binary files differ.
 (DIR) diff --git a/doc/html/_static/comment-close.png b/doc/html/_static/comment-close.png
       Binary files differ.
 (DIR) diff --git a/doc/html/_static/comment.png b/doc/html/_static/comment.png
       Binary files differ.
 (DIR) diff --git a/doc/html/_static/default.css b/doc/html/_static/default.css
       t@@ -1,256 +1 @@
       -/*
       - * default.css_t
       - * ~~~~~~~~~~~~~
       - *
       - * Sphinx stylesheet -- default theme.
       - *
       - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
       - * :license: BSD, see LICENSE for details.
       - *
       - */
       -
       -@import url("basic.css");
       -
       -/* -- page layout ----------------------------------------------------------- */
       -
       -body {
       -    font-family: sans-serif;
       -    font-size: 100%;
       -    background-color: #11303d;
       -    color: #000;
       -    margin: 0;
       -    padding: 0;
       -}
       -
       -div.document {
       -    background-color: #1c4e63;
       -}
       -
       -div.documentwrapper {
       -    float: left;
       -    width: 100%;
       -}
       -
       -div.bodywrapper {
       -    margin: 0 0 0 230px;
       -}
       -
       -div.body {
       -    background-color: #ffffff;
       -    color: #000000;
       -    padding: 0 20px 30px 20px;
       -}
       -
       -div.footer {
       -    color: #ffffff;
       -    width: 100%;
       -    padding: 9px 0 9px 0;
       -    text-align: center;
       -    font-size: 75%;
       -}
       -
       -div.footer a {
       -    color: #ffffff;
       -    text-decoration: underline;
       -}
       -
       -div.related {
       -    background-color: #133f52;
       -    line-height: 30px;
       -    color: #ffffff;
       -}
       -
       -div.related a {
       -    color: #ffffff;
       -}
       -
       -div.sphinxsidebar {
       -}
       -
       -div.sphinxsidebar h3 {
       -    font-family: 'Trebuchet MS', sans-serif;
       -    color: #ffffff;
       -    font-size: 1.4em;
       -    font-weight: normal;
       -    margin: 0;
       -    padding: 0;
       -}
       -
       -div.sphinxsidebar h3 a {
       -    color: #ffffff;
       -}
       -
       -div.sphinxsidebar h4 {
       -    font-family: 'Trebuchet MS', sans-serif;
       -    color: #ffffff;
       -    font-size: 1.3em;
       -    font-weight: normal;
       -    margin: 5px 0 0 0;
       -    padding: 0;
       -}
       -
       -div.sphinxsidebar p {
       -    color: #ffffff;
       -}
       -
       -div.sphinxsidebar p.topless {
       -    margin: 5px 10px 10px 10px;
       -}
       -
       -div.sphinxsidebar ul {
       -    margin: 10px;
       -    padding: 0;
       -    color: #ffffff;
       -}
       -
       -div.sphinxsidebar a {
       -    color: #98dbcc;
       -}
       -
       -div.sphinxsidebar input {
       -    border: 1px solid #98dbcc;
       -    font-family: sans-serif;
       -    font-size: 1em;
       -}
       -
       -
       -
       -/* -- hyperlink styles ------------------------------------------------------ */
       -
       -a {
       -    color: #355f7c;
       -    text-decoration: none;
       -}
       -
       -a:visited {
       -    color: #355f7c;
       -    text-decoration: none;
       -}
       -
       -a:hover {
       -    text-decoration: underline;
       -}
       -
       -
       -
       -/* -- body styles ----------------------------------------------------------- */
       -
       -div.body h1,
       -div.body h2,
       -div.body h3,
       -div.body h4,
       -div.body h5,
       -div.body h6 {
       -    font-family: 'Trebuchet MS', sans-serif;
       -    background-color: #f2f2f2;
       -    font-weight: normal;
       -    color: #20435c;
       -    border-bottom: 1px solid #ccc;
       -    margin: 20px -20px 10px -20px;
       -    padding: 3px 0 3px 10px;
       -}
       -
       -div.body h1 { margin-top: 0; font-size: 200%; }
       -div.body h2 { font-size: 160%; }
       -div.body h3 { font-size: 140%; }
       -div.body h4 { font-size: 120%; }
       -div.body h5 { font-size: 110%; }
       -div.body h6 { font-size: 100%; }
       -
       -a.headerlink {
       -    color: #c60f0f;
       -    font-size: 0.8em;
       -    padding: 0 4px 0 4px;
       -    text-decoration: none;
       -}
       -
       -a.headerlink:hover {
       -    background-color: #c60f0f;
       -    color: white;
       -}
       -
       -div.body p, div.body dd, div.body li {
       -    text-align: justify;
       -    line-height: 130%;
       -}
       -
       -div.admonition p.admonition-title + p {
       -    display: inline;
       -}
       -
       -div.admonition p {
       -    margin-bottom: 5px;
       -}
       -
       -div.admonition pre {
       -    margin-bottom: 5px;
       -}
       -
       -div.admonition ul, div.admonition ol {
       -    margin-bottom: 5px;
       -}
       -
       -div.note {
       -    background-color: #eee;
       -    border: 1px solid #ccc;
       -}
       -
       -div.seealso {
       -    background-color: #ffc;
       -    border: 1px solid #ff6;
       -}
       -
       -div.topic {
       -    background-color: #eee;
       -}
       -
       -div.warning {
       -    background-color: #ffe4e4;
       -    border: 1px solid #f66;
       -}
       -
       -p.admonition-title {
       -    display: inline;
       -}
       -
       -p.admonition-title:after {
       -    content: ":";
       -}
       -
       -pre {
       -    padding: 5px;
       -    background-color: #eeffcc;
       -    color: #333333;
       -    line-height: 120%;
       -    border: 1px solid #ac9;
       -    border-left: none;
       -    border-right: none;
       -}
       -
       -tt {
       -    background-color: #ecf0f3;
       -    padding: 0 1px 0 1px;
       -    font-size: 0.95em;
       -}
       -
       -th {
       -    background-color: #ede;
       -}
       -
       -.warning tt {
       -    background: #efc2c2;
       -}
       -
       -.note tt {
       -    background: #d6d6d6;
       -}
       -
       -.viewcode-back {
       -    font-family: sans-serif;
       -}
       -
       -div.viewcode-block:target {
       -    background-color: #f4debf;
       -    border-top: 1px solid #ac9;
       -    border-bottom: 1px solid #ac9;
       -}
       -\ No newline at end of file
       +@import url("classic.css");
 (DIR) diff --git a/doc/html/_static/doctools.js b/doc/html/_static/doctools.js
       t@@ -4,7 +4,7 @@
         *
         * Sphinx JavaScript utilities for all documentation.
         *
       - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
       + * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
         * :license: BSD, see LICENSE for details.
         *
         */
       t@@ -32,7 +32,7 @@ if (!window.console || !console.firebug) {
         */
        jQuery.urldecode = function(x) {
          return decodeURIComponent(x).replace(/\+/g, ' ');
       -}
       +};
        
        /**
         * small helper function to urlencode strings
       t@@ -62,18 +62,6 @@ jQuery.getQueryParameters = function(s) {
        };
        
        /**
       - * small function to check if an array contains
       - * a given item.
       - */
       -jQuery.contains = function(arr, item) {
       -  for (var i = 0; i < arr.length; i++) {
       -    if (arr[i] == item)
       -      return true;
       -  }
       -  return false;
       -};
       -
       -/**
         * highlight a given string on a jquery object by wrapping it in
         * span elements with the given class name.
         */
       t@@ -103,6 +91,30 @@ jQuery.fn.highlightText = function(text, className) {
          });
        };
        
       +/*
       + * backward compatibility for jQuery.browser
       + * This will be supported until firefox bug is fixed.
       + */
       +if (!jQuery.browser) {
       +  jQuery.uaMatch = function(ua) {
       +    ua = ua.toLowerCase();
       +
       +    var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
       +      /(webkit)[ \/]([\w.]+)/.exec(ua) ||
       +      /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
       +      /(msie) ([\w.]+)/.exec(ua) ||
       +      ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
       +      [];
       +
       +    return {
       +      browser: match[ 1 ] || "",
       +      version: match[ 2 ] || "0"
       +    };
       +  };
       +  jQuery.browser = {};
       +  jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
       +}
       +
        /**
         * Small JavaScript module for the documentation.
         */
       t@@ -112,6 +124,7 @@ var Documentation = {
            this.fixFirefoxAnchorBug();
            this.highlightSearchWords();
            this.initIndexTable();
       +    
          },
        
          /**
       t@@ -164,9 +177,10 @@ var Documentation = {
        
          /**
           * workaround a firefox stupidity
       +   * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
           */
          fixFirefoxAnchorBug : function() {
       -    if (document.location.hash && $.browser.mozilla)
       +    if (document.location.hash)
              window.setTimeout(function() {
                document.location.href += '';
              }, 10);
       t@@ -180,6 +194,9 @@ var Documentation = {
            var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
            if (terms.length) {
              var body = $('div.body');
       +      if (!body.length) {
       +        body = $('body');
       +      }
              window.setTimeout(function() {
                $.each(terms, function() {
                  body.highlightText(this.toLowerCase(), 'highlighted');
       t@@ -236,6 +253,29 @@ var Documentation = {
            });
            var url = parts.join('/');
            return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
       +  },
       +
       +  initOnKeyListeners: function() {
       +    $(document).keyup(function(event) {
       +      var activeElementType = document.activeElement.tagName;
       +      // don't navigate when in search box or textarea
       +      if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
       +        switch (event.keyCode) {
       +          case 37: // left
       +            var prevHref = $('link[rel="prev"]').prop('href');
       +            if (prevHref) {
       +              window.location.href = prevHref;
       +              return false;
       +            }
       +          case 39: // right
       +            var nextHref = $('link[rel="next"]').prop('href');
       +            if (nextHref) {
       +              window.location.href = nextHref;
       +              return false;
       +            }
       +        }
       +      }
       +    });
          }
        };
        
       t@@ -244,4 +284,4 @@ _ = Documentation.gettext;
        
        $(document).ready(function() {
          Documentation.init();
       -});
       +});
       +\ No newline at end of file
 (DIR) diff --git a/doc/html/_static/down-pressed.png b/doc/html/_static/down-pressed.png
       Binary files differ.
 (DIR) diff --git a/doc/html/_static/down.png b/doc/html/_static/down.png
       Binary files differ.
 (DIR) diff --git a/doc/html/_static/file.png b/doc/html/_static/file.png
       Binary files differ.
 (DIR) diff --git a/doc/html/_static/jquery.js b/doc/html/_static/jquery.js
       t@@ -1,291 +1,170 @@
        /*!
       - * jQuery JavaScript Library v1.7.2
       - * http://jquery.com/
       - *
       - * Copyright 2011, John Resig
       - * Dual licensed under the MIT or GPL Version 2 licenses.
       - * http://jquery.org/license
       + * jQuery JavaScript Library v3.1.1
       + * https://jquery.com/
         *
         * Includes Sizzle.js
       - * http://sizzlejs.com/
       - * Copyright 2011, The Dojo Foundation
       - * Released under the MIT, BSD, and GPL Licenses.
       + * https://sizzlejs.com/
         *
       - * Date: Fri Jul  5 14:07:58 UTC 2013
       + * Copyright jQuery Foundation and other contributors
       + * Released under the MIT license
       + * https://jquery.org/license
       + *
       + * Date: 2016-12-11T15:18Z
         */
       -(function( window, undefined ) {
       -
       -// Use the correct document accordingly with window argument (sandbox)
       -var document = window.document,
       -        navigator = window.navigator,
       -        location = window.location;
       -var jQuery = (function() {
       -
       -// Define a local copy of jQuery
       -var jQuery = function( selector, context ) {
       -                // The jQuery object is actually just the init constructor 'enhanced'
       -                return new jQuery.fn.init( selector, context, rootjQuery );
       -        },
       -
       -        // Map over jQuery in case of overwrite
       -        _jQuery = window.jQuery,
       -
       -        // Map over the $ in case of overwrite
       -        _$ = window.$,
       -
       -        // A central reference to the root jQuery(document)
       -        rootjQuery,
       -
       -        // A simple way to check for HTML strings or ID strings
       -        // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
       -        quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
       -
       -        // Check if a string has a non-whitespace character in it
       -        rnotwhite = /\S/,
       -
       -        // Used for trimming whitespace
       -        trimLeft = /^\s+/,
       -        trimRight = /\s+$/,
       -
       -        // Match a standalone tag
       -        rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
       -
       -        // JSON RegExp
       -        rvalidchars = /^[\],:{}\s]*$/,
       -        rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
       -        rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
       -        rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
       -
       -        // Useragent RegExp
       -        rwebkit = /(webkit)[ \/]([\w.]+)/,
       -        ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
       -        rmsie = /(msie) ([\w.]+)/,
       -        rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
       +( function( global, factory ) {
       +
       +        "use strict";
       +
       +        if ( typeof module === "object" && typeof module.exports === "object" ) {
       +
       +                // For CommonJS and CommonJS-like environments where a proper `window`
       +                // is present, execute the factory and get jQuery.
       +                // For environments that do not have a `window` with a `document`
       +                // (such as Node.js), expose a factory as module.exports.
       +                // This accentuates the need for the creation of a real `window`.
       +                // e.g. var jQuery = require("jquery")(window);
       +                // See ticket #14549 for more info.
       +                module.exports = global.document ?
       +                        factory( global, true ) :
       +                        function( w ) {
       +                                if ( !w.document ) {
       +                                        throw new Error( "jQuery requires a window with a document" );
       +                                }
       +                                return factory( w );
       +                        };
       +        } else {
       +                factory( global );
       +        }
        
       -        // Matches dashed string for camelizing
       -        rdashAlpha = /-([a-z]|[0-9])/ig,
       -        rmsPrefix = /^-ms-/,
       +// Pass this if window is not defined yet
       +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
        
       -        // Used by jQuery.camelCase as callback to replace()
       -        fcamelCase = function( all, letter ) {
       -                return ( letter + "" ).toUpperCase();
       -        },
       +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
       +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
       +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
       +// enough that all such attempts are guarded in a try block.
        
       -        // Keep a UserAgent string for use with jQuery.browser
       -        userAgent = navigator.userAgent,
        
       -        // For matching the engine and version of the browser
       -        browserMatch,
       +var arr = [];
        
       -        // The deferred used on DOM ready
       -        readyList,
       +var document = window.document;
        
       -        // The ready event handler
       -        DOMContentLoaded,
       +var getProto = Object.getPrototypeOf;
        
       -        // Save a reference to some core methods
       -        toString = Object.prototype.toString,
       -        hasOwn = Object.prototype.hasOwnProperty,
       -        push = Array.prototype.push,
       -        slice = Array.prototype.slice,
       -        trim = String.prototype.trim,
       -        indexOf = Array.prototype.indexOf,
       +var slice = arr.slice;
        
       -        // [[Class]] -> type pairs
       -        class2type = {};
       +var concat = arr.concat;
        
       -jQuery.fn = jQuery.prototype = {
       -        constructor: jQuery,
       -        init: function( selector, context, rootjQuery ) {
       -                var match, elem, ret, doc;
       +var push = arr.push;
        
       -                // Handle $(""), $(null), or $(undefined)
       -                if ( !selector ) {
       -                        return this;
       -                }
       +var indexOf = arr.indexOf;
        
       -                // Handle $(DOMElement)
       -                if ( selector.nodeType ) {
       -                        this.context = this[0] = selector;
       -                        this.length = 1;
       -                        return this;
       -                }
       +var class2type = {};
        
       -                // The body element only exists once, optimize finding it
       -                if ( selector === "body" && !context && document.body ) {
       -                        this.context = document;
       -                        this[0] = document.body;
       -                        this.selector = selector;
       -                        this.length = 1;
       -                        return this;
       -                }
       +var toString = class2type.toString;
        
       -                // Handle HTML strings
       -                if ( typeof selector === "string" ) {
       -                        // Are we dealing with HTML string or an ID?
       -                        if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
       -                                // Assume that strings that start and end with <> are HTML and skip the regex check
       -                                match = [ null, selector, null ];
       +var hasOwn = class2type.hasOwnProperty;
        
       -                        } else {
       -                                match = quickExpr.exec( selector );
       -                        }
       +var fnToString = hasOwn.toString;
        
       -                        // Verify a match, and that no context was specified for #id
       -                        if ( match && (match[1] || !context) ) {
       +var ObjectFunctionString = fnToString.call( Object );
        
       -                                // HANDLE: $(html) -> $(array)
       -                                if ( match[1] ) {
       -                                        context = context instanceof jQuery ? context[0] : context;
       -                                        doc = ( context ? context.ownerDocument || context : document );
       +var support = {};
        
       -                                        // If a single string is passed in and it's a single tag
       -                                        // just do a createElement and skip the rest
       -                                        ret = rsingleTag.exec( selector );
        
       -                                        if ( ret ) {
       -                                                if ( jQuery.isPlainObject( context ) ) {
       -                                                        selector = [ document.createElement( ret[1] ) ];
       -                                                        jQuery.fn.attr.call( selector, context, true );
        
       -                                                } else {
       -                                                        selector = [ doc.createElement( ret[1] ) ];
       -                                                }
       +        function DOMEval( code, doc ) {
       +                doc = doc || document;
        
       -                                        } else {
       -                                                ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
       -                                                selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
       -                                        }
       +                var script = doc.createElement( "script" );
        
       -                                        return jQuery.merge( this, selector );
       +                script.text = code;
       +                doc.head.appendChild( script ).parentNode.removeChild( script );
       +        }
       +/* global Symbol */
       +// Defining this global in .eslintrc.json would create a danger of using the global
       +// unguarded in another place, it seems safer to define global only for this module
        
       -                                // HANDLE: $("#id")
       -                                } else {
       -                                        elem = document.getElementById( match[2] );
       -
       -                                        // Check parentNode to catch when Blackberry 4.6 returns
       -                                        // nodes that are no longer in the document #6963
       -                                        if ( elem && elem.parentNode ) {
       -                                                // Handle the case where IE and Opera return items
       -                                                // by name instead of ID
       -                                                if ( elem.id !== match[2] ) {
       -                                                        return rootjQuery.find( selector );
       -                                                }
        
       -                                                // Otherwise, we inject the element directly into the jQuery object
       -                                                this.length = 1;
       -                                                this[0] = elem;
       -                                        }
        
       -                                        this.context = document;
       -                                        this.selector = selector;
       -                                        return this;
       -                                }
       +var
       +        version = "3.1.1",
        
       -                        // HANDLE: $(expr, $(...))
       -                        } else if ( !context || context.jquery ) {
       -                                return ( context || rootjQuery ).find( selector );
       +        // Define a local copy of jQuery
       +        jQuery = function( selector, context ) {
        
       -                        // HANDLE: $(expr, context)
       -                        // (which is just equivalent to: $(context).find(expr)
       -                        } else {
       -                                return this.constructor( context ).find( selector );
       -                        }
       +                // The jQuery object is actually just the init constructor 'enhanced'
       +                // Need init if jQuery is called (just allow error to be thrown if not included)
       +                return new jQuery.fn.init( selector, context );
       +        },
        
       -                // HANDLE: $(function)
       -                // Shortcut for document ready
       -                } else if ( jQuery.isFunction( selector ) ) {
       -                        return rootjQuery.ready( selector );
       -                }
       +        // Support: Android <=4.0 only
       +        // Make sure we trim BOM and NBSP
       +        rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
        
       -                if ( selector.selector !== undefined ) {
       -                        this.selector = selector.selector;
       -                        this.context = selector.context;
       -                }
       +        // Matches dashed string for camelizing
       +        rmsPrefix = /^-ms-/,
       +        rdashAlpha = /-([a-z])/g,
        
       -                return jQuery.makeArray( selector, this );
       -        },
       +        // Used by jQuery.camelCase as callback to replace()
       +        fcamelCase = function( all, letter ) {
       +                return letter.toUpperCase();
       +        };
        
       -        // Start with an empty selector
       -        selector: "",
       +jQuery.fn = jQuery.prototype = {
        
                // The current version of jQuery being used
       -        jquery: "1.7.2",
       +        jquery: version,
       +
       +        constructor: jQuery,
        
                // The default length of a jQuery object is 0
                length: 0,
        
       -        // The number of elements contained in the matched element set
       -        size: function() {
       -                return this.length;
       -        },
       -
                toArray: function() {
       -                return slice.call( this, 0 );
       +                return slice.call( this );
                },
        
                // Get the Nth element in the matched element set OR
                // Get the whole matched element set as a clean array
                get: function( num ) {
       -                return num == null ?
        
       -                        // Return a 'clean' array
       -                        this.toArray() :
       +                // Return all the elements in a clean array
       +                if ( num == null ) {
       +                        return slice.call( this );
       +                }
        
       -                        // Return just the object
       -                        ( num < 0 ? this[ this.length + num ] : this[ num ] );
       +                // Return just the one element from the set
       +                return num < 0 ? this[ num + this.length ] : this[ num ];
                },
        
                // Take an array of elements and push it onto the stack
                // (returning the new matched element set)
       -        pushStack: function( elems, name, selector ) {
       -                // Build a new jQuery matched element set
       -                var ret = this.constructor();
       -
       -                if ( jQuery.isArray( elems ) ) {
       -                        push.apply( ret, elems );
       +        pushStack: function( elems ) {
        
       -                } else {
       -                        jQuery.merge( ret, elems );
       -                }
       +                // Build a new jQuery matched element set
       +                var ret = jQuery.merge( this.constructor(), elems );
        
                        // Add the old object onto the stack (as a reference)
                        ret.prevObject = this;
        
       -                ret.context = this.context;
       -
       -                if ( name === "find" ) {
       -                        ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
       -                } else if ( name ) {
       -                        ret.selector = this.selector + "." + name + "(" + selector + ")";
       -                }
       -
                        // Return the newly-formed element set
                        return ret;
                },
        
                // Execute a callback for every element in the matched set.
       -        // (You can seed the arguments with an array of args, but this is
       -        // only used internally.)
       -        each: function( callback, args ) {
       -                return jQuery.each( this, callback, args );
       +        each: function( callback ) {
       +                return jQuery.each( this, callback );
                },
        
       -        ready: function( fn ) {
       -                // Attach the listeners
       -                jQuery.bindReady();
       -
       -                // Add the callback
       -                readyList.add( fn );
       -
       -                return this;
       +        map: function( callback ) {
       +                return this.pushStack( jQuery.map( this, function( elem, i ) {
       +                        return callback.call( elem, i, elem );
       +                } ) );
                },
        
       -        eq: function( i ) {
       -                i = +i;
       -                return i === -1 ?
       -                        this.slice( i ) :
       -                        this.slice( i, i + 1 );
       +        slice: function() {
       +                return this.pushStack( slice.apply( this, arguments ) );
                },
        
                first: function() {
       t@@ -296,34 +175,26 @@ jQuery.fn = jQuery.prototype = {
                        return this.eq( -1 );
                },
        
       -        slice: function() {
       -                return this.pushStack( slice.apply( this, arguments ),
       -                        "slice", slice.call(arguments).join(",") );
       -        },
       -
       -        map: function( callback ) {
       -                return this.pushStack( jQuery.map(this, function( elem, i ) {
       -                        return callback.call( elem, i, elem );
       -                }));
       +        eq: function( i ) {
       +                var len = this.length,
       +                        j = +i + ( i < 0 ? len : 0 );
       +                return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
                },
        
                end: function() {
       -                return this.prevObject || this.constructor(null);
       +                return this.prevObject || this.constructor();
                },
        
                // For internal use only.
                // Behaves like an Array's method, not like a jQuery method.
                push: push,
       -        sort: [].sort,
       -        splice: [].splice
       +        sort: arr.sort,
       +        splice: arr.splice
        };
        
       -// Give the init function the jQuery prototype for later instantiation
       -jQuery.fn.init.prototype = jQuery.fn;
       -
        jQuery.extend = jQuery.fn.extend = function() {
                var options, name, src, copy, copyIsArray, clone,
       -                target = arguments[0] || {},
       +                target = arguments[ 0 ] || {},
                        i = 1,
                        length = arguments.length,
                        deep = false;
       t@@ -331,25 +202,28 @@ jQuery.extend = jQuery.fn.extend = function() {
                // Handle a deep copy situation
                if ( typeof target === "boolean" ) {
                        deep = target;
       -                target = arguments[1] || {};
       -                // skip the boolean and the target
       -                i = 2;
       +
       +                // Skip the boolean and the target
       +                target = arguments[ i ] || {};
       +                i++;
                }
        
                // Handle case when target is a string or something (possible in deep copy)
       -        if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
       +        if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
                        target = {};
                }
        
       -        // extend jQuery itself if only one argument is passed
       -        if ( length === i ) {
       +        // Extend jQuery itself if only one argument is passed
       +        if ( i === length ) {
                        target = this;
       -                --i;
       +                i--;
                }
        
                for ( ; i < length; i++ ) {
       +
                        // Only deal with non-null/undefined values
       -                if ( (options = arguments[ i ]) != null ) {
       +                if ( ( options = arguments[ i ] ) != null ) {
       +
                                // Extend the base object
                                for ( name in options ) {
                                        src = target[ name ];
       t@@ -361,13 +235,15 @@ jQuery.extend = jQuery.fn.extend = function() {
                                        }
        
                                        // Recurse if we're merging plain objects or arrays
       -                                if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
       +                                if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
       +                                        ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
       +
                                                if ( copyIsArray ) {
                                                        copyIsArray = false;
       -                                                clone = src && jQuery.isArray(src) ? src : [];
       +                                                clone = src && jQuery.isArray( src ) ? src : [];
        
                                                } else {
       -                                                clone = src && jQuery.isPlainObject(src) ? src : {};
       +                                                clone = src && jQuery.isPlainObject( src ) ? src : {};
                                                }
        
                                                // Never move original objects, clone them
       t@@ -385,357 +261,163 @@ jQuery.extend = jQuery.fn.extend = function() {
                return target;
        };
        
       -jQuery.extend({
       -        noConflict: function( deep ) {
       -                if ( window.$ === jQuery ) {
       -                        window.$ = _$;
       -                }
       -
       -                if ( deep && window.jQuery === jQuery ) {
       -                        window.jQuery = _jQuery;
       -                }
       -
       -                return jQuery;
       -        },
       -
       -        // Is the DOM ready to be used? Set to true once it occurs.
       -        isReady: false,
       -
       -        // A counter to track how many items to wait for before
       -        // the ready event fires. See #6781
       -        readyWait: 1,
       -
       -        // Hold (or release) the ready event
       -        holdReady: function( hold ) {
       -                if ( hold ) {
       -                        jQuery.readyWait++;
       -                } else {
       -                        jQuery.ready( true );
       -                }
       -        },
       -
       -        // Handle when the DOM is ready
       -        ready: function( wait ) {
       -                // Either a released hold or an DOMready/load event and not yet ready
       -                if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
       -                        // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
       -                        if ( !document.body ) {
       -                                return setTimeout( jQuery.ready, 1 );
       -                        }
       -
       -                        // Remember that the DOM is ready
       -                        jQuery.isReady = true;
       +jQuery.extend( {
        
       -                        // If a normal DOM Ready event fired, decrement, and wait if need be
       -                        if ( wait !== true && --jQuery.readyWait > 0 ) {
       -                                return;
       -                        }
       +        // Unique for each copy of jQuery on the page
       +        expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
        
       -                        // If there are functions bound, to execute
       -                        readyList.fireWith( document, [ jQuery ] );
       +        // Assume jQuery is ready without the ready module
       +        isReady: true,
        
       -                        // Trigger any bound ready events
       -                        if ( jQuery.fn.trigger ) {
       -                                jQuery( document ).trigger( "ready" ).off( "ready" );
       -                        }
       -                }
       +        error: function( msg ) {
       +                throw new Error( msg );
                },
        
       -        bindReady: function() {
       -                if ( readyList ) {
       -                        return;
       -                }
       -
       -                readyList = jQuery.Callbacks( "once memory" );
       -
       -                // Catch cases where $(document).ready() is called after the
       -                // browser event has already occurred.
       -                if ( document.readyState === "complete" ) {
       -                        // Handle it asynchronously to allow scripts the opportunity to delay ready
       -                        return setTimeout( jQuery.ready, 1 );
       -                }
       -
       -                // Mozilla, Opera and webkit nightlies currently support this event
       -                if ( document.addEventListener ) {
       -                        // Use the handy event callback
       -                        document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
       -
       -                        // A fallback to window.onload, that will always work
       -                        window.addEventListener( "load", jQuery.ready, false );
       -
       -                // If IE event model is used
       -                } else if ( document.attachEvent ) {
       -                        // ensure firing before onload,
       -                        // maybe late but safe also for iframes
       -                        document.attachEvent( "onreadystatechange", DOMContentLoaded );
       -
       -                        // A fallback to window.onload, that will always work
       -                        window.attachEvent( "onload", jQuery.ready );
       -
       -                        // If IE and not a frame
       -                        // continually check to see if the document is ready
       -                        var toplevel = false;
       -
       -                        try {
       -                                toplevel = window.frameElement == null;
       -                        } catch(e) {}
       -
       -                        if ( document.documentElement.doScroll && toplevel ) {
       -                                doScrollCheck();
       -                        }
       -                }
       -        },
       +        noop: function() {},
        
       -        // See test/unit/core.js for details concerning isFunction.
       -        // Since version 1.3, DOM methods and functions like alert
       -        // aren't supported. They return false on IE (#2968).
                isFunction: function( obj ) {
       -                return jQuery.type(obj) === "function";
       +                return jQuery.type( obj ) === "function";
                },
        
       -        isArray: Array.isArray || function( obj ) {
       -                return jQuery.type(obj) === "array";
       -        },
       +        isArray: Array.isArray,
        
                isWindow: function( obj ) {
       -                return obj != null && obj == obj.window;
       +                return obj != null && obj === obj.window;
                },
        
                isNumeric: function( obj ) {
       -                return !isNaN( parseFloat(obj) ) && isFinite( obj );
       -        },
        
       -        type: function( obj ) {
       -                return obj == null ?
       -                        String( obj ) :
       -                        class2type[ toString.call(obj) ] || "object";
       +                // As of jQuery 3.0, isNumeric is limited to
       +                // strings and numbers (primitives or objects)
       +                // that can be coerced to finite numbers (gh-2662)
       +                var type = jQuery.type( obj );
       +                return ( type === "number" || type === "string" ) &&
       +
       +                        // parseFloat NaNs numeric-cast false positives ("")
       +                        // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
       +                        // subtraction forces infinities to NaN
       +                        !isNaN( obj - parseFloat( obj ) );
                },
        
                isPlainObject: function( obj ) {
       -                // Must be an Object.
       -                // Because of IE, we also have to check the presence of the constructor property.
       -                // Make sure that DOM nodes and window objects don't pass through, as well
       -                if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
       -                        return false;
       -                }
       +                var proto, Ctor;
        
       -                try {
       -                        // Not own constructor property must be Object
       -                        if ( obj.constructor &&
       -                                !hasOwn.call(obj, "constructor") &&
       -                                !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
       -                                return false;
       -                        }
       -                } catch ( e ) {
       -                        // IE8,9 Will throw exceptions on certain host objects #9897
       +                // Detect obvious negatives
       +                // Use toString instead of jQuery.type to catch host objects
       +                if ( !obj || toString.call( obj ) !== "[object Object]" ) {
                                return false;
                        }
        
       -                // Own properties are enumerated firstly, so to speed up,
       -                // if last one is own, then all properties are own.
       +                proto = getProto( obj );
        
       -                var key;
       -                for ( key in obj ) {}
       +                // Objects with no prototype (e.g., `Object.create( null )`) are plain
       +                if ( !proto ) {
       +                        return true;
       +                }
        
       -                return key === undefined || hasOwn.call( obj, key );
       +                // Objects with prototype are plain iff they were constructed by a global Object function
       +                Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
       +                return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
                },
        
                isEmptyObject: function( obj ) {
       -                for ( var name in obj ) {
       +
       +                /* eslint-disable no-unused-vars */
       +                // See https://github.com/eslint/eslint/issues/6125
       +                var name;
       +
       +                for ( name in obj ) {
                                return false;
                        }
                        return true;
                },
        
       -        error: function( msg ) {
       -                throw new Error( msg );
       -        },
       -
       -        parseJSON: function( data ) {
       -                if ( typeof data !== "string" || !data ) {
       -                        return null;
       -                }
       -
       -                // Make sure leading/trailing whitespace is removed (IE can't handle it)
       -                data = jQuery.trim( data );
       -
       -                // Attempt to parse using the native JSON parser first
       -                if ( window.JSON && window.JSON.parse ) {
       -                        return window.JSON.parse( data );
       -                }
       -
       -                // Make sure the incoming data is actual JSON
       -                // Logic borrowed from http://json.org/json2.js
       -                if ( rvalidchars.test( data.replace( rvalidescape, "@" )
       -                        .replace( rvalidtokens, "]" )
       -                        .replace( rvalidbraces, "")) ) {
       -
       -                        return ( new Function( "return " + data ) )();
       -
       +        type: function( obj ) {
       +                if ( obj == null ) {
       +                        return obj + "";
                        }
       -                jQuery.error( "Invalid JSON: " + data );
       -        },
        
       -        // Cross-browser xml parsing
       -        parseXML: function( data ) {
       -                if ( typeof data !== "string" || !data ) {
       -                        return null;
       -                }
       -                var xml, tmp;
       -                try {
       -                        if ( window.DOMParser ) { // Standard
       -                                tmp = new DOMParser();
       -                                xml = tmp.parseFromString( data , "text/xml" );
       -                        } else { // IE
       -                                xml = new ActiveXObject( "Microsoft.XMLDOM" );
       -                                xml.async = "false";
       -                                xml.loadXML( data );
       -                        }
       -                } catch( e ) {
       -                        xml = undefined;
       -                }
       -                if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
       -                        jQuery.error( "Invalid XML: " + data );
       -                }
       -                return xml;
       +                // Support: Android <=2.3 only (functionish RegExp)
       +                return typeof obj === "object" || typeof obj === "function" ?
       +                        class2type[ toString.call( obj ) ] || "object" :
       +                        typeof obj;
                },
        
       -        noop: function() {},
       -
                // Evaluates a script in a global context
       -        // Workarounds based on findings by Jim Driscoll
       -        // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
       -        globalEval: function( data ) {
       -                if ( data && rnotwhite.test( data ) ) {
       -                        // We use execScript on Internet Explorer
       -                        // We use an anonymous function so that context is window
       -                        // rather than jQuery in Firefox
       -                        ( window.execScript || function( data ) {
       -                                window[ "eval" ].call( window, data );
       -                        } )( data );
       -                }
       +        globalEval: function( code ) {
       +                DOMEval( code );
                },
        
                // Convert dashed to camelCase; used by the css and data modules
       +        // Support: IE <=9 - 11, Edge 12 - 13
                // Microsoft forgot to hump their vendor prefix (#9572)
                camelCase: function( string ) {
                        return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
                },
        
                nodeName: function( elem, name ) {
       -                return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
       +                return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
                },
        
       -        // args is for internal usage only
       -        each: function( object, callback, args ) {
       -                var name, i = 0,
       -                        length = object.length,
       -                        isObj = length === undefined || jQuery.isFunction( object );
       +        each: function( obj, callback ) {
       +                var length, i = 0;
        
       -                if ( args ) {
       -                        if ( isObj ) {
       -                                for ( name in object ) {
       -                                        if ( callback.apply( object[ name ], args ) === false ) {
       -                                                break;
       -                                        }
       -                                }
       -                        } else {
       -                                for ( ; i < length; ) {
       -                                        if ( callback.apply( object[ i++ ], args ) === false ) {
       -                                                break;
       -                                        }
       +                if ( isArrayLike( obj ) ) {
       +                        length = obj.length;
       +                        for ( ; i < length; i++ ) {
       +                                if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
       +                                        break;
                                        }
                                }
       -
       -                // A special, fast, case for the most common use of each
                        } else {
       -                        if ( isObj ) {
       -                                for ( name in object ) {
       -                                        if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
       -                                                break;
       -                                        }
       -                                }
       -                        } else {
       -                                for ( ; i < length; ) {
       -                                        if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
       -                                                break;
       -                                        }
       +                        for ( i in obj ) {
       +                                if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
       +                                        break;
                                        }
                                }
                        }
        
       -                return object;
       +                return obj;
                },
        
       -        // Use native String.trim function wherever possible
       -        trim: trim ?
       -                function( text ) {
       -                        return text == null ?
       -                                "" :
       -                                trim.call( text );
       -                } :
       -
       -                // Otherwise use our own trimming functionality
       -                function( text ) {
       -                        return text == null ?
       -                                "" :
       -                                text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
       -                },
       +        // Support: Android <=4.0 only
       +        trim: function( text ) {
       +                return text == null ?
       +                        "" :
       +                        ( text + "" ).replace( rtrim, "" );
       +        },
        
                // results is for internal usage only
       -        makeArray: function( array, results ) {
       +        makeArray: function( arr, results ) {
                        var ret = results || [];
        
       -                if ( array != null ) {
       -                        // The window, strings (and functions) also have 'length'
       -                        // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
       -                        var type = jQuery.type( array );
       -
       -                        if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
       -                                push.call( ret, array );
       +                if ( arr != null ) {
       +                        if ( isArrayLike( Object( arr ) ) ) {
       +                                jQuery.merge( ret,
       +                                        typeof arr === "string" ?
       +                                        [ arr ] : arr
       +                                );
                                } else {
       -                                jQuery.merge( ret, array );
       +                                push.call( ret, arr );
                                }
                        }
        
                        return ret;
                },
        
       -        inArray: function( elem, array, i ) {
       -                var len;
       -
       -                if ( array ) {
       -                        if ( indexOf ) {
       -                                return indexOf.call( array, elem, i );
       -                        }
       -
       -                        len = array.length;
       -                        i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
       -
       -                        for ( ; i < len; i++ ) {
       -                                // Skip accessing in sparse arrays
       -                                if ( i in array && array[ i ] === elem ) {
       -                                        return i;
       -                                }
       -                        }
       -                }
       -
       -                return -1;
       +        inArray: function( elem, arr, i ) {
       +                return arr == null ? -1 : indexOf.call( arr, elem, i );
                },
        
       +        // Support: Android <=4.0 only, PhantomJS 1 only
       +        // push.apply(_, arraylike) throws on ancient WebKit
                merge: function( first, second ) {
       -                var i = first.length,
       -                        j = 0;
       -
       -                if ( typeof second.length === "number" ) {
       -                        for ( var l = second.length; j < l; j++ ) {
       -                                first[ i++ ] = second[ j ];
       -                        }
       +                var len = +second.length,
       +                        j = 0,
       +                        i = first.length;
        
       -                } else {
       -                        while ( second[j] !== undefined ) {
       -                                first[ i++ ] = second[ j++ ];
       -                        }
       +                for ( ; j < len; j++ ) {
       +                        first[ i++ ] = second[ j ];
                        }
        
                        first.length = i;
       t@@ -743,53 +425,55 @@ jQuery.extend({
                        return first;
                },
        
       -        grep: function( elems, callback, inv ) {
       -                var ret = [], retVal;
       -                inv = !!inv;
       +        grep: function( elems, callback, invert ) {
       +                var callbackInverse,
       +                        matches = [],
       +                        i = 0,
       +                        length = elems.length,
       +                        callbackExpect = !invert;
        
                        // Go through the array, only saving the items
                        // that pass the validator function
       -                for ( var i = 0, length = elems.length; i < length; i++ ) {
       -                        retVal = !!callback( elems[ i ], i );
       -                        if ( inv !== retVal ) {
       -                                ret.push( elems[ i ] );
       +                for ( ; i < length; i++ ) {
       +                        callbackInverse = !callback( elems[ i ], i );
       +                        if ( callbackInverse !== callbackExpect ) {
       +                                matches.push( elems[ i ] );
                                }
                        }
        
       -                return ret;
       +                return matches;
                },
        
                // arg is for internal usage only
                map: function( elems, callback, arg ) {
       -                var value, key, ret = [],
       +                var length, value,
                                i = 0,
       -                        length = elems.length,
       -                        // jquery objects are treated as arrays
       -                        isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
       +                        ret = [];
        
       -                // Go through the array, translating each of the items to their
       -                if ( isArray ) {
       +                // Go through the array, translating each of the items to their new values
       +                if ( isArrayLike( elems ) ) {
       +                        length = elems.length;
                                for ( ; i < length; i++ ) {
                                        value = callback( elems[ i ], i, arg );
        
                                        if ( value != null ) {
       -                                        ret[ ret.length ] = value;
       +                                        ret.push( value );
                                        }
                                }
        
                        // Go through every key on the object,
                        } else {
       -                        for ( key in elems ) {
       -                                value = callback( elems[ key ], key, arg );
       +                        for ( i in elems ) {
       +                                value = callback( elems[ i ], i, arg );
        
                                        if ( value != null ) {
       -                                        ret[ ret.length ] = value;
       +                                        ret.push( value );
                                        }
                                }
                        }
        
                        // Flatten any nested arrays
       -                return ret.concat.apply( [], ret );
       +                return concat.apply( [], ret );
                },
        
                // A global GUID counter for objects
       t@@ -798,8 +482,10 @@ jQuery.extend({
                // Bind a function to a context, optionally partially applying any
                // arguments.
                proxy: function( fn, context ) {
       +                var tmp, args, proxy;
       +
                        if ( typeof context === "string" ) {
       -                        var tmp = fn[ context ];
       +                        tmp = fn[ context ];
                                context = fn;
                                fn = tmp;
                        }
       t@@ -811,6151 +497,6095 @@ jQuery.extend({
                        }
        
                        // Simulated bind
       -                var args = slice.call( arguments, 2 ),
       -                        proxy = function() {
       -                                return fn.apply( context, args.concat( slice.call( arguments ) ) );
       -                        };
       +                args = slice.call( arguments, 2 );
       +                proxy = function() {
       +                        return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
       +                };
        
                        // Set the guid of unique handler to the same of original handler, so it can be removed
       -                proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
       +                proxy.guid = fn.guid = fn.guid || jQuery.guid++;
        
                        return proxy;
                },
        
       -        // Mutifunctional method to get and set values to a collection
       -        // The value/s can optionally be executed if it's a function
       -        access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
       -                var exec,
       -                        bulk = key == null,
       -                        i = 0,
       -                        length = elems.length;
       +        now: Date.now,
        
       -                // Sets many values
       -                if ( key && typeof key === "object" ) {
       -                        for ( i in key ) {
       -                                jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
       -                        }
       -                        chainable = 1;
       +        // jQuery.support is not used in Core but other projects attach their
       +        // properties to it so it needs to exist.
       +        support: support
       +} );
        
       -                // Sets one value
       -                } else if ( value !== undefined ) {
       -                        // Optionally, function values get executed if exec is true
       -                        exec = pass === undefined && jQuery.isFunction( value );
       +if ( typeof Symbol === "function" ) {
       +        jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
       +}
        
       -                        if ( bulk ) {
       -                                // Bulk operations only iterate when executing function values
       -                                if ( exec ) {
       -                                        exec = fn;
       -                                        fn = function( elem, key, value ) {
       -                                                return exec.call( jQuery( elem ), value );
       -                                        };
       +// Populate the class2type map
       +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
       +function( i, name ) {
       +        class2type[ "[object " + name + "]" ] = name.toLowerCase();
       +} );
        
       -                                // Otherwise they run against the entire set
       -                                } else {
       -                                        fn.call( elems, value );
       -                                        fn = null;
       -                                }
       -                        }
       +function isArrayLike( obj ) {
        
       -                        if ( fn ) {
       -                                for (; i < length; i++ ) {
       -                                        fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
       -                                }
       -                        }
       +        // Support: real iOS 8.2 only (not reproducible in simulator)
       +        // `in` check used to prevent JIT error (gh-2145)
       +        // hasOwn isn't used here due to false negatives
       +        // regarding Nodelist length in IE
       +        var length = !!obj && "length" in obj && obj.length,
       +                type = jQuery.type( obj );
        
       -                        chainable = 1;
       -                }
       -
       -                return chainable ?
       -                        elems :
       +        if ( type === "function" || jQuery.isWindow( obj ) ) {
       +                return false;
       +        }
        
       -                        // Gets
       -                        bulk ?
       -                                fn.call( elems ) :
       -                                length ? fn( elems[0], key ) : emptyGet;
       +        return type === "array" || length === 0 ||
       +                typeof length === "number" && length > 0 && ( length - 1 ) in obj;
       +}
       +var Sizzle =
       +/*!
       + * Sizzle CSS Selector Engine v2.3.3
       + * https://sizzlejs.com/
       + *
       + * Copyright jQuery Foundation and other contributors
       + * Released under the MIT license
       + * http://jquery.org/license
       + *
       + * Date: 2016-08-08
       + */
       +(function( window ) {
       +
       +var i,
       +        support,
       +        Expr,
       +        getText,
       +        isXML,
       +        tokenize,
       +        compile,
       +        select,
       +        outermostContext,
       +        sortInput,
       +        hasDuplicate,
       +
       +        // Local document vars
       +        setDocument,
       +        document,
       +        docElem,
       +        documentIsHTML,
       +        rbuggyQSA,
       +        rbuggyMatches,
       +        matches,
       +        contains,
       +
       +        // Instance-specific data
       +        expando = "sizzle" + 1 * new Date(),
       +        preferredDoc = window.document,
       +        dirruns = 0,
       +        done = 0,
       +        classCache = createCache(),
       +        tokenCache = createCache(),
       +        compilerCache = createCache(),
       +        sortOrder = function( a, b ) {
       +                if ( a === b ) {
       +                        hasDuplicate = true;
       +                }
       +                return 0;
                },
        
       -        now: function() {
       -                return ( new Date() ).getTime();
       +        // Instance methods
       +        hasOwn = ({}).hasOwnProperty,
       +        arr = [],
       +        pop = arr.pop,
       +        push_native = arr.push,
       +        push = arr.push,
       +        slice = arr.slice,
       +        // Use a stripped-down indexOf as it's faster than native
       +        // https://jsperf.com/thor-indexof-vs-for/5
       +        indexOf = function( list, elem ) {
       +                var i = 0,
       +                        len = list.length;
       +                for ( ; i < len; i++ ) {
       +                        if ( list[i] === elem ) {
       +                                return i;
       +                        }
       +                }
       +                return -1;
                },
        
       -        // Use of jQuery.browser is frowned upon.
       -        // More details: http://docs.jquery.com/Utilities/jQuery.browser
       -        uaMatch: function( ua ) {
       -                ua = ua.toLowerCase();
       +        booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
        
       -                var match = rwebkit.exec( ua ) ||
       -                        ropera.exec( ua ) ||
       -                        rmsie.exec( ua ) ||
       -                        ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
       -                        [];
       +        // Regular expressions
        
       -                return { browser: match[1] || "", version: match[2] || "0" };
       -        },
       +        // http://www.w3.org/TR/css3-selectors/#whitespace
       +        whitespace = "[\\x20\\t\\r\\n\\f]",
        
       -        sub: function() {
       -                function jQuerySub( selector, context ) {
       -                        return new jQuerySub.fn.init( selector, context );
       -                }
       -                jQuery.extend( true, jQuerySub, this );
       -                jQuerySub.superclass = this;
       -                jQuerySub.fn = jQuerySub.prototype = this();
       -                jQuerySub.fn.constructor = jQuerySub;
       -                jQuerySub.sub = this.sub;
       -                jQuerySub.fn.init = function init( selector, context ) {
       -                        if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
       -                                context = jQuerySub( context );
       -                        }
       +        // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
       +        identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
        
       -                        return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
       -                };
       -                jQuerySub.fn.init.prototype = jQuerySub.fn;
       -                var rootjQuerySub = jQuerySub(document);
       -                return jQuerySub;
       -        },
       +        // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
       +        attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
       +                // Operator (capture 2)
       +                "*([*^$|!~]?=)" + whitespace +
       +                // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
       +                "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
       +                "*\\]",
        
       -        browser: {}
       -});
       +        pseudos = ":(" + identifier + ")(?:\\((" +
       +                // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
       +                // 1. quoted (capture 3; capture 4 or capture 5)
       +                "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
       +                // 2. simple (capture 6)
       +                "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
       +                // 3. anything else (capture 2)
       +                ".*" +
       +                ")\\)|)",
        
       -// Populate the class2type map
       -jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
       -        class2type[ "[object " + name + "]" ] = name.toLowerCase();
       -});
       +        // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
       +        rwhitespace = new RegExp( whitespace + "+", "g" ),
       +        rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
        
       -browserMatch = jQuery.uaMatch( userAgent );
       -if ( browserMatch.browser ) {
       -        jQuery.browser[ browserMatch.browser ] = true;
       -        jQuery.browser.version = browserMatch.version;
       -}
       +        rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
       +        rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
        
       -// Deprecated, use jQuery.browser.webkit instead
       -if ( jQuery.browser.webkit ) {
       -        jQuery.browser.safari = true;
       -}
       +        rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
        
       -// IE doesn't match non-breaking spaces with \s
       -if ( rnotwhite.test( "\xA0" ) ) {
       -        trimLeft = /^[\s\xA0]+/;
       -        trimRight = /[\s\xA0]+$/;
       -}
       +        rpseudo = new RegExp( pseudos ),
       +        ridentifier = new RegExp( "^" + identifier + "$" ),
        
       -// All jQuery objects should point back to these
       -rootjQuery = jQuery(document);
       +        matchExpr = {
       +                "ID": new RegExp( "^#(" + identifier + ")" ),
       +                "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
       +                "TAG": new RegExp( "^(" + identifier + "|[*])" ),
       +                "ATTR": new RegExp( "^" + attributes ),
       +                "PSEUDO": new RegExp( "^" + pseudos ),
       +                "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
       +                        "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
       +                        "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
       +                "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
       +                // For use in libraries implementing .is()
       +                // We use this for POS matching in `select`
       +                "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
       +                        whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
       +        },
        
       -// Cleanup functions for the document ready method
       -if ( document.addEventListener ) {
       -        DOMContentLoaded = function() {
       -                document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
       -                jQuery.ready();
       -        };
       +        rinputs = /^(?:input|select|textarea|button)$/i,
       +        rheader = /^h\d$/i,
        
       -} else if ( document.attachEvent ) {
       -        DOMContentLoaded = function() {
       -                // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
       -                if ( document.readyState === "complete" ) {
       -                        document.detachEvent( "onreadystatechange", DOMContentLoaded );
       -                        jQuery.ready();
       -                }
       -        };
       -}
       +        rnative = /^[^{]+\{\s*\[native \w/,
        
       -// The DOM ready check for Internet Explorer
       -function doScrollCheck() {
       -        if ( jQuery.isReady ) {
       -                return;
       -        }
       +        // Easily-parseable/retrievable ID or TAG or CLASS selectors
       +        rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
        
       -        try {
       -                // If IE is used, use the trick by Diego Perini
       -                // http://javascript.nwbox.com/IEContentLoaded/
       -                document.documentElement.doScroll("left");
       -        } catch(e) {
       -                setTimeout( doScrollCheck, 1 );
       -                return;
       -        }
       +        rsibling = /[+~]/,
        
       -        // and execute any waiting functions
       -        jQuery.ready();
       -}
       +        // CSS escapes
       +        // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
       +        runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
       +        funescape = function( _, escaped, escapedWhitespace ) {
       +                var high = "0x" + escaped - 0x10000;
       +                // NaN means non-codepoint
       +                // Support: Firefox<24
       +                // Workaround erroneous numeric interpretation of +"0x"
       +                return high !== high || escapedWhitespace ?
       +                        escaped :
       +                        high < 0 ?
       +                                // BMP codepoint
       +                                String.fromCharCode( high + 0x10000 ) :
       +                                // Supplemental Plane codepoint (surrogate pair)
       +                                String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
       +        },
        
       -return jQuery;
       +        // CSS string/identifier serialization
       +        // https://drafts.csswg.org/cssom/#common-serializing-idioms
       +        rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
       +        fcssescape = function( ch, asCodePoint ) {
       +                if ( asCodePoint ) {
        
       -})();
       +                        // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
       +                        if ( ch === "\0" ) {
       +                                return "\uFFFD";
       +                        }
        
       +                        // Control characters and (dependent upon position) numbers get escaped as code points
       +                        return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
       +                }
        
       -// String to Object flags format cache
       -var flagsCache = {};
       +                // Other potentially-special ASCII characters get backslash-escaped
       +                return "\\" + ch;
       +        },
       +
       +        // Used for iframes
       +        // See setDocument()
       +        // Removing the function wrapper causes a "Permission Denied"
       +        // error in IE
       +        unloadHandler = function() {
       +                setDocument();
       +        },
       +
       +        disabledAncestor = addCombinator(
       +                function( elem ) {
       +                        return elem.disabled === true && ("form" in elem || "label" in elem);
       +                },
       +                { dir: "parentNode", next: "legend" }
       +        );
        
       -// Convert String-formatted flags into Object-formatted ones and store in cache
       -function createFlags( flags ) {
       -        var object = flagsCache[ flags ] = {},
       -                i, length;
       -        flags = flags.split( /\s+/ );
       -        for ( i = 0, length = flags.length; i < length; i++ ) {
       -                object[ flags[i] ] = true;
       -        }
       -        return object;
       -}
       +// Optimize for push.apply( _, NodeList )
       +try {
       +        push.apply(
       +                (arr = slice.call( preferredDoc.childNodes )),
       +                preferredDoc.childNodes
       +        );
       +        // Support: Android<4.0
       +        // Detect silently failing push.apply
       +        arr[ preferredDoc.childNodes.length ].nodeType;
       +} catch ( e ) {
       +        push = { apply: arr.length ?
       +
       +                // Leverage slice if possible
       +                function( target, els ) {
       +                        push_native.apply( target, slice.call(els) );
       +                } :
        
       -/*
       - * Create a callback list using the following parameters:
       - *
       - *        flags:        an optional list of space-separated flags that will change how
       - *                        the callback list behaves
       - *
       - * By default a callback list will act like an event callback list and can be
       - * "fired" multiple times.
       - *
       - * Possible flags:
       - *
       - *        once:                        will ensure the callback list can only be fired once (like a Deferred)
       - *
       - *        memory:                        will keep track of previous values and will call any callback added
       - *                                        after the list has been fired right away with the latest "memorized"
       - *                                        values (like a Deferred)
       - *
       - *        unique:                        will ensure a callback can only be added once (no duplicate in the list)
       - *
       - *        stopOnFalse:        interrupt callings when a callback returns false
       - *
       - */
       -jQuery.Callbacks = function( flags ) {
       +                // Support: IE<9
       +                // Otherwise append directly
       +                function( target, els ) {
       +                        var j = target.length,
       +                                i = 0;
       +                        // Can't trust NodeList.length
       +                        while ( (target[j++] = els[i++]) ) {}
       +                        target.length = j - 1;
       +                }
       +        };
       +}
        
       -        // Convert flags from String-formatted to Object-formatted
       -        // (we check in cache first)
       -        flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
       +function Sizzle( selector, context, results, seed ) {
       +        var m, i, elem, nid, match, groups, newSelector,
       +                newContext = context && context.ownerDocument,
        
       -        var // Actual callback list
       -                list = [],
       -                // Stack of fire calls for repeatable lists
       -                stack = [],
       -                // Last fire value (for non-forgettable lists)
       -                memory,
       -                // Flag to know if list was already fired
       -                fired,
       -                // Flag to know if list is currently firing
       -                firing,
       -                // First callback to fire (used internally by add and fireWith)
       -                firingStart,
       -                // End of the loop when firing
       -                firingLength,
       -                // Index of currently firing callback (modified by remove if needed)
       -                firingIndex,
       -                // Add one or several callbacks to the list
       -                add = function( args ) {
       -                        var i,
       -                                length,
       -                                elem,
       -                                type,
       -                                actual;
       -                        for ( i = 0, length = args.length; i < length; i++ ) {
       -                                elem = args[ i ];
       -                                type = jQuery.type( elem );
       -                                if ( type === "array" ) {
       -                                        // Inspect recursively
       -                                        add( elem );
       -                                } else if ( type === "function" ) {
       -                                        // Add if not in unique mode and callback is not in
       -                                        if ( !flags.unique || !self.has( elem ) ) {
       -                                                list.push( elem );
       -                                        }
       -                                }
       -                        }
       -                },
       -                // Fire callbacks
       -                fire = function( context, args ) {
       -                        args = args || [];
       -                        memory = !flags.memory || [ context, args ];
       -                        fired = true;
       -                        firing = true;
       -                        firingIndex = firingStart || 0;
       -                        firingStart = 0;
       -                        firingLength = list.length;
       -                        for ( ; list && firingIndex < firingLength; firingIndex++ ) {
       -                                if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
       -                                        memory = true; // Mark as halted
       -                                        break;
       -                                }
       -                        }
       -                        firing = false;
       -                        if ( list ) {
       -                                if ( !flags.once ) {
       -                                        if ( stack && stack.length ) {
       -                                                memory = stack.shift();
       -                                                self.fireWith( memory[ 0 ], memory[ 1 ] );
       -                                        }
       -                                } else if ( memory === true ) {
       -                                        self.disable();
       -                                } else {
       -                                        list = [];
       -                                }
       -                        }
       -                },
       -                // Actual Callbacks object
       -                self = {
       -                        // Add a callback or a collection of callbacks to the list
       -                        add: function() {
       -                                if ( list ) {
       -                                        var length = list.length;
       -                                        add( arguments );
       -                                        // Do we need to add the callbacks to the
       -                                        // current firing batch?
       -                                        if ( firing ) {
       -                                                firingLength = list.length;
       -                                        // With memory, if we're not firing then
       -                                        // we should call right away, unless previous
       -                                        // firing was halted (stopOnFalse)
       -                                        } else if ( memory && memory !== true ) {
       -                                                firingStart = length;
       -                                                fire( memory[ 0 ], memory[ 1 ] );
       -                                        }
       -                                }
       -                                return this;
       -                        },
       -                        // Remove a callback from the list
       -                        remove: function() {
       -                                if ( list ) {
       -                                        var args = arguments,
       -                                                argIndex = 0,
       -                                                argLength = args.length;
       -                                        for ( ; argIndex < argLength ; argIndex++ ) {
       -                                                for ( var i = 0; i < list.length; i++ ) {
       -                                                        if ( args[ argIndex ] === list[ i ] ) {
       -                                                                // Handle firingIndex and firingLength
       -                                                                if ( firing ) {
       -                                                                        if ( i <= firingLength ) {
       -                                                                                firingLength--;
       -                                                                                if ( i <= firingIndex ) {
       -                                                                                        firingIndex--;
       -                                                                                }
       -                                                                        }
       -                                                                }
       -                                                                // Remove the element
       -                                                                list.splice( i--, 1 );
       -                                                                // If we have some unicity property then
       -                                                                // we only need to do this once
       -                                                                if ( flags.unique ) {
       -                                                                        break;
       -                                                                }
       -                                                        }
       -                                                }
       -                                        }
       -                                }
       -                                return this;
       -                        },
       -                        // Control if a given callback is in the list
       -                        has: function( fn ) {
       -                                if ( list ) {
       -                                        var i = 0,
       -                                                length = list.length;
       -                                        for ( ; i < length; i++ ) {
       -                                                if ( fn === list[ i ] ) {
       -                                                        return true;
       -                                                }
       -                                        }
       -                                }
       -                                return false;
       -                        },
       -                        // Remove all callbacks from the list
       -                        empty: function() {
       -                                list = [];
       -                                return this;
       -                        },
       -                        // Have the list do nothing anymore
       -                        disable: function() {
       -                                list = stack = memory = undefined;
       -                                return this;
       -                        },
       -                        // Is it disabled?
       -                        disabled: function() {
       -                                return !list;
       -                        },
       -                        // Lock the list in its current state
       -                        lock: function() {
       -                                stack = undefined;
       -                                if ( !memory || memory === true ) {
       -                                        self.disable();
       -                                }
       -                                return this;
       -                        },
       -                        // Is it locked?
       -                        locked: function() {
       -                                return !stack;
       -                        },
       -                        // Call all callbacks with the given context and arguments
       -                        fireWith: function( context, args ) {
       -                                if ( stack ) {
       -                                        if ( firing ) {
       -                                                if ( !flags.once ) {
       -                                                        stack.push( [ context, args ] );
       -                                                }
       -                                        } else if ( !( flags.once && memory ) ) {
       -                                                fire( context, args );
       -                                        }
       -                                }
       -                                return this;
       -                        },
       -                        // Call all the callbacks with the given arguments
       -                        fire: function() {
       -                                self.fireWith( this, arguments );
       -                                return this;
       -                        },
       -                        // To know if the callbacks have already been called at least once
       -                        fired: function() {
       -                                return !!fired;
       -                        }
       -                };
       +                // nodeType defaults to 9, since context defaults to document
       +                nodeType = context ? context.nodeType : 9;
        
       -        return self;
       -};
       +        results = results || [];
        
       +        // Return early from calls with invalid selector or context
       +        if ( typeof selector !== "string" || !selector ||
       +                nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
        
       +                return results;
       +        }
        
       +        // Try to shortcut find operations (as opposed to filters) in HTML documents
       +        if ( !seed ) {
        
       -var // Static reference to slice
       -        sliceDeferred = [].slice;
       +                if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
       +                        setDocument( context );
       +                }
       +                context = context || document;
        
       -jQuery.extend({
       +                if ( documentIsHTML ) {
        
       -        Deferred: function( func ) {
       -                var doneList = jQuery.Callbacks( "once memory" ),
       -                        failList = jQuery.Callbacks( "once memory" ),
       -                        progressList = jQuery.Callbacks( "memory" ),
       -                        state = "pending",
       -                        lists = {
       -                                resolve: doneList,
       -                                reject: failList,
       -                                notify: progressList
       -                        },
       -                        promise = {
       -                                done: doneList.add,
       -                                fail: failList.add,
       -                                progress: progressList.add,
       +                        // If the selector is sufficiently simple, try using a "get*By*" DOM method
       +                        // (excepting DocumentFragment context, where the methods don't exist)
       +                        if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
        
       -                                state: function() {
       -                                        return state;
       -                                },
       +                                // ID selector
       +                                if ( (m = match[1]) ) {
        
       -                                // Deprecated
       -                                isResolved: doneList.fired,
       -                                isRejected: failList.fired,
       +                                        // Document context
       +                                        if ( nodeType === 9 ) {
       +                                                if ( (elem = context.getElementById( m )) ) {
        
       -                                then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
       -                                        deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
       -                                        return this;
       -                                },
       -                                always: function() {
       -                                        deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
       -                                        return this;
       -                                },
       -                                pipe: function( fnDone, fnFail, fnProgress ) {
       -                                        return jQuery.Deferred(function( newDefer ) {
       -                                                jQuery.each( {
       -                                                        done: [ fnDone, "resolve" ],
       -                                                        fail: [ fnFail, "reject" ],
       -                                                        progress: [ fnProgress, "notify" ]
       -                                                }, function( handler, data ) {
       -                                                        var fn = data[ 0 ],
       -                                                                action = data[ 1 ],
       -                                                                returned;
       -                                                        if ( jQuery.isFunction( fn ) ) {
       -                                                                deferred[ handler ](function() {
       -                                                                        returned = fn.apply( this, arguments );
       -                                                                        if ( returned && jQuery.isFunction( returned.promise ) ) {
       -                                                                                returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
       -                                                                        } else {
       -                                                                                newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
       -                                                                        }
       -                                                                });
       -                                                        } else {
       -                                                                deferred[ handler ]( newDefer[ action ] );
       +                                                        // Support: IE, Opera, Webkit
       +                                                        // TODO: identify versions
       +                                                        // getElementById can match elements by name instead of ID
       +                                                        if ( elem.id === m ) {
       +                                                                results.push( elem );
       +                                                                return results;
                                                                }
       -                                                });
       -                                        }).promise();
       -                                },
       -                                // Get a promise for this deferred
       -                                // If obj is provided, the promise aspect is added to the object
       -                                promise: function( obj ) {
       -                                        if ( obj == null ) {
       -                                                obj = promise;
       +                                                } else {
       +                                                        return results;
       +                                                }
       +
       +                                        // Element context
                                                } else {
       -                                                for ( var key in promise ) {
       -                                                        obj[ key ] = promise[ key ];
       +
       +                                                // Support: IE, Opera, Webkit
       +                                                // TODO: identify versions
       +                                                // getElementById can match elements by name instead of ID
       +                                                if ( newContext && (elem = newContext.getElementById( m )) &&
       +                                                        contains( context, elem ) &&
       +                                                        elem.id === m ) {
       +
       +                                                        results.push( elem );
       +                                                        return results;
                                                        }
                                                }
       -                                        return obj;
       +
       +                                // Type selector
       +                                } else if ( match[2] ) {
       +                                        push.apply( results, context.getElementsByTagName( selector ) );
       +                                        return results;
       +
       +                                // Class selector
       +                                } else if ( (m = match[3]) && support.getElementsByClassName &&
       +                                        context.getElementsByClassName ) {
       +
       +                                        push.apply( results, context.getElementsByClassName( m ) );
       +                                        return results;
                                        }
       -                        },
       -                        deferred = promise.promise({}),
       -                        key;
       +                        }
        
       -                for ( key in lists ) {
       -                        deferred[ key ] = lists[ key ].fire;
       -                        deferred[ key + "With" ] = lists[ key ].fireWith;
       -                }
       +                        // Take advantage of querySelectorAll
       +                        if ( support.qsa &&
       +                                !compilerCache[ selector + " " ] &&
       +                                (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
        
       -                // Handle state
       -                deferred.done( function() {
       -                        state = "resolved";
       -                }, failList.disable, progressList.lock ).fail( function() {
       -                        state = "rejected";
       -                }, doneList.disable, progressList.lock );
       +                                if ( nodeType !== 1 ) {
       +                                        newContext = context;
       +                                        newSelector = selector;
        
       -                // Call given func if any
       -                if ( func ) {
       -                        func.call( deferred, deferred );
       -                }
       +                                // qSA looks outside Element context, which is not what we want
       +                                // Thanks to Andrew Dupont for this workaround technique
       +                                // Support: IE <=8
       +                                // Exclude object elements
       +                                } else if ( context.nodeName.toLowerCase() !== "object" ) {
        
       -                // All done!
       -                return deferred;
       -        },
       +                                        // Capture the context ID, setting it first if necessary
       +                                        if ( (nid = context.getAttribute( "id" )) ) {
       +                                                nid = nid.replace( rcssescape, fcssescape );
       +                                        } else {
       +                                                context.setAttribute( "id", (nid = expando) );
       +                                        }
        
       -        // Deferred helper
       -        when: function( firstParam ) {
       -                var args = sliceDeferred.call( arguments, 0 ),
       -                        i = 0,
       -                        length = args.length,
       -                        pValues = new Array( length ),
       -                        count = length,
       -                        pCount = length,
       -                        deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
       -                                firstParam :
       -                                jQuery.Deferred(),
       -                        promise = deferred.promise();
       -                function resolveFunc( i ) {
       -                        return function( value ) {
       -                                args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
       -                                if ( !( --count ) ) {
       -                                        deferred.resolveWith( deferred, args );
       +                                        // Prefix every selector in the list
       +                                        groups = tokenize( selector );
       +                                        i = groups.length;
       +                                        while ( i-- ) {
       +                                                groups[i] = "#" + nid + " " + toSelector( groups[i] );
       +                                        }
       +                                        newSelector = groups.join( "," );
       +
       +                                        // Expand context for sibling selectors
       +                                        newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
       +                                                context;
                                        }
       -                        };
       -                }
       -                function progressFunc( i ) {
       -                        return function( value ) {
       -                                pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
       -                                deferred.notifyWith( promise, pValues );
       -                        };
       -                }
       -                if ( length > 1 ) {
       -                        for ( ; i < length; i++ ) {
       -                                if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
       -                                        args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
       -                                } else {
       -                                        --count;
       +
       +                                if ( newSelector ) {
       +                                        try {
       +                                                push.apply( results,
       +                                                        newContext.querySelectorAll( newSelector )
       +                                                );
       +                                                return results;
       +                                        } catch ( qsaError ) {
       +                                        } finally {
       +                                                if ( nid === expando ) {
       +                                                        context.removeAttribute( "id" );
       +                                                }
       +                                        }
                                        }
                                }
       -                        if ( !count ) {
       -                                deferred.resolveWith( deferred, args );
       -                        }
       -                } else if ( deferred !== firstParam ) {
       -                        deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
                        }
       -                return promise;
                }
       -});
        
       +        // All others
       +        return select( selector.replace( rtrim, "$1" ), context, results, seed );
       +}
        
       +/**
       + * Create key-value caches of limited size
       + * @returns {function(string, object)} Returns the Object data after storing it on itself with
       + *        property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
       + *        deleting the oldest entry
       + */
       +function createCache() {
       +        var keys = [];
        
       +        function cache( key, value ) {
       +                // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
       +                if ( keys.push( key + " " ) > Expr.cacheLength ) {
       +                        // Only keep the most recent entries
       +                        delete cache[ keys.shift() ];
       +                }
       +                return (cache[ key + " " ] = value);
       +        }
       +        return cache;
       +}
        
       -jQuery.support = (function() {
       -
       -        var support,
       -                all,
       -                a,
       -                select,
       -                opt,
       -                input,
       -                fragment,
       -                tds,
       -                events,
       -                eventName,
       -                i,
       -                isSupported,
       -                div = document.createElement( "div" ),
       -                documentElement = document.documentElement;
       -
       -        // Preliminary tests
       -        div.setAttribute("className", "t");
       -        div.innerHTML = "   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
       -
       -        all = div.getElementsByTagName( "*" );
       -        a = div.getElementsByTagName( "a" )[ 0 ];
       -
       -        // Can't get basic test support
       -        if ( !all || !all.length || !a ) {
       -                return {};
       -        }
       -
       -        // First batch of supports tests
       -        select = document.createElement( "select" );
       -        opt = select.appendChild( document.createElement("option") );
       -        input = div.getElementsByTagName( "input" )[ 0 ];
       -
       -        support = {
       -                // IE strips leading whitespace when .innerHTML is used
       -                leadingWhitespace: ( div.firstChild.nodeType === 3 ),
       -
       -                // Make sure that tbody elements aren't automatically inserted
       -                // IE will insert them into empty tables
       -                tbody: !div.getElementsByTagName("tbody").length,
       -
       -                // Make sure that link elements get serialized correctly by innerHTML
       -                // This requires a wrapper element in IE
       -                htmlSerialize: !!div.getElementsByTagName("link").length,
       -
       -                // Get the style information from getAttribute
       -                // (IE uses .cssText instead)
       -                style: /top/.test( a.getAttribute("style") ),
       -
       -                // Make sure that URLs aren't manipulated
       -                // (IE normalizes it by default)
       -                hrefNormalized: ( a.getAttribute("href") === "/a" ),
       -
       -                // Make sure that element opacity exists
       -                // (IE uses filter instead)
       -                // Use a regex to work around a WebKit issue. See #5145
       -                opacity: /^0.55/.test( a.style.opacity ),
       -
       -                // Verify style float existence
       -                // (IE uses styleFloat instead of cssFloat)
       -                cssFloat: !!a.style.cssFloat,
       -
       -                // Make sure that if no value is specified for a checkbox
       -                // that it defaults to "on".
       -                // (WebKit defaults to "" instead)
       -                checkOn: ( input.value === "on" ),
       -
       -                // Make sure that a selected-by-default option has a working selected property.
       -                // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
       -                optSelected: opt.selected,
       -
       -                // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
       -                getSetAttribute: div.className !== "t",
       -
       -                // Tests for enctype support on a form(#6743)
       -                enctype: !!document.createElement("form").enctype,
       -
       -                // Makes sure cloning an html5 element does not cause problems
       -                // Where outerHTML is undefined, this still works
       -                html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
       -
       -                // Will be defined later
       -                submitBubbles: true,
       -                changeBubbles: true,
       -                focusinBubbles: false,
       -                deleteExpando: true,
       -                noCloneEvent: true,
       -                inlineBlockNeedsLayout: false,
       -                shrinkWrapBlocks: false,
       -                reliableMarginRight: true,
       -                pixelMargin: true
       -        };
       +/**
       + * Mark a function for special use by Sizzle
       + * @param {Function} fn The function to mark
       + */
       +function markFunction( fn ) {
       +        fn[ expando ] = true;
       +        return fn;
       +}
        
       -        // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
       -        jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
       +/**
       + * Support testing using an element
       + * @param {Function} fn Passed the created element and returns a boolean result
       + */
       +function assert( fn ) {
       +        var el = document.createElement("fieldset");
        
       -        // Make sure checked status is properly cloned
       -        input.checked = true;
       -        support.noCloneChecked = input.cloneNode( true ).checked;
       +        try {
       +                return !!fn( el );
       +        } catch (e) {
       +                return false;
       +        } finally {
       +                // Remove from its parent by default
       +                if ( el.parentNode ) {
       +                        el.parentNode.removeChild( el );
       +                }
       +                // release memory in IE
       +                el = null;
       +        }
       +}
        
       -        // Make sure that the options inside disabled selects aren't marked as disabled
       -        // (WebKit marks them as disabled)
       -        select.disabled = true;
       -        support.optDisabled = !opt.disabled;
       +/**
       + * Adds the same handler for all of the specified attrs
       + * @param {String} attrs Pipe-separated list of attributes
       + * @param {Function} handler The method that will be applied
       + */
       +function addHandle( attrs, handler ) {
       +        var arr = attrs.split("|"),
       +                i = arr.length;
        
       -        // Test to see if it's possible to delete an expando from an element
       -        // Fails in Internet Explorer
       -        try {
       -                delete div.test;
       -        } catch( e ) {
       -                support.deleteExpando = false;
       +        while ( i-- ) {
       +                Expr.attrHandle[ arr[i] ] = handler;
                }
       +}
        
       -        if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
       -                div.attachEvent( "onclick", function() {
       -                        // Cloning a node shouldn't copy over any
       -                        // bound event handlers (IE does this)
       -                        support.noCloneEvent = false;
       -                });
       -                div.cloneNode( true ).fireEvent( "onclick" );
       +/**
       + * Checks document order of two siblings
       + * @param {Element} a
       + * @param {Element} b
       + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
       + */
       +function siblingCheck( a, b ) {
       +        var cur = b && a,
       +                diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
       +                        a.sourceIndex - b.sourceIndex;
       +
       +        // Use IE sourceIndex if available on both nodes
       +        if ( diff ) {
       +                return diff;
                }
        
       -        // Check if a radio maintains its value
       -        // after being appended to the DOM
       -        input = document.createElement("input");
       -        input.value = "t";
       -        input.setAttribute("type", "radio");
       -        support.radioValue = input.value === "t";
       +        // Check if b follows a
       +        if ( cur ) {
       +                while ( (cur = cur.nextSibling) ) {
       +                        if ( cur === b ) {
       +                                return -1;
       +                        }
       +                }
       +        }
        
       -        input.setAttribute("checked", "checked");
       -
       -        // #11217 - WebKit loses check when the name is after the checked attribute
       -        input.setAttribute( "name", "t" );
       +        return a ? 1 : -1;
       +}
        
       -        div.appendChild( input );
       -        fragment = document.createDocumentFragment();
       -        fragment.appendChild( div.lastChild );
       -
       -        // WebKit doesn't clone checked state correctly in fragments
       -        support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
       -
       -        // Check if a disconnected checkbox will retain its checked
       -        // value of true after appended to the DOM (IE6/7)
       -        support.appendChecked = input.checked;
       -
       -        fragment.removeChild( input );
       -        fragment.appendChild( div );
       -
       -        // Technique from Juriy Zaytsev
       -        // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
       -        // We only care about the case where non-standard event systems
       -        // are used, namely in IE. Short-circuiting here helps us to
       -        // avoid an eval call (in setAttribute) which can cause CSP
       -        // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
       -        if ( div.attachEvent ) {
       -                for ( i in {
       -                        submit: 1,
       -                        change: 1,
       -                        focusin: 1
       -                }) {
       -                        eventName = "on" + i;
       -                        isSupported = ( eventName in div );
       -                        if ( !isSupported ) {
       -                                div.setAttribute( eventName, "return;" );
       -                                isSupported = ( typeof div[ eventName ] === "function" );
       -                        }
       -                        support[ i + "Bubbles" ] = isSupported;
       -                }
       -        }
       -
       -        fragment.removeChild( div );
       -
       -        // Null elements to avoid leaks in IE
       -        fragment = select = opt = div = input = null;
       -
       -        // Run tests that need a body at doc ready
       -        jQuery(function() {
       -                var container, outer, inner, table, td, offsetSupport,
       -                        marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
       -                        paddingMarginBorderVisibility, paddingMarginBorder,
       -                        body = document.getElementsByTagName("body")[0];
       -
       -                if ( !body ) {
       -                        // Return for frameset docs that don't have a body
       -                        return;
       -                }
       +/**
       + * Returns a function to use in pseudos for input types
       + * @param {String} type
       + */
       +function createInputPseudo( type ) {
       +        return function( elem ) {
       +                var name = elem.nodeName.toLowerCase();
       +                return name === "input" && elem.type === type;
       +        };
       +}
        
       -                conMarginTop = 1;
       -                paddingMarginBorder = "padding:0;margin:0;border:";
       -                positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;";
       -                paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;";
       -                style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;";
       -                html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" +
       -                        "<table " + style + "' cellpadding='0' cellspacing='0'>" +
       -                        "<tr><td></td></tr></table>";
       -
       -                container = document.createElement("div");
       -                container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
       -                body.insertBefore( container, body.firstChild );
       -
       -                // Construct the test element
       -                div = document.createElement("div");
       -                container.appendChild( div );
       -
       -                // Check if table cells still have offsetWidth/Height when they are set
       -                // to display:none and there are still other visible table cells in a
       -                // table row; if so, offsetWidth/Height are not reliable for use when
       -                // determining if an element has been hidden directly using
       -                // display:none (it is still safe to use offsets if a parent element is
       -                // hidden; don safety goggles and see bug #4512 for more information).
       -                // (only IE 8 fails this test)
       -                div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>";
       -                tds = div.getElementsByTagName( "td" );
       -                isSupported = ( tds[ 0 ].offsetHeight === 0 );
       -
       -                tds[ 0 ].style.display = "";
       -                tds[ 1 ].style.display = "none";
       -
       -                // Check if empty table cells still have offsetWidth/Height
       -                // (IE <= 8 fail this test)
       -                support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
       -
       -                // Check if div with explicit width and no margin-right incorrectly
       -                // gets computed margin-right based on width of container. For more
       -                // info see bug #3333
       -                // Fails in WebKit before Feb 2011 nightlies
       -                // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
       -                if ( window.getComputedStyle ) {
       -                        div.innerHTML = "";
       -                        marginDiv = document.createElement( "div" );
       -                        marginDiv.style.width = "0";
       -                        marginDiv.style.marginRight = "0";
       -                        div.style.width = "2px";
       -                        div.appendChild( marginDiv );
       -                        support.reliableMarginRight =
       -                                ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
       -                }
       -
       -                if ( typeof div.style.zoom !== "undefined" ) {
       -                        // Check if natively block-level elements act like inline-block
       -                        // elements when setting their display to 'inline' and giving
       -                        // them layout
       -                        // (IE < 8 does this)
       -                        div.innerHTML = "";
       -                        div.style.width = div.style.padding = "1px";
       -                        div.style.border = 0;
       -                        div.style.overflow = "hidden";
       -                        div.style.display = "inline";
       -                        div.style.zoom = 1;
       -                        support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
       -
       -                        // Check if elements with layout shrink-wrap their children
       -                        // (IE 6 does this)
       -                        div.style.display = "block";
       -                        div.style.overflow = "visible";
       -                        div.innerHTML = "<div style='width:5px;'></div>";
       -                        support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
       -                }
       -
       -                div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility;
       -                div.innerHTML = html;
       -
       -                outer = div.firstChild;
       -                inner = outer.firstChild;
       -                td = outer.nextSibling.firstChild.firstChild;
       -
       -                offsetSupport = {
       -                        doesNotAddBorder: ( inner.offsetTop !== 5 ),
       -                        doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
       -                };
       +/**
       + * Returns a function to use in pseudos for buttons
       + * @param {String} type
       + */
       +function createButtonPseudo( type ) {
       +        return function( elem ) {
       +                var name = elem.nodeName.toLowerCase();
       +                return (name === "input" || name === "button") && elem.type === type;
       +        };
       +}
        
       -                inner.style.position = "fixed";
       -                inner.style.top = "20px";
       +/**
       + * Returns a function to use in pseudos for :enabled/:disabled
       + * @param {Boolean} disabled true for :disabled; false for :enabled
       + */
       +function createDisabledPseudo( disabled ) {
       +
       +        // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
       +        return function( elem ) {
       +
       +                // Only certain elements can match :enabled or :disabled
       +                // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
       +                // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
       +                if ( "form" in elem ) {
       +
       +                        // Check for inherited disabledness on relevant non-disabled elements:
       +                        // * listed form-associated elements in a disabled fieldset
       +                        //   https://html.spec.whatwg.org/multipage/forms.html#category-listed
       +                        //   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
       +                        // * option elements in a disabled optgroup
       +                        //   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
       +                        // All such elements have a "form" property.
       +                        if ( elem.parentNode && elem.disabled === false ) {
       +
       +                                // Option elements defer to a parent optgroup if present
       +                                if ( "label" in elem ) {
       +                                        if ( "label" in elem.parentNode ) {
       +                                                return elem.parentNode.disabled === disabled;
       +                                        } else {
       +                                                return elem.disabled === disabled;
       +                                        }
       +                                }
        
       -                // safari subtracts parent border width here which is 5px
       -                offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
       -                inner.style.position = inner.style.top = "";
       +                                // Support: IE 6 - 11
       +                                // Use the isDisabled shortcut property to check for disabled fieldset ancestors
       +                                return elem.isDisabled === disabled ||
        
       -                outer.style.overflow = "hidden";
       -                outer.style.position = "relative";
       +                                        // Where there is no isDisabled, check manually
       +                                        /* jshint -W018 */
       +                                        elem.isDisabled !== !disabled &&
       +                                                disabledAncestor( elem ) === disabled;
       +                        }
        
       -                offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
       -                offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
       +                        return elem.disabled === disabled;
        
       -                if ( window.getComputedStyle ) {
       -                        div.style.marginTop = "1%";
       -                        support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%";
       +                // Try to winnow out elements that can't be disabled before trusting the disabled property.
       +                // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
       +                // even exist on them, let alone have a boolean value.
       +                } else if ( "label" in elem ) {
       +                        return elem.disabled === disabled;
                        }
        
       -                if ( typeof container.style.zoom !== "undefined" ) {
       -                        container.style.zoom = 1;
       -                }
       +                // Remaining elements are neither :enabled nor :disabled
       +                return false;
       +        };
       +}
        
       -                body.removeChild( container );
       -                marginDiv = div = container = null;
       +/**
       + * Returns a function to use in pseudos for positionals
       + * @param {Function} fn
       + */
       +function createPositionalPseudo( fn ) {
       +        return markFunction(function( argument ) {
       +                argument = +argument;
       +                return markFunction(function( seed, matches ) {
       +                        var j,
       +                                matchIndexes = fn( [], seed.length, argument ),
       +                                i = matchIndexes.length;
        
       -                jQuery.extend( support, offsetSupport );
       +                        // Match elements found at the specified indexes
       +                        while ( i-- ) {
       +                                if ( seed[ (j = matchIndexes[i]) ] ) {
       +                                        seed[j] = !(matches[j] = seed[j]);
       +                                }
       +                        }
       +                });
                });
       +}
        
       -        return support;
       -})();
       -
       -
       +/**
       + * Checks a node for validity as a Sizzle context
       + * @param {Element|Object=} context
       + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
       + */
       +function testContext( context ) {
       +        return context && typeof context.getElementsByTagName !== "undefined" && context;
       +}
        
       +// Expose support vars for convenience
       +support = Sizzle.support = {};
        
       -var rbrace = /^(?:\{.*\}|\[.*\])$/,
       -        rmultiDash = /([A-Z])/g;
       +/**
       + * Detects XML nodes
       + * @param {Element|Object} elem An element or a document
       + * @returns {Boolean} True iff elem is a non-HTML XML node
       + */
       +isXML = Sizzle.isXML = function( elem ) {
       +        // documentElement is verified for cases where it doesn't yet exist
       +        // (such as loading iframes in IE - #4833)
       +        var documentElement = elem && (elem.ownerDocument || elem).documentElement;
       +        return documentElement ? documentElement.nodeName !== "HTML" : false;
       +};
        
       -jQuery.extend({
       -        cache: {},
       +/**
       + * Sets document-related variables once based on the current document
       + * @param {Element|Object} [doc] An element or document object to use to set the document
       + * @returns {Object} Returns the current document
       + */
       +setDocument = Sizzle.setDocument = function( node ) {
       +        var hasCompare, subWindow,
       +                doc = node ? node.ownerDocument || node : preferredDoc;
        
       -        // Please use with caution
       -        uuid: 0,
       +        // Return early if doc is invalid or already selected
       +        if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
       +                return document;
       +        }
        
       -        // Unique for each copy of jQuery on the page
       -        // Non-digits removed to match rinlinejQuery
       -        expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
       +        // Update global variables
       +        document = doc;
       +        docElem = document.documentElement;
       +        documentIsHTML = !isXML( document );
        
       -        // The following elements throw uncatchable exceptions if you
       -        // attempt to add expando properties to them.
       -        noData: {
       -                "embed": true,
       -                // Ban all objects except for Flash (which handle expandos)
       -                "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
       -                "applet": true
       -        },
       +        // Support: IE 9-11, Edge
       +        // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
       +        if ( preferredDoc !== document &&
       +                (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
        
       -        hasData: function( elem ) {
       -                elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
       -                return !!elem && !isEmptyDataObject( elem );
       -        },
       +                // Support: IE 11, Edge
       +                if ( subWindow.addEventListener ) {
       +                        subWindow.addEventListener( "unload", unloadHandler, false );
        
       -        data: function( elem, name, data, pvt /* Internal Use Only */ ) {
       -                if ( !jQuery.acceptData( elem ) ) {
       -                        return;
       +                // Support: IE 9 - 10 only
       +                } else if ( subWindow.attachEvent ) {
       +                        subWindow.attachEvent( "onunload", unloadHandler );
                        }
       +        }
        
       -                var privateCache, thisCache, ret,
       -                        internalKey = jQuery.expando,
       -                        getByName = typeof name === "string",
       +        /* Attributes
       +        ---------------------------------------------------------------------- */
        
       -                        // We have to handle DOM nodes and JS objects differently because IE6-7
       -                        // can't GC object references properly across the DOM-JS boundary
       -                        isNode = elem.nodeType,
       +        // Support: IE<8
       +        // Verify that getAttribute really returns attributes and not properties
       +        // (excepting IE8 booleans)
       +        support.attributes = assert(function( el ) {
       +                el.className = "i";
       +                return !el.getAttribute("className");
       +        });
        
       -                        // Only DOM nodes need the global jQuery cache; JS object data is
       -                        // attached directly to the object so GC can occur automatically
       -                        cache = isNode ? jQuery.cache : elem,
       +        /* getElement(s)By*
       +        ---------------------------------------------------------------------- */
        
       -                        // Only defining an ID for JS objects if its cache already exists allows
       -                        // the code to shortcut on the same path as a DOM node with no cache
       -                        id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
       -                        isEvents = name === "events";
       +        // Check if getElementsByTagName("*") returns only elements
       +        support.getElementsByTagName = assert(function( el ) {
       +                el.appendChild( document.createComment("") );
       +                return !el.getElementsByTagName("*").length;
       +        });
        
       -                // Avoid doing any more work than we need to when trying to get data on an
       -                // object that has no data at all
       -                if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
       -                        return;
       -                }
       +        // Support: IE<9
       +        support.getElementsByClassName = rnative.test( document.getElementsByClassName );
        
       -                if ( !id ) {
       -                        // Only DOM nodes need a new unique ID for each element since their data
       -                        // ends up in the global cache
       -                        if ( isNode ) {
       -                                elem[ internalKey ] = id = ++jQuery.uuid;
       -                        } else {
       -                                id = internalKey;
       +        // Support: IE<10
       +        // Check if getElementById returns elements by name
       +        // The broken getElementById methods don't pick up programmatically-set names,
       +        // so use a roundabout getElementsByName test
       +        support.getById = assert(function( el ) {
       +                docElem.appendChild( el ).id = expando;
       +                return !document.getElementsByName || !document.getElementsByName( expando ).length;
       +        });
       +
       +        // ID filter and find
       +        if ( support.getById ) {
       +                Expr.filter["ID"] = function( id ) {
       +                        var attrId = id.replace( runescape, funescape );
       +                        return function( elem ) {
       +                                return elem.getAttribute("id") === attrId;
       +                        };
       +                };
       +                Expr.find["ID"] = function( id, context ) {
       +                        if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
       +                                var elem = context.getElementById( id );
       +                                return elem ? [ elem ] : [];
                                }
       -                }
       +                };
       +        } else {
       +                Expr.filter["ID"] =  function( id ) {
       +                        var attrId = id.replace( runescape, funescape );
       +                        return function( elem ) {
       +                                var node = typeof elem.getAttributeNode !== "undefined" &&
       +                                        elem.getAttributeNode("id");
       +                                return node && node.value === attrId;
       +                        };
       +                };
       +
       +                // Support: IE 6 - 7 only
       +                // getElementById is not reliable as a find shortcut
       +                Expr.find["ID"] = function( id, context ) {
       +                        if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
       +                                var node, i, elems,
       +                                        elem = context.getElementById( id );
       +
       +                                if ( elem ) {
        
       -                if ( !cache[ id ] ) {
       -                        cache[ id ] = {};
       +                                        // Verify the id attribute
       +                                        node = elem.getAttributeNode("id");
       +                                        if ( node && node.value === id ) {
       +                                                return [ elem ];
       +                                        }
       +
       +                                        // Fall back on getElementsByName
       +                                        elems = context.getElementsByName( id );
       +                                        i = 0;
       +                                        while ( (elem = elems[i++]) ) {
       +                                                node = elem.getAttributeNode("id");
       +                                                if ( node && node.value === id ) {
       +                                                        return [ elem ];
       +                                                }
       +                                        }
       +                                }
        
       -                        // Avoids exposing jQuery metadata on plain JS objects when the object
       -                        // is serialized using JSON.stringify
       -                        if ( !isNode ) {
       -                                cache[ id ].toJSON = jQuery.noop;
       +                                return [];
                                }
       -                }
       +                };
       +        }
        
       -                // An object can be passed to jQuery.data instead of a key/value pair; this gets
       -                // shallow copied over onto the existing cache
       -                if ( typeof name === "object" || typeof name === "function" ) {
       -                        if ( pvt ) {
       -                                cache[ id ] = jQuery.extend( cache[ id ], name );
       -                        } else {
       -                                cache[ id ].data = jQuery.extend( cache[ id ].data, name );
       +        // Tag
       +        Expr.find["TAG"] = support.getElementsByTagName ?
       +                function( tag, context ) {
       +                        if ( typeof context.getElementsByTagName !== "undefined" ) {
       +                                return context.getElementsByTagName( tag );
       +
       +                        // DocumentFragment nodes don't have gEBTN
       +                        } else if ( support.qsa ) {
       +                                return context.querySelectorAll( tag );
                                }
       -                }
       +                } :
       +
       +                function( tag, context ) {
       +                        var elem,
       +                                tmp = [],
       +                                i = 0,
       +                                // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
       +                                results = context.getElementsByTagName( tag );
        
       -                privateCache = thisCache = cache[ id ];
       +                        // Filter out possible comments
       +                        if ( tag === "*" ) {
       +                                while ( (elem = results[i++]) ) {
       +                                        if ( elem.nodeType === 1 ) {
       +                                                tmp.push( elem );
       +                                        }
       +                                }
        
       -                // jQuery data() is stored in a separate object inside the object's internal data
       -                // cache in order to avoid key collisions between internal data and user-defined
       -                // data.
       -                if ( !pvt ) {
       -                        if ( !thisCache.data ) {
       -                                thisCache.data = {};
       +                                return tmp;
                                }
       +                        return results;
       +                };
        
       -                        thisCache = thisCache.data;
       +        // Class
       +        Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
       +                if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
       +                        return context.getElementsByClassName( className );
                        }
       +        };
        
       -                if ( data !== undefined ) {
       -                        thisCache[ jQuery.camelCase( name ) ] = data;
       -                }
       +        /* QSA/matchesSelector
       +        ---------------------------------------------------------------------- */
        
       -                // Users should not attempt to inspect the internal events object using jQuery.data,
       -                // it is undocumented and subject to change. But does anyone listen? No.
       -                if ( isEvents && !thisCache[ name ] ) {
       -                        return privateCache.events;
       -                }
       +        // QSA and matchesSelector support
        
       -                // Check for both converted-to-camel and non-converted data property names
       -                // If a data property was specified
       -                if ( getByName ) {
       +        // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
       +        rbuggyMatches = [];
        
       -                        // First Try to find as-is property data
       -                        ret = thisCache[ name ];
       +        // qSa(:focus) reports false when true (Chrome 21)
       +        // We allow this because of a bug in IE8/9 that throws an error
       +        // whenever `document.activeElement` is accessed on an iframe
       +        // So, we allow :focus to pass through QSA all the time to avoid the IE error
       +        // See https://bugs.jquery.com/ticket/13378
       +        rbuggyQSA = [];
        
       -                        // Test for null|undefined property data
       -                        if ( ret == null ) {
       +        if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
       +                // Build QSA regex
       +                // Regex strategy adopted from Diego Perini
       +                assert(function( el ) {
       +                        // Select is set to empty string on purpose
       +                        // This is to test IE's treatment of not explicitly
       +                        // setting a boolean content attribute,
       +                        // since its presence should be enough
       +                        // https://bugs.jquery.com/ticket/12359
       +                        docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
       +                                "<select id='" + expando + "-\r\\' msallowcapture=''>" +
       +                                "<option selected=''></option></select>";
        
       -                                // Try to find the camelCased property
       -                                ret = thisCache[ jQuery.camelCase( name ) ];
       +                        // Support: IE8, Opera 11-12.16
       +                        // Nothing should be selected when empty strings follow ^= or $= or *=
       +                        // The test attribute must be unknown in Opera but "safe" for WinRT
       +                        // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
       +                        if ( el.querySelectorAll("[msallowcapture^='']").length ) {
       +                                rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
                                }
       -                } else {
       -                        ret = thisCache;
       -                }
        
       -                return ret;
       -        },
       +                        // Support: IE8
       +                        // Boolean attributes and "value" are not treated correctly
       +                        if ( !el.querySelectorAll("[selected]").length ) {
       +                                rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
       +                        }
        
       -        removeData: function( elem, name, pvt /* Internal Use Only */ ) {
       -                if ( !jQuery.acceptData( elem ) ) {
       -                        return;
       -                }
       +                        // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
       +                        if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
       +                                rbuggyQSA.push("~=");
       +                        }
        
       -                var thisCache, i, l,
       +                        // Webkit/Opera - :checked should return selected option elements
       +                        // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
       +                        // IE8 throws error here and will not see later tests
       +                        if ( !el.querySelectorAll(":checked").length ) {
       +                                rbuggyQSA.push(":checked");
       +                        }
        
       -                        // Reference to internal data cache key
       -                        internalKey = jQuery.expando,
       +                        // Support: Safari 8+, iOS 8+
       +                        // https://bugs.webkit.org/show_bug.cgi?id=136851
       +                        // In-page `selector#id sibling-combinator selector` fails
       +                        if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
       +                                rbuggyQSA.push(".#.+[+~]");
       +                        }
       +                });
        
       -                        isNode = elem.nodeType,
       +                assert(function( el ) {
       +                        el.innerHTML = "<a href='' disabled='disabled'></a>" +
       +                                "<select disabled='disabled'><option/></select>";
        
       -                        // See jQuery.data for more information
       -                        cache = isNode ? jQuery.cache : elem,
       +                        // Support: Windows 8 Native Apps
       +                        // The type and name attributes are restricted during .innerHTML assignment
       +                        var input = document.createElement("input");
       +                        input.setAttribute( "type", "hidden" );
       +                        el.appendChild( input ).setAttribute( "name", "D" );
        
       -                        // See jQuery.data for more information
       -                        id = isNode ? elem[ internalKey ] : internalKey;
       +                        // Support: IE8
       +                        // Enforce case-sensitivity of name attribute
       +                        if ( el.querySelectorAll("[name=d]").length ) {
       +                                rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
       +                        }
        
       -                // If there is already no cache entry for this object, there is no
       -                // purpose in continuing
       -                if ( !cache[ id ] ) {
       -                        return;
       -                }
       +                        // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
       +                        // IE8 throws error here and will not see later tests
       +                        if ( el.querySelectorAll(":enabled").length !== 2 ) {
       +                                rbuggyQSA.push( ":enabled", ":disabled" );
       +                        }
        
       -                if ( name ) {
       +                        // Support: IE9-11+
       +                        // IE's :disabled selector does not pick up the children of disabled fieldsets
       +                        docElem.appendChild( el ).disabled = true;
       +                        if ( el.querySelectorAll(":disabled").length !== 2 ) {
       +                                rbuggyQSA.push( ":enabled", ":disabled" );
       +                        }
        
       -                        thisCache = pvt ? cache[ id ] : cache[ id ].data;
       +                        // Opera 10-11 does not throw on post-comma invalid pseudos
       +                        el.querySelectorAll("*,:x");
       +                        rbuggyQSA.push(",.*:");
       +                });
       +        }
        
       -                        if ( thisCache ) {
       +        if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
       +                docElem.webkitMatchesSelector ||
       +                docElem.mozMatchesSelector ||
       +                docElem.oMatchesSelector ||
       +                docElem.msMatchesSelector) )) ) {
        
       -                                // Support array or space separated string names for data keys
       -                                if ( !jQuery.isArray( name ) ) {
       +                assert(function( el ) {
       +                        // Check to see if it's possible to do matchesSelector
       +                        // on a disconnected node (IE 9)
       +                        support.disconnectedMatch = matches.call( el, "*" );
        
       -                                        // try the string as a key before any manipulation
       -                                        if ( name in thisCache ) {
       -                                                name = [ name ];
       -                                        } else {
       +                        // This should fail with an exception
       +                        // Gecko does not error, returns false instead
       +                        matches.call( el, "[s!='']:x" );
       +                        rbuggyMatches.push( "!=", pseudos );
       +                });
       +        }
        
       -                                                // split the camel cased version by spaces unless a key with the spaces exists
       -                                                name = jQuery.camelCase( name );
       -                                                if ( name in thisCache ) {
       -                                                        name = [ name ];
       -                                                } else {
       -                                                        name = name.split( " " );
       -                                                }
       +        rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
       +        rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
       +
       +        /* Contains
       +        ---------------------------------------------------------------------- */
       +        hasCompare = rnative.test( docElem.compareDocumentPosition );
       +
       +        // Element contains another
       +        // Purposefully self-exclusive
       +        // As in, an element does not contain itself
       +        contains = hasCompare || rnative.test( docElem.contains ) ?
       +                function( a, b ) {
       +                        var adown = a.nodeType === 9 ? a.documentElement : a,
       +                                bup = b && b.parentNode;
       +                        return a === bup || !!( bup && bup.nodeType === 1 && (
       +                                adown.contains ?
       +                                        adown.contains( bup ) :
       +                                        a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
       +                        ));
       +                } :
       +                function( a, b ) {
       +                        if ( b ) {
       +                                while ( (b = b.parentNode) ) {
       +                                        if ( b === a ) {
       +                                                return true;
                                                }
                                        }
       -
       -                                for ( i = 0, l = name.length; i < l; i++ ) {
       -                                        delete thisCache[ name[i] ];
       -                                }
       -
       -                                // If there is no data left in the cache, we want to continue
       -                                // and let the cache object itself get destroyed
       -                                if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
       -                                        return;
       -                                }
                                }
       -                }
       +                        return false;
       +                };
        
       -                // See jQuery.data for more information
       -                if ( !pvt ) {
       -                        delete cache[ id ].data;
       +        /* Sorting
       +        ---------------------------------------------------------------------- */
        
       -                        // Don't destroy the parent cache unless the internal data object
       -                        // had been the only thing left in it
       -                        if ( !isEmptyDataObject(cache[ id ]) ) {
       -                                return;
       -                        }
       +        // Document order sorting
       +        sortOrder = hasCompare ?
       +        function( a, b ) {
       +
       +                // Flag for duplicate removal
       +                if ( a === b ) {
       +                        hasDuplicate = true;
       +                        return 0;
                        }
        
       -                // Browsers that fail expando deletion also refuse to delete expandos on
       -                // the window, but it will allow it on all other JS objects; other browsers
       -                // don't care
       -                // Ensure that `cache` is not a window object #10080
       -                if ( jQuery.support.deleteExpando || !cache.setInterval ) {
       -                        delete cache[ id ];
       -                } else {
       -                        cache[ id ] = null;
       -                }
       -
       -                // We destroyed the cache and need to eliminate the expando on the node to avoid
       -                // false lookups in the cache for entries that no longer exist
       -                if ( isNode ) {
       -                        // IE does not allow us to delete expando properties from nodes,
       -                        // nor does it have a removeAttribute function on Document nodes;
       -                        // we must handle all of these cases
       -                        if ( jQuery.support.deleteExpando ) {
       -                                delete elem[ internalKey ];
       -                        } else if ( elem.removeAttribute ) {
       -                                elem.removeAttribute( internalKey );
       -                        } else {
       -                                elem[ internalKey ] = null;
       -                        }
       +                // Sort on method existence if only one input has compareDocumentPosition
       +                var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
       +                if ( compare ) {
       +                        return compare;
                        }
       -        },
        
       -        // For internal use only.
       -        _data: function( elem, name, data ) {
       -                return jQuery.data( elem, name, data, true );
       -        },
       +                // Calculate position if both inputs belong to the same document
       +                compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
       +                        a.compareDocumentPosition( b ) :
        
       -        // A method for determining if a DOM node can handle the data expando
       -        acceptData: function( elem ) {
       -                if ( elem.nodeName ) {
       -                        var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
       +                        // Otherwise we know they are disconnected
       +                        1;
        
       -                        if ( match ) {
       -                                return !(match === true || elem.getAttribute("classid") !== match);
       +                // Disconnected nodes
       +                if ( compare & 1 ||
       +                        (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
       +
       +                        // Choose the first element that is related to our preferred document
       +                        if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
       +                                return -1;
                                }
       +                        if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
       +                                return 1;
       +                        }
       +
       +                        // Maintain original order
       +                        return sortInput ?
       +                                ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
       +                                0;
                        }
        
       -                return true;
       -        }
       -});
       +                return compare & 4 ? -1 : 1;
       +        } :
       +        function( a, b ) {
       +                // Exit early if the nodes are identical
       +                if ( a === b ) {
       +                        hasDuplicate = true;
       +                        return 0;
       +                }
        
       -jQuery.fn.extend({
       -        data: function( key, value ) {
       -                var parts, part, attr, name, l,
       -                        elem = this[0],
       +                var cur,
                                i = 0,
       -                        data = null;
       +                        aup = a.parentNode,
       +                        bup = b.parentNode,
       +                        ap = [ a ],
       +                        bp = [ b ];
       +
       +                // Parentless nodes are either documents or disconnected
       +                if ( !aup || !bup ) {
       +                        return a === document ? -1 :
       +                                b === document ? 1 :
       +                                aup ? -1 :
       +                                bup ? 1 :
       +                                sortInput ?
       +                                ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
       +                                0;
        
       -                // Gets all values
       -                if ( key === undefined ) {
       -                        if ( this.length ) {
       -                                data = jQuery.data( elem );
       +                // If the nodes are siblings, we can do a quick check
       +                } else if ( aup === bup ) {
       +                        return siblingCheck( a, b );
       +                }
        
       -                                if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
       -                                        attr = elem.attributes;
       -                                        for ( l = attr.length; i < l; i++ ) {
       -                                                name = attr[i].name;
       +                // Otherwise we need full lists of their ancestors for comparison
       +                cur = a;
       +                while ( (cur = cur.parentNode) ) {
       +                        ap.unshift( cur );
       +                }
       +                cur = b;
       +                while ( (cur = cur.parentNode) ) {
       +                        bp.unshift( cur );
       +                }
        
       -                                                if ( name.indexOf( "data-" ) === 0 ) {
       -                                                        name = jQuery.camelCase( name.substring(5) );
       +                // Walk down the tree looking for a discrepancy
       +                while ( ap[i] === bp[i] ) {
       +                        i++;
       +                }
        
       -                                                        dataAttr( elem, name, data[ name ] );
       -                                                }
       -                                        }
       -                                        jQuery._data( elem, "parsedAttrs", true );
       -                                }
       -                        }
       +                return i ?
       +                        // Do a sibling check if the nodes have a common ancestor
       +                        siblingCheck( ap[i], bp[i] ) :
        
       -                        return data;
       -                }
       +                        // Otherwise nodes in our document sort first
       +                        ap[i] === preferredDoc ? -1 :
       +                        bp[i] === preferredDoc ? 1 :
       +                        0;
       +        };
        
       -                // Sets multiple values
       -                if ( typeof key === "object" ) {
       -                        return this.each(function() {
       -                                jQuery.data( this, key );
       -                        });
       -                }
       +        return document;
       +};
       +
       +Sizzle.matches = function( expr, elements ) {
       +        return Sizzle( expr, null, null, elements );
       +};
        
       -                parts = key.split( ".", 2 );
       -                parts[1] = parts[1] ? "." + parts[1] : "";
       -                part = parts[1] + "!";
       +Sizzle.matchesSelector = function( elem, expr ) {
       +        // Set document vars if needed
       +        if ( ( elem.ownerDocument || elem ) !== document ) {
       +                setDocument( elem );
       +        }
        
       -                return jQuery.access( this, function( value ) {
       +        // Make sure that attribute selectors are quoted
       +        expr = expr.replace( rattributeQuotes, "='$1']" );
        
       -                        if ( value === undefined ) {
       -                                data = this.triggerHandler( "getData" + part, [ parts[0] ] );
       +        if ( support.matchesSelector && documentIsHTML &&
       +                !compilerCache[ expr + " " ] &&
       +                ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
       +                ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
        
       -                                // Try to fetch any internally stored data first
       -                                if ( data === undefined && elem ) {
       -                                        data = jQuery.data( elem, key );
       -                                        data = dataAttr( elem, key, data );
       -                                }
       +                try {
       +                        var ret = matches.call( elem, expr );
        
       -                                return data === undefined && parts[1] ?
       -                                        this.data( parts[0] ) :
       -                                        data;
       +                        // IE 9's matchesSelector returns false on disconnected nodes
       +                        if ( ret || support.disconnectedMatch ||
       +                                        // As well, disconnected nodes are said to be in a document
       +                                        // fragment in IE 9
       +                                        elem.document && elem.document.nodeType !== 11 ) {
       +                                return ret;
                                }
       +                } catch (e) {}
       +        }
        
       -                        parts[1] = value;
       -                        this.each(function() {
       -                                var self = jQuery( this );
       +        return Sizzle( expr, document, null, [ elem ] ).length > 0;
       +};
        
       -                                self.triggerHandler( "setData" + part, parts );
       -                                jQuery.data( this, key, value );
       -                                self.triggerHandler( "changeData" + part, parts );
       -                        });
       -                }, null, value, arguments.length > 1, null, false );
       -        },
       +Sizzle.contains = function( context, elem ) {
       +        // Set document vars if needed
       +        if ( ( context.ownerDocument || context ) !== document ) {
       +                setDocument( context );
       +        }
       +        return contains( context, elem );
       +};
        
       -        removeData: function( key ) {
       -                return this.each(function() {
       -                        jQuery.removeData( this, key );
       -                });
       +Sizzle.attr = function( elem, name ) {
       +        // Set document vars if needed
       +        if ( ( elem.ownerDocument || elem ) !== document ) {
       +                setDocument( elem );
                }
       -});
        
       -function dataAttr( elem, key, data ) {
       -        // If nothing was found internally, try to fetch any
       -        // data from the HTML5 data-* attribute
       -        if ( data === undefined && elem.nodeType === 1 ) {
       +        var fn = Expr.attrHandle[ name.toLowerCase() ],
       +                // Don't get fooled by Object.prototype properties (jQuery #13807)
       +                val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
       +                        fn( elem, name, !documentIsHTML ) :
       +                        undefined;
        
       -                var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
       +        return val !== undefined ?
       +                val :
       +                support.attributes || !documentIsHTML ?
       +                        elem.getAttribute( name ) :
       +                        (val = elem.getAttributeNode(name)) && val.specified ?
       +                                val.value :
       +                                null;
       +};
        
       -                data = elem.getAttribute( name );
       +Sizzle.escape = function( sel ) {
       +        return (sel + "").replace( rcssescape, fcssescape );
       +};
        
       -                if ( typeof data === "string" ) {
       -                        try {
       -                                data = data === "true" ? true :
       -                                data === "false" ? false :
       -                                data === "null" ? null :
       -                                jQuery.isNumeric( data ) ? +data :
       -                                        rbrace.test( data ) ? jQuery.parseJSON( data ) :
       -                                        data;
       -                        } catch( e ) {}
       +Sizzle.error = function( msg ) {
       +        throw new Error( "Syntax error, unrecognized expression: " + msg );
       +};
        
       -                        // Make sure we set the data so it isn't changed later
       -                        jQuery.data( elem, key, data );
       +/**
       + * Document sorting and removing duplicates
       + * @param {ArrayLike} results
       + */
       +Sizzle.uniqueSort = function( results ) {
       +        var elem,
       +                duplicates = [],
       +                j = 0,
       +                i = 0;
        
       -                } else {
       -                        data = undefined;
       +        // Unless we *know* we can detect duplicates, assume their presence
       +        hasDuplicate = !support.detectDuplicates;
       +        sortInput = !support.sortStable && results.slice( 0 );
       +        results.sort( sortOrder );
       +
       +        if ( hasDuplicate ) {
       +                while ( (elem = results[i++]) ) {
       +                        if ( elem === results[ i ] ) {
       +                                j = duplicates.push( i );
       +                        }
       +                }
       +                while ( j-- ) {
       +                        results.splice( duplicates[ j ], 1 );
                        }
                }
        
       -        return data;
       -}
       +        // Clear input after sorting to release objects
       +        // See https://github.com/jquery/sizzle/pull/225
       +        sortInput = null;
        
       -// checks a cache object for emptiness
       -function isEmptyDataObject( obj ) {
       -        for ( var name in obj ) {
       +        return results;
       +};
        
       -                // if the public data object is empty, the private is still empty
       -                if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
       -                        continue;
       +/**
       + * Utility function for retrieving the text value of an array of DOM nodes
       + * @param {Array|Element} elem
       + */
       +getText = Sizzle.getText = function( elem ) {
       +        var node,
       +                ret = "",
       +                i = 0,
       +                nodeType = elem.nodeType;
       +
       +        if ( !nodeType ) {
       +                // If no nodeType, this is expected to be an array
       +                while ( (node = elem[i++]) ) {
       +                        // Do not traverse comment nodes
       +                        ret += getText( node );
                        }
       -                if ( name !== "toJSON" ) {
       -                        return false;
       +        } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
       +                // Use textContent for elements
       +                // innerText usage removed for consistency of new lines (jQuery #11153)
       +                if ( typeof elem.textContent === "string" ) {
       +                        return elem.textContent;
       +                } else {
       +                        // Traverse its children
       +                        for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
       +                                ret += getText( elem );
       +                        }
                        }
       +        } else if ( nodeType === 3 || nodeType === 4 ) {
       +                return elem.nodeValue;
                }
       +        // Do not include comment or processing instruction nodes
        
       -        return true;
       -}
       +        return ret;
       +};
        
       +Expr = Sizzle.selectors = {
        
       +        // Can be adjusted by the user
       +        cacheLength: 50,
        
       +        createPseudo: markFunction,
        
       -function handleQueueMarkDefer( elem, type, src ) {
       -        var deferDataKey = type + "defer",
       -                queueDataKey = type + "queue",
       -                markDataKey = type + "mark",
       -                defer = jQuery._data( elem, deferDataKey );
       -        if ( defer &&
       -                ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
       -                ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
       -                // Give room for hard-coded callbacks to fire first
       -                // and eventually mark/queue something else on the element
       -                setTimeout( function() {
       -                        if ( !jQuery._data( elem, queueDataKey ) &&
       -                                !jQuery._data( elem, markDataKey ) ) {
       -                                jQuery.removeData( elem, deferDataKey, true );
       -                                defer.fire();
       -                        }
       -                }, 0 );
       -        }
       -}
       +        match: matchExpr,
        
       -jQuery.extend({
       +        attrHandle: {},
        
       -        _mark: function( elem, type ) {
       -                if ( elem ) {
       -                        type = ( type || "fx" ) + "mark";
       -                        jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
       -                }
       +        find: {},
       +
       +        relative: {
       +                ">": { dir: "parentNode", first: true },
       +                " ": { dir: "parentNode" },
       +                "+": { dir: "previousSibling", first: true },
       +                "~": { dir: "previousSibling" }
                },
        
       -        _unmark: function( force, elem, type ) {
       -                if ( force !== true ) {
       -                        type = elem;
       -                        elem = force;
       -                        force = false;
       -                }
       -                if ( elem ) {
       -                        type = type || "fx";
       -                        var key = type + "mark",
       -                                count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
       -                        if ( count ) {
       -                                jQuery._data( elem, key, count );
       -                        } else {
       -                                jQuery.removeData( elem, key, true );
       -                                handleQueueMarkDefer( elem, type, "mark" );
       +        preFilter: {
       +                "ATTR": function( match ) {
       +                        match[1] = match[1].replace( runescape, funescape );
       +
       +                        // Move the given value to match[3] whether quoted or unquoted
       +                        match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
       +
       +                        if ( match[2] === "~=" ) {
       +                                match[3] = " " + match[3] + " ";
                                }
       -                }
       -        },
        
       -        queue: function( elem, type, data ) {
       -                var q;
       -                if ( elem ) {
       -                        type = ( type || "fx" ) + "queue";
       -                        q = jQuery._data( elem, type );
       +                        return match.slice( 0, 4 );
       +                },
        
       -                        // Speed up dequeue by getting out quickly if this is just a lookup
       -                        if ( data ) {
       -                                if ( !q || jQuery.isArray(data) ) {
       -                                        q = jQuery._data( elem, type, jQuery.makeArray(data) );
       -                                } else {
       -                                        q.push( data );
       +                "CHILD": function( match ) {
       +                        /* matches from matchExpr["CHILD"]
       +                                1 type (only|nth|...)
       +                                2 what (child|of-type)
       +                                3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
       +                                4 xn-component of xn+y argument ([+-]?\d*n|)
       +                                5 sign of xn-component
       +                                6 x of xn-component
       +                                7 sign of y-component
       +                                8 y of y-component
       +                        */
       +                        match[1] = match[1].toLowerCase();
       +
       +                        if ( match[1].slice( 0, 3 ) === "nth" ) {
       +                                // nth-* requires argument
       +                                if ( !match[3] ) {
       +                                        Sizzle.error( match[0] );
                                        }
       +
       +                                // numeric x and y parameters for Expr.filter.CHILD
       +                                // remember that false/true cast respectively to 0/1
       +                                match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
       +                                match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
       +
       +                        // other types prohibit arguments
       +                        } else if ( match[3] ) {
       +                                Sizzle.error( match[0] );
                                }
       -                        return q || [];
       -                }
       -        },
        
       -        dequeue: function( elem, type ) {
       -                type = type || "fx";
       +                        return match;
       +                },
        
       -                var queue = jQuery.queue( elem, type ),
       -                        fn = queue.shift(),
       -                        hooks = {};
       +                "PSEUDO": function( match ) {
       +                        var excess,
       +                                unquoted = !match[6] && match[2];
        
       -                // If the fx queue is dequeued, always remove the progress sentinel
       -                if ( fn === "inprogress" ) {
       -                        fn = queue.shift();
       -                }
       +                        if ( matchExpr["CHILD"].test( match[0] ) ) {
       +                                return null;
       +                        }
        
       -                if ( fn ) {
       -                        // Add a progress sentinel to prevent the fx queue from being
       -                        // automatically dequeued
       -                        if ( type === "fx" ) {
       -                                queue.unshift( "inprogress" );
       +                        // Accept quoted arguments as-is
       +                        if ( match[3] ) {
       +                                match[2] = match[4] || match[5] || "";
       +
       +                        // Strip excess characters from unquoted arguments
       +                        } else if ( unquoted && rpseudo.test( unquoted ) &&
       +                                // Get excess from tokenize (recursively)
       +                                (excess = tokenize( unquoted, true )) &&
       +                                // advance to the next closing parenthesis
       +                                (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
       +
       +                                // excess is a negative index
       +                                match[0] = match[0].slice( 0, excess );
       +                                match[2] = unquoted.slice( 0, excess );
                                }
        
       -                        jQuery._data( elem, type + ".run", hooks );
       -                        fn.call( elem, function() {
       -                                jQuery.dequeue( elem, type );
       -                        }, hooks );
       +                        // Return only captures needed by the pseudo filter method (type and argument)
       +                        return match.slice( 0, 3 );
                        }
       +        },
        
       -                if ( !queue.length ) {
       -                        jQuery.removeData( elem, type + "queue " + type + ".run", true );
       -                        handleQueueMarkDefer( elem, type, "queue" );
       -                }
       -        }
       -});
       +        filter: {
        
       -jQuery.fn.extend({
       -        queue: function( type, data ) {
       -                var setter = 2;
       +                "TAG": function( nodeNameSelector ) {
       +                        var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
       +                        return nodeNameSelector === "*" ?
       +                                function() { return true; } :
       +                                function( elem ) {
       +                                        return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
       +                                };
       +                },
        
       -                if ( typeof type !== "string" ) {
       -                        data = type;
       -                        type = "fx";
       -                        setter--;
       -                }
       +                "CLASS": function( className ) {
       +                        var pattern = classCache[ className + " " ];
        
       -                if ( arguments.length < setter ) {
       -                        return jQuery.queue( this[0], type );
       -                }
       +                        return pattern ||
       +                                (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
       +                                classCache( className, function( elem ) {
       +                                        return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
       +                                });
       +                },
        
       -                return data === undefined ?
       -                        this :
       -                        this.each(function() {
       -                                var queue = jQuery.queue( this, type, data );
       +                "ATTR": function( name, operator, check ) {
       +                        return function( elem ) {
       +                                var result = Sizzle.attr( elem, name );
        
       -                                if ( type === "fx" && queue[0] !== "inprogress" ) {
       -                                        jQuery.dequeue( this, type );
       +                                if ( result == null ) {
       +                                        return operator === "!=";
                                        }
       -                        });
       -        },
       -        dequeue: function( type ) {
       -                return this.each(function() {
       -                        jQuery.dequeue( this, type );
       -                });
       -        },
       -        // Based off of the plugin by Clint Helfers, with permission.
       -        // http://blindsignals.com/index.php/2009/07/jquery-delay/
       -        delay: function( time, type ) {
       -                time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
       -                type = type || "fx";
       +                                if ( !operator ) {
       +                                        return true;
       +                                }
       +
       +                                result += "";
        
       -                return this.queue( type, function( next, hooks ) {
       -                        var timeout = setTimeout( next, time );
       -                        hooks.stop = function() {
       -                                clearTimeout( timeout );
       +                                return operator === "=" ? result === check :
       +                                        operator === "!=" ? result !== check :
       +                                        operator === "^=" ? check && result.indexOf( check ) === 0 :
       +                                        operator === "*=" ? check && result.indexOf( check ) > -1 :
       +                                        operator === "$=" ? check && result.slice( -check.length ) === check :
       +                                        operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
       +                                        operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
       +                                        false;
                                };
       -                });
       -        },
       -        clearQueue: function( type ) {
       -                return this.queue( type || "fx", [] );
       -        },
       -        // Get a promise resolved when queues of a certain type
       -        // are emptied (fx is the type by default)
       -        promise: function( type, object ) {
       -                if ( typeof type !== "string" ) {
       -                        object = type;
       -                        type = undefined;
       -                }
       -                type = type || "fx";
       -                var defer = jQuery.Deferred(),
       -                        elements = this,
       -                        i = elements.length,
       -                        count = 1,
       -                        deferDataKey = type + "defer",
       -                        queueDataKey = type + "queue",
       -                        markDataKey = type + "mark",
       -                        tmp;
       -                function resolve() {
       -                        if ( !( --count ) ) {
       -                                defer.resolveWith( elements, [ elements ] );
       -                        }
       -                }
       -                while( i-- ) {
       -                        if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
       -                                        ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
       -                                                jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
       -                                        jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
       -                                count++;
       -                                tmp.add( resolve );
       -                        }
       -                }
       -                resolve();
       -                return defer.promise( object );
       -        }
       -});
       +                },
        
       +                "CHILD": function( type, what, argument, first, last ) {
       +                        var simple = type.slice( 0, 3 ) !== "nth",
       +                                forward = type.slice( -4 ) !== "last",
       +                                ofType = what === "of-type";
       +
       +                        return first === 1 && last === 0 ?
       +
       +                                // Shortcut for :nth-*(n)
       +                                function( elem ) {
       +                                        return !!elem.parentNode;
       +                                } :
       +
       +                                function( elem, context, xml ) {
       +                                        var cache, uniqueCache, outerCache, node, nodeIndex, start,
       +                                                dir = simple !== forward ? "nextSibling" : "previousSibling",
       +                                                parent = elem.parentNode,
       +                                                name = ofType && elem.nodeName.toLowerCase(),
       +                                                useCache = !xml && !ofType,
       +                                                diff = false;
       +
       +                                        if ( parent ) {
       +
       +                                                // :(first|last|only)-(child|of-type)
       +                                                if ( simple ) {
       +                                                        while ( dir ) {
       +                                                                node = elem;
       +                                                                while ( (node = node[ dir ]) ) {
       +                                                                        if ( ofType ?
       +                                                                                node.nodeName.toLowerCase() === name :
       +                                                                                node.nodeType === 1 ) {
       +
       +                                                                                return false;
       +                                                                        }
       +                                                                }
       +                                                                // Reverse direction for :only-* (if we haven't yet done so)
       +                                                                start = dir = type === "only" && !start && "nextSibling";
       +                                                        }
       +                                                        return true;
       +                                                }
        
       +                                                start = [ forward ? parent.firstChild : parent.lastChild ];
        
       +                                                // non-xml :nth-child(...) stores cache data on `parent`
       +                                                if ( forward && useCache ) {
        
       -var rclass = /[\n\t\r]/g,
       -        rspace = /\s+/,
       -        rreturn = /\r/g,
       -        rtype = /^(?:button|input)$/i,
       -        rfocusable = /^(?:button|input|object|select|textarea)$/i,
       -        rclickable = /^a(?:rea)?$/i,
       -        rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
       -        getSetAttribute = jQuery.support.getSetAttribute,
       -        nodeHook, boolHook, fixSpecified;
       +                                                        // Seek `elem` from a previously-cached index
        
       -jQuery.fn.extend({
       -        attr: function( name, value ) {
       -                return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
       -        },
       +                                                        // ...in a gzip-friendly way
       +                                                        node = parent;
       +                                                        outerCache = node[ expando ] || (node[ expando ] = {});
        
       -        removeAttr: function( name ) {
       -                return this.each(function() {
       -                        jQuery.removeAttr( this, name );
       -                });
       -        },
       +                                                        // Support: IE <9 only
       +                                                        // Defend against cloned attroperties (jQuery gh-1709)
       +                                                        uniqueCache = outerCache[ node.uniqueID ] ||
       +                                                                (outerCache[ node.uniqueID ] = {});
        
       -        prop: function( name, value ) {
       -                return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
       -        },
       +                                                        cache = uniqueCache[ type ] || [];
       +                                                        nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
       +                                                        diff = nodeIndex && cache[ 2 ];
       +                                                        node = nodeIndex && parent.childNodes[ nodeIndex ];
        
       -        removeProp: function( name ) {
       -                name = jQuery.propFix[ name ] || name;
       -                return this.each(function() {
       -                        // try/catch handles cases where IE balks (such as removing a property on window)
       -                        try {
       -                                this[ name ] = undefined;
       -                                delete this[ name ];
       -                        } catch( e ) {}
       -                });
       -        },
       +                                                        while ( (node = ++nodeIndex && node && node[ dir ] ||
        
       -        addClass: function( value ) {
       -                var classNames, i, l, elem,
       -                        setClass, c, cl;
       +                                                                // Fallback to seeking `elem` from the start
       +                                                                (diff = nodeIndex = 0) || start.pop()) ) {
        
       -                if ( jQuery.isFunction( value ) ) {
       -                        return this.each(function( j ) {
       -                                jQuery( this ).addClass( value.call(this, j, this.className) );
       -                        });
       -                }
       +                                                                // When found, cache indexes on `parent` and break
       +                                                                if ( node.nodeType === 1 && ++diff && node === elem ) {
       +                                                                        uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
       +                                                                        break;
       +                                                                }
       +                                                        }
        
       -                if ( value && typeof value === "string" ) {
       -                        classNames = value.split( rspace );
       +                                                } else {
       +                                                        // Use previously-cached element index if available
       +                                                        if ( useCache ) {
       +                                                                // ...in a gzip-friendly way
       +                                                                node = elem;
       +                                                                outerCache = node[ expando ] || (node[ expando ] = {});
       +
       +                                                                // Support: IE <9 only
       +                                                                // Defend against cloned attroperties (jQuery gh-1709)
       +                                                                uniqueCache = outerCache[ node.uniqueID ] ||
       +                                                                        (outerCache[ node.uniqueID ] = {});
       +
       +                                                                cache = uniqueCache[ type ] || [];
       +                                                                nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
       +                                                                diff = nodeIndex;
       +                                                        }
        
       -                        for ( i = 0, l = this.length; i < l; i++ ) {
       -                                elem = this[ i ];
       +                                                        // xml :nth-child(...)
       +                                                        // or :nth-last-child(...) or :nth(-last)?-of-type(...)
       +                                                        if ( diff === false ) {
       +                                                                // Use the same loop as above to seek `elem` from the start
       +                                                                while ( (node = ++nodeIndex && node && node[ dir ] ||
       +                                                                        (diff = nodeIndex = 0) || start.pop()) ) {
        
       -                                if ( elem.nodeType === 1 ) {
       -                                        if ( !elem.className && classNames.length === 1 ) {
       -                                                elem.className = value;
       +                                                                        if ( ( ofType ?
       +                                                                                node.nodeName.toLowerCase() === name :
       +                                                                                node.nodeType === 1 ) &&
       +                                                                                ++diff ) {
        
       -                                        } else {
       -                                                setClass = " " + elem.className + " ";
       +                                                                                // Cache the index of each encountered element
       +                                                                                if ( useCache ) {
       +                                                                                        outerCache = node[ expando ] || (node[ expando ] = {});
       +
       +                                                                                        // Support: IE <9 only
       +                                                                                        // Defend against cloned attroperties (jQuery gh-1709)
       +                                                                                        uniqueCache = outerCache[ node.uniqueID ] ||
       +                                                                                                (outerCache[ node.uniqueID ] = {});
        
       -                                                for ( c = 0, cl = classNames.length; c < cl; c++ ) {
       -                                                        if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
       -                                                                setClass += classNames[ c ] + " ";
       +                                                                                        uniqueCache[ type ] = [ dirruns, diff ];
       +                                                                                }
       +
       +                                                                                if ( node === elem ) {
       +                                                                                        break;
       +                                                                                }
       +                                                                        }
       +                                                                }
                                                                }
                                                        }
       -                                                elem.className = jQuery.trim( setClass );
       -                                        }
       -                                }
       -                        }
       -                }
        
       -                return this;
       -        },
       +                                                // Incorporate the offset, then check against cycle size
       +                                                diff -= last;
       +                                                return diff === first || ( diff % first === 0 && diff / first >= 0 );
       +                                        }
       +                                };
       +                },
        
       -        removeClass: function( value ) {
       -                var classNames, i, l, elem, className, c, cl;
       +                "PSEUDO": function( pseudo, argument ) {
       +                        // pseudo-class names are case-insensitive
       +                        // http://www.w3.org/TR/selectors/#pseudo-classes
       +                        // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
       +                        // Remember that setFilters inherits from pseudos
       +                        var args,
       +                                fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
       +                                        Sizzle.error( "unsupported pseudo: " + pseudo );
       +
       +                        // The user may use createPseudo to indicate that
       +                        // arguments are needed to create the filter function
       +                        // just as Sizzle does
       +                        if ( fn[ expando ] ) {
       +                                return fn( argument );
       +                        }
       +
       +                        // But maintain support for old signatures
       +                        if ( fn.length > 1 ) {
       +                                args = [ pseudo, pseudo, "", argument ];
       +                                return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
       +                                        markFunction(function( seed, matches ) {
       +                                                var idx,
       +                                                        matched = fn( seed, argument ),
       +                                                        i = matched.length;
       +                                                while ( i-- ) {
       +                                                        idx = indexOf( seed, matched[i] );
       +                                                        seed[ idx ] = !( matches[ idx ] = matched[i] );
       +                                                }
       +                                        }) :
       +                                        function( elem ) {
       +                                                return fn( elem, 0, args );
       +                                        };
       +                        }
        
       -                if ( jQuery.isFunction( value ) ) {
       -                        return this.each(function( j ) {
       -                                jQuery( this ).removeClass( value.call(this, j, this.className) );
       -                        });
       +                        return fn;
                        }
       +        },
        
       -                if ( (value && typeof value === "string") || value === undefined ) {
       -                        classNames = ( value || "" ).split( rspace );
       +        pseudos: {
       +                // Potentially complex pseudos
       +                "not": markFunction(function( selector ) {
       +                        // Trim the selector passed to compile
       +                        // to avoid treating leading and trailing
       +                        // spaces as combinators
       +                        var input = [],
       +                                results = [],
       +                                matcher = compile( selector.replace( rtrim, "$1" ) );
        
       -                        for ( i = 0, l = this.length; i < l; i++ ) {
       -                                elem = this[ i ];
       +                        return matcher[ expando ] ?
       +                                markFunction(function( seed, matches, context, xml ) {
       +                                        var elem,
       +                                                unmatched = matcher( seed, null, xml, [] ),
       +                                                i = seed.length;
        
       -                                if ( elem.nodeType === 1 && elem.className ) {
       -                                        if ( value ) {
       -                                                className = (" " + elem.className + " ").replace( rclass, " " );
       -                                                for ( c = 0, cl = classNames.length; c < cl; c++ ) {
       -                                                        className = className.replace(" " + classNames[ c ] + " ", " ");
       +                                        // Match elements unmatched by `matcher`
       +                                        while ( i-- ) {
       +                                                if ( (elem = unmatched[i]) ) {
       +                                                        seed[i] = !(matches[i] = elem);
                                                        }
       -                                                elem.className = jQuery.trim( className );
       -
       -                                        } else {
       -                                                elem.className = "";
                                                }
       -                                }
       -                        }
       -                }
       +                                }) :
       +                                function( elem, context, xml ) {
       +                                        input[0] = elem;
       +                                        matcher( input, null, xml, results );
       +                                        // Don't keep the element (issue #299)
       +                                        input[0] = null;
       +                                        return !results.pop();
       +                                };
       +                }),
        
       -                return this;
       -        },
       +                "has": markFunction(function( selector ) {
       +                        return function( elem ) {
       +                                return Sizzle( selector, elem ).length > 0;
       +                        };
       +                }),
        
       -        toggleClass: function( value, stateVal ) {
       -                var type = typeof value,
       -                        isBool = typeof stateVal === "boolean";
       +                "contains": markFunction(function( text ) {
       +                        text = text.replace( runescape, funescape );
       +                        return function( elem ) {
       +                                return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
       +                        };
       +                }),
       +
       +                // "Whether an element is represented by a :lang() selector
       +                // is based solely on the element's language value
       +                // being equal to the identifier C,
       +                // or beginning with the identifier C immediately followed by "-".
       +                // The matching of C against the element's language value is performed case-insensitively.
       +                // The identifier C does not have to be a valid language name."
       +                // http://www.w3.org/TR/selectors/#lang-pseudo
       +                "lang": markFunction( function( lang ) {
       +                        // lang value must be a valid identifier
       +                        if ( !ridentifier.test(lang || "") ) {
       +                                Sizzle.error( "unsupported lang: " + lang );
       +                        }
       +                        lang = lang.replace( runescape, funescape ).toLowerCase();
       +                        return function( elem ) {
       +                                var elemLang;
       +                                do {
       +                                        if ( (elemLang = documentIsHTML ?
       +                                                elem.lang :
       +                                                elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
       +
       +                                                elemLang = elemLang.toLowerCase();
       +                                                return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
       +                                        }
       +                                } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
       +                                return false;
       +                        };
       +                }),
        
       -                if ( jQuery.isFunction( value ) ) {
       -                        return this.each(function( i ) {
       -                                jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
       -                        });
       -                }
       +                // Miscellaneous
       +                "target": function( elem ) {
       +                        var hash = window.location && window.location.hash;
       +                        return hash && hash.slice( 1 ) === elem.id;
       +                },
        
       -                return this.each(function() {
       -                        if ( type === "string" ) {
       -                                // toggle individual class names
       -                                var className,
       -                                        i = 0,
       -                                        self = jQuery( this ),
       -                                        state = stateVal,
       -                                        classNames = value.split( rspace );
       +                "root": function( elem ) {
       +                        return elem === docElem;
       +                },
        
       -                                while ( (className = classNames[ i++ ]) ) {
       -                                        // check each className given, space seperated list
       -                                        state = isBool ? state : !self.hasClass( className );
       -                                        self[ state ? "addClass" : "removeClass" ]( className );
       -                                }
       +                "focus": function( elem ) {
       +                        return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
       +                },
        
       -                        } else if ( type === "undefined" || type === "boolean" ) {
       -                                if ( this.className ) {
       -                                        // store className if set
       -                                        jQuery._data( this, "__className__", this.className );
       -                                }
       +                // Boolean properties
       +                "enabled": createDisabledPseudo( false ),
       +                "disabled": createDisabledPseudo( true ),
       +
       +                "checked": function( elem ) {
       +                        // In CSS3, :checked should return both checked and selected elements
       +                        // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
       +                        var nodeName = elem.nodeName.toLowerCase();
       +                        return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
       +                },
        
       -                                // toggle whole className
       -                                this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
       +                "selected": function( elem ) {
       +                        // Accessing this property makes selected-by-default
       +                        // options in Safari work properly
       +                        if ( elem.parentNode ) {
       +                                elem.parentNode.selectedIndex;
                                }
       -                });
       -        },
        
       -        hasClass: function( selector ) {
       -                var className = " " + selector + " ",
       -                        i = 0,
       -                        l = this.length;
       -                for ( ; i < l; i++ ) {
       -                        if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
       -                                return true;
       +                        return elem.selected === true;
       +                },
       +
       +                // Contents
       +                "empty": function( elem ) {
       +                        // http://www.w3.org/TR/selectors/#empty-pseudo
       +                        // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
       +                        //   but not by others (comment: 8; processing instruction: 7; etc.)
       +                        // nodeType < 6 works because attributes (2) do not appear as children
       +                        for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
       +                                if ( elem.nodeType < 6 ) {
       +                                        return false;
       +                                }
                                }
       -                }
       +                        return true;
       +                },
        
       -                return false;
       -        },
       +                "parent": function( elem ) {
       +                        return !Expr.pseudos["empty"]( elem );
       +                },
        
       -        val: function( value ) {
       -                var hooks, ret, isFunction,
       -                        elem = this[0];
       +                // Element/input types
       +                "header": function( elem ) {
       +                        return rheader.test( elem.nodeName );
       +                },
        
       -                if ( !arguments.length ) {
       -                        if ( elem ) {
       -                                hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
       +                "input": function( elem ) {
       +                        return rinputs.test( elem.nodeName );
       +                },
        
       -                                if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
       -                                        return ret;
       -                                }
       +                "button": function( elem ) {
       +                        var name = elem.nodeName.toLowerCase();
       +                        return name === "input" && elem.type === "button" || name === "button";
       +                },
        
       -                                ret = elem.value;
       +                "text": function( elem ) {
       +                        var attr;
       +                        return elem.nodeName.toLowerCase() === "input" &&
       +                                elem.type === "text" &&
        
       -                                return typeof ret === "string" ?
       -                                        // handle most common string cases
       -                                        ret.replace(rreturn, "") :
       -                                        // handle cases where value is null/undef or number
       -                                        ret == null ? "" : ret;
       -                        }
       +                                // Support: IE<8
       +                                // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
       +                                ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
       +                },
        
       -                        return;
       -                }
       +                // Position-in-collection
       +                "first": createPositionalPseudo(function() {
       +                        return [ 0 ];
       +                }),
        
       -                isFunction = jQuery.isFunction( value );
       +                "last": createPositionalPseudo(function( matchIndexes, length ) {
       +                        return [ length - 1 ];
       +                }),
        
       -                return this.each(function( i ) {
       -                        var self = jQuery(this), val;
       +                "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
       +                        return [ argument < 0 ? argument + length : argument ];
       +                }),
        
       -                        if ( this.nodeType !== 1 ) {
       -                                return;
       +                "even": createPositionalPseudo(function( matchIndexes, length ) {
       +                        var i = 0;
       +                        for ( ; i < length; i += 2 ) {
       +                                matchIndexes.push( i );
                                }
       +                        return matchIndexes;
       +                }),
        
       -                        if ( isFunction ) {
       -                                val = value.call( this, i, self.val() );
       -                        } else {
       -                                val = value;
       +                "odd": createPositionalPseudo(function( matchIndexes, length ) {
       +                        var i = 1;
       +                        for ( ; i < length; i += 2 ) {
       +                                matchIndexes.push( i );
                                }
       +                        return matchIndexes;
       +                }),
        
       -                        // Treat null/undefined as ""; convert numbers to string
       -                        if ( val == null ) {
       -                                val = "";
       -                        } else if ( typeof val === "number" ) {
       -                                val += "";
       -                        } else if ( jQuery.isArray( val ) ) {
       -                                val = jQuery.map(val, function ( value ) {
       -                                        return value == null ? "" : value + "";
       -                                });
       +                "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
       +                        var i = argument < 0 ? argument + length : argument;
       +                        for ( ; --i >= 0; ) {
       +                                matchIndexes.push( i );
                                }
       +                        return matchIndexes;
       +                }),
        
       -                        hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
       -
       -                        // If set returns undefined, fall back to normal setting
       -                        if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
       -                                this.value = val;
       +                "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
       +                        var i = argument < 0 ? argument + length : argument;
       +                        for ( ; ++i < length; ) {
       +                                matchIndexes.push( i );
                                }
       -                });
       +                        return matchIndexes;
       +                })
                }
       -});
       +};
        
       -jQuery.extend({
       -        valHooks: {
       -                option: {
       -                        get: function( elem ) {
       -                                // attributes.value is undefined in Blackberry 4.7 but
       -                                // uses .value. See #6932
       -                                var val = elem.attributes.value;
       -                                return !val || val.specified ? elem.value : elem.text;
       -                        }
       -                },
       -                select: {
       -                        get: function( elem ) {
       -                                var value, i, max, option,
       -                                        index = elem.selectedIndex,
       -                                        values = [],
       -                                        options = elem.options,
       -                                        one = elem.type === "select-one";
       +Expr.pseudos["nth"] = Expr.pseudos["eq"];
        
       -                                // Nothing was selected
       -                                if ( index < 0 ) {
       -                                        return null;
       -                                }
       +// Add button/input type pseudos
       +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
       +        Expr.pseudos[ i ] = createInputPseudo( i );
       +}
       +for ( i in { submit: true, reset: true } ) {
       +        Expr.pseudos[ i ] = createButtonPseudo( i );
       +}
        
       -                                // Loop through all the selected options
       -                                i = one ? index : 0;
       -                                max = one ? index + 1 : options.length;
       -                                for ( ; i < max; i++ ) {
       -                                        option = options[ i ];
       +// Easy API for creating new setFilters
       +function setFilters() {}
       +setFilters.prototype = Expr.filters = Expr.pseudos;
       +Expr.setFilters = new setFilters();
        
       -                                        // Don't return options that are disabled or in a disabled optgroup
       -                                        if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
       -                                                        (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
       +tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
       +        var matched, match, tokens, type,
       +                soFar, groups, preFilters,
       +                cached = tokenCache[ selector + " " ];
        
       -                                                // Get the specific value for the option
       -                                                value = jQuery( option ).val();
       +        if ( cached ) {
       +                return parseOnly ? 0 : cached.slice( 0 );
       +        }
        
       -                                                // We don't need an array for one selects
       -                                                if ( one ) {
       -                                                        return value;
       -                                                }
       +        soFar = selector;
       +        groups = [];
       +        preFilters = Expr.preFilter;
        
       -                                                // Multi-Selects return an array
       -                                                values.push( value );
       -                                        }
       -                                }
       +        while ( soFar ) {
        
       -                                // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
       -                                if ( one && !values.length && options.length ) {
       -                                        return jQuery( options[ index ] ).val();
       -                                }
       +                // Comma and first run
       +                if ( !matched || (match = rcomma.exec( soFar )) ) {
       +                        if ( match ) {
       +                                // Don't consume trailing commas as valid
       +                                soFar = soFar.slice( match[0].length ) || soFar;
       +                        }
       +                        groups.push( (tokens = []) );
       +                }
        
       -                                return values;
       -                        },
       +                matched = false;
        
       -                        set: function( elem, value ) {
       -                                var values = jQuery.makeArray( value );
       +                // Combinators
       +                if ( (match = rcombinators.exec( soFar )) ) {
       +                        matched = match.shift();
       +                        tokens.push({
       +                                value: matched,
       +                                // Cast descendant combinators to space
       +                                type: match[0].replace( rtrim, " " )
       +                        });
       +                        soFar = soFar.slice( matched.length );
       +                }
        
       -                                jQuery(elem).find("option").each(function() {
       -                                        this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
       +                // Filters
       +                for ( type in Expr.filter ) {
       +                        if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
       +                                (match = preFilters[ type ]( match ))) ) {
       +                                matched = match.shift();
       +                                tokens.push({
       +                                        value: matched,
       +                                        type: type,
       +                                        matches: match
                                        });
       -
       -                                if ( !values.length ) {
       -                                        elem.selectedIndex = -1;
       -                                }
       -                                return values;
       +                                soFar = soFar.slice( matched.length );
                                }
                        }
       -        },
        
       -        attrFn: {
       -                val: true,
       -                css: true,
       -                html: true,
       -                text: true,
       -                data: true,
       -                width: true,
       -                height: true,
       -                offset: true
       -        },
       +                if ( !matched ) {
       +                        break;
       +                }
       +        }
        
       -        attr: function( elem, name, value, pass ) {
       -                var ret, hooks, notxml,
       -                        nType = elem.nodeType;
       +        // Return the length of the invalid excess
       +        // if we're just parsing
       +        // Otherwise, throw an error or return tokens
       +        return parseOnly ?
       +                soFar.length :
       +                soFar ?
       +                        Sizzle.error( selector ) :
       +                        // Cache the tokens
       +                        tokenCache( selector, groups ).slice( 0 );
       +};
        
       -                // don't get/set attributes on text, comment and attribute nodes
       -                if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
       -                        return;
       -                }
       +function toSelector( tokens ) {
       +        var i = 0,
       +                len = tokens.length,
       +                selector = "";
       +        for ( ; i < len; i++ ) {
       +                selector += tokens[i].value;
       +        }
       +        return selector;
       +}
        
       -                if ( pass && name in jQuery.attrFn ) {
       -                        return jQuery( elem )[ name ]( value );
       -                }
       +function addCombinator( matcher, combinator, base ) {
       +        var dir = combinator.dir,
       +                skip = combinator.next,
       +                key = skip || dir,
       +                checkNonElements = base && key === "parentNode",
       +                doneName = done++;
        
       -                // Fallback to prop when attributes are not supported
       -                if ( typeof elem.getAttribute === "undefined" ) {
       -                        return jQuery.prop( elem, name, value );
       -                }
       +        return combinator.first ?
       +                // Check against closest ancestor/preceding element
       +                function( elem, context, xml ) {
       +                        while ( (elem = elem[ dir ]) ) {
       +                                if ( elem.nodeType === 1 || checkNonElements ) {
       +                                        return matcher( elem, context, xml );
       +                                }
       +                        }
       +                        return false;
       +                } :
        
       -                notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
       +                // Check against all ancestor/preceding elements
       +                function( elem, context, xml ) {
       +                        var oldCache, uniqueCache, outerCache,
       +                                newCache = [ dirruns, doneName ];
        
       -                // All attributes are lowercase
       -                // Grab necessary hook if one is defined
       -                if ( notxml ) {
       -                        name = name.toLowerCase();
       -                        hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
       -                }
       +                        // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
       +                        if ( xml ) {
       +                                while ( (elem = elem[ dir ]) ) {
       +                                        if ( elem.nodeType === 1 || checkNonElements ) {
       +                                                if ( matcher( elem, context, xml ) ) {
       +                                                        return true;
       +                                                }
       +                                        }
       +                                }
       +                        } else {
       +                                while ( (elem = elem[ dir ]) ) {
       +                                        if ( elem.nodeType === 1 || checkNonElements ) {
       +                                                outerCache = elem[ expando ] || (elem[ expando ] = {});
        
       -                if ( value !== undefined ) {
       +                                                // Support: IE <9 only
       +                                                // Defend against cloned attroperties (jQuery gh-1709)
       +                                                uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
        
       -                        if ( value === null ) {
       -                                jQuery.removeAttr( elem, name );
       -                                return;
       +                                                if ( skip && skip === elem.nodeName.toLowerCase() ) {
       +                                                        elem = elem[ dir ] || elem;
       +                                                } else if ( (oldCache = uniqueCache[ key ]) &&
       +                                                        oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
        
       -                        } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
       -                                return ret;
       +                                                        // Assign to newCache so results back-propagate to previous elements
       +                                                        return (newCache[ 2 ] = oldCache[ 2 ]);
       +                                                } else {
       +                                                        // Reuse newcache so results back-propagate to previous elements
       +                                                        uniqueCache[ key ] = newCache;
        
       -                        } else {
       -                                elem.setAttribute( name, "" + value );
       -                                return value;
       +                                                        // A match means we're done; a fail means we have to keep checking
       +                                                        if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
       +                                                                return true;
       +                                                        }
       +                                                }
       +                                        }
       +                                }
                                }
       +                        return false;
       +                };
       +}
        
       -                } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
       -                        return ret;
       +function elementMatcher( matchers ) {
       +        return matchers.length > 1 ?
       +                function( elem, context, xml ) {
       +                        var i = matchers.length;
       +                        while ( i-- ) {
       +                                if ( !matchers[i]( elem, context, xml ) ) {
       +                                        return false;
       +                                }
       +                        }
       +                        return true;
       +                } :
       +                matchers[0];
       +}
        
       -                } else {
       +function multipleContexts( selector, contexts, results ) {
       +        var i = 0,
       +                len = contexts.length;
       +        for ( ; i < len; i++ ) {
       +                Sizzle( selector, contexts[i], results );
       +        }
       +        return results;
       +}
        
       -                        ret = elem.getAttribute( name );
       +function condense( unmatched, map, filter, context, xml ) {
       +        var elem,
       +                newUnmatched = [],
       +                i = 0,
       +                len = unmatched.length,
       +                mapped = map != null;
        
       -                        // Non-existent attributes return null, we normalize to undefined
       -                        return ret === null ?
       -                                undefined :
       -                                ret;
       +        for ( ; i < len; i++ ) {
       +                if ( (elem = unmatched[i]) ) {
       +                        if ( !filter || filter( elem, context, xml ) ) {
       +                                newUnmatched.push( elem );
       +                                if ( mapped ) {
       +                                        map.push( i );
       +                                }
       +                        }
                        }
       -        },
       +        }
        
       -        removeAttr: function( elem, value ) {
       -                var propName, attrNames, name, l, isBool,
       -                        i = 0;
       +        return newUnmatched;
       +}
       +
       +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
       +        if ( postFilter && !postFilter[ expando ] ) {
       +                postFilter = setMatcher( postFilter );
       +        }
       +        if ( postFinder && !postFinder[ expando ] ) {
       +                postFinder = setMatcher( postFinder, postSelector );
       +        }
       +        return markFunction(function( seed, results, context, xml ) {
       +                var temp, i, elem,
       +                        preMap = [],
       +                        postMap = [],
       +                        preexisting = results.length,
        
       -                if ( value && elem.nodeType === 1 ) {
       -                        attrNames = value.toLowerCase().split( rspace );
       -                        l = attrNames.length;
       +                        // Get initial elements from seed or context
       +                        elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
        
       -                        for ( ; i < l; i++ ) {
       -                                name = attrNames[ i ];
       +                        // Prefilter to get matcher input, preserving a map for seed-results synchronization
       +                        matcherIn = preFilter && ( seed || !selector ) ?
       +                                condense( elems, preMap, preFilter, context, xml ) :
       +                                elems,
       +
       +                        matcherOut = matcher ?
       +                                // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
       +                                postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
       +
       +                                        // ...intermediate processing is necessary
       +                                        [] :
       +
       +                                        // ...otherwise use results directly
       +                                        results :
       +                                matcherIn;
       +
       +                // Find primary matches
       +                if ( matcher ) {
       +                        matcher( matcherIn, matcherOut, context, xml );
       +                }
        
       -                                if ( name ) {
       -                                        propName = jQuery.propFix[ name ] || name;
       -                                        isBool = rboolean.test( name );
       +                // Apply postFilter
       +                if ( postFilter ) {
       +                        temp = condense( matcherOut, postMap );
       +                        postFilter( temp, [], context, xml );
        
       -                                        // See #9699 for explanation of this approach (setting first, then removal)
       -                                        // Do not do this for boolean attributes (see #10870)
       -                                        if ( !isBool ) {
       -                                                jQuery.attr( elem, name, "" );
       +                        // Un-match failing elements by moving them back to matcherIn
       +                        i = temp.length;
       +                        while ( i-- ) {
       +                                if ( (elem = temp[i]) ) {
       +                                        matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
       +                                }
       +                        }
       +                }
       +
       +                if ( seed ) {
       +                        if ( postFinder || preFilter ) {
       +                                if ( postFinder ) {
       +                                        // Get the final matcherOut by condensing this intermediate into postFinder contexts
       +                                        temp = [];
       +                                        i = matcherOut.length;
       +                                        while ( i-- ) {
       +                                                if ( (elem = matcherOut[i]) ) {
       +                                                        // Restore matcherIn since elem is not yet a final match
       +                                                        temp.push( (matcherIn[i] = elem) );
       +                                                }
                                                }
       -                                        elem.removeAttribute( getSetAttribute ? name : propName );
       +                                        postFinder( null, (matcherOut = []), temp, xml );
       +                                }
        
       -                                        // Set corresponding property to false for boolean attributes
       -                                        if ( isBool && propName in elem ) {
       -                                                elem[ propName ] = false;
       +                                // Move matched elements from seed to results to keep them synchronized
       +                                i = matcherOut.length;
       +                                while ( i-- ) {
       +                                        if ( (elem = matcherOut[i]) &&
       +                                                (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
       +
       +                                                seed[temp] = !(results[temp] = elem);
                                                }
                                        }
                                }
       +
       +                // Add elements to results, through postFinder if defined
       +                } else {
       +                        matcherOut = condense(
       +                                matcherOut === results ?
       +                                        matcherOut.splice( preexisting, matcherOut.length ) :
       +                                        matcherOut
       +                        );
       +                        if ( postFinder ) {
       +                                postFinder( null, results, matcherOut, xml );
       +                        } else {
       +                                push.apply( results, matcherOut );
       +                        }
                        }
       -        },
       +        });
       +}
        
       -        attrHooks: {
       -                type: {
       -                        set: function( elem, value ) {
       -                                // We can't allow the type property to be changed (since it causes problems in IE)
       -                                if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
       -                                        jQuery.error( "type property can't be changed" );
       -                                } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
       -                                        // Setting the type on a radio button after the value resets the value in IE6-9
       -                                        // Reset value to it's default in case type is set after value
       -                                        // This is for element creation
       -                                        var val = elem.value;
       -                                        elem.setAttribute( "type", value );
       -                                        if ( val ) {
       -                                                elem.value = val;
       +function matcherFromTokens( tokens ) {
       +        var checkContext, matcher, j,
       +                len = tokens.length,
       +                leadingRelative = Expr.relative[ tokens[0].type ],
       +                implicitRelative = leadingRelative || Expr.relative[" "],
       +                i = leadingRelative ? 1 : 0,
       +
       +                // The foundational matcher ensures that elements are reachable from top-level context(s)
       +                matchContext = addCombinator( function( elem ) {
       +                        return elem === checkContext;
       +                }, implicitRelative, true ),
       +                matchAnyContext = addCombinator( function( elem ) {
       +                        return indexOf( checkContext, elem ) > -1;
       +                }, implicitRelative, true ),
       +                matchers = [ function( elem, context, xml ) {
       +                        var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
       +                                (checkContext = context).nodeType ?
       +                                        matchContext( elem, context, xml ) :
       +                                        matchAnyContext( elem, context, xml ) );
       +                        // Avoid hanging onto element (issue #299)
       +                        checkContext = null;
       +                        return ret;
       +                } ];
       +
       +        for ( ; i < len; i++ ) {
       +                if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
       +                        matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
       +                } else {
       +                        matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
       +
       +                        // Return special upon seeing a positional matcher
       +                        if ( matcher[ expando ] ) {
       +                                // Find the next relative operator (if any) for proper handling
       +                                j = ++i;
       +                                for ( ; j < len; j++ ) {
       +                                        if ( Expr.relative[ tokens[j].type ] ) {
       +                                                break;
                                                }
       -                                        return value;
                                        }
       +                                return setMatcher(
       +                                        i > 1 && elementMatcher( matchers ),
       +                                        i > 1 && toSelector(
       +                                                // If the preceding token was a descendant combinator, insert an implicit any-element `*`
       +                                                tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
       +                                        ).replace( rtrim, "$1" ),
       +                                        matcher,
       +                                        i < j && matcherFromTokens( tokens.slice( i, j ) ),
       +                                        j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
       +                                        j < len && toSelector( tokens )
       +                                );
                                }
       -                },
       -                // Use the value property for back compat
       -                // Use the nodeHook for button elements in IE6/7 (#1954)
       -                value: {
       -                        get: function( elem, name ) {
       -                                if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
       -                                        return nodeHook.get( elem, name );
       -                                }
       -                                return name in elem ?
       -                                        elem.value :
       -                                        null;
       -                        },
       -                        set: function( elem, value, name ) {
       -                                if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
       -                                        return nodeHook.set( elem, value, name );
       +                        matchers.push( matcher );
       +                }
       +        }
       +
       +        return elementMatcher( matchers );
       +}
       +
       +function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
       +        var bySet = setMatchers.length > 0,
       +                byElement = elementMatchers.length > 0,
       +                superMatcher = function( seed, context, xml, results, outermost ) {
       +                        var elem, j, matcher,
       +                                matchedCount = 0,
       +                                i = "0",
       +                                unmatched = seed && [],
       +                                setMatched = [],
       +                                contextBackup = outermostContext,
       +                                // We must always have either seed elements or outermost context
       +                                elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
       +                                // Use integer dirruns iff this is the outermost matcher
       +                                dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
       +                                len = elems.length;
       +
       +                        if ( outermost ) {
       +                                outermostContext = context === document || context || outermost;
       +                        }
       +
       +                        // Add elements passing elementMatchers directly to results
       +                        // Support: IE<9, Safari
       +                        // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
       +                        for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
       +                                if ( byElement && elem ) {
       +                                        j = 0;
       +                                        if ( !context && elem.ownerDocument !== document ) {
       +                                                setDocument( elem );
       +                                                xml = !documentIsHTML;
       +                                        }
       +                                        while ( (matcher = elementMatchers[j++]) ) {
       +                                                if ( matcher( elem, context || document, xml) ) {
       +                                                        results.push( elem );
       +                                                        break;
       +                                                }
       +                                        }
       +                                        if ( outermost ) {
       +                                                dirruns = dirrunsUnique;
       +                                        }
       +                                }
       +
       +                                // Track unmatched elements for set filters
       +                                if ( bySet ) {
       +                                        // They will have gone through all possible matchers
       +                                        if ( (elem = !matcher && elem) ) {
       +                                                matchedCount--;
       +                                        }
       +
       +                                        // Lengthen the array for every element, matched or not
       +                                        if ( seed ) {
       +                                                unmatched.push( elem );
       +                                        }
                                        }
       -                                // Does not return so that setAttribute is also used
       -                                elem.value = value;
                                }
       -                }
       -        },
        
       -        propFix: {
       -                tabindex: "tabIndex",
       -                readonly: "readOnly",
       -                "for": "htmlFor",
       -                "class": "className",
       -                maxlength: "maxLength",
       -                cellspacing: "cellSpacing",
       -                cellpadding: "cellPadding",
       -                rowspan: "rowSpan",
       -                colspan: "colSpan",
       -                usemap: "useMap",
       -                frameborder: "frameBorder",
       -                contenteditable: "contentEditable"
       -        },
       +                        // `i` is now the count of elements visited above, and adding it to `matchedCount`
       +                        // makes the latter nonnegative.
       +                        matchedCount += i;
        
       -        prop: function( elem, name, value ) {
       -                var ret, hooks, notxml,
       -                        nType = elem.nodeType;
       +                        // Apply set filters to unmatched elements
       +                        // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
       +                        // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
       +                        // no element matchers and no seed.
       +                        // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
       +                        // case, which will result in a "00" `matchedCount` that differs from `i` but is also
       +                        // numerically zero.
       +                        if ( bySet && i !== matchedCount ) {
       +                                j = 0;
       +                                while ( (matcher = setMatchers[j++]) ) {
       +                                        matcher( unmatched, setMatched, context, xml );
       +                                }
        
       -                // don't get/set properties on text, comment and attribute nodes
       -                if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
       -                        return;
       -                }
       +                                if ( seed ) {
       +                                        // Reintegrate element matches to eliminate the need for sorting
       +                                        if ( matchedCount > 0 ) {
       +                                                while ( i-- ) {
       +                                                        if ( !(unmatched[i] || setMatched[i]) ) {
       +                                                                setMatched[i] = pop.call( results );
       +                                                        }
       +                                                }
       +                                        }
        
       -                notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
       +                                        // Discard index placeholder values to get only actual matches
       +                                        setMatched = condense( setMatched );
       +                                }
        
       -                if ( notxml ) {
       -                        // Fix name and attach hooks
       -                        name = jQuery.propFix[ name ] || name;
       -                        hooks = jQuery.propHooks[ name ];
       -                }
       +                                // Add matches to results
       +                                push.apply( results, setMatched );
        
       -                if ( value !== undefined ) {
       -                        if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
       -                                return ret;
       +                                // Seedless set matches succeeding multiple successful matchers stipulate sorting
       +                                if ( outermost && !seed && setMatched.length > 0 &&
       +                                        ( matchedCount + setMatchers.length ) > 1 ) {
        
       -                        } else {
       -                                return ( elem[ name ] = value );
       +                                        Sizzle.uniqueSort( results );
       +                                }
                                }
        
       -                } else {
       -                        if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
       -                                return ret;
       +                        // Override manipulation of globals by nested matchers
       +                        if ( outermost ) {
       +                                dirruns = dirrunsUnique;
       +                                outermostContext = contextBackup;
       +                        }
       +
       +                        return unmatched;
       +                };
        
       +        return bySet ?
       +                markFunction( superMatcher ) :
       +                superMatcher;
       +}
       +
       +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
       +        var i,
       +                setMatchers = [],
       +                elementMatchers = [],
       +                cached = compilerCache[ selector + " " ];
       +
       +        if ( !cached ) {
       +                // Generate a function of recursive functions that can be used to check each element
       +                if ( !match ) {
       +                        match = tokenize( selector );
       +                }
       +                i = match.length;
       +                while ( i-- ) {
       +                        cached = matcherFromTokens( match[i] );
       +                        if ( cached[ expando ] ) {
       +                                setMatchers.push( cached );
                                } else {
       -                                return elem[ name ];
       +                                elementMatchers.push( cached );
                                }
                        }
       -        },
        
       -        propHooks: {
       -                tabIndex: {
       -                        get: function( elem ) {
       -                                // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
       -                                // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
       -                                var attributeNode = elem.getAttributeNode("tabindex");
       +                // Cache the compiled function
       +                cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
        
       -                                return attributeNode && attributeNode.specified ?
       -                                        parseInt( attributeNode.value, 10 ) :
       -                                        rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
       -                                                0 :
       -                                                undefined;
       -                        }
       -                }
       +                // Save selector and tokenization
       +                cached.selector = selector;
                }
       -});
       +        return cached;
       +};
        
       -// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
       -jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
       +/**
       + * A low-level selection function that works with Sizzle's compiled
       + *  selector functions
       + * @param {String|Function} selector A selector or a pre-compiled
       + *  selector function built with Sizzle.compile
       + * @param {Element} context
       + * @param {Array} [results]
       + * @param {Array} [seed] A set of elements to match against
       + */
       +select = Sizzle.select = function( selector, context, results, seed ) {
       +        var i, tokens, token, type, find,
       +                compiled = typeof selector === "function" && selector,
       +                match = !seed && tokenize( (selector = compiled.selector || selector) );
        
       -// Hook for boolean attributes
       -boolHook = {
       -        get: function( elem, name ) {
       -                // Align boolean attributes with corresponding properties
       -                // Fall back to attribute presence where some booleans are not supported
       -                var attrNode,
       -                        property = jQuery.prop( elem, name );
       -                return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
       -                        name.toLowerCase() :
       -                        undefined;
       -        },
       -        set: function( elem, value, name ) {
       -                var propName;
       -                if ( value === false ) {
       -                        // Remove boolean attributes when set to false
       -                        jQuery.removeAttr( elem, name );
       -                } else {
       -                        // value is true since we know at this point it's type boolean and not false
       -                        // Set boolean attributes to the same name and set the DOM property
       -                        propName = jQuery.propFix[ name ] || name;
       -                        if ( propName in elem ) {
       -                                // Only set the IDL specifically if it already exists on the element
       -                                elem[ propName ] = true;
       -                        }
       +        results = results || [];
        
       -                        elem.setAttribute( name, name.toLowerCase() );
       -                }
       -                return name;
       -        }
       -};
       +        // Try to minimize operations if there is only one selector in the list and no seed
       +        // (the latter of which guarantees us context)
       +        if ( match.length === 1 ) {
        
       -// IE6/7 do not support getting/setting some attributes with get/setAttribute
       -if ( !getSetAttribute ) {
       +                // Reduce context if the leading compound selector is an ID
       +                tokens = match[0] = match[0].slice( 0 );
       +                if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
       +                                context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
        
       -        fixSpecified = {
       -                name: true,
       -                id: true,
       -                coords: true
       -        };
       +                        context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
       +                        if ( !context ) {
       +                                return results;
        
       -        // Use this for any attribute in IE6/7
       -        // This fixes almost every IE6/7 issue
       -        nodeHook = jQuery.valHooks.button = {
       -                get: function( elem, name ) {
       -                        var ret;
       -                        ret = elem.getAttributeNode( name );
       -                        return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
       -                                ret.nodeValue :
       -                                undefined;
       -                },
       -                set: function( elem, value, name ) {
       -                        // Set the existing or create a new attribute node
       -                        var ret = elem.getAttributeNode( name );
       -                        if ( !ret ) {
       -                                ret = document.createAttribute( name );
       -                                elem.setAttributeNode( ret );
       +                        // Precompiled matchers will still verify ancestry, so step up a level
       +                        } else if ( compiled ) {
       +                                context = context.parentNode;
                                }
       -                        return ( ret.nodeValue = value + "" );
       +
       +                        selector = selector.slice( tokens.shift().value.length );
                        }
       -        };
        
       -        // Apply the nodeHook to tabindex
       -        jQuery.attrHooks.tabindex.set = nodeHook.set;
       +                // Fetch a seed set for right-to-left matching
       +                i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
       +                while ( i-- ) {
       +                        token = tokens[i];
        
       -        // Set width and height to auto instead of 0 on empty string( Bug #8150 )
       -        // This is for removals
       -        jQuery.each([ "width", "height" ], function( i, name ) {
       -                jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
       -                        set: function( elem, value ) {
       -                                if ( value === "" ) {
       -                                        elem.setAttribute( name, "auto" );
       -                                        return value;
       -                                }
       +                        // Abort if we hit a combinator
       +                        if ( Expr.relative[ (type = token.type) ] ) {
       +                                break;
                                }
       -                });
       -        });
       +                        if ( (find = Expr.find[ type ]) ) {
       +                                // Search, expanding context for leading sibling combinators
       +                                if ( (seed = find(
       +                                        token.matches[0].replace( runescape, funescape ),
       +                                        rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
       +                                )) ) {
       +
       +                                        // If seed is empty or no tokens remain, we can return early
       +                                        tokens.splice( i, 1 );
       +                                        selector = seed.length && toSelector( tokens );
       +                                        if ( !selector ) {
       +                                                push.apply( results, seed );
       +                                                return results;
       +                                        }
        
       -        // Set contenteditable to false on removals(#10429)
       -        // Setting to empty string throws an error as an invalid value
       -        jQuery.attrHooks.contenteditable = {
       -                get: nodeHook.get,
       -                set: function( elem, value, name ) {
       -                        if ( value === "" ) {
       -                                value = "false";
       +                                        break;
       +                                }
                                }
       -                        nodeHook.set( elem, value, name );
                        }
       -        };
       -}
       +        }
        
       +        // Compile and execute a filtering function if one is not provided
       +        // Provide `match` to avoid retokenization if we modified the selector above
       +        ( compiled || compile( selector, match ) )(
       +                seed,
       +                context,
       +                !documentIsHTML,
       +                results,
       +                !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
       +        );
       +        return results;
       +};
        
       -// Some attributes require a special call on IE
       -if ( !jQuery.support.hrefNormalized ) {
       -        jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
       -                jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
       -                        get: function( elem ) {
       -                                var ret = elem.getAttribute( name, 2 );
       -                                return ret === null ? undefined : ret;
       -                        }
       -                });
       -        });
       -}
       +// One-time assignments
        
       -if ( !jQuery.support.style ) {
       -        jQuery.attrHooks.style = {
       -                get: function( elem ) {
       -                        // Return undefined in the case of empty string
       -                        // Normalize to lowercase since IE uppercases css property names
       -                        return elem.style.cssText.toLowerCase() || undefined;
       -                },
       -                set: function( elem, value ) {
       -                        return ( elem.style.cssText = "" + value );
       -                }
       -        };
       -}
       +// Sort stability
       +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
        
       -// Safari mis-reports the default selected property of an option
       -// Accessing the parent's selectedIndex property fixes it
       -if ( !jQuery.support.optSelected ) {
       -        jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
       -                get: function( elem ) {
       -                        var parent = elem.parentNode;
       +// Support: Chrome 14-35+
       +// Always assume duplicates if they aren't passed to the comparison function
       +support.detectDuplicates = !!hasDuplicate;
        
       -                        if ( parent ) {
       -                                parent.selectedIndex;
       +// Initialize against the default document
       +setDocument();
        
       -                                // Make sure that it also works with optgroups, see #5701
       -                                if ( parent.parentNode ) {
       -                                        parent.parentNode.selectedIndex;
       -                                }
       -                        }
       -                        return null;
       +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
       +// Detached nodes confoundingly follow *each other*
       +support.sortDetached = assert(function( el ) {
       +        // Should return 1, but returns 4 (following)
       +        return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
       +});
       +
       +// Support: IE<8
       +// Prevent attribute/property "interpolation"
       +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
       +if ( !assert(function( el ) {
       +        el.innerHTML = "<a href='#'></a>";
       +        return el.firstChild.getAttribute("href") === "#" ;
       +}) ) {
       +        addHandle( "type|href|height|width", function( elem, name, isXML ) {
       +                if ( !isXML ) {
       +                        return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
                        }
                });
        }
        
       -// IE6/7 call enctype encoding
       -if ( !jQuery.support.enctype ) {
       -        jQuery.propFix.enctype = "encoding";
       -}
       -
       -// Radios and checkboxes getter/setter
       -if ( !jQuery.support.checkOn ) {
       -        jQuery.each([ "radio", "checkbox" ], function() {
       -                jQuery.valHooks[ this ] = {
       -                        get: function( elem ) {
       -                                // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
       -                                return elem.getAttribute("value") === null ? "on" : elem.value;
       -                        }
       -                };
       +// Support: IE<9
       +// Use defaultValue in place of getAttribute("value")
       +if ( !support.attributes || !assert(function( el ) {
       +        el.innerHTML = "<input/>";
       +        el.firstChild.setAttribute( "value", "" );
       +        return el.firstChild.getAttribute( "value" ) === "";
       +}) ) {
       +        addHandle( "value", function( elem, name, isXML ) {
       +                if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
       +                        return elem.defaultValue;
       +                }
                });
        }
       -jQuery.each([ "radio", "checkbox" ], function() {
       -        jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
       -                set: function( elem, value ) {
       -                        if ( jQuery.isArray( value ) ) {
       -                                return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
       -                        }
       +
       +// Support: IE<9
       +// Use getAttributeNode to fetch booleans when getAttribute lies
       +if ( !assert(function( el ) {
       +        return el.getAttribute("disabled") == null;
       +}) ) {
       +        addHandle( booleans, function( elem, name, isXML ) {
       +                var val;
       +                if ( !isXML ) {
       +                        return elem[ name ] === true ? name.toLowerCase() :
       +                                        (val = elem.getAttributeNode( name )) && val.specified ?
       +                                        val.value :
       +                                null;
                        }
                });
       -});
       +}
        
       +return Sizzle;
        
       +})( window );
        
        
       -var rformElems = /^(?:textarea|input|select)$/i,
       -        rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
       -        rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
       -        rkeyEvent = /^key/,
       -        rmouseEvent = /^(?:mouse|contextmenu)|click/,
       -        rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
       -        rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
       -        quickParse = function( selector ) {
       -                var quick = rquickIs.exec( selector );
       -                if ( quick ) {
       -                        //   0  1    2   3
       -                        // [ _, tag, id, class ]
       -                        quick[1] = ( quick[1] || "" ).toLowerCase();
       -                        quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
       -                }
       -                return quick;
       -        },
       -        quickIs = function( elem, m ) {
       -                var attrs = elem.attributes || {};
       -                return (
       -                        (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
       -                        (!m[2] || (attrs.id || {}).value === m[2]) &&
       -                        (!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
       -                );
       -        },
       -        hoverHack = function( events ) {
       -                return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
       -        };
        
       -/*
       - * Helper functions for managing events -- not part of the public interface.
       - * Props to Dean Edwards' addEvent library for many of the ideas.
       - */
       -jQuery.event = {
       +jQuery.find = Sizzle;
       +jQuery.expr = Sizzle.selectors;
        
       -        add: function( elem, types, handler, data, selector ) {
       +// Deprecated
       +jQuery.expr[ ":" ] = jQuery.expr.pseudos;
       +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
       +jQuery.text = Sizzle.getText;
       +jQuery.isXMLDoc = Sizzle.isXML;
       +jQuery.contains = Sizzle.contains;
       +jQuery.escapeSelector = Sizzle.escape;
        
       -                var elemData, eventHandle, events,
       -                        t, tns, type, namespaces, handleObj,
       -                        handleObjIn, quick, handlers, special;
        
       -                // Don't attach events to noData or text/comment nodes (allow plain objects tho)
       -                if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
       -                        return;
       -                }
        
       -                // Caller can pass in an object of custom data in lieu of the handler
       -                if ( handler.handler ) {
       -                        handleObjIn = handler;
       -                        handler = handleObjIn.handler;
       -                        selector = handleObjIn.selector;
       -                }
        
       -                // Make sure that the handler has a unique ID, used to find/remove it later
       -                if ( !handler.guid ) {
       -                        handler.guid = jQuery.guid++;
       -                }
       +var dir = function( elem, dir, until ) {
       +        var matched = [],
       +                truncate = until !== undefined;
        
       -                // Init the element's event structure and main handler, if this is the first
       -                events = elemData.events;
       -                if ( !events ) {
       -                        elemData.events = events = {};
       -                }
       -                eventHandle = elemData.handle;
       -                if ( !eventHandle ) {
       -                        elemData.handle = eventHandle = function( e ) {
       -                                // Discard the second event of a jQuery.event.trigger() and
       -                                // when an event is called after a page has unloaded
       -                                return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
       -                                        jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
       -                                        undefined;
       -                        };
       -                        // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
       -                        eventHandle.elem = elem;
       +        while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
       +                if ( elem.nodeType === 1 ) {
       +                        if ( truncate && jQuery( elem ).is( until ) ) {
       +                                break;
       +                        }
       +                        matched.push( elem );
                        }
       +        }
       +        return matched;
       +};
        
       -                // Handle multiple events separated by a space
       -                // jQuery(...).bind("mouseover mouseout", fn);
       -                types = jQuery.trim( hoverHack(types) ).split( " " );
       -                for ( t = 0; t < types.length; t++ ) {
       -
       -                        tns = rtypenamespace.exec( types[t] ) || [];
       -                        type = tns[1];
       -                        namespaces = ( tns[2] || "" ).split( "." ).sort();
        
       -                        // If event changes its type, use the special event handlers for the changed type
       -                        special = jQuery.event.special[ type ] || {};
       +var siblings = function( n, elem ) {
       +        var matched = [];
        
       -                        // If selector defined, determine special event api type, otherwise given type
       -                        type = ( selector ? special.delegateType : special.bindType ) || type;
       -
       -                        // Update special based on newly reset type
       -                        special = jQuery.event.special[ type ] || {};
       -
       -                        // handleObj is passed to all event handlers
       -                        handleObj = jQuery.extend({
       -                                type: type,
       -                                origType: tns[1],
       -                                data: data,
       -                                handler: handler,
       -                                guid: handler.guid,
       -                                selector: selector,
       -                                quick: selector && quickParse( selector ),
       -                                namespace: namespaces.join(".")
       -                        }, handleObjIn );
       +        for ( ; n; n = n.nextSibling ) {
       +                if ( n.nodeType === 1 && n !== elem ) {
       +                        matched.push( n );
       +                }
       +        }
        
       -                        // Init the event handler queue if we're the first
       -                        handlers = events[ type ];
       -                        if ( !handlers ) {
       -                                handlers = events[ type ] = [];
       -                                handlers.delegateCount = 0;
       +        return matched;
       +};
        
       -                                // Only use addEventListener/attachEvent if the special events handler returns false
       -                                if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
       -                                        // Bind the global event handler to the element
       -                                        if ( elem.addEventListener ) {
       -                                                elem.addEventListener( type, eventHandle, false );
        
       -                                        } else if ( elem.attachEvent ) {
       -                                                elem.attachEvent( "on" + type, eventHandle );
       -                                        }
       -                                }
       -                        }
       +var rneedsContext = jQuery.expr.match.needsContext;
        
       -                        if ( special.add ) {
       -                                special.add.call( elem, handleObj );
       +var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
        
       -                                if ( !handleObj.handler.guid ) {
       -                                        handleObj.handler.guid = handler.guid;
       -                                }
       -                        }
        
       -                        // Add to the element's handler list, delegates in front
       -                        if ( selector ) {
       -                                handlers.splice( handlers.delegateCount++, 0, handleObj );
       -                        } else {
       -                                handlers.push( handleObj );
       -                        }
        
       -                        // Keep track of which events have ever been used, for event optimization
       -                        jQuery.event.global[ type ] = true;
       -                }
       +var risSimple = /^.[^:#\[\.,]*$/;
        
       -                // Nullify elem to prevent memory leaks in IE
       -                elem = null;
       -        },
       +// Implement the identical functionality for filter and not
       +function winnow( elements, qualifier, not ) {
       +        if ( jQuery.isFunction( qualifier ) ) {
       +                return jQuery.grep( elements, function( elem, i ) {
       +                        return !!qualifier.call( elem, i, elem ) !== not;
       +                } );
       +        }
        
       -        global: {},
       +        // Single element
       +        if ( qualifier.nodeType ) {
       +                return jQuery.grep( elements, function( elem ) {
       +                        return ( elem === qualifier ) !== not;
       +                } );
       +        }
        
       -        // Detach an event or set of events from an element
       -        remove: function( elem, types, handler, selector, mappedTypes ) {
       +        // Arraylike of elements (jQuery, arguments, Array)
       +        if ( typeof qualifier !== "string" ) {
       +                return jQuery.grep( elements, function( elem ) {
       +                        return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
       +                } );
       +        }
        
       -                var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
       -                        t, tns, type, origType, namespaces, origCount,
       -                        j, events, special, handle, eventType, handleObj;
       +        // Simple selector that can be filtered directly, removing non-Elements
       +        if ( risSimple.test( qualifier ) ) {
       +                return jQuery.filter( qualifier, elements, not );
       +        }
        
       -                if ( !elemData || !(events = elemData.events) ) {
       -                        return;
       -                }
       +        // Complex selector, compare the two sets, removing non-Elements
       +        qualifier = jQuery.filter( qualifier, elements );
       +        return jQuery.grep( elements, function( elem ) {
       +                return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
       +        } );
       +}
        
       -                // Once for each type.namespace in types; type may be omitted
       -                types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
       -                for ( t = 0; t < types.length; t++ ) {
       -                        tns = rtypenamespace.exec( types[t] ) || [];
       -                        type = origType = tns[1];
       -                        namespaces = tns[2];
       +jQuery.filter = function( expr, elems, not ) {
       +        var elem = elems[ 0 ];
        
       -                        // Unbind all events (on this namespace, if provided) for the element
       -                        if ( !type ) {
       -                                for ( type in events ) {
       -                                        jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
       -                                }
       -                                continue;
       -                        }
       +        if ( not ) {
       +                expr = ":not(" + expr + ")";
       +        }
        
       -                        special = jQuery.event.special[ type ] || {};
       -                        type = ( selector? special.delegateType : special.bindType ) || type;
       -                        eventType = events[ type ] || [];
       -                        origCount = eventType.length;
       -                        namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
       +        if ( elems.length === 1 && elem.nodeType === 1 ) {
       +                return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
       +        }
        
       -                        // Remove matching events
       -                        for ( j = 0; j < eventType.length; j++ ) {
       -                                handleObj = eventType[ j ];
       +        return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
       +                return elem.nodeType === 1;
       +        } ) );
       +};
        
       -                                if ( ( mappedTypes || origType === handleObj.origType ) &&
       -                                         ( !handler || handler.guid === handleObj.guid ) &&
       -                                         ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
       -                                         ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
       -                                        eventType.splice( j--, 1 );
       +jQuery.fn.extend( {
       +        find: function( selector ) {
       +                var i, ret,
       +                        len = this.length,
       +                        self = this;
        
       -                                        if ( handleObj.selector ) {
       -                                                eventType.delegateCount--;
       -                                        }
       -                                        if ( special.remove ) {
       -                                                special.remove.call( elem, handleObj );
       +                if ( typeof selector !== "string" ) {
       +                        return this.pushStack( jQuery( selector ).filter( function() {
       +                                for ( i = 0; i < len; i++ ) {
       +                                        if ( jQuery.contains( self[ i ], this ) ) {
       +                                                return true;
                                                }
                                        }
       -                        }
       -
       -                        // Remove generic event handler if we removed something and no more handlers exist
       -                        // (avoids potential for endless recursion during removal of special event handlers)
       -                        if ( eventType.length === 0 && origCount !== eventType.length ) {
       -                                if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
       -                                        jQuery.removeEvent( elem, type, elemData.handle );
       -                                }
       -
       -                                delete events[ type ];
       -                        }
       +                        } ) );
                        }
        
       -                // Remove the expando if it's no longer used
       -                if ( jQuery.isEmptyObject( events ) ) {
       -                        handle = elemData.handle;
       -                        if ( handle ) {
       -                                handle.elem = null;
       -                        }
       +                ret = this.pushStack( [] );
        
       -                        // removeData also checks for emptiness and clears the expando if empty
       -                        // so use it instead of delete
       -                        jQuery.removeData( elem, [ "events", "handle" ], true );
       +                for ( i = 0; i < len; i++ ) {
       +                        jQuery.find( selector, self[ i ], ret );
                        }
       -        },
        
       -        // Events that are safe to short-circuit if no handlers are attached.
       -        // Native DOM events should not be added, they may have inline handlers.
       -        customEvent: {
       -                "getData": true,
       -                "setData": true,
       -                "changeData": true
       +                return len > 1 ? jQuery.uniqueSort( ret ) : ret;
                },
       +        filter: function( selector ) {
       +                return this.pushStack( winnow( this, selector || [], false ) );
       +        },
       +        not: function( selector ) {
       +                return this.pushStack( winnow( this, selector || [], true ) );
       +        },
       +        is: function( selector ) {
       +                return !!winnow(
       +                        this,
       +
       +                        // If this is a positional/relative selector, check membership in the returned set
       +                        // so $("p:first").is("p:last") won't return true for a doc with two "p".
       +                        typeof selector === "string" && rneedsContext.test( selector ) ?
       +                                jQuery( selector ) :
       +                                selector || [],
       +                        false
       +                ).length;
       +        }
       +} );
        
       -        trigger: function( event, data, elem, onlyHandlers ) {
       -                // Don't do events on text and comment nodes
       -                if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
       -                        return;
       -                }
       -
       -                // Event object or event type
       -                var type = event.type || event,
       -                        namespaces = [],
       -                        cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
       -
       -                // focus/blur morphs to focusin/out; ensure we're not firing them right now
       -                if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
       -                        return;
       -                }
       -
       -                if ( type.indexOf( "!" ) >= 0 ) {
       -                        // Exclusive events trigger only for the exact event (no namespaces)
       -                        type = type.slice(0, -1);
       -                        exclusive = true;
       -                }
       -
       -                if ( type.indexOf( "." ) >= 0 ) {
       -                        // Namespaced trigger; create a regexp to match event type in handle()
       -                        namespaces = type.split(".");
       -                        type = namespaces.shift();
       -                        namespaces.sort();
       -                }
        
       -                if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
       -                        // No jQuery handlers for this event type, and it can't have inline handlers
       -                        return;
       -                }
       +// Initialize a jQuery object
        
       -                // Caller can pass in an Event, Object, or just an event type string
       -                event = typeof event === "object" ?
       -                        // jQuery.Event object
       -                        event[ jQuery.expando ] ? event :
       -                        // Object literal
       -                        new jQuery.Event( type, event ) :
       -                        // Just the event type (string)
       -                        new jQuery.Event( type );
        
       -                event.type = type;
       -                event.isTrigger = true;
       -                event.exclusive = exclusive;
       -                event.namespace = namespaces.join( "." );
       -                event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
       -                ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
       +// A central reference to the root jQuery(document)
       +var rootjQuery,
        
       -                // Handle a global trigger
       -                if ( !elem ) {
       +        // A simple way to check for HTML strings
       +        // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
       +        // Strict HTML recognition (#11290: must start with <)
       +        // Shortcut simple #id case for speed
       +        rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
        
       -                        // TODO: Stop taunting the data cache; remove global events and always attach to document
       -                        cache = jQuery.cache;
       -                        for ( i in cache ) {
       -                                if ( cache[ i ].events && cache[ i ].events[ type ] ) {
       -                                        jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
       -                                }
       -                        }
       -                        return;
       -                }
       +        init = jQuery.fn.init = function( selector, context, root ) {
       +                var match, elem;
        
       -                // Clean up the event in case it is being reused
       -                event.result = undefined;
       -                if ( !event.target ) {
       -                        event.target = elem;
       +                // HANDLE: $(""), $(null), $(undefined), $(false)
       +                if ( !selector ) {
       +                        return this;
                        }
        
       -                // Clone any incoming data and prepend the event, creating the handler arg list
       -                data = data != null ? jQuery.makeArray( data ) : [];
       -                data.unshift( event );
       -
       -                // Allow special events to draw outside the lines
       -                special = jQuery.event.special[ type ] || {};
       -                if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
       -                        return;
       -                }
       +                // Method init() accepts an alternate rootjQuery
       +                // so migrate can support jQuery.sub (gh-2101)
       +                root = root || rootjQuery;
        
       -                // Determine event propagation path in advance, per W3C events spec (#9951)
       -                // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
       -                eventPath = [[ elem, special.bindType || type ]];
       -                if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
       +                // Handle HTML strings
       +                if ( typeof selector === "string" ) {
       +                        if ( selector[ 0 ] === "<" &&
       +                                selector[ selector.length - 1 ] === ">" &&
       +                                selector.length >= 3 ) {
        
       -                        bubbleType = special.delegateType || type;
       -                        cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
       -                        old = null;
       -                        for ( ; cur; cur = cur.parentNode ) {
       -                                eventPath.push([ cur, bubbleType ]);
       -                                old = cur;
       -                        }
       +                                // Assume that strings that start and end with <> are HTML and skip the regex check
       +                                match = [ null, selector, null ];
        
       -                        // Only add window if we got to document (e.g., not plain obj or detached DOM)
       -                        if ( old && old === elem.ownerDocument ) {
       -                                eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
       +                        } else {
       +                                match = rquickExpr.exec( selector );
                                }
       -                }
        
       -                // Fire handlers on the event path
       -                for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
       -
       -                        cur = eventPath[i][0];
       -                        event.type = eventPath[i][1];
       -
       -                        handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
       -                        if ( handle ) {
       -                                handle.apply( cur, data );
       -                        }
       -                        // Note that this is a bare JS function and not a jQuery handler
       -                        handle = ontype && cur[ ontype ];
       -                        if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
       -                                event.preventDefault();
       -                        }
       -                }
       -                event.type = type;
       +                        // Match html or make sure no context is specified for #id
       +                        if ( match && ( match[ 1 ] || !context ) ) {
        
       -                // If nobody prevented the default action, do it now
       -                if ( !onlyHandlers && !event.isDefaultPrevented() ) {
       +                                // HANDLE: $(html) -> $(array)
       +                                if ( match[ 1 ] ) {
       +                                        context = context instanceof jQuery ? context[ 0 ] : context;
       +
       +                                        // Option to run scripts is true for back-compat
       +                                        // Intentionally let the error be thrown if parseHTML is not present
       +                                        jQuery.merge( this, jQuery.parseHTML(
       +                                                match[ 1 ],
       +                                                context && context.nodeType ? context.ownerDocument || context : document,
       +                                                true
       +                                        ) );
       +
       +                                        // HANDLE: $(html, props)
       +                                        if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
       +                                                for ( match in context ) {
       +
       +                                                        // Properties of context are called as methods if possible
       +                                                        if ( jQuery.isFunction( this[ match ] ) ) {
       +                                                                this[ match ]( context[ match ] );
       +
       +                                                        // ...and otherwise set as attributes
       +                                                        } else {
       +                                                                this.attr( match, context[ match ] );
       +                                                        }
       +                                                }
       +                                        }
        
       -                        if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
       -                                !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
       +                                        return this;
        
       -                                // Call a native DOM method on the target with the same name name as the event.
       -                                // Can't use an .isFunction() check here because IE6/7 fails that test.
       -                                // Don't do default actions on window, that's where global variables be (#6170)
       -                                // IE<9 dies on focus/blur to hidden element (#1486)
       -                                if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
       +                                // HANDLE: $(#id)
       +                                } else {
       +                                        elem = document.getElementById( match[ 2 ] );
        
       -                                        // Don't re-trigger an onFOO event when we call its FOO() method
       -                                        old = elem[ ontype ];
       +                                        if ( elem ) {
        
       -                                        if ( old ) {
       -                                                elem[ ontype ] = null;
       +                                                // Inject the element directly into the jQuery object
       +                                                this[ 0 ] = elem;
       +                                                this.length = 1;
                                                }
       +                                        return this;
       +                                }
        
       -                                        // Prevent re-triggering of the same event, since we already bubbled it above
       -                                        jQuery.event.triggered = type;
       -                                        elem[ type ]();
       -                                        jQuery.event.triggered = undefined;
       +                        // HANDLE: $(expr, $(...))
       +                        } else if ( !context || context.jquery ) {
       +                                return ( context || root ).find( selector );
        
       -                                        if ( old ) {
       -                                                elem[ ontype ] = old;
       -                                        }
       -                                }
       +                        // HANDLE: $(expr, context)
       +                        // (which is just equivalent to: $(context).find(expr)
       +                        } else {
       +                                return this.constructor( context ).find( selector );
                                }
       -                }
        
       -                return event.result;
       -        },
       +                // HANDLE: $(DOMElement)
       +                } else if ( selector.nodeType ) {
       +                        this[ 0 ] = selector;
       +                        this.length = 1;
       +                        return this;
        
       -        dispatch: function( event ) {
       +                // HANDLE: $(function)
       +                // Shortcut for document ready
       +                } else if ( jQuery.isFunction( selector ) ) {
       +                        return root.ready !== undefined ?
       +                                root.ready( selector ) :
        
       -                // Make a writable jQuery.Event from the native event object
       -                event = jQuery.event.fix( event || window.event );
       +                                // Execute immediately if ready is not present
       +                                selector( jQuery );
       +                }
        
       -                var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
       -                        delegateCount = handlers.delegateCount,
       -                        args = [].slice.call( arguments, 0 ),
       -                        run_all = !event.exclusive && !event.namespace,
       -                        special = jQuery.event.special[ event.type ] || {},
       -                        handlerQueue = [],
       -                        i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
       +                return jQuery.makeArray( selector, this );
       +        };
        
       -                // Use the fix-ed jQuery.Event rather than the (read-only) native event
       -                args[0] = event;
       -                event.delegateTarget = this;
       +// Give the init function the jQuery prototype for later instantiation
       +init.prototype = jQuery.fn;
        
       -                // Call the preDispatch hook for the mapped type, and let it bail if desired
       -                if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
       -                        return;
       -                }
       +// Initialize central reference
       +rootjQuery = jQuery( document );
        
       -                // Determine handlers that should run if there are delegated events
       -                // Avoid non-left-click bubbling in Firefox (#3861)
       -                if ( delegateCount && !(event.button && event.type === "click") ) {
        
       -                        // Pregenerate a single jQuery object for reuse with .is()
       -                        jqcur = jQuery(this);
       -                        jqcur.context = this.ownerDocument || this;
       +var rparentsprev = /^(?:parents|prev(?:Until|All))/,
        
       -                        for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
       +        // Methods guaranteed to produce a unique set when starting from a unique set
       +        guaranteedUnique = {
       +                children: true,
       +                contents: true,
       +                next: true,
       +                prev: true
       +        };
        
       -                                // Don't process events on disabled elements (#6911, #8165)
       -                                if ( cur.disabled !== true ) {
       -                                        selMatch = {};
       -                                        matches = [];
       -                                        jqcur[0] = cur;
       -                                        for ( i = 0; i < delegateCount; i++ ) {
       -                                                handleObj = handlers[ i ];
       -                                                sel = handleObj.selector;
       +jQuery.fn.extend( {
       +        has: function( target ) {
       +                var targets = jQuery( target, this ),
       +                        l = targets.length;
        
       -                                                if ( selMatch[ sel ] === undefined ) {
       -                                                        selMatch[ sel ] = (
       -                                                                handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
       -                                                        );
       -                                                }
       -                                                if ( selMatch[ sel ] ) {
       -                                                        matches.push( handleObj );
       -                                                }
       -                                        }
       -                                        if ( matches.length ) {
       -                                                handlerQueue.push({ elem: cur, matches: matches });
       -                                        }
       +                return this.filter( function() {
       +                        var i = 0;
       +                        for ( ; i < l; i++ ) {
       +                                if ( jQuery.contains( this, targets[ i ] ) ) {
       +                                        return true;
                                        }
                                }
       -                }
       -
       -                // Add the remaining (directly-bound) handlers
       -                if ( handlers.length > delegateCount ) {
       -                        handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
       -                }
       -
       -                // Run delegates first; they may want to stop propagation beneath us
       -                for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
       -                        matched = handlerQueue[ i ];
       -                        event.currentTarget = matched.elem;
       +                } );
       +        },
        
       -                        for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
       -                                handleObj = matched.matches[ j ];
       +        closest: function( selectors, context ) {
       +                var cur,
       +                        i = 0,
       +                        l = this.length,
       +                        matched = [],
       +                        targets = typeof selectors !== "string" && jQuery( selectors );
        
       -                                // Triggered event must either 1) be non-exclusive and have no namespace, or
       -                                // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
       -                                if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
       +                // Positional selectors never match, since there's no _selection_ context
       +                if ( !rneedsContext.test( selectors ) ) {
       +                        for ( ; i < l; i++ ) {
       +                                for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
        
       -                                        event.data = handleObj.data;
       -                                        event.handleObj = handleObj;
       +                                        // Always skip document fragments
       +                                        if ( cur.nodeType < 11 && ( targets ?
       +                                                targets.index( cur ) > -1 :
        
       -                                        ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
       -                                                        .apply( matched.elem, args );
       +                                                // Don't pass non-elements to Sizzle
       +                                                cur.nodeType === 1 &&
       +                                                        jQuery.find.matchesSelector( cur, selectors ) ) ) {
        
       -                                        if ( ret !== undefined ) {
       -                                                event.result = ret;
       -                                                if ( ret === false ) {
       -                                                        event.preventDefault();
       -                                                        event.stopPropagation();
       -                                                }
       +                                                matched.push( cur );
       +                                                break;
                                                }
                                        }
                                }
                        }
        
       -                // Call the postDispatch hook for the mapped type
       -                if ( special.postDispatch ) {
       -                        special.postDispatch.call( this, event );
       -                }
       -
       -                return event.result;
       +                return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
                },
        
       -        // Includes some event props shared by KeyEvent and MouseEvent
       -        // *** attrChange attrName relatedNode srcElement  are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
       -        props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
       +        // Determine the position of an element within the set
       +        index: function( elem ) {
        
       -        fixHooks: {},
       +                // No argument, return index in parent
       +                if ( !elem ) {
       +                        return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
       +                }
        
       -        keyHooks: {
       -                props: "char charCode key keyCode".split(" "),
       -                filter: function( event, original ) {
       +                // Index in selector
       +                if ( typeof elem === "string" ) {
       +                        return indexOf.call( jQuery( elem ), this[ 0 ] );
       +                }
        
       -                        // Add which for key events
       -                        if ( event.which == null ) {
       -                                event.which = original.charCode != null ? original.charCode : original.keyCode;
       -                        }
       +                // Locate the position of the desired element
       +                return indexOf.call( this,
        
       -                        return event;
       -                }
       +                        // If it receives a jQuery object, the first element is used
       +                        elem.jquery ? elem[ 0 ] : elem
       +                );
                },
        
       -        mouseHooks: {
       -                props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
       -                filter: function( event, original ) {
       -                        var eventDoc, doc, body,
       -                                button = original.button,
       -                                fromElement = original.fromElement;
       +        add: function( selector, context ) {
       +                return this.pushStack(
       +                        jQuery.uniqueSort(
       +                                jQuery.merge( this.get(), jQuery( selector, context ) )
       +                        )
       +                );
       +        },
        
       -                        // Calculate pageX/Y if missing and clientX/Y available
       -                        if ( event.pageX == null && original.clientX != null ) {
       -                                eventDoc = event.target.ownerDocument || document;
       -                                doc = eventDoc.documentElement;
       -                                body = eventDoc.body;
       -
       -                                event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
       -                                event.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );
       -                        }
       -
       -                        // Add relatedTarget, if necessary
       -                        if ( !event.relatedTarget && fromElement ) {
       -                                event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
       -                        }
       +        addBack: function( selector ) {
       +                return this.add( selector == null ?
       +                        this.prevObject : this.prevObject.filter( selector )
       +                );
       +        }
       +} );
        
       -                        // Add which for click: 1 === left; 2 === middle; 3 === right
       -                        // Note: button is not normalized, so don't use it
       -                        if ( !event.which && button !== undefined ) {
       -                                event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
       -                        }
       +function sibling( cur, dir ) {
       +        while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
       +        return cur;
       +}
        
       -                        return event;
       -                }
       +jQuery.each( {
       +        parent: function( elem ) {
       +                var parent = elem.parentNode;
       +                return parent && parent.nodeType !== 11 ? parent : null;
                },
       +        parents: function( elem ) {
       +                return dir( elem, "parentNode" );
       +        },
       +        parentsUntil: function( elem, i, until ) {
       +                return dir( elem, "parentNode", until );
       +        },
       +        next: function( elem ) {
       +                return sibling( elem, "nextSibling" );
       +        },
       +        prev: function( elem ) {
       +                return sibling( elem, "previousSibling" );
       +        },
       +        nextAll: function( elem ) {
       +                return dir( elem, "nextSibling" );
       +        },
       +        prevAll: function( elem ) {
       +                return dir( elem, "previousSibling" );
       +        },
       +        nextUntil: function( elem, i, until ) {
       +                return dir( elem, "nextSibling", until );
       +        },
       +        prevUntil: function( elem, i, until ) {
       +                return dir( elem, "previousSibling", until );
       +        },
       +        siblings: function( elem ) {
       +                return siblings( ( elem.parentNode || {} ).firstChild, elem );
       +        },
       +        children: function( elem ) {
       +                return siblings( elem.firstChild );
       +        },
       +        contents: function( elem ) {
       +                return elem.contentDocument || jQuery.merge( [], elem.childNodes );
       +        }
       +}, function( name, fn ) {
       +        jQuery.fn[ name ] = function( until, selector ) {
       +                var matched = jQuery.map( this, fn, until );
        
       -        fix: function( event ) {
       -                if ( event[ jQuery.expando ] ) {
       -                        return event;
       -                }
       -
       -                // Create a writable copy of the event object and normalize some properties
       -                var i, prop,
       -                        originalEvent = event,
       -                        fixHook = jQuery.event.fixHooks[ event.type ] || {},
       -                        copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
       -
       -                event = jQuery.Event( originalEvent );
       -
       -                for ( i = copy.length; i; ) {
       -                        prop = copy[ --i ];
       -                        event[ prop ] = originalEvent[ prop ];
       -                }
       -
       -                // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
       -                if ( !event.target ) {
       -                        event.target = originalEvent.srcElement || document;
       -                }
       -
       -                // Target should not be a text node (#504, Safari)
       -                if ( event.target.nodeType === 3 ) {
       -                        event.target = event.target.parentNode;
       +                if ( name.slice( -5 ) !== "Until" ) {
       +                        selector = until;
                        }
        
       -                // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
       -                if ( event.metaKey === undefined ) {
       -                        event.metaKey = event.ctrlKey;
       +                if ( selector && typeof selector === "string" ) {
       +                        matched = jQuery.filter( selector, matched );
                        }
        
       -                return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
       -        },
       -
       -        special: {
       -                ready: {
       -                        // Make sure the ready event is setup
       -                        setup: jQuery.bindReady
       -                },
       -
       -                load: {
       -                        // Prevent triggered image.load events from bubbling to window.load
       -                        noBubble: true
       -                },
       -
       -                focus: {
       -                        delegateType: "focusin"
       -                },
       -                blur: {
       -                        delegateType: "focusout"
       -                },
       -
       -                beforeunload: {
       -                        setup: function( data, namespaces, eventHandle ) {
       -                                // We only want to do this special case on windows
       -                                if ( jQuery.isWindow( this ) ) {
       -                                        this.onbeforeunload = eventHandle;
       -                                }
       -                        },
       +                if ( this.length > 1 ) {
        
       -                        teardown: function( namespaces, eventHandle ) {
       -                                if ( this.onbeforeunload === eventHandle ) {
       -                                        this.onbeforeunload = null;
       -                                }
       +                        // Remove duplicates
       +                        if ( !guaranteedUnique[ name ] ) {
       +                                jQuery.uniqueSort( matched );
                                }
       -                }
       -        },
        
       -        simulate: function( type, elem, event, bubble ) {
       -                // Piggyback on a donor event to simulate a different one.
       -                // Fake originalEvent to avoid donor's stopPropagation, but if the
       -                // simulated event prevents default then we do the same on the donor.
       -                var e = jQuery.extend(
       -                        new jQuery.Event(),
       -                        event,
       -                        { type: type,
       -                                isSimulated: true,
       -                                originalEvent: {}
       +                        // Reverse order for parents* and prev-derivatives
       +                        if ( rparentsprev.test( name ) ) {
       +                                matched.reverse();
                                }
       -                );
       -                if ( bubble ) {
       -                        jQuery.event.trigger( e, null, elem );
       -                } else {
       -                        jQuery.event.dispatch.call( elem, e );
       -                }
       -                if ( e.isDefaultPrevented() ) {
       -                        event.preventDefault();
                        }
       -        }
       -};
        
       -// Some plugins are using, but it's undocumented/deprecated and will be removed.
       -// The 1.7 special event interface should provide all the hooks needed now.
       -jQuery.event.handle = jQuery.event.dispatch;
       -
       -jQuery.removeEvent = document.removeEventListener ?
       -        function( elem, type, handle ) {
       -                if ( elem.removeEventListener ) {
       -                        elem.removeEventListener( type, handle, false );
       -                }
       -        } :
       -        function( elem, type, handle ) {
       -                if ( elem.detachEvent ) {
       -                        elem.detachEvent( "on" + type, handle );
       -                }
       +                return this.pushStack( matched );
                };
       +} );
       +var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
        
       -jQuery.Event = function( src, props ) {
       -        // Allow instantiation without the 'new' keyword
       -        if ( !(this instanceof jQuery.Event) ) {
       -                return new jQuery.Event( src, props );
       -        }
       -
       -        // Event object
       -        if ( src && src.type ) {
       -                this.originalEvent = src;
       -                this.type = src.type;
       -
       -                // Events bubbling up the document may have been marked as prevented
       -                // by a handler lower down the tree; reflect the correct value.
       -                this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
       -                        src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
        
       -        // Event type
       -        } else {
       -                this.type = src;
       -        }
        
       -        // Put explicitly provided properties onto the event object
       -        if ( props ) {
       -                jQuery.extend( this, props );
       -        }
       +// Convert String-formatted options into Object-formatted ones
       +function createOptions( options ) {
       +        var object = {};
       +        jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
       +                object[ flag ] = true;
       +        } );
       +        return object;
       +}
        
       -        // Create a timestamp if incoming event doesn't have one
       -        this.timeStamp = src && src.timeStamp || jQuery.now();
       +/*
       + * Create a callback list using the following parameters:
       + *
       + *        options: an optional list of space-separated options that will change how
       + *                        the callback list behaves or a more traditional option object
       + *
       + * By default a callback list will act like an event callback list and can be
       + * "fired" multiple times.
       + *
       + * Possible options:
       + *
       + *        once:                        will ensure the callback list can only be fired once (like a Deferred)
       + *
       + *        memory:                        will keep track of previous values and will call any callback added
       + *                                        after the list has been fired right away with the latest "memorized"
       + *                                        values (like a Deferred)
       + *
       + *        unique:                        will ensure a callback can only be added once (no duplicate in the list)
       + *
       + *        stopOnFalse:        interrupt callings when a callback returns false
       + *
       + */
       +jQuery.Callbacks = function( options ) {
        
       -        // Mark it as fixed
       -        this[ jQuery.expando ] = true;
       -};
       +        // Convert options from String-formatted to Object-formatted if needed
       +        // (we check in cache first)
       +        options = typeof options === "string" ?
       +                createOptions( options ) :
       +                jQuery.extend( {}, options );
        
       -function returnFalse() {
       -        return false;
       -}
       -function returnTrue() {
       -        return true;
       -}
       +        var // Flag to know if list is currently firing
       +                firing,
        
       -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
       -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
       -jQuery.Event.prototype = {
       -        preventDefault: function() {
       -                this.isDefaultPrevented = returnTrue;
       +                // Last fire value for non-forgettable lists
       +                memory,
        
       -                var e = this.originalEvent;
       -                if ( !e ) {
       -                        return;
       -                }
       +                // Flag to know if list was already fired
       +                fired,
        
       -                // if preventDefault exists run it on the original event
       -                if ( e.preventDefault ) {
       -                        e.preventDefault();
       +                // Flag to prevent firing
       +                locked,
        
       -                // otherwise set the returnValue property of the original event to false (IE)
       -                } else {
       -                        e.returnValue = false;
       -                }
       -        },
       -        stopPropagation: function() {
       -                this.isPropagationStopped = returnTrue;
       +                // Actual callback list
       +                list = [],
        
       -                var e = this.originalEvent;
       -                if ( !e ) {
       -                        return;
       -                }
       -                // if stopPropagation exists run it on the original event
       -                if ( e.stopPropagation ) {
       -                        e.stopPropagation();
       -                }
       -                // otherwise set the cancelBubble property of the original event to true (IE)
       -                e.cancelBubble = true;
       -        },
       -        stopImmediatePropagation: function() {
       -                this.isImmediatePropagationStopped = returnTrue;
       -                this.stopPropagation();
       -        },
       -        isDefaultPrevented: returnFalse,
       -        isPropagationStopped: returnFalse,
       -        isImmediatePropagationStopped: returnFalse
       -};
       +                // Queue of execution data for repeatable lists
       +                queue = [],
        
       -// Create mouseenter/leave events using mouseover/out and event-time checks
       -jQuery.each({
       -        mouseenter: "mouseover",
       -        mouseleave: "mouseout"
       -}, function( orig, fix ) {
       -        jQuery.event.special[ orig ] = {
       -                delegateType: fix,
       -                bindType: fix,
       +                // Index of currently firing callback (modified by add/remove as needed)
       +                firingIndex = -1,
        
       -                handle: function( event ) {
       -                        var target = this,
       -                                related = event.relatedTarget,
       -                                handleObj = event.handleObj,
       -                                selector = handleObj.selector,
       -                                ret;
       +                // Fire callbacks
       +                fire = function() {
        
       -                        // For mousenter/leave call the handler if related is outside the target.
       -                        // NB: No relatedTarget if the mouse left/entered the browser window
       -                        if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
       -                                event.type = handleObj.origType;
       -                                ret = handleObj.handler.apply( this, arguments );
       -                                event.type = fix;
       -                        }
       -                        return ret;
       -                }
       -        };
       -});
       +                        // Enforce single-firing
       +                        locked = options.once;
        
       -// IE submit delegation
       -if ( !jQuery.support.submitBubbles ) {
       +                        // Execute callbacks for all pending executions,
       +                        // respecting firingIndex overrides and runtime changes
       +                        fired = firing = true;
       +                        for ( ; queue.length; firingIndex = -1 ) {
       +                                memory = queue.shift();
       +                                while ( ++firingIndex < list.length ) {
        
       -        jQuery.event.special.submit = {
       -                setup: function() {
       -                        // Only need this for delegated form submit events
       -                        if ( jQuery.nodeName( this, "form" ) ) {
       -                                return false;
       -                        }
       +                                        // Run callback and check for early termination
       +                                        if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
       +                                                options.stopOnFalse ) {
        
       -                        // Lazy-add a submit handler when a descendant form may potentially be submitted
       -                        jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
       -                                // Node name check avoids a VML-related crash in IE (#9807)
       -                                var elem = e.target,
       -                                        form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
       -                                if ( form && !form._submit_attached ) {
       -                                        jQuery.event.add( form, "submit._submit", function( event ) {
       -                                                event._submit_bubble = true;
       -                                        });
       -                                        form._submit_attached = true;
       -                                }
       -                        });
       -                        // return undefined since we don't need an event listener
       -                },
       -                
       -                postDispatch: function( event ) {
       -                        // If form was submitted by the user, bubble the event up the tree
       -                        if ( event._submit_bubble ) {
       -                                delete event._submit_bubble;
       -                                if ( this.parentNode && !event.isTrigger ) {
       -                                        jQuery.event.simulate( "submit", this.parentNode, event, true );
       +                                                // Jump to end and forget the data so .add doesn't re-fire
       +                                                firingIndex = list.length;
       +                                                memory = false;
       +                                        }
                                        }
                                }
       -                },
        
       -                teardown: function() {
       -                        // Only need this for delegated form submit events
       -                        if ( jQuery.nodeName( this, "form" ) ) {
       -                                return false;
       +                        // Forget the data if we're done with it
       +                        if ( !options.memory ) {
       +                                memory = false;
                                }
        
       -                        // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
       -                        jQuery.event.remove( this, "._submit" );
       -                }
       -        };
       -}
       -
       -// IE change delegation and checkbox/radio fix
       -if ( !jQuery.support.changeBubbles ) {
       +                        firing = false;
        
       -        jQuery.event.special.change = {
       +                        // Clean up if we're done firing for good
       +                        if ( locked ) {
        
       -                setup: function() {
       +                                // Keep an empty list if we have data for future add calls
       +                                if ( memory ) {
       +                                        list = [];
        
       -                        if ( rformElems.test( this.nodeName ) ) {
       -                                // IE doesn't fire change on a check/radio until blur; trigger it on click
       -                                // after a propertychange. Eat the blur-change in special.change.handle.
       -                                // This still fires onchange a second time for check/radio after blur.
       -                                if ( this.type === "checkbox" || this.type === "radio" ) {
       -                                        jQuery.event.add( this, "propertychange._change", function( event ) {
       -                                                if ( event.originalEvent.propertyName === "checked" ) {
       -                                                        this._just_changed = true;
       -                                                }
       -                                        });
       -                                        jQuery.event.add( this, "click._change", function( event ) {
       -                                                if ( this._just_changed && !event.isTrigger ) {
       -                                                        this._just_changed = false;
       -                                                        jQuery.event.simulate( "change", this, event, true );
       -                                                }
       -                                        });
       +                                // Otherwise, this object is spent
       +                                } else {
       +                                        list = "";
                                        }
       -                                return false;
                                }
       -                        // Delegated event; lazy-add a change handler on descendant inputs
       -                        jQuery.event.add( this, "beforeactivate._change", function( e ) {
       -                                var elem = e.target;
       -
       -                                if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
       -                                        jQuery.event.add( elem, "change._change", function( event ) {
       -                                                if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
       -                                                        jQuery.event.simulate( "change", this.parentNode, event, true );
       -                                                }
       -                                        });
       -                                        elem._change_attached = true;
       -                                }
       -                        });
                        },
        
       -                handle: function( event ) {
       -                        var elem = event.target;
       -
       -                        // Swallow native change events from checkbox/radio, we already triggered them above
       -                        if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
       -                                return event.handleObj.handler.apply( this, arguments );
       -                        }
       -                },
       +                // Actual Callbacks object
       +                self = {
        
       -                teardown: function() {
       -                        jQuery.event.remove( this, "._change" );
       +                        // Add a callback or a collection of callbacks to the list
       +                        add: function() {
       +                                if ( list ) {
        
       -                        return rformElems.test( this.nodeName );
       -                }
       -        };
       -}
       +                                        // If we have memory from a past run, we should fire after adding
       +                                        if ( memory && !firing ) {
       +                                                firingIndex = list.length - 1;
       +                                                queue.push( memory );
       +                                        }
        
       -// Create "bubbling" focus and blur events
       -if ( !jQuery.support.focusinBubbles ) {
       -        jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
       +                                        ( function add( args ) {
       +                                                jQuery.each( args, function( _, arg ) {
       +                                                        if ( jQuery.isFunction( arg ) ) {
       +                                                                if ( !options.unique || !self.has( arg ) ) {
       +                                                                        list.push( arg );
       +                                                                }
       +                                                        } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
        
       -                // Attach a single capturing handler while someone wants focusin/focusout
       -                var attaches = 0,
       -                        handler = function( event ) {
       -                                jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
       -                        };
       +                                                                // Inspect recursively
       +                                                                add( arg );
       +                                                        }
       +                                                } );
       +                                        } )( arguments );
        
       -                jQuery.event.special[ fix ] = {
       -                        setup: function() {
       -                                if ( attaches++ === 0 ) {
       -                                        document.addEventListener( orig, handler, true );
       +                                        if ( memory && !firing ) {
       +                                                fire();
       +                                        }
                                        }
       +                                return this;
                                },
       -                        teardown: function() {
       -                                if ( --attaches === 0 ) {
       -                                        document.removeEventListener( orig, handler, true );
       -                                }
       -                        }
       -                };
       -        });
       -}
        
       -jQuery.fn.extend({
       +                        // Remove a callback from the list
       +                        remove: function() {
       +                                jQuery.each( arguments, function( _, arg ) {
       +                                        var index;
       +                                        while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
       +                                                list.splice( index, 1 );
       +
       +                                                // Handle firing indexes
       +                                                if ( index <= firingIndex ) {
       +                                                        firingIndex--;
       +                                                }
       +                                        }
       +                                } );
       +                                return this;
       +                        },
        
       -        on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
       -                var origFn, type;
       +                        // Check if a given callback is in the list.
       +                        // If no argument is given, return whether or not list has callbacks attached.
       +                        has: function( fn ) {
       +                                return fn ?
       +                                        jQuery.inArray( fn, list ) > -1 :
       +                                        list.length > 0;
       +                        },
        
       -                // Types can be a map of types/handlers
       -                if ( typeof types === "object" ) {
       -                        // ( types-Object, selector, data )
       -                        if ( typeof selector !== "string" ) { // && selector != null
       -                                // ( types-Object, data )
       -                                data = data || selector;
       -                                selector = undefined;
       -                        }
       -                        for ( type in types ) {
       -                                this.on( type, selector, data, types[ type ], one );
       -                        }
       -                        return this;
       -                }
       +                        // Remove all callbacks from the list
       +                        empty: function() {
       +                                if ( list ) {
       +                                        list = [];
       +                                }
       +                                return this;
       +                        },
        
       -                if ( data == null && fn == null ) {
       -                        // ( types, fn )
       -                        fn = selector;
       -                        data = selector = undefined;
       -                } else if ( fn == null ) {
       -                        if ( typeof selector === "string" ) {
       -                                // ( types, selector, fn )
       -                                fn = data;
       -                                data = undefined;
       -                        } else {
       -                                // ( types, data, fn )
       -                                fn = data;
       -                                data = selector;
       -                                selector = undefined;
       -                        }
       -                }
       -                if ( fn === false ) {
       -                        fn = returnFalse;
       -                } else if ( !fn ) {
       -                        return this;
       -                }
       +                        // Disable .fire and .add
       +                        // Abort any current/pending executions
       +                        // Clear all callbacks and values
       +                        disable: function() {
       +                                locked = queue = [];
       +                                list = memory = "";
       +                                return this;
       +                        },
       +                        disabled: function() {
       +                                return !list;
       +                        },
        
       -                if ( one === 1 ) {
       -                        origFn = fn;
       -                        fn = function( event ) {
       -                                // Can use an empty set, since event contains the info
       -                                jQuery().off( event );
       -                                return origFn.apply( this, arguments );
       -                        };
       -                        // Use same guid so caller can remove using origFn
       -                        fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
       -                }
       -                return this.each( function() {
       -                        jQuery.event.add( this, types, fn, data, selector );
       -                });
       -        },
       -        one: function( types, selector, data, fn ) {
       -                return this.on( types, selector, data, fn, 1 );
       -        },
       -        off: function( types, selector, fn ) {
       -                if ( types && types.preventDefault && types.handleObj ) {
       -                        // ( event )  dispatched jQuery.Event
       -                        var handleObj = types.handleObj;
       -                        jQuery( types.delegateTarget ).off(
       -                                handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
       -                                handleObj.selector,
       -                                handleObj.handler
       -                        );
       -                        return this;
       -                }
       -                if ( typeof types === "object" ) {
       -                        // ( types-object [, selector] )
       -                        for ( var type in types ) {
       -                                this.off( type, selector, types[ type ] );
       -                        }
       -                        return this;
       -                }
       -                if ( selector === false || typeof selector === "function" ) {
       -                        // ( types [, fn] )
       -                        fn = selector;
       -                        selector = undefined;
       -                }
       -                if ( fn === false ) {
       -                        fn = returnFalse;
       -                }
       -                return this.each(function() {
       -                        jQuery.event.remove( this, types, fn, selector );
       -                });
       -        },
       +                        // Disable .fire
       +                        // Also disable .add unless we have memory (since it would have no effect)
       +                        // Abort any pending executions
       +                        lock: function() {
       +                                locked = queue = [];
       +                                if ( !memory && !firing ) {
       +                                        list = memory = "";
       +                                }
       +                                return this;
       +                        },
       +                        locked: function() {
       +                                return !!locked;
       +                        },
        
       -        bind: function( types, data, fn ) {
       -                return this.on( types, null, data, fn );
       -        },
       -        unbind: function( types, fn ) {
       -                return this.off( types, null, fn );
       -        },
       +                        // Call all callbacks with the given context and arguments
       +                        fireWith: function( context, args ) {
       +                                if ( !locked ) {
       +                                        args = args || [];
       +                                        args = [ context, args.slice ? args.slice() : args ];
       +                                        queue.push( args );
       +                                        if ( !firing ) {
       +                                                fire();
       +                                        }
       +                                }
       +                                return this;
       +                        },
        
       -        live: function( types, data, fn ) {
       -                jQuery( this.context ).on( types, this.selector, data, fn );
       -                return this;
       -        },
       -        die: function( types, fn ) {
       -                jQuery( this.context ).off( types, this.selector || "**", fn );
       -                return this;
       -        },
       +                        // Call all the callbacks with the given arguments
       +                        fire: function() {
       +                                self.fireWith( this, arguments );
       +                                return this;
       +                        },
        
       -        delegate: function( selector, types, data, fn ) {
       -                return this.on( types, selector, data, fn );
       -        },
       -        undelegate: function( selector, types, fn ) {
       -                // ( namespace ) or ( selector, types [, fn] )
       -                return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
       -        },
       +                        // To know if the callbacks have already been called at least once
       +                        fired: function() {
       +                                return !!fired;
       +                        }
       +                };
        
       -        trigger: function( type, data ) {
       -                return this.each(function() {
       -                        jQuery.event.trigger( type, data, this );
       -                });
       -        },
       -        triggerHandler: function( type, data ) {
       -                if ( this[0] ) {
       -                        return jQuery.event.trigger( type, data, this[0], true );
       -                }
       -        },
       +        return self;
       +};
        
       -        toggle: function( fn ) {
       -                // Save reference to arguments for access in closure
       -                var args = arguments,
       -                        guid = fn.guid || jQuery.guid++,
       -                        i = 0,
       -                        toggler = function( event ) {
       -                                // Figure out which function to execute
       -                                var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
       -                                jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
        
       -                                // Make sure that clicks stop
       -                                event.preventDefault();
       +function Identity( v ) {
       +        return v;
       +}
       +function Thrower( ex ) {
       +        throw ex;
       +}
        
       -                                // and execute the function
       -                                return args[ lastToggle ].apply( this, arguments ) || false;
       -                        };
       +function adoptValue( value, resolve, reject ) {
       +        var method;
        
       -                // link all the functions, so any of them can unbind this click handler
       -                toggler.guid = guid;
       -                while ( i < args.length ) {
       -                        args[ i++ ].guid = guid;
       -                }
       +        try {
        
       -                return this.click( toggler );
       -        },
       +                // Check for promise aspect first to privilege synchronous behavior
       +                if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {
       +                        method.call( value ).done( resolve ).fail( reject );
        
       -        hover: function( fnOver, fnOut ) {
       -                return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
       -        }
       -});
       +                // Other thenables
       +                } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {
       +                        method.call( value, resolve, reject );
        
       -jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
       -        "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
       -        "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
       +                // Other non-thenables
       +                } else {
        
       -        // Handle event binding
       -        jQuery.fn[ name ] = function( data, fn ) {
       -                if ( fn == null ) {
       -                        fn = data;
       -                        data = null;
       +                        // Support: Android 4.0 only
       +                        // Strict mode functions invoked without .call/.apply get global-object context
       +                        resolve.call( undefined, value );
                        }
        
       -                return arguments.length > 0 ?
       -                        this.on( name, null, data, fn ) :
       -                        this.trigger( name );
       -        };
       -
       -        if ( jQuery.attrFn ) {
       -                jQuery.attrFn[ name ] = true;
       -        }
       -
       -        if ( rkeyEvent.test( name ) ) {
       -                jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
       -        }
       +        // For Promises/A+, convert exceptions into rejections
       +        // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
       +        // Deferred#then to conditionally suppress rejection.
       +        } catch ( value ) {
        
       -        if ( rmouseEvent.test( name ) ) {
       -                jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
       +                // Support: Android 4.0 only
       +                // Strict mode functions invoked without .call/.apply get global-object context
       +                reject.call( undefined, value );
                }
       -});
       -
       +}
        
       +jQuery.extend( {
        
       -/*!
       - * Sizzle CSS Selector Engine
       - *  Copyright 2011, The Dojo Foundation
       - *  Released under the MIT, BSD, and GPL Licenses.
       - *  More information: http://sizzlejs.com/
       - */
       -(function(){
       +        Deferred: function( func ) {
       +                var tuples = [
       +
       +                                // action, add listener, callbacks,
       +                                // ... .then handlers, argument index, [final state]
       +                                [ "notify", "progress", jQuery.Callbacks( "memory" ),
       +                                        jQuery.Callbacks( "memory" ), 2 ],
       +                                [ "resolve", "done", jQuery.Callbacks( "once memory" ),
       +                                        jQuery.Callbacks( "once memory" ), 0, "resolved" ],
       +                                [ "reject", "fail", jQuery.Callbacks( "once memory" ),
       +                                        jQuery.Callbacks( "once memory" ), 1, "rejected" ]
       +                        ],
       +                        state = "pending",
       +                        promise = {
       +                                state: function() {
       +                                        return state;
       +                                },
       +                                always: function() {
       +                                        deferred.done( arguments ).fail( arguments );
       +                                        return this;
       +                                },
       +                                "catch": function( fn ) {
       +                                        return promise.then( null, fn );
       +                                },
        
       -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
       -        expando = "sizcache" + (Math.random() + '').replace('.', ''),
       -        done = 0,
       -        toString = Object.prototype.toString,
       -        hasDuplicate = false,
       -        baseHasDuplicate = true,
       -        rBackslash = /\\/g,
       -        rReturn = /\r\n/g,
       -        rNonWord = /\W/;
       -
       -// Here we check if the JavaScript engine is using some sort of
       -// optimization where it does not always call our comparision
       -// function. If that is the case, discard the hasDuplicate value.
       -//   Thus far that includes Google Chrome.
       -[0, 0].sort(function() {
       -        baseHasDuplicate = false;
       -        return 0;
       -});
       +                                // Keep pipe for back-compat
       +                                pipe: function( /* fnDone, fnFail, fnProgress */ ) {
       +                                        var fns = arguments;
       +
       +                                        return jQuery.Deferred( function( newDefer ) {
       +                                                jQuery.each( tuples, function( i, tuple ) {
       +
       +                                                        // Map tuples (progress, done, fail) to arguments (done, fail, progress)
       +                                                        var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
       +
       +                                                        // deferred.progress(function() { bind to newDefer or newDefer.notify })
       +                                                        // deferred.done(function() { bind to newDefer or newDefer.resolve })
       +                                                        // deferred.fail(function() { bind to newDefer or newDefer.reject })
       +                                                        deferred[ tuple[ 1 ] ]( function() {
       +                                                                var returned = fn && fn.apply( this, arguments );
       +                                                                if ( returned && jQuery.isFunction( returned.promise ) ) {
       +                                                                        returned.promise()
       +                                                                                .progress( newDefer.notify )
       +                                                                                .done( newDefer.resolve )
       +                                                                                .fail( newDefer.reject );
       +                                                                } else {
       +                                                                        newDefer[ tuple[ 0 ] + "With" ](
       +                                                                                this,
       +                                                                                fn ? [ returned ] : arguments
       +                                                                        );
       +                                                                }
       +                                                        } );
       +                                                } );
       +                                                fns = null;
       +                                        } ).promise();
       +                                },
       +                                then: function( onFulfilled, onRejected, onProgress ) {
       +                                        var maxDepth = 0;
       +                                        function resolve( depth, deferred, handler, special ) {
       +                                                return function() {
       +                                                        var that = this,
       +                                                                args = arguments,
       +                                                                mightThrow = function() {
       +                                                                        var returned, then;
       +
       +                                                                        // Support: Promises/A+ section 2.3.3.3.3
       +                                                                        // https://promisesaplus.com/#point-59
       +                                                                        // Ignore double-resolution attempts
       +                                                                        if ( depth < maxDepth ) {
       +                                                                                return;
       +                                                                        }
        
       -var Sizzle = function( selector, context, results, seed ) {
       -        results = results || [];
       -        context = context || document;
       +                                                                        returned = handler.apply( that, args );
        
       -        var origContext = context;
       +                                                                        // Support: Promises/A+ section 2.3.1
       +                                                                        // https://promisesaplus.com/#point-48
       +                                                                        if ( returned === deferred.promise() ) {
       +                                                                                throw new TypeError( "Thenable self-resolution" );
       +                                                                        }
        
       -        if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
       -                return [];
       -        }
       +                                                                        // Support: Promises/A+ sections 2.3.3.1, 3.5
       +                                                                        // https://promisesaplus.com/#point-54
       +                                                                        // https://promisesaplus.com/#point-75
       +                                                                        // Retrieve `then` only once
       +                                                                        then = returned &&
       +
       +                                                                                // Support: Promises/A+ section 2.3.4
       +                                                                                // https://promisesaplus.com/#point-64
       +                                                                                // Only check objects and functions for thenability
       +                                                                                ( typeof returned === "object" ||
       +                                                                                        typeof returned === "function" ) &&
       +                                                                                returned.then;
       +
       +                                                                        // Handle a returned thenable
       +                                                                        if ( jQuery.isFunction( then ) ) {
       +
       +                                                                                // Special processors (notify) just wait for resolution
       +                                                                                if ( special ) {
       +                                                                                        then.call(
       +                                                                                                returned,
       +                                                                                                resolve( maxDepth, deferred, Identity, special ),
       +                                                                                                resolve( maxDepth, deferred, Thrower, special )
       +                                                                                        );
       +
       +                                                                                // Normal processors (resolve) also hook into progress
       +                                                                                } else {
       +
       +                                                                                        // ...and disregard older resolution values
       +                                                                                        maxDepth++;
       +
       +                                                                                        then.call(
       +                                                                                                returned,
       +                                                                                                resolve( maxDepth, deferred, Identity, special ),
       +                                                                                                resolve( maxDepth, deferred, Thrower, special ),
       +                                                                                                resolve( maxDepth, deferred, Identity,
       +                                                                                                        deferred.notifyWith )
       +                                                                                        );
       +                                                                                }
        
       -        if ( !selector || typeof selector !== "string" ) {
       -                return results;
       -        }
       +                                                                        // Handle all other returned values
       +                                                                        } else {
        
       -        var m, set, checkSet, extra, ret, cur, pop, i,
       -                prune = true,
       -                contextXML = Sizzle.isXML( context ),
       -                parts = [],
       -                soFar = selector;
       +                                                                                // Only substitute handlers pass on context
       +                                                                                // and multiple values (non-spec behavior)
       +                                                                                if ( handler !== Identity ) {
       +                                                                                        that = undefined;
       +                                                                                        args = [ returned ];
       +                                                                                }
        
       -        // Reset the position of the chunker regexp (start from head)
       -        do {
       -                chunker.exec( "" );
       -                m = chunker.exec( soFar );
       +                                                                                // Process the value(s)
       +                                                                                // Default process is resolve
       +                                                                                ( special || deferred.resolveWith )( that, args );
       +                                                                        }
       +                                                                },
       +
       +                                                                // Only normal processors (resolve) catch and reject exceptions
       +                                                                process = special ?
       +                                                                        mightThrow :
       +                                                                        function() {
       +                                                                                try {
       +                                                                                        mightThrow();
       +                                                                                } catch ( e ) {
       +
       +                                                                                        if ( jQuery.Deferred.exceptionHook ) {
       +                                                                                                jQuery.Deferred.exceptionHook( e,
       +                                                                                                        process.stackTrace );
       +                                                                                        }
       +
       +                                                                                        // Support: Promises/A+ section 2.3.3.3.4.1
       +                                                                                        // https://promisesaplus.com/#point-61
       +                                                                                        // Ignore post-resolution exceptions
       +                                                                                        if ( depth + 1 >= maxDepth ) {
       +
       +                                                                                                // Only substitute handlers pass on context
       +                                                                                                // and multiple values (non-spec behavior)
       +                                                                                                if ( handler !== Thrower ) {
       +                                                                                                        that = undefined;
       +                                                                                                        args = [ e ];
       +                                                                                                }
       +
       +                                                                                                deferred.rejectWith( that, args );
       +                                                                                        }
       +                                                                                }
       +                                                                        };
       +
       +                                                        // Support: Promises/A+ section 2.3.3.3.1
       +                                                        // https://promisesaplus.com/#point-57
       +                                                        // Re-resolve promises immediately to dodge false rejection from
       +                                                        // subsequent errors
       +                                                        if ( depth ) {
       +                                                                process();
       +                                                        } else {
        
       -                if ( m ) {
       -                        soFar = m[3];
       +                                                                // Call an optional hook to record the stack, in case of exception
       +                                                                // since it's otherwise lost when execution goes async
       +                                                                if ( jQuery.Deferred.getStackHook ) {
       +                                                                        process.stackTrace = jQuery.Deferred.getStackHook();
       +                                                                }
       +                                                                window.setTimeout( process );
       +                                                        }
       +                                                };
       +                                        }
        
       -                        parts.push( m[1] );
       +                                        return jQuery.Deferred( function( newDefer ) {
       +
       +                                                // progress_handlers.add( ... )
       +                                                tuples[ 0 ][ 3 ].add(
       +                                                        resolve(
       +                                                                0,
       +                                                                newDefer,
       +                                                                jQuery.isFunction( onProgress ) ?
       +                                                                        onProgress :
       +                                                                        Identity,
       +                                                                newDefer.notifyWith
       +                                                        )
       +                                                );
       +
       +                                                // fulfilled_handlers.add( ... )
       +                                                tuples[ 1 ][ 3 ].add(
       +                                                        resolve(
       +                                                                0,
       +                                                                newDefer,
       +                                                                jQuery.isFunction( onFulfilled ) ?
       +                                                                        onFulfilled :
       +                                                                        Identity
       +                                                        )
       +                                                );
       +
       +                                                // rejected_handlers.add( ... )
       +                                                tuples[ 2 ][ 3 ].add(
       +                                                        resolve(
       +                                                                0,
       +                                                                newDefer,
       +                                                                jQuery.isFunction( onRejected ) ?
       +                                                                        onRejected :
       +                                                                        Thrower
       +                                                        )
       +                                                );
       +                                        } ).promise();
       +                                },
        
       -                        if ( m[2] ) {
       -                                extra = m[3];
       -                                break;
       +                                // Get a promise for this deferred
       +                                // If obj is provided, the promise aspect is added to the object
       +                                promise: function( obj ) {
       +                                        return obj != null ? jQuery.extend( obj, promise ) : promise;
       +                                }
       +                        },
       +                        deferred = {};
       +
       +                // Add list-specific methods
       +                jQuery.each( tuples, function( i, tuple ) {
       +                        var list = tuple[ 2 ],
       +                                stateString = tuple[ 5 ];
       +
       +                        // promise.progress = list.add
       +                        // promise.done = list.add
       +                        // promise.fail = list.add
       +                        promise[ tuple[ 1 ] ] = list.add;
       +
       +                        // Handle state
       +                        if ( stateString ) {
       +                                list.add(
       +                                        function() {
       +
       +                                                // state = "resolved" (i.e., fulfilled)
       +                                                // state = "rejected"
       +                                                state = stateString;
       +                                        },
       +
       +                                        // rejected_callbacks.disable
       +                                        // fulfilled_callbacks.disable
       +                                        tuples[ 3 - i ][ 2 ].disable,
       +
       +                                        // progress_callbacks.lock
       +                                        tuples[ 0 ][ 2 ].lock
       +                                );
                                }
       -                }
       -        } while ( m );
        
       -        if ( parts.length > 1 && origPOS.exec( selector ) ) {
       +                        // progress_handlers.fire
       +                        // fulfilled_handlers.fire
       +                        // rejected_handlers.fire
       +                        list.add( tuple[ 3 ].fire );
        
       -                if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
       -                        set = posProcess( parts[0] + parts[1], context, seed );
       -
       -                } else {
       -                        set = Expr.relative[ parts[0] ] ?
       -                                [ context ] :
       -                                Sizzle( parts.shift(), context );
       +                        // deferred.notify = function() { deferred.notifyWith(...) }
       +                        // deferred.resolve = function() { deferred.resolveWith(...) }
       +                        // deferred.reject = function() { deferred.rejectWith(...) }
       +                        deferred[ tuple[ 0 ] ] = function() {
       +                                deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
       +                                return this;
       +                        };
        
       -                        while ( parts.length ) {
       -                                selector = parts.shift();
       +                        // deferred.notifyWith = list.fireWith
       +                        // deferred.resolveWith = list.fireWith
       +                        // deferred.rejectWith = list.fireWith
       +                        deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
       +                } );
        
       -                                if ( Expr.relative[ selector ] ) {
       -                                        selector += parts.shift();
       -                                }
       +                // Make the deferred a promise
       +                promise.promise( deferred );
        
       -                                set = posProcess( selector, set, seed );
       -                        }
       +                // Call given func if any
       +                if ( func ) {
       +                        func.call( deferred, deferred );
                        }
        
       -        } else {
       -                // Take a shortcut and set the context if the root selector is an ID
       -                // (but not if it'll be faster if the inner selector is an ID)
       -                if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
       -                                Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
       +                // All done!
       +                return deferred;
       +        },
        
       -                        ret = Sizzle.find( parts.shift(), context, contextXML );
       -                        context = ret.expr ?
       -                                Sizzle.filter( ret.expr, ret.set )[0] :
       -                                ret.set[0];
       -                }
       +        // Deferred helper
       +        when: function( singleValue ) {
       +                var
        
       -                if ( context ) {
       -                        ret = seed ?
       -                                { expr: parts.pop(), set: makeArray(seed) } :
       -                                Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
       +                        // count of uncompleted subordinates
       +                        remaining = arguments.length,
        
       -                        set = ret.expr ?
       -                                Sizzle.filter( ret.expr, ret.set ) :
       -                                ret.set;
       +                        // count of unprocessed arguments
       +                        i = remaining,
        
       -                        if ( parts.length > 0 ) {
       -                                checkSet = makeArray( set );
       +                        // subordinate fulfillment data
       +                        resolveContexts = Array( i ),
       +                        resolveValues = slice.call( arguments ),
        
       -                        } else {
       -                                prune = false;
       -                        }
       +                        // the master Deferred
       +                        master = jQuery.Deferred(),
        
       -                        while ( parts.length ) {
       -                                cur = parts.pop();
       -                                pop = cur;
       +                        // subordinate callback factory
       +                        updateFunc = function( i ) {
       +                                return function( value ) {
       +                                        resolveContexts[ i ] = this;
       +                                        resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
       +                                        if ( !( --remaining ) ) {
       +                                                master.resolveWith( resolveContexts, resolveValues );
       +                                        }
       +                                };
       +                        };
        
       -                                if ( !Expr.relative[ cur ] ) {
       -                                        cur = "";
       -                                } else {
       -                                        pop = parts.pop();
       -                                }
       +                // Single- and empty arguments are adopted like Promise.resolve
       +                if ( remaining <= 1 ) {
       +                        adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject );
        
       -                                if ( pop == null ) {
       -                                        pop = context;
       -                                }
       +                        // Use .then() to unwrap secondary thenables (cf. gh-3000)
       +                        if ( master.state() === "pending" ||
       +                                jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
        
       -                                Expr.relative[ cur ]( checkSet, pop, contextXML );
       +                                return master.then();
                                }
       -
       -                } else {
       -                        checkSet = parts = [];
                        }
       -        }
        
       -        if ( !checkSet ) {
       -                checkSet = set;
       -        }
       +                // Multiple arguments are aggregated like Promise.all array elements
       +                while ( i-- ) {
       +                        adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
       +                }
        
       -        if ( !checkSet ) {
       -                Sizzle.error( cur || selector );
       +                return master.promise();
                }
       +} );
        
       -        if ( toString.call(checkSet) === "[object Array]" ) {
       -                if ( !prune ) {
       -                        results.push.apply( results, checkSet );
        
       -                } else if ( context && context.nodeType === 1 ) {
       -                        for ( i = 0; checkSet[i] != null; i++ ) {
       -                                if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
       -                                        results.push( set[i] );
       -                                }
       -                        }
       +// These usually indicate a programmer mistake during development,
       +// warn about them ASAP rather than swallowing them by default.
       +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
        
       -                } else {
       -                        for ( i = 0; checkSet[i] != null; i++ ) {
       -                                if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
       -                                        results.push( set[i] );
       -                                }
       -                        }
       -                }
       +jQuery.Deferred.exceptionHook = function( error, stack ) {
        
       -        } else {
       -                makeArray( checkSet, results );
       +        // Support: IE 8 - 9 only
       +        // Console exists when dev tools are open, which can happen at any time
       +        if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
       +                window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
                }
       +};
        
       -        if ( extra ) {
       -                Sizzle( extra, origContext, results, seed );
       -                Sizzle.uniqueSort( results );
       -        }
        
       -        return results;
       +
       +
       +jQuery.readyException = function( error ) {
       +        window.setTimeout( function() {
       +                throw error;
       +        } );
        };
        
       -Sizzle.uniqueSort = function( results ) {
       -        if ( sortOrder ) {
       -                hasDuplicate = baseHasDuplicate;
       -                results.sort( sortOrder );
        
       -                if ( hasDuplicate ) {
       -                        for ( var i = 1; i < results.length; i++ ) {
       -                                if ( results[i] === results[ i - 1 ] ) {
       -                                        results.splice( i--, 1 );
       -                                }
       -                        }
       -                }
       -        }
        
       -        return results;
       -};
        
       -Sizzle.matches = function( expr, set ) {
       -        return Sizzle( expr, null, null, set );
       -};
       +// The deferred used on DOM ready
       +var readyList = jQuery.Deferred();
        
       -Sizzle.matchesSelector = function( node, expr ) {
       -        return Sizzle( expr, null, null, [node] ).length > 0;
       -};
       +jQuery.fn.ready = function( fn ) {
        
       -Sizzle.find = function( expr, context, isXML ) {
       -        var set, i, len, match, type, left;
       +        readyList
       +                .then( fn )
        
       -        if ( !expr ) {
       -                return [];
       -        }
       +                // Wrap jQuery.readyException in a function so that the lookup
       +                // happens at the time of error handling instead of callback
       +                // registration.
       +                .catch( function( error ) {
       +                        jQuery.readyException( error );
       +                } );
        
       -        for ( i = 0, len = Expr.order.length; i < len; i++ ) {
       -                type = Expr.order[i];
       +        return this;
       +};
        
       -                if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
       -                        left = match[1];
       -                        match.splice( 1, 1 );
       +jQuery.extend( {
        
       -                        if ( left.substr( left.length - 1 ) !== "\\" ) {
       -                                match[1] = (match[1] || "").replace( rBackslash, "" );
       -                                set = Expr.find[ type ]( match, context, isXML );
       +        // Is the DOM ready to be used? Set to true once it occurs.
       +        isReady: false,
        
       -                                if ( set != null ) {
       -                                        expr = expr.replace( Expr.match[ type ], "" );
       -                                        break;
       -                                }
       -                        }
       +        // A counter to track how many items to wait for before
       +        // the ready event fires. See #6781
       +        readyWait: 1,
       +
       +        // Hold (or release) the ready event
       +        holdReady: function( hold ) {
       +                if ( hold ) {
       +                        jQuery.readyWait++;
       +                } else {
       +                        jQuery.ready( true );
                        }
       -        }
       +        },
        
       -        if ( !set ) {
       -                set = typeof context.getElementsByTagName !== "undefined" ?
       -                        context.getElementsByTagName( "*" ) :
       -                        [];
       -        }
       +        // Handle when the DOM is ready
       +        ready: function( wait ) {
        
       -        return { set: set, expr: expr };
       -};
       +                // Abort if there are pending holds or we're already ready
       +                if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
       +                        return;
       +                }
        
       -Sizzle.filter = function( expr, set, inplace, not ) {
       -        var match, anyFound,
       -                type, found, item, filter, left,
       -                i, pass,
       -                old = expr,
       -                result = [],
       -                curLoop = set,
       -                isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
       +                // Remember that the DOM is ready
       +                jQuery.isReady = true;
        
       -        while ( expr && set.length ) {
       -                for ( type in Expr.filter ) {
       -                        if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
       -                                filter = Expr.filter[ type ];
       -                                left = match[1];
       +                // If a normal DOM Ready event fired, decrement, and wait if need be
       +                if ( wait !== true && --jQuery.readyWait > 0 ) {
       +                        return;
       +                }
        
       -                                anyFound = false;
       +                // If there are functions bound, to execute
       +                readyList.resolveWith( document, [ jQuery ] );
       +        }
       +} );
        
       -                                match.splice(1,1);
       +jQuery.ready.then = readyList.then;
        
       -                                if ( left.substr( left.length - 1 ) === "\\" ) {
       -                                        continue;
       -                                }
       +// The ready event handler and self cleanup method
       +function completed() {
       +        document.removeEventListener( "DOMContentLoaded", completed );
       +        window.removeEventListener( "load", completed );
       +        jQuery.ready();
       +}
        
       -                                if ( curLoop === result ) {
       -                                        result = [];
       -                                }
       +// Catch cases where $(document).ready() is called
       +// after the browser event has already occurred.
       +// Support: IE <=9 - 10 only
       +// Older IE sometimes signals "interactive" too soon
       +if ( document.readyState === "complete" ||
       +        ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
        
       -                                if ( Expr.preFilter[ type ] ) {
       -                                        match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
       +        // Handle it asynchronously to allow scripts the opportunity to delay ready
       +        window.setTimeout( jQuery.ready );
        
       -                                        if ( !match ) {
       -                                                anyFound = found = true;
       +} else {
        
       -                                        } else if ( match === true ) {
       -                                                continue;
       -                                        }
       -                                }
       +        // Use the handy event callback
       +        document.addEventListener( "DOMContentLoaded", completed );
        
       -                                if ( match ) {
       -                                        for ( i = 0; (item = curLoop[i]) != null; i++ ) {
       -                                                if ( item ) {
       -                                                        found = filter( item, match, i, curLoop );
       -                                                        pass = not ^ found;
       +        // A fallback to window.onload, that will always work
       +        window.addEventListener( "load", completed );
       +}
        
       -                                                        if ( inplace && found != null ) {
       -                                                                if ( pass ) {
       -                                                                        anyFound = true;
        
       -                                                                } else {
       -                                                                        curLoop[i] = false;
       -                                                                }
        
       -                                                        } else if ( pass ) {
       -                                                                result.push( item );
       -                                                                anyFound = true;
       -                                                        }
       -                                                }
       -                                        }
       -                                }
        
       -                                if ( found !== undefined ) {
       -                                        if ( !inplace ) {
       -                                                curLoop = result;
       -                                        }
       +// Multifunctional method to get and set values of a collection
       +// The value/s can optionally be executed if it's a function
       +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
       +        var i = 0,
       +                len = elems.length,
       +                bulk = key == null;
        
       -                                        expr = expr.replace( Expr.match[ type ], "" );
       +        // Sets many values
       +        if ( jQuery.type( key ) === "object" ) {
       +                chainable = true;
       +                for ( i in key ) {
       +                        access( elems, fn, i, key[ i ], true, emptyGet, raw );
       +                }
        
       -                                        if ( !anyFound ) {
       -                                                return [];
       -                                        }
       -
       -                                        break;
       -                                }
       -                        }
       -                }
       +        // Sets one value
       +        } else if ( value !== undefined ) {
       +                chainable = true;
        
       -                // Improper expression
       -                if ( expr === old ) {
       -                        if ( anyFound == null ) {
       -                                Sizzle.error( expr );
       -
       -                        } else {
       -                                break;
       -                        }
       +                if ( !jQuery.isFunction( value ) ) {
       +                        raw = true;
                        }
        
       -                old = expr;
       -        }
       -
       -        return curLoop;
       -};
       +                if ( bulk ) {
        
       -Sizzle.error = function( msg ) {
       -        throw new Error( "Syntax error, unrecognized expression: " + msg );
       -};
       +                        // Bulk operations run against the entire set
       +                        if ( raw ) {
       +                                fn.call( elems, value );
       +                                fn = null;
        
       -/**
       - * Utility function for retreiving the text value of an array of DOM nodes
       - * @param {Array|Element} elem
       - */
       -var getText = Sizzle.getText = function( elem ) {
       -    var i, node,
       -                nodeType = elem.nodeType,
       -                ret = "";
       -
       -        if ( nodeType ) {
       -                if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
       -                        // Use textContent || innerText for elements
       -                        if ( typeof elem.textContent === 'string' ) {
       -                                return elem.textContent;
       -                        } else if ( typeof elem.innerText === 'string' ) {
       -                                // Replace IE's carriage returns
       -                                return elem.innerText.replace( rReturn, '' );
       +                        // ...except when executing function values
                                } else {
       -                                // Traverse it's children
       -                                for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
       -                                        ret += getText( elem );
       -                                }
       +                                bulk = fn;
       +                                fn = function( elem, key, value ) {
       +                                        return bulk.call( jQuery( elem ), value );
       +                                };
                                }
       -                } else if ( nodeType === 3 || nodeType === 4 ) {
       -                        return elem.nodeValue;
                        }
       -        } else {
        
       -                // If no nodeType, this is expected to be an array
       -                for ( i = 0; (node = elem[i]); i++ ) {
       -                        // Do not traverse comment nodes
       -                        if ( node.nodeType !== 8 ) {
       -                                ret += getText( node );
       +                if ( fn ) {
       +                        for ( ; i < len; i++ ) {
       +                                fn(
       +                                        elems[ i ], key, raw ?
       +                                        value :
       +                                        value.call( elems[ i ], i, fn( elems[ i ], key ) )
       +                                );
                                }
                        }
                }
       -        return ret;
       -};
       -
       -var Expr = Sizzle.selectors = {
       -        order: [ "ID", "NAME", "TAG" ],
       -
       -        match: {
       -                ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
       -                CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
       -                NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
       -                ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
       -                TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
       -                CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
       -                POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
       -                PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
       -        },
        
       -        leftMatch: {},
       +        if ( chainable ) {
       +                return elems;
       +        }
        
       -        attrMap: {
       -                "class": "className",
       -                "for": "htmlFor"
       -        },
       +        // Gets
       +        if ( bulk ) {
       +                return fn.call( elems );
       +        }
        
       -        attrHandle: {
       -                href: function( elem ) {
       -                        return elem.getAttribute( "href" );
       -                },
       -                type: function( elem ) {
       -                        return elem.getAttribute( "type" );
       -                }
       -        },
       +        return len ? fn( elems[ 0 ], key ) : emptyGet;
       +};
       +var acceptData = function( owner ) {
       +
       +        // Accepts only:
       +        //  - Node
       +        //    - Node.ELEMENT_NODE
       +        //    - Node.DOCUMENT_NODE
       +        //  - Object
       +        //    - Any
       +        return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
       +};
        
       -        relative: {
       -                "+": function(checkSet, part){
       -                        var isPartStr = typeof part === "string",
       -                                isTag = isPartStr && !rNonWord.test( part ),
       -                                isPartStrNotTag = isPartStr && !isTag;
        
       -                        if ( isTag ) {
       -                                part = part.toLowerCase();
       -                        }
        
       -                        for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
       -                                if ( (elem = checkSet[i]) ) {
       -                                        while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
        
       -                                        checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
       -                                                elem || false :
       -                                                elem === part;
       -                                }
       -                        }
       +function Data() {
       +        this.expando = jQuery.expando + Data.uid++;
       +}
        
       -                        if ( isPartStrNotTag ) {
       -                                Sizzle.filter( part, checkSet, true );
       -                        }
       -                },
       +Data.uid = 1;
        
       -                ">": function( checkSet, part ) {
       -                        var elem,
       -                                isPartStr = typeof part === "string",
       -                                i = 0,
       -                                l = checkSet.length;
       +Data.prototype = {
        
       -                        if ( isPartStr && !rNonWord.test( part ) ) {
       -                                part = part.toLowerCase();
       +        cache: function( owner ) {
        
       -                                for ( ; i < l; i++ ) {
       -                                        elem = checkSet[i];
       +                // Check if the owner object already has a cache
       +                var value = owner[ this.expando ];
        
       -                                        if ( elem ) {
       -                                                var parent = elem.parentNode;
       -                                                checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
       -                                        }
       -                                }
       +                // If not, create one
       +                if ( !value ) {
       +                        value = {};
        
       -                        } else {
       -                                for ( ; i < l; i++ ) {
       -                                        elem = checkSet[i];
       +                        // We can accept data for non-element nodes in modern browsers,
       +                        // but we should not, see #8335.
       +                        // Always return an empty object.
       +                        if ( acceptData( owner ) ) {
        
       -                                        if ( elem ) {
       -                                                checkSet[i] = isPartStr ?
       -                                                        elem.parentNode :
       -                                                        elem.parentNode === part;
       -                                        }
       -                                }
       +                                // If it is a node unlikely to be stringify-ed or looped over
       +                                // use plain assignment
       +                                if ( owner.nodeType ) {
       +                                        owner[ this.expando ] = value;
        
       -                                if ( isPartStr ) {
       -                                        Sizzle.filter( part, checkSet, true );
       +                                // Otherwise secure it in a non-enumerable property
       +                                // configurable must be true to allow the property to be
       +                                // deleted when data is removed
       +                                } else {
       +                                        Object.defineProperty( owner, this.expando, {
       +                                                value: value,
       +                                                configurable: true
       +                                        } );
                                        }
                                }
       -                },
       -
       -                "": function(checkSet, part, isXML){
       -                        var nodeCheck,
       -                                doneName = done++,
       -                                checkFn = dirCheck;
       +                }
        
       -                        if ( typeof part === "string" && !rNonWord.test( part ) ) {
       -                                part = part.toLowerCase();
       -                                nodeCheck = part;
       -                                checkFn = dirNodeCheck;
       -                        }
       +                return value;
       +        },
       +        set: function( owner, data, value ) {
       +                var prop,
       +                        cache = this.cache( owner );
        
       -                        checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
       -                },
       +                // Handle: [ owner, key, value ] args
       +                // Always use camelCase key (gh-2257)
       +                if ( typeof data === "string" ) {
       +                        cache[ jQuery.camelCase( data ) ] = value;
        
       -                "~": function( checkSet, part, isXML ) {
       -                        var nodeCheck,
       -                                doneName = done++,
       -                                checkFn = dirCheck;
       +                // Handle: [ owner, { properties } ] args
       +                } else {
        
       -                        if ( typeof part === "string" && !rNonWord.test( part ) ) {
       -                                part = part.toLowerCase();
       -                                nodeCheck = part;
       -                                checkFn = dirNodeCheck;
       +                        // Copy the properties one-by-one to the cache object
       +                        for ( prop in data ) {
       +                                cache[ jQuery.camelCase( prop ) ] = data[ prop ];
                                }
       -
       -                        checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
                        }
       +                return cache;
                },
       +        get: function( owner, key ) {
       +                return key === undefined ?
       +                        this.cache( owner ) :
        
       -        find: {
       -                ID: function( match, context, isXML ) {
       -                        if ( typeof context.getElementById !== "undefined" && !isXML ) {
       -                                var m = context.getElementById(match[1]);
       -                                // Check parentNode to catch when Blackberry 4.6 returns
       -                                // nodes that are no longer in the document #6963
       -                                return m && m.parentNode ? [m] : [];
       -                        }
       -                },
       +                        // Always use camelCase key (gh-2257)
       +                        owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
       +        },
       +        access: function( owner, key, value ) {
        
       -                NAME: function( match, context ) {
       -                        if ( typeof context.getElementsByName !== "undefined" ) {
       -                                var ret = [],
       -                                        results = context.getElementsByName( match[1] );
       +                // In cases where either:
       +                //
       +                //   1. No key was specified
       +                //   2. A string key was specified, but no value provided
       +                //
       +                // Take the "read" path and allow the get method to determine
       +                // which value to return, respectively either:
       +                //
       +                //   1. The entire cache object
       +                //   2. The data stored at the key
       +                //
       +                if ( key === undefined ||
       +                                ( ( key && typeof key === "string" ) && value === undefined ) ) {
        
       -                                for ( var i = 0, l = results.length; i < l; i++ ) {
       -                                        if ( results[i].getAttribute("name") === match[1] ) {
       -                                                ret.push( results[i] );
       -                                        }
       -                                }
       +                        return this.get( owner, key );
       +                }
        
       -                                return ret.length === 0 ? null : ret;
       -                        }
       -                },
       +                // When the key is not a string, or both a key and value
       +                // are specified, set or extend (existing objects) with either:
       +                //
       +                //   1. An object of properties
       +                //   2. A key and value
       +                //
       +                this.set( owner, key, value );
        
       -                TAG: function( match, context ) {
       -                        if ( typeof context.getElementsByTagName !== "undefined" ) {
       -                                return context.getElementsByTagName( match[1] );
       -                        }
       -                }
       +                // Since the "set" path can have two possible entry points
       +                // return the expected data based on which path was taken[*]
       +                return value !== undefined ? value : key;
                },
       -        preFilter: {
       -                CLASS: function( match, curLoop, inplace, result, not, isXML ) {
       -                        match = " " + match[1].replace( rBackslash, "" ) + " ";
       -
       -                        if ( isXML ) {
       -                                return match;
       -                        }
       +        remove: function( owner, key ) {
       +                var i,
       +                        cache = owner[ this.expando ];
        
       -                        for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
       -                                if ( elem ) {
       -                                        if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
       -                                                if ( !inplace ) {
       -                                                        result.push( elem );
       -                                                }
       +                if ( cache === undefined ) {
       +                        return;
       +                }
        
       -                                        } else if ( inplace ) {
       -                                                curLoop[i] = false;
       -                                        }
       -                                }
       -                        }
       +                if ( key !== undefined ) {
        
       -                        return false;
       -                },
       +                        // Support array or space separated string of keys
       +                        if ( jQuery.isArray( key ) ) {
        
       -                ID: function( match ) {
       -                        return match[1].replace( rBackslash, "" );
       -                },
       +                                // If key is an array of keys...
       +                                // We always set camelCase keys, so remove that.
       +                                key = key.map( jQuery.camelCase );
       +                        } else {
       +                                key = jQuery.camelCase( key );
        
       -                TAG: function( match, curLoop ) {
       -                        return match[1].replace( rBackslash, "" ).toLowerCase();
       -                },
       +                                // If a key with the spaces exists, use it.
       +                                // Otherwise, create an array by matching non-whitespace
       +                                key = key in cache ?
       +                                        [ key ] :
       +                                        ( key.match( rnothtmlwhite ) || [] );
       +                        }
        
       -                CHILD: function( match ) {
       -                        if ( match[1] === "nth" ) {
       -                                if ( !match[2] ) {
       -                                        Sizzle.error( match[0] );
       -                                }
       +                        i = key.length;
        
       -                                match[2] = match[2].replace(/^\+|\s*/g, '');
       +                        while ( i-- ) {
       +                                delete cache[ key[ i ] ];
       +                        }
       +                }
        
       -                                // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
       -                                var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
       -                                        match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
       -                                        !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
       +                // Remove the expando if there's no more data
       +                if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
        
       -                                // calculate the numbers (first)n+(last) including if they are negative
       -                                match[2] = (test[1] + (test[2] || 1)) - 0;
       -                                match[3] = test[3] - 0;
       -                        }
       -                        else if ( match[2] ) {
       -                                Sizzle.error( match[0] );
       +                        // Support: Chrome <=35 - 45
       +                        // Webkit & Blink performance suffers when deleting properties
       +                        // from DOM nodes, so set to undefined instead
       +                        // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
       +                        if ( owner.nodeType ) {
       +                                owner[ this.expando ] = undefined;
       +                        } else {
       +                                delete owner[ this.expando ];
                                }
       +                }
       +        },
       +        hasData: function( owner ) {
       +                var cache = owner[ this.expando ];
       +                return cache !== undefined && !jQuery.isEmptyObject( cache );
       +        }
       +};
       +var dataPriv = new Data();
        
       -                        // TODO: Move to normal caching system
       -                        match[0] = done++;
       +var dataUser = new Data();
        
       -                        return match;
       -                },
        
       -                ATTR: function( match, curLoop, inplace, result, not, isXML ) {
       -                        var name = match[1] = match[1].replace( rBackslash, "" );
        
       -                        if ( !isXML && Expr.attrMap[name] ) {
       -                                match[1] = Expr.attrMap[name];
       -                        }
       +//        Implementation Summary
       +//
       +//        1. Enforce API surface and semantic compatibility with 1.9.x branch
       +//        2. Improve the module's maintainability by reducing the storage
       +//                paths to a single mechanism.
       +//        3. Use the same single mechanism to support "private" and "user" data.
       +//        4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
       +//        5. Avoid exposing implementation details on user objects (eg. expando properties)
       +//        6. Provide a clear path for implementation upgrade to WeakMap in 2014
        
       -                        // Handle if an un-quoted value was used
       -                        match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
       +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
       +        rmultiDash = /[A-Z]/g;
        
       -                        if ( match[2] === "~=" ) {
       -                                match[4] = " " + match[4] + " ";
       -                        }
       +function getData( data ) {
       +        if ( data === "true" ) {
       +                return true;
       +        }
        
       -                        return match;
       -                },
       +        if ( data === "false" ) {
       +                return false;
       +        }
        
       -                PSEUDO: function( match, curLoop, inplace, result, not ) {
       -                        if ( match[1] === "not" ) {
       -                                // If we're dealing with a complex expression, or a simple one
       -                                if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
       -                                        match[3] = Sizzle(match[3], null, null, curLoop);
       +        if ( data === "null" ) {
       +                return null;
       +        }
        
       -                                } else {
       -                                        var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
       +        // Only convert to a number if it doesn't change the string
       +        if ( data === +data + "" ) {
       +                return +data;
       +        }
        
       -                                        if ( !inplace ) {
       -                                                result.push.apply( result, ret );
       -                                        }
       +        if ( rbrace.test( data ) ) {
       +                return JSON.parse( data );
       +        }
        
       -                                        return false;
       -                                }
       +        return data;
       +}
        
       -                        } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
       -                                return true;
       -                        }
       +function dataAttr( elem, key, data ) {
       +        var name;
        
       -                        return match;
       -                },
       +        // If nothing was found internally, try to fetch any
       +        // data from the HTML5 data-* attribute
       +        if ( data === undefined && elem.nodeType === 1 ) {
       +                name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
       +                data = elem.getAttribute( name );
        
       -                POS: function( match ) {
       -                        match.unshift( true );
       +                if ( typeof data === "string" ) {
       +                        try {
       +                                data = getData( data );
       +                        } catch ( e ) {}
        
       -                        return match;
       +                        // Make sure we set the data so it isn't changed later
       +                        dataUser.set( elem, key, data );
       +                } else {
       +                        data = undefined;
                        }
       +        }
       +        return data;
       +}
       +
       +jQuery.extend( {
       +        hasData: function( elem ) {
       +                return dataUser.hasData( elem ) || dataPriv.hasData( elem );
                },
        
       -        filters: {
       -                enabled: function( elem ) {
       -                        return elem.disabled === false && elem.type !== "hidden";
       -                },
       +        data: function( elem, name, data ) {
       +                return dataUser.access( elem, name, data );
       +        },
        
       -                disabled: function( elem ) {
       -                        return elem.disabled === true;
       -                },
       +        removeData: function( elem, name ) {
       +                dataUser.remove( elem, name );
       +        },
        
       -                checked: function( elem ) {
       -                        return elem.checked === true;
       -                },
       +        // TODO: Now that all calls to _data and _removeData have been replaced
       +        // with direct calls to dataPriv methods, these can be deprecated.
       +        _data: function( elem, name, data ) {
       +                return dataPriv.access( elem, name, data );
       +        },
        
       -                selected: function( elem ) {
       -                        // Accessing this property makes selected-by-default
       -                        // options in Safari work properly
       -                        if ( elem.parentNode ) {
       -                                elem.parentNode.selectedIndex;
       -                        }
       +        _removeData: function( elem, name ) {
       +                dataPriv.remove( elem, name );
       +        }
       +} );
        
       -                        return elem.selected === true;
       -                },
       +jQuery.fn.extend( {
       +        data: function( key, value ) {
       +                var i, name, data,
       +                        elem = this[ 0 ],
       +                        attrs = elem && elem.attributes;
        
       -                parent: function( elem ) {
       -                        return !!elem.firstChild;
       -                },
       +                // Gets all values
       +                if ( key === undefined ) {
       +                        if ( this.length ) {
       +                                data = dataUser.get( elem );
       +
       +                                if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
       +                                        i = attrs.length;
       +                                        while ( i-- ) {
       +
       +                                                // Support: IE 11 only
       +                                                // The attrs elements can be null (#14894)
       +                                                if ( attrs[ i ] ) {
       +                                                        name = attrs[ i ].name;
       +                                                        if ( name.indexOf( "data-" ) === 0 ) {
       +                                                                name = jQuery.camelCase( name.slice( 5 ) );
       +                                                                dataAttr( elem, name, data[ name ] );
       +                                                        }
       +                                                }
       +                                        }
       +                                        dataPriv.set( elem, "hasDataAttrs", true );
       +                                }
       +                        }
        
       -                empty: function( elem ) {
       -                        return !elem.firstChild;
       -                },
       +                        return data;
       +                }
        
       -                has: function( elem, i, match ) {
       -                        return !!Sizzle( match[3], elem ).length;
       -                },
       +                // Sets multiple values
       +                if ( typeof key === "object" ) {
       +                        return this.each( function() {
       +                                dataUser.set( this, key );
       +                        } );
       +                }
        
       -                header: function( elem ) {
       -                        return (/h\d/i).test( elem.nodeName );
       -                },
       +                return access( this, function( value ) {
       +                        var data;
        
       -                text: function( elem ) {
       -                        var attr = elem.getAttribute( "type" ), type = elem.type;
       -                        // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
       -                        // use getAttribute instead to test this case
       -                        return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
       -                },
       +                        // The calling jQuery object (element matches) is not empty
       +                        // (and therefore has an element appears at this[ 0 ]) and the
       +                        // `value` parameter was not undefined. An empty jQuery object
       +                        // will result in `undefined` for elem = this[ 0 ] which will
       +                        // throw an exception if an attempt to read a data cache is made.
       +                        if ( elem && value === undefined ) {
        
       -                radio: function( elem ) {
       -                        return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
       -                },
       +                                // Attempt to get data from the cache
       +                                // The key will always be camelCased in Data
       +                                data = dataUser.get( elem, key );
       +                                if ( data !== undefined ) {
       +                                        return data;
       +                                }
        
       -                checkbox: function( elem ) {
       -                        return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
       -                },
       +                                // Attempt to "discover" the data in
       +                                // HTML5 custom data-* attrs
       +                                data = dataAttr( elem, key );
       +                                if ( data !== undefined ) {
       +                                        return data;
       +                                }
        
       -                file: function( elem ) {
       -                        return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
       -                },
       +                                // We tried really hard, but the data doesn't exist.
       +                                return;
       +                        }
        
       -                password: function( elem ) {
       -                        return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
       -                },
       +                        // Set the data...
       +                        this.each( function() {
        
       -                submit: function( elem ) {
       -                        var name = elem.nodeName.toLowerCase();
       -                        return (name === "input" || name === "button") && "submit" === elem.type;
       -                },
       +                                // We always store the camelCased key
       +                                dataUser.set( this, key, value );
       +                        } );
       +                }, null, value, arguments.length > 1, null, true );
       +        },
        
       -                image: function( elem ) {
       -                        return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
       -                },
       +        removeData: function( key ) {
       +                return this.each( function() {
       +                        dataUser.remove( this, key );
       +                } );
       +        }
       +} );
        
       -                reset: function( elem ) {
       -                        var name = elem.nodeName.toLowerCase();
       -                        return (name === "input" || name === "button") && "reset" === elem.type;
       -                },
        
       -                button: function( elem ) {
       -                        var name = elem.nodeName.toLowerCase();
       -                        return name === "input" && "button" === elem.type || name === "button";
       -                },
       +jQuery.extend( {
       +        queue: function( elem, type, data ) {
       +                var queue;
        
       -                input: function( elem ) {
       -                        return (/input|select|textarea|button/i).test( elem.nodeName );
       -                },
       +                if ( elem ) {
       +                        type = ( type || "fx" ) + "queue";
       +                        queue = dataPriv.get( elem, type );
        
       -                focus: function( elem ) {
       -                        return elem === elem.ownerDocument.activeElement;
       +                        // Speed up dequeue by getting out quickly if this is just a lookup
       +                        if ( data ) {
       +                                if ( !queue || jQuery.isArray( data ) ) {
       +                                        queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
       +                                } else {
       +                                        queue.push( data );
       +                                }
       +                        }
       +                        return queue || [];
                        }
                },
       -        setFilters: {
       -                first: function( elem, i ) {
       -                        return i === 0;
       -                },
        
       -                last: function( elem, i, match, array ) {
       -                        return i === array.length - 1;
       -                },
       +        dequeue: function( elem, type ) {
       +                type = type || "fx";
        
       -                even: function( elem, i ) {
       -                        return i % 2 === 0;
       -                },
       +                var queue = jQuery.queue( elem, type ),
       +                        startLength = queue.length,
       +                        fn = queue.shift(),
       +                        hooks = jQuery._queueHooks( elem, type ),
       +                        next = function() {
       +                                jQuery.dequeue( elem, type );
       +                        };
        
       -                odd: function( elem, i ) {
       -                        return i % 2 === 1;
       -                },
       +                // If the fx queue is dequeued, always remove the progress sentinel
       +                if ( fn === "inprogress" ) {
       +                        fn = queue.shift();
       +                        startLength--;
       +                }
        
       -                lt: function( elem, i, match ) {
       -                        return i < match[3] - 0;
       -                },
       +                if ( fn ) {
        
       -                gt: function( elem, i, match ) {
       -                        return i > match[3] - 0;
       -                },
       +                        // Add a progress sentinel to prevent the fx queue from being
       +                        // automatically dequeued
       +                        if ( type === "fx" ) {
       +                                queue.unshift( "inprogress" );
       +                        }
        
       -                nth: function( elem, i, match ) {
       -                        return match[3] - 0 === i;
       -                },
       +                        // Clear up the last queue stop function
       +                        delete hooks.stop;
       +                        fn.call( elem, next, hooks );
       +                }
        
       -                eq: function( elem, i, match ) {
       -                        return match[3] - 0 === i;
       +                if ( !startLength && hooks ) {
       +                        hooks.empty.fire();
                        }
                },
       -        filter: {
       -                PSEUDO: function( elem, match, i, array ) {
       -                        var name = match[1],
       -                                filter = Expr.filters[ name ];
       -
       -                        if ( filter ) {
       -                                return filter( elem, i, match, array );
        
       -                        } else if ( name === "contains" ) {
       -                                return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
       -
       -                        } else if ( name === "not" ) {
       -                                var not = match[3];
       -
       -                                for ( var j = 0, l = not.length; j < l; j++ ) {
       -                                        if ( not[j] === elem ) {
       -                                                return false;
       -                                        }
       -                                }
       +        // Not public - generate a queueHooks object, or return the current one
       +        _queueHooks: function( elem, type ) {
       +                var key = type + "queueHooks";
       +                return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
       +                        empty: jQuery.Callbacks( "once memory" ).add( function() {
       +                                dataPriv.remove( elem, [ type + "queue", key ] );
       +                        } )
       +                } );
       +        }
       +} );
        
       -                                return true;
       +jQuery.fn.extend( {
       +        queue: function( type, data ) {
       +                var setter = 2;
        
       -                        } else {
       -                                Sizzle.error( name );
       -                        }
       -                },
       +                if ( typeof type !== "string" ) {
       +                        data = type;
       +                        type = "fx";
       +                        setter--;
       +                }
        
       -                CHILD: function( elem, match ) {
       -                        var first, last,
       -                                doneName, parent, cache,
       -                                count, diff,
       -                                type = match[1],
       -                                node = elem;
       -
       -                        switch ( type ) {
       -                                case "only":
       -                                case "first":
       -                                        while ( (node = node.previousSibling) ) {
       -                                                if ( node.nodeType === 1 ) {
       -                                                        return false;
       -                                                }
       -                                        }
       +                if ( arguments.length < setter ) {
       +                        return jQuery.queue( this[ 0 ], type );
       +                }
        
       -                                        if ( type === "first" ) {
       -                                                return true;
       -                                        }
       +                return data === undefined ?
       +                        this :
       +                        this.each( function() {
       +                                var queue = jQuery.queue( this, type, data );
        
       -                                        node = elem;
       +                                // Ensure a hooks for this queue
       +                                jQuery._queueHooks( this, type );
        
       -                                        /* falls through */
       -                                case "last":
       -                                        while ( (node = node.nextSibling) ) {
       -                                                if ( node.nodeType === 1 ) {
       -                                                        return false;
       -                                                }
       -                                        }
       -
       -                                        return true;
       +                                if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
       +                                        jQuery.dequeue( this, type );
       +                                }
       +                        } );
       +        },
       +        dequeue: function( type ) {
       +                return this.each( function() {
       +                        jQuery.dequeue( this, type );
       +                } );
       +        },
       +        clearQueue: function( type ) {
       +                return this.queue( type || "fx", [] );
       +        },
        
       -                                case "nth":
       -                                        first = match[2];
       -                                        last = match[3];
       +        // Get a promise resolved when queues of a certain type
       +        // are emptied (fx is the type by default)
       +        promise: function( type, obj ) {
       +                var tmp,
       +                        count = 1,
       +                        defer = jQuery.Deferred(),
       +                        elements = this,
       +                        i = this.length,
       +                        resolve = function() {
       +                                if ( !( --count ) ) {
       +                                        defer.resolveWith( elements, [ elements ] );
       +                                }
       +                        };
        
       -                                        if ( first === 1 && last === 0 ) {
       -                                                return true;
       -                                        }
       +                if ( typeof type !== "string" ) {
       +                        obj = type;
       +                        type = undefined;
       +                }
       +                type = type || "fx";
        
       -                                        doneName = match[0];
       -                                        parent = elem.parentNode;
       +                while ( i-- ) {
       +                        tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
       +                        if ( tmp && tmp.empty ) {
       +                                count++;
       +                                tmp.empty.add( resolve );
       +                        }
       +                }
       +                resolve();
       +                return defer.promise( obj );
       +        }
       +} );
       +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
        
       -                                        if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
       -                                                count = 0;
       +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
        
       -                                                for ( node = parent.firstChild; node; node = node.nextSibling ) {
       -                                                        if ( node.nodeType === 1 ) {
       -                                                                node.nodeIndex = ++count;
       -                                                        }
       -                                                }
        
       -                                                parent[ expando ] = doneName;
       -                                        }
       +var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
        
       -                                        diff = elem.nodeIndex - last;
       +var isHiddenWithinTree = function( elem, el ) {
        
       -                                        if ( first === 0 ) {
       -                                                return diff === 0;
       +                // isHiddenWithinTree might be called from jQuery#filter function;
       +                // in that case, element will be second argument
       +                elem = el || elem;
        
       -                                        } else {
       -                                                return ( diff % first === 0 && diff / first >= 0 );
       -                                        }
       -                        }
       -                },
       +                // Inline style trumps all
       +                return elem.style.display === "none" ||
       +                        elem.style.display === "" &&
        
       -                ID: function( elem, match ) {
       -                        return elem.nodeType === 1 && elem.getAttribute("id") === match;
       -                },
       +                        // Otherwise, check computed style
       +                        // Support: Firefox <=43 - 45
       +                        // Disconnected elements can have computed display: none, so first confirm that elem is
       +                        // in the document.
       +                        jQuery.contains( elem.ownerDocument, elem ) &&
        
       -                TAG: function( elem, match ) {
       -                        return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
       -                },
       +                        jQuery.css( elem, "display" ) === "none";
       +        };
        
       -                CLASS: function( elem, match ) {
       -                        return (" " + (elem.className || elem.getAttribute("class")) + " ")
       -                                .indexOf( match ) > -1;
       -                },
       +var swap = function( elem, options, callback, args ) {
       +        var ret, name,
       +                old = {};
        
       -                ATTR: function( elem, match ) {
       -                        var name = match[1],
       -                                result = Sizzle.attr ?
       -                                        Sizzle.attr( elem, name ) :
       -                                        Expr.attrHandle[ name ] ?
       -                                        Expr.attrHandle[ name ]( elem ) :
       -                                        elem[ name ] != null ?
       -                                                elem[ name ] :
       -                                                elem.getAttribute( name ),
       -                                value = result + "",
       -                                type = match[2],
       -                                check = match[4];
       -
       -                        return result == null ?
       -                                type === "!=" :
       -                                !type && Sizzle.attr ?
       -                                result != null :
       -                                type === "=" ?
       -                                value === check :
       -                                type === "*=" ?
       -                                value.indexOf(check) >= 0 :
       -                                type === "~=" ?
       -                                (" " + value + " ").indexOf(check) >= 0 :
       -                                !check ?
       -                                value && result !== false :
       -                                type === "!=" ?
       -                                value !== check :
       -                                type === "^=" ?
       -                                value.indexOf(check) === 0 :
       -                                type === "$=" ?
       -                                value.substr(value.length - check.length) === check :
       -                                type === "|=" ?
       -                                value === check || value.substr(0, check.length + 1) === check + "-" :
       -                                false;
       -                },
       +        // Remember the old values, and insert the new ones
       +        for ( name in options ) {
       +                old[ name ] = elem.style[ name ];
       +                elem.style[ name ] = options[ name ];
       +        }
        
       -                POS: function( elem, match, i, array ) {
       -                        var name = match[2],
       -                                filter = Expr.setFilters[ name ];
       +        ret = callback.apply( elem, args || [] );
        
       -                        if ( filter ) {
       -                                return filter( elem, i, match, array );
       -                        }
       -                }
       +        // Revert the old values
       +        for ( name in options ) {
       +                elem.style[ name ] = old[ name ];
                }
       +
       +        return ret;
        };
        
       -var origPOS = Expr.match.POS,
       -        fescape = function(all, num){
       -                return "\\" + (num - 0 + 1);
       -        };
        
       -for ( var type in Expr.match ) {
       -        Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
       -        Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
       -}
       -// Expose origPOS
       -// "global" as in regardless of relation to brackets/parens
       -Expr.match.globalPOS = origPOS;
        
       -var makeArray = function( array, results ) {
       -        array = Array.prototype.slice.call( array, 0 );
        
       -        if ( results ) {
       -                results.push.apply( results, array );
       -                return results;
       -        }
       +function adjustCSS( elem, prop, valueParts, tween ) {
       +        var adjusted,
       +                scale = 1,
       +                maxIterations = 20,
       +                currentValue = tween ?
       +                        function() {
       +                                return tween.cur();
       +                        } :
       +                        function() {
       +                                return jQuery.css( elem, prop, "" );
       +                        },
       +                initial = currentValue(),
       +                unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
        
       -        return array;
       -};
       +                // Starting value computation is required for potential unit mismatches
       +                initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
       +                        rcssNum.exec( jQuery.css( elem, prop ) );
        
       -// Perform a simple check to determine if the browser is capable of
       -// converting a NodeList to an array using builtin methods.
       -// Also verifies that the returned array holds DOM nodes
       -// (which is not the case in the Blackberry browser)
       -try {
       -        Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
       +        if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
        
       -// Provide a fallback method if it does not work
       -} catch( e ) {
       -        makeArray = function( array, results ) {
       -                var i = 0,
       -                        ret = results || [];
       +                // Trust units reported by jQuery.css
       +                unit = unit || initialInUnit[ 3 ];
        
       -                if ( toString.call(array) === "[object Array]" ) {
       -                        Array.prototype.push.apply( ret, array );
       +                // Make sure we update the tween properties later on
       +                valueParts = valueParts || [];
        
       -                } else {
       -                        if ( typeof array.length === "number" ) {
       -                                for ( var l = array.length; i < l; i++ ) {
       -                                        ret.push( array[i] );
       -                                }
       +                // Iteratively approximate from a nonzero starting point
       +                initialInUnit = +initial || 1;
        
       -                        } else {
       -                                for ( ; array[i]; i++ ) {
       -                                        ret.push( array[i] );
       -                                }
       -                        }
       -                }
       +                do {
        
       -                return ret;
       -        };
       -}
       +                        // If previous iteration zeroed out, double until we get *something*.
       +                        // Use string for doubling so we don't accidentally see scale as unchanged below
       +                        scale = scale || ".5";
        
       -var sortOrder, siblingCheck;
       +                        // Adjust and apply
       +                        initialInUnit = initialInUnit / scale;
       +                        jQuery.style( elem, prop, initialInUnit + unit );
        
       -if ( document.documentElement.compareDocumentPosition ) {
       -        sortOrder = function( a, b ) {
       -                if ( a === b ) {
       -                        hasDuplicate = true;
       -                        return 0;
       -                }
       +                // Update scale, tolerating zero or NaN from tween.cur()
       +                // Break the loop if scale is unchanged or perfect, or if we've just had enough.
       +                } while (
       +                        scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
       +                );
       +        }
       +
       +        if ( valueParts ) {
       +                initialInUnit = +initialInUnit || +initial || 0;
        
       -                if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
       -                        return a.compareDocumentPosition ? -1 : 1;
       +                // Apply relative offset (+=/-=) if specified
       +                adjusted = valueParts[ 1 ] ?
       +                        initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
       +                        +valueParts[ 2 ];
       +                if ( tween ) {
       +                        tween.unit = unit;
       +                        tween.start = initialInUnit;
       +                        tween.end = adjusted;
                        }
       +        }
       +        return adjusted;
       +}
        
       -                return a.compareDocumentPosition(b) & 4 ? -1 : 1;
       -        };
        
       -} else {
       -        sortOrder = function( a, b ) {
       -                // The nodes are identical, we can exit early
       -                if ( a === b ) {
       -                        hasDuplicate = true;
       -                        return 0;
       +var defaultDisplayMap = {};
        
       -                // Fallback to using sourceIndex (in IE) if it's available on both nodes
       -                } else if ( a.sourceIndex && b.sourceIndex ) {
       -                        return a.sourceIndex - b.sourceIndex;
       -                }
       +function getDefaultDisplay( elem ) {
       +        var temp,
       +                doc = elem.ownerDocument,
       +                nodeName = elem.nodeName,
       +                display = defaultDisplayMap[ nodeName ];
        
       -                var al, bl,
       -                        ap = [],
       -                        bp = [],
       -                        aup = a.parentNode,
       -                        bup = b.parentNode,
       -                        cur = aup;
       +        if ( display ) {
       +                return display;
       +        }
        
       -                // If the nodes are siblings (or identical) we can do a quick check
       -                if ( aup === bup ) {
       -                        return siblingCheck( a, b );
       +        temp = doc.body.appendChild( doc.createElement( nodeName ) );
       +        display = jQuery.css( temp, "display" );
        
       -                // If no parents were found then the nodes are disconnected
       -                } else if ( !aup ) {
       -                        return -1;
       +        temp.parentNode.removeChild( temp );
        
       -                } else if ( !bup ) {
       -                        return 1;
       -                }
       +        if ( display === "none" ) {
       +                display = "block";
       +        }
       +        defaultDisplayMap[ nodeName ] = display;
        
       -                // Otherwise they're somewhere else in the tree so we need
       -                // to build up a full list of the parentNodes for comparison
       -                while ( cur ) {
       -                        ap.unshift( cur );
       -                        cur = cur.parentNode;
       -                }
       +        return display;
       +}
        
       -                cur = bup;
       +function showHide( elements, show ) {
       +        var display, elem,
       +                values = [],
       +                index = 0,
       +                length = elements.length;
        
       -                while ( cur ) {
       -                        bp.unshift( cur );
       -                        cur = cur.parentNode;
       +        // Determine new display value for elements that need to change
       +        for ( ; index < length; index++ ) {
       +                elem = elements[ index ];
       +                if ( !elem.style ) {
       +                        continue;
                        }
        
       -                al = ap.length;
       -                bl = bp.length;
       +                display = elem.style.display;
       +                if ( show ) {
        
       -                // Start walking down the tree looking for a discrepancy
       -                for ( var i = 0; i < al && i < bl; i++ ) {
       -                        if ( ap[i] !== bp[i] ) {
       -                                return siblingCheck( ap[i], bp[i] );
       +                        // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
       +                        // check is required in this first loop unless we have a nonempty display value (either
       +                        // inline or about-to-be-restored)
       +                        if ( display === "none" ) {
       +                                values[ index ] = dataPriv.get( elem, "display" ) || null;
       +                                if ( !values[ index ] ) {
       +                                        elem.style.display = "";
       +                                }
                                }
       -                }
       -
       -                // We ended someplace up the tree so do a sibling check
       -                return i === al ?
       -                        siblingCheck( a, bp[i], -1 ) :
       -                        siblingCheck( ap[i], b, 1 );
       -        };
       -
       -        siblingCheck = function( a, b, ret ) {
       -                if ( a === b ) {
       -                        return ret;
       -                }
       -
       -                var cur = a.nextSibling;
       +                        if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
       +                                values[ index ] = getDefaultDisplay( elem );
       +                        }
       +                } else {
       +                        if ( display !== "none" ) {
       +                                values[ index ] = "none";
        
       -                while ( cur ) {
       -                        if ( cur === b ) {
       -                                return -1;
       +                                // Remember what we're overwriting
       +                                dataPriv.set( elem, "display", display );
                                }
       +                }
       +        }
        
       -                        cur = cur.nextSibling;
       +        // Set the display of the elements in a second loop to avoid constant reflow
       +        for ( index = 0; index < length; index++ ) {
       +                if ( values[ index ] != null ) {
       +                        elements[ index ].style.display = values[ index ];
                        }
       +        }
        
       -                return 1;
       -        };
       +        return elements;
        }
        
       -// Check to see if the browser returns elements by name when
       -// querying by getElementById (and provide a workaround)
       -(function(){
       -        // We're going to inject a fake input element with a specified name
       -        var form = document.createElement("div"),
       -                id = "script" + (new Date()).getTime(),
       -                root = document.documentElement;
       +jQuery.fn.extend( {
       +        show: function() {
       +                return showHide( this, true );
       +        },
       +        hide: function() {
       +                return showHide( this );
       +        },
       +        toggle: function( state ) {
       +                if ( typeof state === "boolean" ) {
       +                        return state ? this.show() : this.hide();
       +                }
        
       -        form.innerHTML = "<a name='" + id + "'/>";
       +                return this.each( function() {
       +                        if ( isHiddenWithinTree( this ) ) {
       +                                jQuery( this ).show();
       +                        } else {
       +                                jQuery( this ).hide();
       +                        }
       +                } );
       +        }
       +} );
       +var rcheckableType = ( /^(?:checkbox|radio)$/i );
        
       -        // Inject it into the root element, check its status, and remove it quickly
       -        root.insertBefore( form, root.firstChild );
       +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
        
       -        // The workaround has to do additional checks after a getElementById
       -        // Which slows things down for other browsers (hence the branching)
       -        if ( document.getElementById( id ) ) {
       -                Expr.find.ID = function( match, context, isXML ) {
       -                        if ( typeof context.getElementById !== "undefined" && !isXML ) {
       -                                var m = context.getElementById(match[1]);
       +var rscriptType = ( /^$|\/(?:java|ecma)script/i );
        
       -                                return m ?
       -                                        m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
       -                                                [m] :
       -                                                undefined :
       -                                        [];
       -                        }
       -                };
        
       -                Expr.filter.ID = function( elem, match ) {
       -                        var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
        
       -                        return elem.nodeType === 1 && node && node.nodeValue === match;
       -                };
       -        }
       +// We have to close these tags to support XHTML (#13200)
       +var wrapMap = {
        
       -        root.removeChild( form );
       +        // Support: IE <=9 only
       +        option: [ 1, "<select multiple='multiple'>", "</select>" ],
        
       -        // release memory in IE
       -        root = form = null;
       -})();
       +        // XHTML parsers do not magically insert elements in the
       +        // same way that tag soup parsers do. So we cannot shorten
       +        // this by omitting <tbody> or other required elements.
       +        thead: [ 1, "<table>", "</table>" ],
       +        col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
       +        tr: [ 2, "<table><tbody>", "</tbody></table>" ],
       +        td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
        
       -(function(){
       -        // Check to see if the browser returns only elements
       -        // when doing getElementsByTagName("*")
       +        _default: [ 0, "", "" ]
       +};
        
       -        // Create a fake element
       -        var div = document.createElement("div");
       -        div.appendChild( document.createComment("") );
       +// Support: IE <=9 only
       +wrapMap.optgroup = wrapMap.option;
        
       -        // Make sure no comments are found
       -        if ( div.getElementsByTagName("*").length > 0 ) {
       -                Expr.find.TAG = function( match, context ) {
       -                        var results = context.getElementsByTagName( match[1] );
       +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
       +wrapMap.th = wrapMap.td;
        
       -                        // Filter out possible comments
       -                        if ( match[1] === "*" ) {
       -                                var tmp = [];
        
       -                                for ( var i = 0; results[i]; i++ ) {
       -                                        if ( results[i].nodeType === 1 ) {
       -                                                tmp.push( results[i] );
       -                                        }
       -                                }
       +function getAll( context, tag ) {
        
       -                                results = tmp;
       -                        }
       +        // Support: IE <=9 - 11 only
       +        // Use typeof to avoid zero-argument method invocation on host objects (#15151)
       +        var ret;
        
       -                        return results;
       -                };
       -        }
       +        if ( typeof context.getElementsByTagName !== "undefined" ) {
       +                ret = context.getElementsByTagName( tag || "*" );
        
       -        // Check to see if an attribute returns normalized href attributes
       -        div.innerHTML = "<a href='#'></a>";
       +        } else if ( typeof context.querySelectorAll !== "undefined" ) {
       +                ret = context.querySelectorAll( tag || "*" );
        
       -        if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
       -                        div.firstChild.getAttribute("href") !== "#" ) {
       +        } else {
       +                ret = [];
       +        }
        
       -                Expr.attrHandle.href = function( elem ) {
       -                        return elem.getAttribute( "href", 2 );
       -                };
       +        if ( tag === undefined || tag && jQuery.nodeName( context, tag ) ) {
       +                return jQuery.merge( [ context ], ret );
                }
        
       -        // release memory in IE
       -        div = null;
       -})();
       +        return ret;
       +}
        
       -if ( document.querySelectorAll ) {
       -        (function(){
       -                var oldSizzle = Sizzle,
       -                        div = document.createElement("div"),
       -                        id = "__sizzle__";
        
       -                div.innerHTML = "<p class='TEST'></p>";
       +// Mark scripts as having already been evaluated
       +function setGlobalEval( elems, refElements ) {
       +        var i = 0,
       +                l = elems.length;
        
       -                // Safari can't handle uppercase or unicode characters when
       -                // in quirks mode.
       -                if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
       -                        return;
       -                }
       +        for ( ; i < l; i++ ) {
       +                dataPriv.set(
       +                        elems[ i ],
       +                        "globalEval",
       +                        !refElements || dataPriv.get( refElements[ i ], "globalEval" )
       +                );
       +        }
       +}
        
       -                Sizzle = function( query, context, extra, seed ) {
       -                        context = context || document;
        
       -                        // Only use querySelectorAll on non-XML documents
       -                        // (ID selectors don't work in non-HTML documents)
       -                        if ( !seed && !Sizzle.isXML(context) ) {
       -                                // See if we find a selector to speed up
       -                                var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
       +var rhtml = /<|&#?\w+;/;
        
       -                                if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
       -                                        // Speed-up: Sizzle("TAG")
       -                                        if ( match[1] ) {
       -                                                return makeArray( context.getElementsByTagName( query ), extra );
       +function buildFragment( elems, context, scripts, selection, ignored ) {
       +        var elem, tmp, tag, wrap, contains, j,
       +                fragment = context.createDocumentFragment(),
       +                nodes = [],
       +                i = 0,
       +                l = elems.length;
        
       -                                        // Speed-up: Sizzle(".CLASS")
       -                                        } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
       -                                                return makeArray( context.getElementsByClassName( match[2] ), extra );
       -                                        }
       -                                }
       +        for ( ; i < l; i++ ) {
       +                elem = elems[ i ];
        
       -                                if ( context.nodeType === 9 ) {
       -                                        // Speed-up: Sizzle("body")
       -                                        // The body element only exists once, optimize finding it
       -                                        if ( query === "body" && context.body ) {
       -                                                return makeArray( [ context.body ], extra );
       +                if ( elem || elem === 0 ) {
        
       -                                        // Speed-up: Sizzle("#ID")
       -                                        } else if ( match && match[3] ) {
       -                                                var elem = context.getElementById( match[3] );
       +                        // Add nodes directly
       +                        if ( jQuery.type( elem ) === "object" ) {
        
       -                                                // Check parentNode to catch when Blackberry 4.6 returns
       -                                                // nodes that are no longer in the document #6963
       -                                                if ( elem && elem.parentNode ) {
       -                                                        // Handle the case where IE and Opera return items
       -                                                        // by name instead of ID
       -                                                        if ( elem.id === match[3] ) {
       -                                                                return makeArray( [ elem ], extra );
       -                                                        }
       +                                // Support: Android <=4.0 only, PhantomJS 1 only
       +                                // push.apply(_, arraylike) throws on ancient WebKit
       +                                jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
        
       -                                                } else {
       -                                                        return makeArray( [], extra );
       -                                                }
       -                                        }
       +                        // Convert non-html into a text node
       +                        } else if ( !rhtml.test( elem ) ) {
       +                                nodes.push( context.createTextNode( elem ) );
        
       -                                        try {
       -                                                return makeArray( context.querySelectorAll(query), extra );
       -                                        } catch(qsaError) {}
       -
       -                                // qSA works strangely on Element-rooted queries
       -                                // We can work around this by specifying an extra ID on the root
       -                                // and working up from there (Thanks to Andrew Dupont for the technique)
       -                                // IE 8 doesn't work on object elements
       -                                } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
       -                                        var oldContext = context,
       -                                                old = context.getAttribute( "id" ),
       -                                                nid = old || id,
       -                                                hasParent = context.parentNode,
       -                                                relativeHierarchySelector = /^\s*[+~]/.test( query );
       -
       -                                        if ( !old ) {
       -                                                context.setAttribute( "id", nid );
       -                                        } else {
       -                                                nid = nid.replace( /'/g, "\\$&" );
       -                                        }
       -                                        if ( relativeHierarchySelector && hasParent ) {
       -                                                context = context.parentNode;
       -                                        }
       +                        // Convert html into DOM nodes
       +                        } else {
       +                                tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
        
       -                                        try {
       -                                                if ( !relativeHierarchySelector || hasParent ) {
       -                                                        return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
       -                                                }
       +                                // Deserialize a standard representation
       +                                tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
       +                                wrap = wrapMap[ tag ] || wrapMap._default;
       +                                tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
        
       -                                        } catch(pseudoError) {
       -                                        } finally {
       -                                                if ( !old ) {
       -                                                        oldContext.removeAttribute( "id" );
       -                                                }
       -                                        }
       +                                // Descend through wrappers to the right content
       +                                j = wrap[ 0 ];
       +                                while ( j-- ) {
       +                                        tmp = tmp.lastChild;
                                        }
       -                        }
       -
       -                        return oldSizzle(query, context, extra, seed);
       -                };
       -
       -                for ( var prop in oldSizzle ) {
       -                        Sizzle[ prop ] = oldSizzle[ prop ];
       -                }
       -
       -                // release memory in IE
       -                div = null;
       -        })();
       -}
       -
       -(function(){
       -        var html = document.documentElement,
       -                matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
        
       -        if ( matches ) {
       -                // Check to see if it's possible to do matchesSelector
       -                // on a disconnected node (IE 9 fails this)
       -                var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
       -                        pseudoWorks = false;
       +                                // Support: Android <=4.0 only, PhantomJS 1 only
       +                                // push.apply(_, arraylike) throws on ancient WebKit
       +                                jQuery.merge( nodes, tmp.childNodes );
        
       -                try {
       -                        // This should fail with an exception
       -                        // Gecko does not error, returns false instead
       -                        matches.call( document.documentElement, "[test!='']:sizzle" );
       +                                // Remember the top-level container
       +                                tmp = fragment.firstChild;
        
       -                } catch( pseudoError ) {
       -                        pseudoWorks = true;
       +                                // Ensure the created nodes are orphaned (#12392)
       +                                tmp.textContent = "";
       +                        }
                        }
       +        }
        
       -                Sizzle.matchesSelector = function( node, expr ) {
       -                        // Make sure that attribute selectors are quoted
       -                        expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
       +        // Remove wrapper from fragment
       +        fragment.textContent = "";
        
       -                        if ( !Sizzle.isXML( node ) ) {
       -                                try {
       -                                        if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
       -                                                var ret = matches.call( node, expr );
       -
       -                                                // IE 9's matchesSelector returns false on disconnected nodes
       -                                                if ( ret || !disconnectedMatch ||
       -                                                                // As well, disconnected nodes are said to be in a document
       -                                                                // fragment in IE 9, so check for that
       -                                                                node.document && node.document.nodeType !== 11 ) {
       -                                                        return ret;
       -                                                }
       -                                        }
       -                                } catch(e) {}
       +        i = 0;
       +        while ( ( elem = nodes[ i++ ] ) ) {
       +
       +                // Skip elements already in the context collection (trac-4087)
       +                if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
       +                        if ( ignored ) {
       +                                ignored.push( elem );
                                }
       +                        continue;
       +                }
        
       -                        return Sizzle(expr, null, null, [node]).length > 0;
       -                };
       -        }
       -})();
       +                contains = jQuery.contains( elem.ownerDocument, elem );
        
       -(function(){
       -        var div = document.createElement("div");
       +                // Append to fragment
       +                tmp = getAll( fragment.appendChild( elem ), "script" );
        
       -        div.innerHTML = "<div class='test e'></div><div class='test'></div>";
       +                // Preserve script evaluation history
       +                if ( contains ) {
       +                        setGlobalEval( tmp );
       +                }
        
       -        // Opera can't find a second classname (in 9.6)
       -        // Also, make sure that getElementsByClassName actually exists
       -        if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
       -                return;
       +                // Capture executables
       +                if ( scripts ) {
       +                        j = 0;
       +                        while ( ( elem = tmp[ j++ ] ) ) {
       +                                if ( rscriptType.test( elem.type || "" ) ) {
       +                                        scripts.push( elem );
       +                                }
       +                        }
       +                }
                }
        
       -        // Safari caches class attributes, doesn't catch changes (in 3.2)
       -        div.lastChild.className = "e";
       +        return fragment;
       +}
        
       -        if ( div.getElementsByClassName("e").length === 1 ) {
       -                return;
       -        }
        
       -        Expr.order.splice(1, 0, "CLASS");
       -        Expr.find.CLASS = function( match, context, isXML ) {
       -                if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
       -                        return context.getElementsByClassName(match[1]);
       -                }
       -        };
       +( function() {
       +        var fragment = document.createDocumentFragment(),
       +                div = fragment.appendChild( document.createElement( "div" ) ),
       +                input = document.createElement( "input" );
        
       -        // release memory in IE
       -        div = null;
       -})();
       +        // Support: Android 4.0 - 4.3 only
       +        // Check state lost if the name is set (#11217)
       +        // Support: Windows Web Apps (WWA)
       +        // `name` and `type` must use .setAttribute for WWA (#14901)
       +        input.setAttribute( "type", "radio" );
       +        input.setAttribute( "checked", "checked" );
       +        input.setAttribute( "name", "t" );
        
       -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
       -        for ( var i = 0, l = checkSet.length; i < l; i++ ) {
       -                var elem = checkSet[i];
       +        div.appendChild( input );
        
       -                if ( elem ) {
       -                        var match = false;
       +        // Support: Android <=4.1 only
       +        // Older WebKit doesn't clone checked state correctly in fragments
       +        support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
        
       -                        elem = elem[dir];
       +        // Support: IE <=11 only
       +        // Make sure textarea (and checkbox) defaultValue is properly cloned
       +        div.innerHTML = "<textarea>x</textarea>";
       +        support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
       +} )();
       +var documentElement = document.documentElement;
        
       -                        while ( elem ) {
       -                                if ( elem[ expando ] === doneName ) {
       -                                        match = checkSet[elem.sizset];
       -                                        break;
       -                                }
        
       -                                if ( elem.nodeType === 1 && !isXML ){
       -                                        elem[ expando ] = doneName;
       -                                        elem.sizset = i;
       -                                }
        
       -                                if ( elem.nodeName.toLowerCase() === cur ) {
       -                                        match = elem;
       -                                        break;
       -                                }
       +var
       +        rkeyEvent = /^key/,
       +        rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
       +        rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
        
       -                                elem = elem[dir];
       -                        }
       +function returnTrue() {
       +        return true;
       +}
        
       -                        checkSet[i] = match;
       -                }
       -        }
       +function returnFalse() {
       +        return false;
        }
        
       -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
       -        for ( var i = 0, l = checkSet.length; i < l; i++ ) {
       -                var elem = checkSet[i];
       +// Support: IE <=9 only
       +// See #13393 for more info
       +function safeActiveElement() {
       +        try {
       +                return document.activeElement;
       +        } catch ( err ) { }
       +}
        
       -                if ( elem ) {
       -                        var match = false;
       +function on( elem, types, selector, data, fn, one ) {
       +        var origFn, type;
        
       -                        elem = elem[dir];
       +        // Types can be a map of types/handlers
       +        if ( typeof types === "object" ) {
        
       -                        while ( elem ) {
       -                                if ( elem[ expando ] === doneName ) {
       -                                        match = checkSet[elem.sizset];
       -                                        break;
       -                                }
       +                // ( types-Object, selector, data )
       +                if ( typeof selector !== "string" ) {
        
       -                                if ( elem.nodeType === 1 ) {
       -                                        if ( !isXML ) {
       -                                                elem[ expando ] = doneName;
       -                                                elem.sizset = i;
       -                                        }
       +                        // ( types-Object, data )
       +                        data = data || selector;
       +                        selector = undefined;
       +                }
       +                for ( type in types ) {
       +                        on( elem, type, selector, data, types[ type ], one );
       +                }
       +                return elem;
       +        }
        
       -                                        if ( typeof cur !== "string" ) {
       -                                                if ( elem === cur ) {
       -                                                        match = true;
       -                                                        break;
       -                                                }
       +        if ( data == null && fn == null ) {
        
       -                                        } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
       -                                                match = elem;
       -                                                break;
       -                                        }
       -                                }
       +                // ( types, fn )
       +                fn = selector;
       +                data = selector = undefined;
       +        } else if ( fn == null ) {
       +                if ( typeof selector === "string" ) {
        
       -                                elem = elem[dir];
       -                        }
       +                        // ( types, selector, fn )
       +                        fn = data;
       +                        data = undefined;
       +                } else {
        
       -                        checkSet[i] = match;
       +                        // ( types, data, fn )
       +                        fn = data;
       +                        data = selector;
       +                        selector = undefined;
                        }
                }
       -}
       +        if ( fn === false ) {
       +                fn = returnFalse;
       +        } else if ( !fn ) {
       +                return elem;
       +        }
        
       -if ( document.documentElement.contains ) {
       -        Sizzle.contains = function( a, b ) {
       -                return a !== b && (a.contains ? a.contains(b) : true);
       -        };
       +        if ( one === 1 ) {
       +                origFn = fn;
       +                fn = function( event ) {
        
       -} else if ( document.documentElement.compareDocumentPosition ) {
       -        Sizzle.contains = function( a, b ) {
       -                return !!(a.compareDocumentPosition(b) & 16);
       -        };
       +                        // Can use an empty set, since event contains the info
       +                        jQuery().off( event );
       +                        return origFn.apply( this, arguments );
       +                };
        
       -} else {
       -        Sizzle.contains = function() {
       -                return false;
       -        };
       +                // Use same guid so caller can remove using origFn
       +                fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
       +        }
       +        return elem.each( function() {
       +                jQuery.event.add( this, types, fn, data, selector );
       +        } );
        }
        
       -Sizzle.isXML = function( elem ) {
       -        // documentElement is verified for cases where it doesn't yet exist
       -        // (such as loading iframes in IE - #4833)
       -        var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
       +/*
       + * Helper functions for managing events -- not part of the public interface.
       + * Props to Dean Edwards' addEvent library for many of the ideas.
       + */
       +jQuery.event = {
        
       -        return documentElement ? documentElement.nodeName !== "HTML" : false;
       -};
       +        global: {},
        
       -var posProcess = function( selector, context, seed ) {
       -        var match,
       -                tmpSet = [],
       -                later = "",
       -                root = context.nodeType ? [context] : context;
       +        add: function( elem, types, handler, data, selector ) {
        
       -        // Position selectors must be done after the filter
       -        // And so must :not(positional) so we move all PSEUDOs to the end
       -        while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
       -                later += match[0];
       -                selector = selector.replace( Expr.match.PSEUDO, "" );
       -        }
       +                var handleObjIn, eventHandle, tmp,
       +                        events, t, handleObj,
       +                        special, handlers, type, namespaces, origType,
       +                        elemData = dataPriv.get( elem );
        
       -        selector = Expr.relative[selector] ? selector + "*" : selector;
       +                // Don't attach events to noData or text/comment nodes (but allow plain objects)
       +                if ( !elemData ) {
       +                        return;
       +                }
        
       -        for ( var i = 0, l = root.length; i < l; i++ ) {
       -                Sizzle( selector, root[i], tmpSet, seed );
       -        }
       +                // Caller can pass in an object of custom data in lieu of the handler
       +                if ( handler.handler ) {
       +                        handleObjIn = handler;
       +                        handler = handleObjIn.handler;
       +                        selector = handleObjIn.selector;
       +                }
        
       -        return Sizzle.filter( later, tmpSet );
       -};
       +                // Ensure that invalid selectors throw exceptions at attach time
       +                // Evaluate against documentElement in case elem is a non-element node (e.g., document)
       +                if ( selector ) {
       +                        jQuery.find.matchesSelector( documentElement, selector );
       +                }
        
       -// EXPOSE
       -// Override sizzle attribute retrieval
       -Sizzle.attr = jQuery.attr;
       -Sizzle.selectors.attrMap = {};
       -jQuery.find = Sizzle;
       -jQuery.expr = Sizzle.selectors;
       -jQuery.expr[":"] = jQuery.expr.filters;
       -jQuery.unique = Sizzle.uniqueSort;
       -jQuery.text = Sizzle.getText;
       -jQuery.isXMLDoc = Sizzle.isXML;
       -jQuery.contains = Sizzle.contains;
       +                // Make sure that the handler has a unique ID, used to find/remove it later
       +                if ( !handler.guid ) {
       +                        handler.guid = jQuery.guid++;
       +                }
        
       +                // Init the element's event structure and main handler, if this is the first
       +                if ( !( events = elemData.events ) ) {
       +                        events = elemData.events = {};
       +                }
       +                if ( !( eventHandle = elemData.handle ) ) {
       +                        eventHandle = elemData.handle = function( e ) {
        
       -})();
       +                                // Discard the second event of a jQuery.event.trigger() and
       +                                // when an event is called after a page has unloaded
       +                                return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
       +                                        jQuery.event.dispatch.apply( elem, arguments ) : undefined;
       +                        };
       +                }
        
       +                // Handle multiple events separated by a space
       +                types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
       +                t = types.length;
       +                while ( t-- ) {
       +                        tmp = rtypenamespace.exec( types[ t ] ) || [];
       +                        type = origType = tmp[ 1 ];
       +                        namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
       +
       +                        // There *must* be a type, no attaching namespace-only handlers
       +                        if ( !type ) {
       +                                continue;
       +                        }
        
       -var runtil = /Until$/,
       -        rparentsprev = /^(?:parents|prevUntil|prevAll)/,
       -        // Note: This RegExp should be improved, or likely pulled from Sizzle
       -        rmultiselector = /,/,
       -        isSimple = /^.[^:#\[\.,]*$/,
       -        slice = Array.prototype.slice,
       -        POS = jQuery.expr.match.globalPOS,
       -        // methods guaranteed to produce a unique set when starting from a unique set
       -        guaranteedUnique = {
       -                children: true,
       -                contents: true,
       -                next: true,
       -                prev: true
       -        };
       +                        // If event changes its type, use the special event handlers for the changed type
       +                        special = jQuery.event.special[ type ] || {};
        
       -jQuery.fn.extend({
       -        find: function( selector ) {
       -                var self = this,
       -                        i, l;
       +                        // If selector defined, determine special event api type, otherwise given type
       +                        type = ( selector ? special.delegateType : special.bindType ) || type;
        
       -                if ( typeof selector !== "string" ) {
       -                        return jQuery( selector ).filter(function() {
       -                                for ( i = 0, l = self.length; i < l; i++ ) {
       -                                        if ( jQuery.contains( self[ i ], this ) ) {
       -                                                return true;
       -                                        }
       -                                }
       -                        });
       -                }
       +                        // Update special based on newly reset type
       +                        special = jQuery.event.special[ type ] || {};
       +
       +                        // handleObj is passed to all event handlers
       +                        handleObj = jQuery.extend( {
       +                                type: type,
       +                                origType: origType,
       +                                data: data,
       +                                handler: handler,
       +                                guid: handler.guid,
       +                                selector: selector,
       +                                needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
       +                                namespace: namespaces.join( "." )
       +                        }, handleObjIn );
        
       -                var ret = this.pushStack( "", "find", selector ),
       -                        length, n, r;
       +                        // Init the event handler queue if we're the first
       +                        if ( !( handlers = events[ type ] ) ) {
       +                                handlers = events[ type ] = [];
       +                                handlers.delegateCount = 0;
        
       -                for ( i = 0, l = this.length; i < l; i++ ) {
       -                        length = ret.length;
       -                        jQuery.find( selector, this[i], ret );
       +                                // Only use addEventListener if the special events handler returns false
       +                                if ( !special.setup ||
       +                                        special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
        
       -                        if ( i > 0 ) {
       -                                // Make sure that the results are unique
       -                                for ( n = length; n < ret.length; n++ ) {
       -                                        for ( r = 0; r < length; r++ ) {
       -                                                if ( ret[r] === ret[n] ) {
       -                                                        ret.splice(n--, 1);
       -                                                        break;
       -                                                }
       +                                        if ( elem.addEventListener ) {
       +                                                elem.addEventListener( type, eventHandle );
                                                }
                                        }
                                }
       -                }
        
       -                return ret;
       -        },
       +                        if ( special.add ) {
       +                                special.add.call( elem, handleObj );
        
       -        has: function( target ) {
       -                var targets = jQuery( target );
       -                return this.filter(function() {
       -                        for ( var i = 0, l = targets.length; i < l; i++ ) {
       -                                if ( jQuery.contains( this, targets[i] ) ) {
       -                                        return true;
       +                                if ( !handleObj.handler.guid ) {
       +                                        handleObj.handler.guid = handler.guid;
                                        }
                                }
       -                });
       -        },
        
       -        not: function( selector ) {
       -                return this.pushStack( winnow(this, selector, false), "not", selector);
       -        },
       +                        // Add to the element's handler list, delegates in front
       +                        if ( selector ) {
       +                                handlers.splice( handlers.delegateCount++, 0, handleObj );
       +                        } else {
       +                                handlers.push( handleObj );
       +                        }
        
       -        filter: function( selector ) {
       -                return this.pushStack( winnow(this, selector, true), "filter", selector );
       -        },
       +                        // Keep track of which events have ever been used, for event optimization
       +                        jQuery.event.global[ type ] = true;
       +                }
        
       -        is: function( selector ) {
       -                return !!selector && (
       -                        typeof selector === "string" ?
       -                                // If this is a positional selector, check membership in the returned set
       -                                // so $("p:first").is("p:last") won't return true for a doc with two "p".
       -                                POS.test( selector ) ?
       -                                        jQuery( selector, this.context ).index( this[0] ) >= 0 :
       -                                        jQuery.filter( selector, this ).length > 0 :
       -                                this.filter( selector ).length > 0 );
                },
        
       -        closest: function( selectors, context ) {
       -                var ret = [], i, l, cur = this[0];
       +        // Detach an event or set of events from an element
       +        remove: function( elem, types, handler, selector, mappedTypes ) {
        
       -                // Array (deprecated as of jQuery 1.7)
       -                if ( jQuery.isArray( selectors ) ) {
       -                        var level = 1;
       +                var j, origCount, tmp,
       +                        events, t, handleObj,
       +                        special, handlers, type, namespaces, origType,
       +                        elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
        
       -                        while ( cur && cur.ownerDocument && cur !== context ) {
       -                                for ( i = 0; i < selectors.length; i++ ) {
       +                if ( !elemData || !( events = elemData.events ) ) {
       +                        return;
       +                }
        
       -                                        if ( jQuery( cur ).is( selectors[ i ] ) ) {
       -                                                ret.push({ selector: selectors[ i ], elem: cur, level: level });
       -                                        }
       -                                }
       +                // Once for each type.namespace in types; type may be omitted
       +                types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
       +                t = types.length;
       +                while ( t-- ) {
       +                        tmp = rtypenamespace.exec( types[ t ] ) || [];
       +                        type = origType = tmp[ 1 ];
       +                        namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
        
       -                                cur = cur.parentNode;
       -                                level++;
       +                        // Unbind all events (on this namespace, if provided) for the element
       +                        if ( !type ) {
       +                                for ( type in events ) {
       +                                        jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
       +                                }
       +                                continue;
                                }
        
       -                        return ret;
       -                }
       -
       -                // String
       -                var pos = POS.test( selectors ) || typeof selectors !== "string" ?
       -                                jQuery( selectors, context || this.context ) :
       -                                0;
       +                        special = jQuery.event.special[ type ] || {};
       +                        type = ( selector ? special.delegateType : special.bindType ) || type;
       +                        handlers = events[ type ] || [];
       +                        tmp = tmp[ 2 ] &&
       +                                new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
        
       -                for ( i = 0, l = this.length; i < l; i++ ) {
       -                        cur = this[i];
       +                        // Remove matching events
       +                        origCount = j = handlers.length;
       +                        while ( j-- ) {
       +                                handleObj = handlers[ j ];
        
       -                        while ( cur ) {
       -                                if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
       -                                        ret.push( cur );
       -                                        break;
       +                                if ( ( mappedTypes || origType === handleObj.origType ) &&
       +                                        ( !handler || handler.guid === handleObj.guid ) &&
       +                                        ( !tmp || tmp.test( handleObj.namespace ) ) &&
       +                                        ( !selector || selector === handleObj.selector ||
       +                                                selector === "**" && handleObj.selector ) ) {
       +                                        handlers.splice( j, 1 );
        
       -                                } else {
       -                                        cur = cur.parentNode;
       -                                        if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
       -                                                break;
       +                                        if ( handleObj.selector ) {
       +                                                handlers.delegateCount--;
       +                                        }
       +                                        if ( special.remove ) {
       +                                                special.remove.call( elem, handleObj );
                                                }
                                        }
                                }
       -                }
       -
       -                ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
        
       -                return this.pushStack( ret, "closest", selectors );
       -        },
       +                        // Remove generic event handler if we removed something and no more handlers exist
       +                        // (avoids potential for endless recursion during removal of special event handlers)
       +                        if ( origCount && !handlers.length ) {
       +                                if ( !special.teardown ||
       +                                        special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
        
       -        // Determine the position of an element within
       -        // the matched set of elements
       -        index: function( elem ) {
       +                                        jQuery.removeEvent( elem, type, elemData.handle );
       +                                }
        
       -                // No argument, return index in parent
       -                if ( !elem ) {
       -                        return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
       +                                delete events[ type ];
       +                        }
                        }
        
       -                // index in selector
       -                if ( typeof elem === "string" ) {
       -                        return jQuery.inArray( this[0], jQuery( elem ) );
       +                // Remove data and the expando if it's no longer used
       +                if ( jQuery.isEmptyObject( events ) ) {
       +                        dataPriv.remove( elem, "handle events" );
                        }
       -
       -                // Locate the position of the desired element
       -                return jQuery.inArray(
       -                        // If it receives a jQuery object, the first element is used
       -                        elem.jquery ? elem[0] : elem, this );
                },
        
       -        add: function( selector, context ) {
       -                var set = typeof selector === "string" ?
       -                                jQuery( selector, context ) :
       -                                jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
       -                        all = jQuery.merge( this.get(), set );
       -
       -                return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
       -                        all :
       -                        jQuery.unique( all ) );
       -        },
       +        dispatch: function( nativeEvent ) {
        
       -        andSelf: function() {
       -                return this.add( this.prevObject );
       -        }
       -});
       +                // Make a writable jQuery.Event from the native event object
       +                var event = jQuery.event.fix( nativeEvent );
        
       -// A painfully simple check to see if an element is disconnected
       -// from a document (should be improved, where feasible).
       -function isDisconnected( node ) {
       -        return !node || !node.parentNode || node.parentNode.nodeType === 11;
       -}
       +                var i, j, ret, matched, handleObj, handlerQueue,
       +                        args = new Array( arguments.length ),
       +                        handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
       +                        special = jQuery.event.special[ event.type ] || {};
        
       -jQuery.each({
       -        parent: function( elem ) {
       -                var parent = elem.parentNode;
       -                return parent && parent.nodeType !== 11 ? parent : null;
       -        },
       -        parents: function( elem ) {
       -                return jQuery.dir( elem, "parentNode" );
       -        },
       -        parentsUntil: function( elem, i, until ) {
       -                return jQuery.dir( elem, "parentNode", until );
       -        },
       -        next: function( elem ) {
       -                return jQuery.nth( elem, 2, "nextSibling" );
       -        },
       -        prev: function( elem ) {
       -                return jQuery.nth( elem, 2, "previousSibling" );
       -        },
       -        nextAll: function( elem ) {
       -                return jQuery.dir( elem, "nextSibling" );
       -        },
       -        prevAll: function( elem ) {
       -                return jQuery.dir( elem, "previousSibling" );
       -        },
       -        nextUntil: function( elem, i, until ) {
       -                return jQuery.dir( elem, "nextSibling", until );
       -        },
       -        prevUntil: function( elem, i, until ) {
       -                return jQuery.dir( elem, "previousSibling", until );
       -        },
       -        siblings: function( elem ) {
       -                return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
       -        },
       -        children: function( elem ) {
       -                return jQuery.sibling( elem.firstChild );
       -        },
       -        contents: function( elem ) {
       -                return jQuery.nodeName( elem, "iframe" ) ?
       -                        elem.contentDocument || elem.contentWindow.document :
       -                        jQuery.makeArray( elem.childNodes );
       -        }
       -}, function( name, fn ) {
       -        jQuery.fn[ name ] = function( until, selector ) {
       -                var ret = jQuery.map( this, fn, until );
       +                // Use the fix-ed jQuery.Event rather than the (read-only) native event
       +                args[ 0 ] = event;
        
       -                if ( !runtil.test( name ) ) {
       -                        selector = until;
       +                for ( i = 1; i < arguments.length; i++ ) {
       +                        args[ i ] = arguments[ i ];
                        }
        
       -                if ( selector && typeof selector === "string" ) {
       -                        ret = jQuery.filter( selector, ret );
       +                event.delegateTarget = this;
       +
       +                // Call the preDispatch hook for the mapped type, and let it bail if desired
       +                if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
       +                        return;
                        }
        
       -                ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
       +                // Determine handlers
       +                handlerQueue = jQuery.event.handlers.call( this, event, handlers );
        
       -                if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
       -                        ret = ret.reverse();
       -                }
       +                // Run delegates first; they may want to stop propagation beneath us
       +                i = 0;
       +                while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
       +                        event.currentTarget = matched.elem;
        
       -                return this.pushStack( ret, name, slice.call( arguments ).join(",") );
       -        };
       -});
       +                        j = 0;
       +                        while ( ( handleObj = matched.handlers[ j++ ] ) &&
       +                                !event.isImmediatePropagationStopped() ) {
        
       -jQuery.extend({
       -        filter: function( expr, elems, not ) {
       -                if ( not ) {
       -                        expr = ":not(" + expr + ")";
       -                }
       +                                // Triggered event must either 1) have no namespace, or 2) have namespace(s)
       +                                // a subset or equal to those in the bound event (both can have no namespace).
       +                                if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
        
       -                return elems.length === 1 ?
       -                        jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
       -                        jQuery.find.matches(expr, elems);
       -        },
       +                                        event.handleObj = handleObj;
       +                                        event.data = handleObj.data;
        
       -        dir: function( elem, dir, until ) {
       -                var matched = [],
       -                        cur = elem[ dir ];
       +                                        ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
       +                                                handleObj.handler ).apply( matched.elem, args );
        
       -                while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
       -                        if ( cur.nodeType === 1 ) {
       -                                matched.push( cur );
       +                                        if ( ret !== undefined ) {
       +                                                if ( ( event.result = ret ) === false ) {
       +                                                        event.preventDefault();
       +                                                        event.stopPropagation();
       +                                                }
       +                                        }
       +                                }
                                }
       -                        cur = cur[dir];
                        }
       -                return matched;
       -        },
       -
       -        nth: function( cur, result, dir, elem ) {
       -                result = result || 1;
       -                var num = 0;
        
       -                for ( ; cur; cur = cur[dir] ) {
       -                        if ( cur.nodeType === 1 && ++num === result ) {
       -                                break;
       -                        }
       +                // Call the postDispatch hook for the mapped type
       +                if ( special.postDispatch ) {
       +                        special.postDispatch.call( this, event );
                        }
        
       -                return cur;
       +                return event.result;
                },
        
       -        sibling: function( n, elem ) {
       -                var r = [];
       -
       -                for ( ; n; n = n.nextSibling ) {
       -                        if ( n.nodeType === 1 && n !== elem ) {
       -                                r.push( n );
       -                        }
       -                }
       +        handlers: function( event, handlers ) {
       +                var i, handleObj, sel, matchedHandlers, matchedSelectors,
       +                        handlerQueue = [],
       +                        delegateCount = handlers.delegateCount,
       +                        cur = event.target;
        
       -                return r;
       -        }
       -});
       +                // Find delegate handlers
       +                if ( delegateCount &&
        
       -// Implement the identical functionality for filter and not
       -function winnow( elements, qualifier, keep ) {
       +                        // Support: IE <=9
       +                        // Black-hole SVG <use> instance trees (trac-13180)
       +                        cur.nodeType &&
        
       -        // Can't pass null or undefined to indexOf in Firefox 4
       -        // Set to 0 to skip string check
       -        qualifier = qualifier || 0;
       +                        // Support: Firefox <=42
       +                        // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
       +                        // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
       +                        // Support: IE 11 only
       +                        // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
       +                        !( event.type === "click" && event.button >= 1 ) ) {
        
       -        if ( jQuery.isFunction( qualifier ) ) {
       -                return jQuery.grep(elements, function( elem, i ) {
       -                        var retVal = !!qualifier.call( elem, i, elem );
       -                        return retVal === keep;
       -                });
       +                        for ( ; cur !== this; cur = cur.parentNode || this ) {
        
       -        } else if ( qualifier.nodeType ) {
       -                return jQuery.grep(elements, function( elem, i ) {
       -                        return ( elem === qualifier ) === keep;
       -                });
       +                                // Don't check non-elements (#13208)
       +                                // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
       +                                if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
       +                                        matchedHandlers = [];
       +                                        matchedSelectors = {};
       +                                        for ( i = 0; i < delegateCount; i++ ) {
       +                                                handleObj = handlers[ i ];
        
       -        } else if ( typeof qualifier === "string" ) {
       -                var filtered = jQuery.grep(elements, function( elem ) {
       -                        return elem.nodeType === 1;
       -                });
       +                                                // Don't conflict with Object.prototype properties (#13203)
       +                                                sel = handleObj.selector + " ";
        
       -                if ( isSimple.test( qualifier ) ) {
       -                        return jQuery.filter(qualifier, filtered, !keep);
       -                } else {
       -                        qualifier = jQuery.filter( qualifier, filtered );
       +                                                if ( matchedSelectors[ sel ] === undefined ) {
       +                                                        matchedSelectors[ sel ] = handleObj.needsContext ?
       +                                                                jQuery( sel, this ).index( cur ) > -1 :
       +                                                                jQuery.find( sel, this, null, [ cur ] ).length;
       +                                                }
       +                                                if ( matchedSelectors[ sel ] ) {
       +                                                        matchedHandlers.push( handleObj );
       +                                                }
       +                                        }
       +                                        if ( matchedHandlers.length ) {
       +                                                handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
       +                                        }
       +                                }
       +                        }
                        }
       -        }
       -
       -        return jQuery.grep(elements, function( elem, i ) {
       -                return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
       -        });
       -}
        
       +                // Add the remaining (directly-bound) handlers
       +                cur = this;
       +                if ( delegateCount < handlers.length ) {
       +                        handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
       +                }
        
       +                return handlerQueue;
       +        },
        
       +        addProp: function( name, hook ) {
       +                Object.defineProperty( jQuery.Event.prototype, name, {
       +                        enumerable: true,
       +                        configurable: true,
        
       -function createSafeFragment( document ) {
       -        var list = nodeNames.split( "|" ),
       -        safeFrag = document.createDocumentFragment();
       +                        get: jQuery.isFunction( hook ) ?
       +                                function() {
       +                                        if ( this.originalEvent ) {
       +                                                        return hook( this.originalEvent );
       +                                        }
       +                                } :
       +                                function() {
       +                                        if ( this.originalEvent ) {
       +                                                        return this.originalEvent[ name ];
       +                                        }
       +                                },
        
       -        if ( safeFrag.createElement ) {
       -                while ( list.length ) {
       -                        safeFrag.createElement(
       -                                list.pop()
       -                        );
       -                }
       -        }
       -        return safeFrag;
       -}
       +                        set: function( value ) {
       +                                Object.defineProperty( this, name, {
       +                                        enumerable: true,
       +                                        configurable: true,
       +                                        writable: true,
       +                                        value: value
       +                                } );
       +                        }
       +                } );
       +        },
        
       -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
       -                "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
       -        rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
       -        rleadingWhitespace = /^\s+/,
       -        rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
       -        rtagName = /<([\w:]+)/,
       -        rtbody = /<tbody/i,
       -        rhtml = /<|&#?\w+;/,
       -        rnoInnerhtml = /<(?:script|style)/i,
       -        rnocache = /<(?:script|object|embed|option|style)/i,
       -        rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
       -        // checked="checked" or checked
       -        rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
       -        rscriptType = /\/(java|ecma)script/i,
       -        rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
       -        wrapMap = {
       -                option: [ 1, "<select multiple='multiple'>", "</select>" ],
       -                legend: [ 1, "<fieldset>", "</fieldset>" ],
       -                thead: [ 1, "<table>", "</table>" ],
       -                tr: [ 2, "<table><tbody>", "</tbody></table>" ],
       -                td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
       -                col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
       -                area: [ 1, "<map>", "</map>" ],
       -                _default: [ 0, "", "" ]
       -        },
       -        safeFragment = createSafeFragment( document );
       +        fix: function( originalEvent ) {
       +                return originalEvent[ jQuery.expando ] ?
       +                        originalEvent :
       +                        new jQuery.Event( originalEvent );
       +        },
        
       -wrapMap.optgroup = wrapMap.option;
       -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
       -wrapMap.th = wrapMap.td;
       +        special: {
       +                load: {
        
       -// IE can't serialize <link> and <script> tags normally
       -if ( !jQuery.support.htmlSerialize ) {
       -        wrapMap._default = [ 1, "div<div>", "</div>" ];
       -}
       +                        // Prevent triggered image.load events from bubbling to window.load
       +                        noBubble: true
       +                },
       +                focus: {
        
       -jQuery.fn.extend({
       -        text: function( value ) {
       -                return jQuery.access( this, function( value ) {
       -                        return value === undefined ?
       -                                jQuery.text( this ) :
       -                                this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
       -                }, null, value, arguments.length );
       -        },
       -
       -        wrapAll: function( html ) {
       -                if ( jQuery.isFunction( html ) ) {
       -                        return this.each(function(i) {
       -                                jQuery(this).wrapAll( html.call(this, i) );
       -                        });
       -                }
       +                        // Fire native event if possible so blur/focus sequence is correct
       +                        trigger: function() {
       +                                if ( this !== safeActiveElement() && this.focus ) {
       +                                        this.focus();
       +                                        return false;
       +                                }
       +                        },
       +                        delegateType: "focusin"
       +                },
       +                blur: {
       +                        trigger: function() {
       +                                if ( this === safeActiveElement() && this.blur ) {
       +                                        this.blur();
       +                                        return false;
       +                                }
       +                        },
       +                        delegateType: "focusout"
       +                },
       +                click: {
        
       -                if ( this[0] ) {
       -                        // The elements to wrap the target around
       -                        var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
       +                        // For checkbox, fire native event so checked state will be right
       +                        trigger: function() {
       +                                if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
       +                                        this.click();
       +                                        return false;
       +                                }
       +                        },
        
       -                        if ( this[0].parentNode ) {
       -                                wrap.insertBefore( this[0] );
       +                        // For cross-browser consistency, don't fire native .click() on links
       +                        _default: function( event ) {
       +                                return jQuery.nodeName( event.target, "a" );
                                }
       +                },
        
       -                        wrap.map(function() {
       -                                var elem = this;
       +                beforeunload: {
       +                        postDispatch: function( event ) {
        
       -                                while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
       -                                        elem = elem.firstChild;
       +                                // Support: Firefox 20+
       +                                // Firefox doesn't alert if the returnValue field is not set.
       +                                if ( event.result !== undefined && event.originalEvent ) {
       +                                        event.originalEvent.returnValue = event.result;
                                        }
       -
       -                                return elem;
       -                        }).append( this );
       +                        }
                        }
       +        }
       +};
        
       -                return this;
       -        },
       +jQuery.removeEvent = function( elem, type, handle ) {
        
       -        wrapInner: function( html ) {
       -                if ( jQuery.isFunction( html ) ) {
       -                        return this.each(function(i) {
       -                                jQuery(this).wrapInner( html.call(this, i) );
       -                        });
       -                }
       +        // This "if" is needed for plain objects
       +        if ( elem.removeEventListener ) {
       +                elem.removeEventListener( type, handle );
       +        }
       +};
        
       -                return this.each(function() {
       -                        var self = jQuery( this ),
       -                                contents = self.contents();
       +jQuery.Event = function( src, props ) {
        
       -                        if ( contents.length ) {
       -                                contents.wrapAll( html );
       +        // Allow instantiation without the 'new' keyword
       +        if ( !( this instanceof jQuery.Event ) ) {
       +                return new jQuery.Event( src, props );
       +        }
        
       -                        } else {
       -                                self.append( html );
       -                        }
       -                });
       -        },
       +        // Event object
       +        if ( src && src.type ) {
       +                this.originalEvent = src;
       +                this.type = src.type;
        
       -        wrap: function( html ) {
       -                var isFunction = jQuery.isFunction( html );
       +                // Events bubbling up the document may have been marked as prevented
       +                // by a handler lower down the tree; reflect the correct value.
       +                this.isDefaultPrevented = src.defaultPrevented ||
       +                                src.defaultPrevented === undefined &&
        
       -                return this.each(function(i) {
       -                        jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
       -                });
       -        },
       +                                // Support: Android <=2.3 only
       +                                src.returnValue === false ?
       +                        returnTrue :
       +                        returnFalse;
        
       -        unwrap: function() {
       -                return this.parent().each(function() {
       -                        if ( !jQuery.nodeName( this, "body" ) ) {
       -                                jQuery( this ).replaceWith( this.childNodes );
       -                        }
       -                }).end();
       -        },
       +                // Create target properties
       +                // Support: Safari <=6 - 7 only
       +                // Target should not be a text node (#504, #13143)
       +                this.target = ( src.target && src.target.nodeType === 3 ) ?
       +                        src.target.parentNode :
       +                        src.target;
        
       -        append: function() {
       -                return this.domManip(arguments, true, function( elem ) {
       -                        if ( this.nodeType === 1 ) {
       -                                this.appendChild( elem );
       -                        }
       -                });
       -        },
       +                this.currentTarget = src.currentTarget;
       +                this.relatedTarget = src.relatedTarget;
        
       -        prepend: function() {
       -                return this.domManip(arguments, true, function( elem ) {
       -                        if ( this.nodeType === 1 ) {
       -                                this.insertBefore( elem, this.firstChild );
       -                        }
       -                });
       -        },
       +        // Event type
       +        } else {
       +                this.type = src;
       +        }
        
       -        before: function() {
       -                if ( this[0] && this[0].parentNode ) {
       -                        return this.domManip(arguments, false, function( elem ) {
       -                                this.parentNode.insertBefore( elem, this );
       -                        });
       -                } else if ( arguments.length ) {
       -                        var set = jQuery.clean( arguments );
       -                        set.push.apply( set, this.toArray() );
       -                        return this.pushStack( set, "before", arguments );
       -                }
       -        },
       +        // Put explicitly provided properties onto the event object
       +        if ( props ) {
       +                jQuery.extend( this, props );
       +        }
        
       -        after: function() {
       -                if ( this[0] && this[0].parentNode ) {
       -                        return this.domManip(arguments, false, function( elem ) {
       -                                this.parentNode.insertBefore( elem, this.nextSibling );
       -                        });
       -                } else if ( arguments.length ) {
       -                        var set = this.pushStack( this, "after", arguments );
       -                        set.push.apply( set, jQuery.clean(arguments) );
       -                        return set;
       -                }
       -        },
       +        // Create a timestamp if incoming event doesn't have one
       +        this.timeStamp = src && src.timeStamp || jQuery.now();
        
       -        // keepData is for internal use only--do not document
       -        remove: function( selector, keepData ) {
       -                for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
       -                        if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
       -                                if ( !keepData && elem.nodeType === 1 ) {
       -                                        jQuery.cleanData( elem.getElementsByTagName("*") );
       -                                        jQuery.cleanData( [ elem ] );
       -                                }
       +        // Mark it as fixed
       +        this[ jQuery.expando ] = true;
       +};
        
       -                                if ( elem.parentNode ) {
       -                                        elem.parentNode.removeChild( elem );
       -                                }
       -                        }
       -                }
       +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
       +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
       +jQuery.Event.prototype = {
       +        constructor: jQuery.Event,
       +        isDefaultPrevented: returnFalse,
       +        isPropagationStopped: returnFalse,
       +        isImmediatePropagationStopped: returnFalse,
       +        isSimulated: false,
        
       -                return this;
       -        },
       +        preventDefault: function() {
       +                var e = this.originalEvent;
        
       -        empty: function() {
       -                for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
       -                        // Remove element nodes and prevent memory leaks
       -                        if ( elem.nodeType === 1 ) {
       -                                jQuery.cleanData( elem.getElementsByTagName("*") );
       -                        }
       +                this.isDefaultPrevented = returnTrue;
        
       -                        // Remove any remaining nodes
       -                        while ( elem.firstChild ) {
       -                                elem.removeChild( elem.firstChild );
       -                        }
       +                if ( e && !this.isSimulated ) {
       +                        e.preventDefault();
                        }
       -
       -                return this;
                },
       +        stopPropagation: function() {
       +                var e = this.originalEvent;
        
       -        clone: function( dataAndEvents, deepDataAndEvents ) {
       -                dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
       -                deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
       +                this.isPropagationStopped = returnTrue;
        
       -                return this.map( function () {
       -                        return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
       -                });
       +                if ( e && !this.isSimulated ) {
       +                        e.stopPropagation();
       +                }
                },
       +        stopImmediatePropagation: function() {
       +                var e = this.originalEvent;
        
       -        html: function( value ) {
       -                return jQuery.access( this, function( value ) {
       -                        var elem = this[0] || {},
       -                                i = 0,
       -                                l = this.length;
       +                this.isImmediatePropagationStopped = returnTrue;
        
       -                        if ( value === undefined ) {
       -                                return elem.nodeType === 1 ?
       -                                        elem.innerHTML.replace( rinlinejQuery, "" ) :
       -                                        null;
       -                        }
       +                if ( e && !this.isSimulated ) {
       +                        e.stopImmediatePropagation();
       +                }
        
       +                this.stopPropagation();
       +        }
       +};
        
       -                        if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
       -                                ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
       -                                !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
       +// Includes all common event props including KeyEvent and MouseEvent specific props
       +jQuery.each( {
       +        altKey: true,
       +        bubbles: true,
       +        cancelable: true,
       +        changedTouches: true,
       +        ctrlKey: true,
       +        detail: true,
       +        eventPhase: true,
       +        metaKey: true,
       +        pageX: true,
       +        pageY: true,
       +        shiftKey: true,
       +        view: true,
       +        "char": true,
       +        charCode: true,
       +        key: true,
       +        keyCode: true,
       +        button: true,
       +        buttons: true,
       +        clientX: true,
       +        clientY: true,
       +        offsetX: true,
       +        offsetY: true,
       +        pointerId: true,
       +        pointerType: true,
       +        screenX: true,
       +        screenY: true,
       +        targetTouches: true,
       +        toElement: true,
       +        touches: true,
       +
       +        which: function( event ) {
       +                var button = event.button;
       +
       +                // Add which for key events
       +                if ( event.which == null && rkeyEvent.test( event.type ) ) {
       +                        return event.charCode != null ? event.charCode : event.keyCode;
       +                }
       +
       +                // Add which for click: 1 === left; 2 === middle; 3 === right
       +                if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
       +                        if ( button & 1 ) {
       +                                return 1;
       +                        }
       +
       +                        if ( button & 2 ) {
       +                                return 3;
       +                        }
       +
       +                        if ( button & 4 ) {
       +                                return 2;
       +                        }
        
       -                                value = value.replace( rxhtmlTag, "<$1></$2>" );
       +                        return 0;
       +                }
        
       -                                try {
       -                                        for (; i < l; i++ ) {
       -                                                // Remove element nodes and prevent memory leaks
       -                                                elem = this[i] || {};
       -                                                if ( elem.nodeType === 1 ) {
       -                                                        jQuery.cleanData( elem.getElementsByTagName( "*" ) );
       -                                                        elem.innerHTML = value;
       -                                                }
       -                                        }
       +                return event.which;
       +        }
       +}, jQuery.event.addProp );
        
       -                                        elem = 0;
       +// Create mouseenter/leave events using mouseover/out and event-time checks
       +// so that event delegation works in jQuery.
       +// Do the same for pointerenter/pointerleave and pointerover/pointerout
       +//
       +// Support: Safari 7 only
       +// Safari sends mouseenter too often; see:
       +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258
       +// for the description of the bug (it existed in older Chrome versions as well).
       +jQuery.each( {
       +        mouseenter: "mouseover",
       +        mouseleave: "mouseout",
       +        pointerenter: "pointerover",
       +        pointerleave: "pointerout"
       +}, function( orig, fix ) {
       +        jQuery.event.special[ orig ] = {
       +                delegateType: fix,
       +                bindType: fix,
        
       -                                // If using innerHTML throws an exception, use the fallback method
       -                                } catch(e) {}
       -                        }
       +                handle: function( event ) {
       +                        var ret,
       +                                target = this,
       +                                related = event.relatedTarget,
       +                                handleObj = event.handleObj;
        
       -                        if ( elem ) {
       -                                this.empty().append( value );
       +                        // For mouseenter/leave call the handler if related is outside the target.
       +                        // NB: No relatedTarget if the mouse left/entered the browser window
       +                        if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
       +                                event.type = handleObj.origType;
       +                                ret = handleObj.handler.apply( this, arguments );
       +                                event.type = fix;
                                }
       -                }, null, value, arguments.length );
       -        },
       +                        return ret;
       +                }
       +        };
       +} );
        
       -        replaceWith: function( value ) {
       -                if ( this[0] && this[0].parentNode ) {
       -                        // Make sure that the elements are removed from the DOM before they are inserted
       -                        // this can help fix replacing a parent with child elements
       -                        if ( jQuery.isFunction( value ) ) {
       -                                return this.each(function(i) {
       -                                        var self = jQuery(this), old = self.html();
       -                                        self.replaceWith( value.call( this, i, old ) );
       -                                });
       -                        }
       +jQuery.fn.extend( {
        
       -                        if ( typeof value !== "string" ) {
       -                                value = jQuery( value ).detach();
       -                        }
       +        on: function( types, selector, data, fn ) {
       +                return on( this, types, selector, data, fn );
       +        },
       +        one: function( types, selector, data, fn ) {
       +                return on( this, types, selector, data, fn, 1 );
       +        },
       +        off: function( types, selector, fn ) {
       +                var handleObj, type;
       +                if ( types && types.preventDefault && types.handleObj ) {
        
       -                        return this.each(function() {
       -                                var next = this.nextSibling,
       -                                        parent = this.parentNode;
       +                        // ( event )  dispatched jQuery.Event
       +                        handleObj = types.handleObj;
       +                        jQuery( types.delegateTarget ).off(
       +                                handleObj.namespace ?
       +                                        handleObj.origType + "." + handleObj.namespace :
       +                                        handleObj.origType,
       +                                handleObj.selector,
       +                                handleObj.handler
       +                        );
       +                        return this;
       +                }
       +                if ( typeof types === "object" ) {
        
       -                                jQuery( this ).remove();
       +                        // ( types-object [, selector] )
       +                        for ( type in types ) {
       +                                this.off( type, selector, types[ type ] );
       +                        }
       +                        return this;
       +                }
       +                if ( selector === false || typeof selector === "function" ) {
        
       -                                if ( next ) {
       -                                        jQuery(next).before( value );
       -                                } else {
       -                                        jQuery(parent).append( value );
       -                                }
       -                        });
       -                } else {
       -                        return this.length ?
       -                                this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
       -                                this;
       +                        // ( types [, fn] )
       +                        fn = selector;
       +                        selector = undefined;
                        }
       -        },
       +                if ( fn === false ) {
       +                        fn = returnFalse;
       +                }
       +                return this.each( function() {
       +                        jQuery.event.remove( this, types, fn, selector );
       +                } );
       +        }
       +} );
        
       -        detach: function( selector ) {
       -                return this.remove( selector, true );
       -        },
        
       -        domManip: function( args, table, callback ) {
       -                var results, first, fragment, parent,
       -                        value = args[0],
       -                        scripts = [];
       +var
        
       -                // We can't cloneNode fragments that contain checked, in WebKit
       -                if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
       -                        return this.each(function() {
       -                                jQuery(this).domManip( args, table, callback, true );
       -                        });
       -                }
       +        /* eslint-disable max-len */
        
       -                if ( jQuery.isFunction(value) ) {
       -                        return this.each(function(i) {
       -                                var self = jQuery(this);
       -                                args[0] = value.call(this, i, table ? self.html() : undefined);
       -                                self.domManip( args, table, callback );
       -                        });
       -                }
       +        // See https://github.com/eslint/eslint/issues/3229
       +        rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
        
       -                if ( this[0] ) {
       -                        parent = value && value.parentNode;
       +        /* eslint-enable */
        
       -                        // If we're in a fragment, just use that instead of building a new one
       -                        if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
       -                                results = { fragment: parent };
       +        // Support: IE <=10 - 11, Edge 12 - 13
       +        // In IE/Edge using regex groups here causes severe slowdowns.
       +        // See https://connect.microsoft.com/IE/feedback/details/1736512/
       +        rnoInnerhtml = /<script|<style|<link/i,
        
       -                        } else {
       -                                results = jQuery.buildFragment( args, this, scripts );
       -                        }
       +        // checked="checked" or checked
       +        rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
       +        rscriptTypeMasked = /^true\/(.*)/,
       +        rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
        
       -                        fragment = results.fragment;
       +function manipulationTarget( elem, content ) {
       +        if ( jQuery.nodeName( elem, "table" ) &&
       +                jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
        
       -                        if ( fragment.childNodes.length === 1 ) {
       -                                first = fragment = fragment.firstChild;
       -                        } else {
       -                                first = fragment.firstChild;
       -                        }
       -
       -                        if ( first ) {
       -                                table = table && jQuery.nodeName( first, "tr" );
       -
       -                                for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
       -                                        callback.call(
       -                                                table ?
       -                                                        root(this[i], first) :
       -                                                        this[i],
       -                                                // Make sure that we do not leak memory by inadvertently discarding
       -                                                // the original fragment (which might have attached data) instead of
       -                                                // using it; in addition, use the original fragment object for the last
       -                                                // item instead of first because it can end up being emptied incorrectly
       -                                                // in certain situations (Bug #8070).
       -                                                // Fragments from the fragment cache must always be cloned and never used
       -                                                // in place.
       -                                                results.cacheable || ( l > 1 && i < lastIndex ) ?
       -                                                        jQuery.clone( fragment, true, true ) :
       -                                                        fragment
       -                                        );
       -                                }
       -                        }
       +                return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
       +        }
        
       -                        if ( scripts.length ) {
       -                                jQuery.each( scripts, function( i, elem ) {
       -                                        if ( elem.src ) {
       -                                                jQuery.ajax({
       -                                                        type: "GET",
       -                                                        global: false,
       -                                                        url: elem.src,
       -                                                        async: false,
       -                                                        dataType: "script"
       -                                                });
       -                                        } else {
       -                                                jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
       -                                        }
       +        return elem;
       +}
        
       -                                        if ( elem.parentNode ) {
       -                                                elem.parentNode.removeChild( elem );
       -                                        }
       -                                });
       -                        }
       -                }
       +// Replace/restore the type attribute of script elements for safe DOM manipulation
       +function disableScript( elem ) {
       +        elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
       +        return elem;
       +}
       +function restoreScript( elem ) {
       +        var match = rscriptTypeMasked.exec( elem.type );
        
       -                return this;
       +        if ( match ) {
       +                elem.type = match[ 1 ];
       +        } else {
       +                elem.removeAttribute( "type" );
                }
       -});
        
       -function root( elem, cur ) {
       -        return jQuery.nodeName(elem, "table") ?
       -                (elem.getElementsByTagName("tbody")[0] ||
       -                elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
       -                elem;
       +        return elem;
        }
        
        function cloneCopyEvent( src, dest ) {
       +        var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
        
       -        if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
       +        if ( dest.nodeType !== 1 ) {
                        return;
                }
        
       -        var type, i, l,
       -                oldData = jQuery._data( src ),
       -                curData = jQuery._data( dest, oldData ),
       -                events = oldData.events;
       +        // 1. Copy private data: events, handlers, etc.
       +        if ( dataPriv.hasData( src ) ) {
       +                pdataOld = dataPriv.access( src );
       +                pdataCur = dataPriv.set( dest, pdataOld );
       +                events = pdataOld.events;
        
       -        if ( events ) {
       -                delete curData.handle;
       -                curData.events = {};
       +                if ( events ) {
       +                        delete pdataCur.handle;
       +                        pdataCur.events = {};
        
       -                for ( type in events ) {
       -                        for ( i = 0, l = events[ type ].length; i < l; i++ ) {
       -                                jQuery.event.add( dest, type, events[ type ][ i ] );
       +                        for ( type in events ) {
       +                                for ( i = 0, l = events[ type ].length; i < l; i++ ) {
       +                                        jQuery.event.add( dest, type, events[ type ][ i ] );
       +                                }
                                }
                        }
                }
        
       -        // make the cloned public data object a copy from the original
       -        if ( curData.data ) {
       -                curData.data = jQuery.extend( {}, curData.data );
       +        // 2. Copy user data
       +        if ( dataUser.hasData( src ) ) {
       +                udataOld = dataUser.access( src );
       +                udataCur = jQuery.extend( {}, udataOld );
       +
       +                dataUser.set( dest, udataCur );
                }
        }
        
       -function cloneFixAttributes( src, dest ) {
       -        var nodeName;
       +// Fix IE bugs, see support tests
       +function fixInput( src, dest ) {
       +        var nodeName = dest.nodeName.toLowerCase();
        
       -        // We do not need to do anything for non-Elements
       -        if ( dest.nodeType !== 1 ) {
       -                return;
       -        }
       +        // Fails to persist the checked state of a cloned checkbox or radio button.
       +        if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
       +                dest.checked = src.checked;
        
       -        // clearAttributes removes the attributes, which we don't want,
       -        // but also removes the attachEvent events, which we *do* want
       -        if ( dest.clearAttributes ) {
       -                dest.clearAttributes();
       +        // Fails to return the selected option to the default selected state when cloning options
       +        } else if ( nodeName === "input" || nodeName === "textarea" ) {
       +                dest.defaultValue = src.defaultValue;
                }
       +}
        
       -        // mergeAttributes, in contrast, only merges back on the
       -        // original attributes, not the events
       -        if ( dest.mergeAttributes ) {
       -                dest.mergeAttributes( src );
       -        }
       +function domManip( collection, args, callback, ignored ) {
        
       -        nodeName = dest.nodeName.toLowerCase();
       +        // Flatten any nested arrays
       +        args = concat.apply( [], args );
        
       -        // IE6-8 fail to clone children inside object elements that use
       -        // the proprietary classid attribute value (rather than the type
       -        // attribute) to identify the type of content to display
       -        if ( nodeName === "object" ) {
       -                dest.outerHTML = src.outerHTML;
       +        var fragment, first, scripts, hasScripts, node, doc,
       +                i = 0,
       +                l = collection.length,
       +                iNoClone = l - 1,
       +                value = args[ 0 ],
       +                isFunction = jQuery.isFunction( value );
        
       -        } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
       -                // IE6-8 fails to persist the checked state of a cloned checkbox
       -                // or radio button. Worse, IE6-7 fail to give the cloned element
       -                // a checked appearance if the defaultChecked value isn't also set
       -                if ( src.checked ) {
       -                        dest.defaultChecked = dest.checked = src.checked;
       -                }
       +        // We can't cloneNode fragments that contain checked, in WebKit
       +        if ( isFunction ||
       +                        ( l > 1 && typeof value === "string" &&
       +                                !support.checkClone && rchecked.test( value ) ) ) {
       +                return collection.each( function( index ) {
       +                        var self = collection.eq( index );
       +                        if ( isFunction ) {
       +                                args[ 0 ] = value.call( this, index, self.html() );
       +                        }
       +                        domManip( self, args, callback, ignored );
       +                } );
       +        }
        
       -                // IE6-7 get confused and end up setting the value of a cloned
       -                // checkbox/radio button to an empty string instead of "on"
       -                if ( dest.value !== src.value ) {
       -                        dest.value = src.value;
       +        if ( l ) {
       +                fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
       +                first = fragment.firstChild;
       +
       +                if ( fragment.childNodes.length === 1 ) {
       +                        fragment = first;
                        }
        
       -        // IE6-8 fails to return the selected option to the default selected
       -        // state when cloning options
       -        } else if ( nodeName === "option" ) {
       -                dest.selected = src.defaultSelected;
       +                // Require either new content or an interest in ignored elements to invoke the callback
       +                if ( first || ignored ) {
       +                        scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
       +                        hasScripts = scripts.length;
        
       -        // IE6-8 fails to set the defaultValue to the correct value when
       -        // cloning other types of input fields
       -        } else if ( nodeName === "input" || nodeName === "textarea" ) {
       -                dest.defaultValue = src.defaultValue;
       +                        // Use the original fragment for the last item
       +                        // instead of the first because it can end up
       +                        // being emptied incorrectly in certain situations (#8070).
       +                        for ( ; i < l; i++ ) {
       +                                node = fragment;
        
       -        // IE blanks contents when cloning scripts
       -        } else if ( nodeName === "script" && dest.text !== src.text ) {
       -                dest.text = src.text;
       -        }
       +                                if ( i !== iNoClone ) {
       +                                        node = jQuery.clone( node, true, true );
        
       -        // Event data gets referenced instead of copied if the expando
       -        // gets copied too
       -        dest.removeAttribute( jQuery.expando );
       +                                        // Keep references to cloned scripts for later restoration
       +                                        if ( hasScripts ) {
        
       -        // Clear flags for bubbling special change/submit events, they must
       -        // be reattached when the newly cloned events are first activated
       -        dest.removeAttribute( "_submit_attached" );
       -        dest.removeAttribute( "_change_attached" );
       -}
       +                                                // Support: Android <=4.0 only, PhantomJS 1 only
       +                                                // push.apply(_, arraylike) throws on ancient WebKit
       +                                                jQuery.merge( scripts, getAll( node, "script" ) );
       +                                        }
       +                                }
        
       -jQuery.buildFragment = function( args, nodes, scripts ) {
       -        var fragment, cacheable, cacheresults, doc,
       -        first = args[ 0 ];
       +                                callback.call( collection[ i ], node, i );
       +                        }
        
       -        // nodes may contain either an explicit document object,
       -        // a jQuery collection or context object.
       -        // If nodes[0] contains a valid object to assign to doc
       -        if ( nodes && nodes[0] ) {
       -                doc = nodes[0].ownerDocument || nodes[0];
       -        }
       +                        if ( hasScripts ) {
       +                                doc = scripts[ scripts.length - 1 ].ownerDocument;
        
       -        // Ensure that an attr object doesn't incorrectly stand in as a document object
       -        // Chrome and Firefox seem to allow this to occur and will throw exception
       -        // Fixes #8950
       -        if ( !doc.createDocumentFragment ) {
       -                doc = document;
       -        }
       +                                // Reenable scripts
       +                                jQuery.map( scripts, restoreScript );
        
       -        // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
       -        // Cloning options loses the selected state, so don't cache them
       -        // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
       -        // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
       -        // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
       -        if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
       -                first.charAt(0) === "<" && !rnocache.test( first ) &&
       -                (jQuery.support.checkClone || !rchecked.test( first )) &&
       -                (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
       +                                // Evaluate executable scripts on first document insertion
       +                                for ( i = 0; i < hasScripts; i++ ) {
       +                                        node = scripts[ i ];
       +                                        if ( rscriptType.test( node.type || "" ) &&
       +                                                !dataPriv.access( node, "globalEval" ) &&
       +                                                jQuery.contains( doc, node ) ) {
        
       -                cacheable = true;
       +                                                if ( node.src ) {
        
       -                cacheresults = jQuery.fragments[ first ];
       -                if ( cacheresults && cacheresults !== 1 ) {
       -                        fragment = cacheresults;
       +                                                        // Optional AJAX dependency, but won't run scripts if not present
       +                                                        if ( jQuery._evalUrl ) {
       +                                                                jQuery._evalUrl( node.src );
       +                                                        }
       +                                                } else {
       +                                                        DOMEval( node.textContent.replace( rcleanScript, "" ), doc );
       +                                                }
       +                                        }
       +                                }
       +                        }
                        }
                }
        
       -        if ( !fragment ) {
       -                fragment = doc.createDocumentFragment();
       -                jQuery.clean( args, doc, fragment, scripts );
       -        }
       -
       -        if ( cacheable ) {
       -                jQuery.fragments[ first ] = cacheresults ? fragment : 1;
       -        }
       -
       -        return { fragment: fragment, cacheable: cacheable };
       -};
       -
       -jQuery.fragments = {};
       +        return collection;
       +}
        
       -jQuery.each({
       -        appendTo: "append",
       -        prependTo: "prepend",
       -        insertBefore: "before",
       -        insertAfter: "after",
       -        replaceAll: "replaceWith"
       -}, function( name, original ) {
       -        jQuery.fn[ name ] = function( selector ) {
       -                var ret = [],
       -                        insert = jQuery( selector ),
       -                        parent = this.length === 1 && this[0].parentNode;
       +function remove( elem, selector, keepData ) {
       +        var node,
       +                nodes = selector ? jQuery.filter( selector, elem ) : elem,
       +                i = 0;
        
       -                if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
       -                        insert[ original ]( this[0] );
       -                        return this;
       +        for ( ; ( node = nodes[ i ] ) != null; i++ ) {
       +                if ( !keepData && node.nodeType === 1 ) {
       +                        jQuery.cleanData( getAll( node ) );
       +                }
        
       -                } else {
       -                        for ( var i = 0, l = insert.length; i < l; i++ ) {
       -                                var elems = ( i > 0 ? this.clone(true) : this ).get();
       -                                jQuery( insert[i] )[ original ]( elems );
       -                                ret = ret.concat( elems );
       +                if ( node.parentNode ) {
       +                        if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
       +                                setGlobalEval( getAll( node, "script" ) );
                                }
       -
       -                        return this.pushStack( ret, name, insert.selector );
       +                        node.parentNode.removeChild( node );
                        }
       -        };
       -});
       -
       -function getAll( elem ) {
       -        if ( typeof elem.getElementsByTagName !== "undefined" ) {
       -                return elem.getElementsByTagName( "*" );
       -
       -        } else if ( typeof elem.querySelectorAll !== "undefined" ) {
       -                return elem.querySelectorAll( "*" );
       -
       -        } else {
       -                return [];
                }
       -}
        
       -// Used in clean, fixes the defaultChecked property
       -function fixDefaultChecked( elem ) {
       -        if ( elem.type === "checkbox" || elem.type === "radio" ) {
       -                elem.defaultChecked = elem.checked;
       -        }
       -}
       -// Finds all inputs and passes them to fixDefaultChecked
       -function findInputs( elem ) {
       -        var nodeName = ( elem.nodeName || "" ).toLowerCase();
       -        if ( nodeName === "input" ) {
       -                fixDefaultChecked( elem );
       -        // Skip scripts, get other children
       -        } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
       -                jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
       -        }
       +        return elem;
        }
        
       -// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
       -function shimCloneNode( elem ) {
       -        var div = document.createElement( "div" );
       -        safeFragment.appendChild( div );
       -
       -        div.innerHTML = elem.outerHTML;
       -        return div.firstChild;
       -}
       +jQuery.extend( {
       +        htmlPrefilter: function( html ) {
       +                return html.replace( rxhtmlTag, "<$1></$2>" );
       +        },
        
       -jQuery.extend({
                clone: function( elem, dataAndEvents, deepDataAndEvents ) {
       -                var srcElements,
       -                        destElements,
       -                        i,
       -                        // IE<=8 does not properly clone detached, unknown element nodes
       -                        clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ?
       -                                elem.cloneNode( true ) :
       -                                shimCloneNode( elem );
       -
       -                if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
       -                                (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
       -                        // IE copies events bound via attachEvent when using cloneNode.
       -                        // Calling detachEvent on the clone will also remove the events
       -                        // from the original. In order to get around this, we use some
       -                        // proprietary methods to clear the events. Thanks to MooTools
       -                        // guys for this hotness.
       -
       -                        cloneFixAttributes( elem, clone );
       -
       -                        // Using Sizzle here is crazy slow, so we use getElementsByTagName instead
       -                        srcElements = getAll( elem );
       +                var i, l, srcElements, destElements,
       +                        clone = elem.cloneNode( true ),
       +                        inPage = jQuery.contains( elem.ownerDocument, elem );
       +
       +                // Fix IE cloning issues
       +                if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
       +                                !jQuery.isXMLDoc( elem ) ) {
       +
       +                        // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
                                destElements = getAll( clone );
       +                        srcElements = getAll( elem );
        
       -                        // Weird iteration because IE will replace the length property
       -                        // with an element if you are cloning the body and one of the
       -                        // elements on the page has a name or id of "length"
       -                        for ( i = 0; srcElements[i]; ++i ) {
       -                                // Ensure that the destination node is not null; Fixes #9587
       -                                if ( destElements[i] ) {
       -                                        cloneFixAttributes( srcElements[i], destElements[i] );
       -                                }
       +                        for ( i = 0, l = srcElements.length; i < l; i++ ) {
       +                                fixInput( srcElements[ i ], destElements[ i ] );
                                }
                        }
        
                        // Copy the events from the original to the clone
                        if ( dataAndEvents ) {
       -                        cloneCopyEvent( elem, clone );
       -
                                if ( deepDataAndEvents ) {
       -                                srcElements = getAll( elem );
       -                                destElements = getAll( clone );
       +                                srcElements = srcElements || getAll( elem );
       +                                destElements = destElements || getAll( clone );
        
       -                                for ( i = 0; srcElements[i]; ++i ) {
       -                                        cloneCopyEvent( srcElements[i], destElements[i] );
       +                                for ( i = 0, l = srcElements.length; i < l; i++ ) {
       +                                        cloneCopyEvent( srcElements[ i ], destElements[ i ] );
                                        }
       +                        } else {
       +                                cloneCopyEvent( elem, clone );
                                }
                        }
        
       -                srcElements = destElements = null;
       +                // Preserve script evaluation history
       +                destElements = getAll( clone, "script" );
       +                if ( destElements.length > 0 ) {
       +                        setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
       +                }
        
                        // Return the cloned set
                        return clone;
                },
        
       -        clean: function( elems, context, fragment, scripts ) {
       -                var checkScriptType, script, j,
       -                                ret = [];
       -
       -                context = context || document;
       -
       -                // !context.createElement fails in IE with an error but returns typeof 'object'
       -                if ( typeof context.createElement === "undefined" ) {
       -                        context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
       -                }
       -
       -                for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
       -                        if ( typeof elem === "number" ) {
       -                                elem += "";
       -                        }
       -
       -                        if ( !elem ) {
       -                                continue;
       -                        }
       -
       -                        // Convert html string into DOM nodes
       -                        if ( typeof elem === "string" ) {
       -                                if ( !rhtml.test( elem ) ) {
       -                                        elem = context.createTextNode( elem );
       -                                } else {
       -                                        // Fix "XHTML"-style tags in all browsers
       -                                        elem = elem.replace(rxhtmlTag, "<$1></$2>");
       -
       -                                        // Trim whitespace, otherwise indexOf won't work as expected
       -                                        var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
       -                                                wrap = wrapMap[ tag ] || wrapMap._default,
       -                                                depth = wrap[0],
       -                                                div = context.createElement("div"),
       -                                                safeChildNodes = safeFragment.childNodes,
       -                                                remove;
       -
       -                                        // Append wrapper element to unknown element safe doc fragment
       -                                        if ( context === document ) {
       -                                                // Use the fragment we've already created for this document
       -                                                safeFragment.appendChild( div );
       -                                        } else {
       -                                                // Use a fragment created with the owner document
       -                                                createSafeFragment( context ).appendChild( div );
       -                                        }
       -
       -                                        // Go to html and back, then peel off extra wrappers
       -                                        div.innerHTML = wrap[1] + elem + wrap[2];
       -
       -                                        // Move to the right depth
       -                                        while ( depth-- ) {
       -                                                div = div.lastChild;
       -                                        }
       -
       -                                        // Remove IE's autoinserted <tbody> from table fragments
       -                                        if ( !jQuery.support.tbody ) {
       -
       -                                                // String was a <table>, *may* have spurious <tbody>
       -                                                var hasBody = rtbody.test(elem),
       -                                                        tbody = tag === "table" && !hasBody ?
       -                                                                div.firstChild && div.firstChild.childNodes :
       +        cleanData: function( elems ) {
       +                var data, elem, type,
       +                        special = jQuery.event.special,
       +                        i = 0;
        
       -                                                                // String was a bare <thead> or <tfoot>
       -                                                                wrap[1] === "<table>" && !hasBody ?
       -                                                                        div.childNodes :
       -                                                                        [];
       +                for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
       +                        if ( acceptData( elem ) ) {
       +                                if ( ( data = elem[ dataPriv.expando ] ) ) {
       +                                        if ( data.events ) {
       +                                                for ( type in data.events ) {
       +                                                        if ( special[ type ] ) {
       +                                                                jQuery.event.remove( elem, type );
        
       -                                                for ( j = tbody.length - 1; j >= 0 ; --j ) {
       -                                                        if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
       -                                                                tbody[ j ].parentNode.removeChild( tbody[ j ] );
       +                                                        // This is a shortcut to avoid jQuery.event.remove's overhead
       +                                                        } else {
       +                                                                jQuery.removeEvent( elem, type, data.handle );
                                                                }
                                                        }
                                                }
        
       -                                        // IE completely kills leading whitespace when innerHTML is used
       -                                        if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
       -                                                div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
       -                                        }
       +                                        // Support: Chrome <=35 - 45+
       +                                        // Assign undefined instead of using delete, see Data#remove
       +                                        elem[ dataPriv.expando ] = undefined;
       +                                }
       +                                if ( elem[ dataUser.expando ] ) {
        
       -                                        elem = div.childNodes;
       +                                        // Support: Chrome <=35 - 45+
       +                                        // Assign undefined instead of using delete, see Data#remove
       +                                        elem[ dataUser.expando ] = undefined;
       +                                }
       +                        }
       +                }
       +        }
       +} );
        
       -                                        // Clear elements from DocumentFragment (safeFragment or otherwise)
       -                                        // to avoid hoarding elements. Fixes #11356
       -                                        if ( div ) {
       -                                                div.parentNode.removeChild( div );
       +jQuery.fn.extend( {
       +        detach: function( selector ) {
       +                return remove( this, selector, true );
       +        },
        
       -                                                // Guard against -1 index exceptions in FF3.6
       -                                                if ( safeChildNodes.length > 0 ) {
       -                                                        remove = safeChildNodes[ safeChildNodes.length - 1 ];
       +        remove: function( selector ) {
       +                return remove( this, selector );
       +        },
        
       -                                                        if ( remove && remove.parentNode ) {
       -                                                                remove.parentNode.removeChild( remove );
       -                                                        }
       -                                                }
       +        text: function( value ) {
       +                return access( this, function( value ) {
       +                        return value === undefined ?
       +                                jQuery.text( this ) :
       +                                this.empty().each( function() {
       +                                        if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
       +                                                this.textContent = value;
                                                }
       -                                }
       +                                } );
       +                }, null, value, arguments.length );
       +        },
       +
       +        append: function() {
       +                return domManip( this, arguments, function( elem ) {
       +                        if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
       +                                var target = manipulationTarget( this, elem );
       +                                target.appendChild( elem );
                                }
       +                } );
       +        },
        
       -                        // Resets defaultChecked for any radios and checkboxes
       -                        // about to be appended to the DOM in IE 6/7 (#8060)
       -                        var len;
       -                        if ( !jQuery.support.appendChecked ) {
       -                                if ( elem[0] && typeof (len = elem.length) === "number" ) {
       -                                        for ( j = 0; j < len; j++ ) {
       -                                                findInputs( elem[j] );
       -                                        }
       -                                } else {
       -                                        findInputs( elem );
       -                                }
       +        prepend: function() {
       +                return domManip( this, arguments, function( elem ) {
       +                        if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
       +                                var target = manipulationTarget( this, elem );
       +                                target.insertBefore( elem, target.firstChild );
                                }
       +                } );
       +        },
        
       -                        if ( elem.nodeType ) {
       -                                ret.push( elem );
       -                        } else {
       -                                ret = jQuery.merge( ret, elem );
       +        before: function() {
       +                return domManip( this, arguments, function( elem ) {
       +                        if ( this.parentNode ) {
       +                                this.parentNode.insertBefore( elem, this );
                                }
       -                }
       +                } );
       +        },
        
       -                if ( fragment ) {
       -                        checkScriptType = function( elem ) {
       -                                return !elem.type || rscriptType.test( elem.type );
       -                        };
       -                        for ( i = 0; ret[i]; i++ ) {
       -                                script = ret[i];
       -                                if ( scripts && jQuery.nodeName( script, "script" ) && (!script.type || rscriptType.test( script.type )) ) {
       -                                        scripts.push( script.parentNode ? script.parentNode.removeChild( script ) : script );
       +        after: function() {
       +                return domManip( this, arguments, function( elem ) {
       +                        if ( this.parentNode ) {
       +                                this.parentNode.insertBefore( elem, this.nextSibling );
       +                        }
       +                } );
       +        },
        
       -                                } else {
       -                                        if ( script.nodeType === 1 ) {
       -                                                var jsTags = jQuery.grep( script.getElementsByTagName( "script" ), checkScriptType );
       +        empty: function() {
       +                var elem,
       +                        i = 0;
        
       -                                                ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
       -                                        }
       -                                        fragment.appendChild( script );
       -                                }
       +                for ( ; ( elem = this[ i ] ) != null; i++ ) {
       +                        if ( elem.nodeType === 1 ) {
       +
       +                                // Prevent memory leaks
       +                                jQuery.cleanData( getAll( elem, false ) );
       +
       +                                // Remove any remaining nodes
       +                                elem.textContent = "";
                                }
                        }
        
       -                return ret;
       +                return this;
                },
        
       -        cleanData: function( elems ) {
       -                var data, id,
       -                        cache = jQuery.cache,
       -                        special = jQuery.event.special,
       -                        deleteExpando = jQuery.support.deleteExpando;
       +        clone: function( dataAndEvents, deepDataAndEvents ) {
       +                dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
       +                deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
        
       -                for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
       -                        if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
       -                                continue;
       +                return this.map( function() {
       +                        return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
       +                } );
       +        },
       +
       +        html: function( value ) {
       +                return access( this, function( value ) {
       +                        var elem = this[ 0 ] || {},
       +                                i = 0,
       +                                l = this.length;
       +
       +                        if ( value === undefined && elem.nodeType === 1 ) {
       +                                return elem.innerHTML;
                                }
        
       -                        id = elem[ jQuery.expando ];
       +                        // See if we can take a shortcut and just use innerHTML
       +                        if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
       +                                !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
        
       -                        if ( id ) {
       -                                data = cache[ id ];
       +                                value = jQuery.htmlPrefilter( value );
        
       -                                if ( data && data.events ) {
       -                                        for ( var type in data.events ) {
       -                                                if ( special[ type ] ) {
       -                                                        jQuery.event.remove( elem, type );
       +                                try {
       +                                        for ( ; i < l; i++ ) {
       +                                                elem = this[ i ] || {};
        
       -                                                // This is a shortcut to avoid jQuery.event.remove's overhead
       -                                                } else {
       -                                                        jQuery.removeEvent( elem, type, data.handle );
       +                                                // Remove element nodes and prevent memory leaks
       +                                                if ( elem.nodeType === 1 ) {
       +                                                        jQuery.cleanData( getAll( elem, false ) );
       +                                                        elem.innerHTML = value;
                                                        }
                                                }
        
       -                                        // Null the DOM reference to avoid IE6/7/8 leak (#7054)
       -                                        if ( data.handle ) {
       -                                                data.handle.elem = null;
       -                                        }
       -                                }
       +                                        elem = 0;
        
       -                                if ( deleteExpando ) {
       -                                        delete elem[ jQuery.expando ];
       +                                // If using innerHTML throws an exception, use the fallback method
       +                                } catch ( e ) {}
       +                        }
        
       -                                } else if ( elem.removeAttribute ) {
       -                                        elem.removeAttribute( jQuery.expando );
       -                                }
       +                        if ( elem ) {
       +                                this.empty().append( value );
       +                        }
       +                }, null, value, arguments.length );
       +        },
        
       -                                delete cache[ id ];
       +        replaceWith: function() {
       +                var ignored = [];
       +
       +                // Make the changes, replacing each non-ignored context element with the new content
       +                return domManip( this, arguments, function( elem ) {
       +                        var parent = this.parentNode;
       +
       +                        if ( jQuery.inArray( this, ignored ) < 0 ) {
       +                                jQuery.cleanData( getAll( this ) );
       +                                if ( parent ) {
       +                                        parent.replaceChild( elem, this );
       +                                }
                                }
       -                }
       +
       +                // Force callback invocation
       +                }, ignored );
                }
       -});
       +} );
        
       +jQuery.each( {
       +        appendTo: "append",
       +        prependTo: "prepend",
       +        insertBefore: "before",
       +        insertAfter: "after",
       +        replaceAll: "replaceWith"
       +}, function( name, original ) {
       +        jQuery.fn[ name ] = function( selector ) {
       +                var elems,
       +                        ret = [],
       +                        insert = jQuery( selector ),
       +                        last = insert.length - 1,
       +                        i = 0;
        
       +                for ( ; i <= last; i++ ) {
       +                        elems = i === last ? this : this.clone( true );
       +                        jQuery( insert[ i ] )[ original ]( elems );
        
       +                        // Support: Android <=4.0 only, PhantomJS 1 only
       +                        // .get() because push.apply(_, arraylike) throws on ancient WebKit
       +                        push.apply( ret, elems.get() );
       +                }
        
       -var ralpha = /alpha\([^)]*\)/i,
       -        ropacity = /opacity=([^)]*)/,
       -        // fixed for IE9, see #8346
       -        rupper = /([A-Z]|^ms)/g,
       -        rnum = /^[\-+]?(?:\d*\.)?\d+$/i,
       -        rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,
       -        rrelNum = /^([\-+])=([\-+.\de]+)/,
       -        rmargin = /^margin/,
       +                return this.pushStack( ret );
       +        };
       +} );
       +var rmargin = ( /^margin/ );
        
       -        cssShow = { position: "absolute", visibility: "hidden", display: "block" },
       +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
        
       -        // order is important!
       -        cssExpand = [ "Top", "Right", "Bottom", "Left" ],
       +var getStyles = function( elem ) {
        
       -        curCSS,
       +                // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
       +                // IE throws on elements created in popups
       +                // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
       +                var view = elem.ownerDocument.defaultView;
        
       -        getComputedStyle,
       -        currentStyle;
       +                if ( !view || !view.opener ) {
       +                        view = window;
       +                }
        
       -jQuery.fn.css = function( name, value ) {
       -        return jQuery.access( this, function( elem, name, value ) {
       -                return value !== undefined ?
       -                        jQuery.style( elem, name, value ) :
       -                        jQuery.css( elem, name );
       -        }, name, value, arguments.length > 1 );
       -};
       +                return view.getComputedStyle( elem );
       +        };
        
       -jQuery.extend({
       -        // Add in style property hooks for overriding the default
       -        // behavior of getting and setting a style property
       -        cssHooks: {
       -                opacity: {
       -                        get: function( elem, computed ) {
       -                                if ( computed ) {
       -                                        // We should always get a number back from opacity
       -                                        var ret = curCSS( elem, "opacity" );
       -                                        return ret === "" ? "1" : ret;
        
       -                                } else {
       -                                        return elem.style.opacity;
       -                                }
       -                        }
       -                }
       -        },
        
       -        // Exclude the following css properties to add px
       -        cssNumber: {
       -                "fillOpacity": true,
       -                "fontWeight": true,
       -                "lineHeight": true,
       -                "opacity": true,
       -                "orphans": true,
       -                "widows": true,
       -                "zIndex": true,
       -                "zoom": true
       -        },
       +( function() {
        
       -        // Add in properties whose names you wish to fix before
       -        // setting or getting the value
       -        cssProps: {
       -                // normalize float css property
       -                "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
       -        },
       +        // Executing both pixelPosition & boxSizingReliable tests require only one layout
       +        // so they're executed at the same time to save the second computation.
       +        function computeStyleTests() {
        
       -        // Get and set the style property on a DOM Node
       -        style: function( elem, name, value, extra ) {
       -                // Don't set styles on text and comment nodes
       -                if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
       +                // This is a singleton, we need to execute it only once
       +                if ( !div ) {
                                return;
                        }
        
       -                // Make sure that we're working with the right name
       -                var ret, type, origName = jQuery.camelCase( name ),
       -                        style = elem.style, hooks = jQuery.cssHooks[ origName ];
       +                div.style.cssText =
       +                        "box-sizing:border-box;" +
       +                        "position:relative;display:block;" +
       +                        "margin:auto;border:1px;padding:1px;" +
       +                        "top:1%;width:50%";
       +                div.innerHTML = "";
       +                documentElement.appendChild( container );
        
       -                name = jQuery.cssProps[ origName ] || origName;
       +                var divStyle = window.getComputedStyle( div );
       +                pixelPositionVal = divStyle.top !== "1%";
        
       -                // Check if we're setting a value
       -                if ( value !== undefined ) {
       -                        type = typeof value;
       +                // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
       +                reliableMarginLeftVal = divStyle.marginLeft === "2px";
       +                boxSizingReliableVal = divStyle.width === "4px";
        
       -                        // convert relative number strings (+= or -=) to relative numbers. #7345
       -                        if ( type === "string" && (ret = rrelNum.exec( value )) ) {
       -                                value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
       -                                // Fixes bug #9237
       -                                type = "number";
       -                        }
       +                // Support: Android 4.0 - 4.3 only
       +                // Some styles come back with percentage values, even though they shouldn't
       +                div.style.marginRight = "50%";
       +                pixelMarginRightVal = divStyle.marginRight === "4px";
        
       -                        // Make sure that NaN and null values aren't set. See: #7116
       -                        if ( value == null || type === "number" && isNaN( value ) ) {
       -                                return;
       -                        }
       +                documentElement.removeChild( container );
        
       -                        // If a number was passed in, add 'px' to the (except for certain CSS properties)
       -                        if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
       -                                value += "px";
       -                        }
       +                // Nullify the div so it wouldn't be stored in the memory and
       +                // it will also be a sign that checks already performed
       +                div = null;
       +        }
        
       -                        // If a hook was provided, use that value, otherwise just set the specified value
       -                        if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
       -                                // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
       -                                // Fixes bug #5509
       -                                try {
       -                                        style[ name ] = value;
       -                                } catch(e) {}
       -                        }
       +        var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
       +                container = document.createElement( "div" ),
       +                div = document.createElement( "div" );
        
       -                } else {
       -                        // If a hook was provided get the non-computed value from there
       -                        if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
       -                                return ret;
       -                        }
       +        // Finish early in limited (non-browser) environments
       +        if ( !div.style ) {
       +                return;
       +        }
        
       -                        // Otherwise just get the value from the style object
       -                        return style[ name ];
       +        // Support: IE <=9 - 11 only
       +        // Style of cloned element affects source element cloned (#8908)
       +        div.style.backgroundClip = "content-box";
       +        div.cloneNode( true ).style.backgroundClip = "";
       +        support.clearCloneStyle = div.style.backgroundClip === "content-box";
       +
       +        container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
       +                "padding:0;margin-top:1px;position:absolute";
       +        container.appendChild( div );
       +
       +        jQuery.extend( support, {
       +                pixelPosition: function() {
       +                        computeStyleTests();
       +                        return pixelPositionVal;
       +                },
       +                boxSizingReliable: function() {
       +                        computeStyleTests();
       +                        return boxSizingReliableVal;
       +                },
       +                pixelMarginRight: function() {
       +                        computeStyleTests();
       +                        return pixelMarginRightVal;
       +                },
       +                reliableMarginLeft: function() {
       +                        computeStyleTests();
       +                        return reliableMarginLeftVal;
                        }
       -        },
       +        } );
       +} )();
        
       -        css: function( elem, name, extra ) {
       -                var ret, hooks;
        
       -                // Make sure that we're working with the right name
       -                name = jQuery.camelCase( name );
       -                hooks = jQuery.cssHooks[ name ];
       -                name = jQuery.cssProps[ name ] || name;
       +function curCSS( elem, name, computed ) {
       +        var width, minWidth, maxWidth, ret,
       +                style = elem.style;
        
       -                // cssFloat needs a special treatment
       -                if ( name === "cssFloat" ) {
       -                        name = "float";
       -                }
       +        computed = computed || getStyles( elem );
        
       -                // If a hook was provided get the computed value from there
       -                if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
       -                        return ret;
       +        // Support: IE <=9 only
       +        // getPropertyValue is only needed for .css('filter') (#12537)
       +        if ( computed ) {
       +                ret = computed.getPropertyValue( name ) || computed[ name ];
        
       -                // Otherwise, if a way to get the computed value exists, use that
       -                } else if ( curCSS ) {
       -                        return curCSS( elem, name );
       +                if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
       +                        ret = jQuery.style( elem, name );
                        }
       -        },
        
       -        // A method for quickly swapping in/out CSS properties to get correct calculations
       -        swap: function( elem, options, callback ) {
       -                var old = {},
       -                        ret, name;
       +                // A tribute to the "awesome hack by Dean Edwards"
       +                // Android Browser returns percentage for some values,
       +                // but width seems to be reliably pixels.
       +                // This is against the CSSOM draft spec:
       +                // https://drafts.csswg.org/cssom/#resolved-values
       +                if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
        
       -                // Remember the old values, and insert the new ones
       -                for ( name in options ) {
       -                        old[ name ] = elem.style[ name ];
       -                        elem.style[ name ] = options[ name ];
       -                }
       +                        // Remember the original values
       +                        width = style.width;
       +                        minWidth = style.minWidth;
       +                        maxWidth = style.maxWidth;
        
       -                ret = callback.call( elem );
       +                        // Put in the new values to get a computed value out
       +                        style.minWidth = style.maxWidth = style.width = ret;
       +                        ret = computed.width;
        
       -                // Revert the old values
       -                for ( name in options ) {
       -                        elem.style[ name ] = old[ name ];
       +                        // Revert the changed values
       +                        style.width = width;
       +                        style.minWidth = minWidth;
       +                        style.maxWidth = maxWidth;
                        }
       -
       -                return ret;
                }
       -});
        
       -// DEPRECATED in 1.3, Use jQuery.css() instead
       -jQuery.curCSS = jQuery.css;
       +        return ret !== undefined ?
       +
       +                // Support: IE <=9 - 11 only
       +                // IE returns zIndex value as an integer.
       +                ret + "" :
       +                ret;
       +}
        
       -if ( document.defaultView && document.defaultView.getComputedStyle ) {
       -        getComputedStyle = function( elem, name ) {
       -                var ret, defaultView, computedStyle, width,
       -                        style = elem.style;
        
       -                name = name.replace( rupper, "-$1" ).toLowerCase();
       +function addGetHookIf( conditionFn, hookFn ) {
        
       -                if ( (defaultView = elem.ownerDocument.defaultView) &&
       -                                (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
       +        // Define the hook, we'll check on the first run if it's really needed.
       +        return {
       +                get: function() {
       +                        if ( conditionFn() ) {
        
       -                        ret = computedStyle.getPropertyValue( name );
       -                        if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
       -                                ret = jQuery.style( elem, name );
       +                                // Hook not needed (or it's not possible to use it due
       +                                // to missing dependency), remove it.
       +                                delete this.get;
       +                                return;
                                }
       -                }
        
       -                // A tribute to the "awesome hack by Dean Edwards"
       -                // WebKit uses "computed value (percentage if specified)" instead of "used value" for margins
       -                // which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
       -                if ( !jQuery.support.pixelMargin && computedStyle && rmargin.test( name ) && rnumnonpx.test( ret ) ) {
       -                        width = style.width;
       -                        style.width = ret;
       -                        ret = computedStyle.width;
       -                        style.width = width;
       +                        // Hook needed; redefine it so that the support test is not executed again.
       +                        return ( this.get = hookFn ).apply( this, arguments );
                        }
       -
       -                return ret;
                };
        }
        
       -if ( document.documentElement.currentStyle ) {
       -        currentStyle = function( elem, name ) {
       -                var left, rsLeft, uncomputed,
       -                        ret = elem.currentStyle && elem.currentStyle[ name ],
       -                        style = elem.style;
        
       -                // Avoid setting ret to empty string here
       -                // so we don't default to auto
       -                if ( ret == null && style && (uncomputed = style[ name ]) ) {
       -                        ret = uncomputed;
       -                }
       +var
        
       -                // From the awesome hack by Dean Edwards
       -                // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
       +        // Swappable if display is none or starts with table
       +        // except "table", "table-cell", or "table-caption"
       +        // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
       +        rdisplayswap = /^(none|table(?!-c[ea]).+)/,
       +        cssShow = { position: "absolute", visibility: "hidden", display: "block" },
       +        cssNormalTransform = {
       +                letterSpacing: "0",
       +                fontWeight: "400"
       +        },
        
       -                // If we're not dealing with a regular pixel number
       -                // but a number that has a weird ending, we need to convert it to pixels
       -                if ( rnumnonpx.test( ret ) ) {
       +        cssPrefixes = [ "Webkit", "Moz", "ms" ],
       +        emptyStyle = document.createElement( "div" ).style;
        
       -                        // Remember the original values
       -                        left = style.left;
       -                        rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
       +// Return a css property mapped to a potentially vendor prefixed property
       +function vendorPropName( name ) {
        
       -                        // Put in the new values to get a computed value out
       -                        if ( rsLeft ) {
       -                                elem.runtimeStyle.left = elem.currentStyle.left;
       -                        }
       -                        style.left = name === "fontSize" ? "1em" : ret;
       -                        ret = style.pixelLeft + "px";
       +        // Shortcut for names that are not vendor prefixed
       +        if ( name in emptyStyle ) {
       +                return name;
       +        }
        
       -                        // Revert the changed values
       -                        style.left = left;
       -                        if ( rsLeft ) {
       -                                elem.runtimeStyle.left = rsLeft;
       -                        }
       +        // Check for vendor prefixed names
       +        var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
       +                i = cssPrefixes.length;
       +
       +        while ( i-- ) {
       +                name = cssPrefixes[ i ] + capName;
       +                if ( name in emptyStyle ) {
       +                        return name;
                        }
       +        }
       +}
        
       -                return ret === "" ? "auto" : ret;
       -        };
       +function setPositiveNumber( elem, value, subtract ) {
       +
       +        // Any relative (+/-) values have already been
       +        // normalized at this point
       +        var matches = rcssNum.exec( value );
       +        return matches ?
       +
       +                // Guard against undefined "subtract", e.g., when used as in cssHooks
       +                Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
       +                value;
        }
        
       -curCSS = getComputedStyle || currentStyle;
       +function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
       +        var i,
       +                val = 0;
        
       -function getWidthOrHeight( elem, name, extra ) {
       +        // If we already have the right measurement, avoid augmentation
       +        if ( extra === ( isBorderBox ? "border" : "content" ) ) {
       +                i = 4;
        
       -        // Start with offset property
       -        var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
       -                i = name === "width" ? 1 : 0,
       -                len = 4;
       +        // Otherwise initialize for horizontal or vertical properties
       +        } else {
       +                i = name === "width" ? 1 : 0;
       +        }
        
       -        if ( val > 0 ) {
       -                if ( extra !== "border" ) {
       -                        for ( ; i < len; i += 2 ) {
       -                                if ( !extra ) {
       -                                        val -= parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
       -                                }
       -                                if ( extra === "margin" ) {
       -                                        val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ] ) ) || 0;
       -                                } else {
       -                                        val -= parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
       -                                }
       -                        }
       +        for ( ; i < 4; i += 2 ) {
       +
       +                // Both box models exclude margin, so add it if we want it
       +                if ( extra === "margin" ) {
       +                        val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
                        }
        
       -                return val + "px";
       -        }
       +                if ( isBorderBox ) {
        
       -        // Fall back to computed then uncomputed css if necessary
       -        val = curCSS( elem, name );
       -        if ( val < 0 || val == null ) {
       -                val = elem.style[ name ];
       -        }
       +                        // border-box includes padding, so remove it if we want content
       +                        if ( extra === "content" ) {
       +                                val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
       +                        }
        
       -        // Computed unit is not pixels. Stop here and return.
       -        if ( rnumnonpx.test(val) ) {
       -                return val;
       -        }
       +                        // At this point, extra isn't border nor margin, so remove border
       +                        if ( extra !== "margin" ) {
       +                                val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
       +                        }
       +                } else {
        
       -        // Normalize "", auto, and prepare for extra
       -        val = parseFloat( val ) || 0;
       +                        // At this point, extra isn't content, so add padding
       +                        val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
        
       -        // Add padding, border, margin
       -        if ( extra ) {
       -                for ( ; i < len; i += 2 ) {
       -                        val += parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
       +                        // At this point, extra isn't content nor padding, so add border
                                if ( extra !== "padding" ) {
       -                                val += parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
       -                        }
       -                        if ( extra === "margin" ) {
       -                                val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ]) ) || 0;
       +                                val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
                                }
                        }
                }
        
       -        return val + "px";
       +        return val;
        }
        
       -jQuery.each([ "height", "width" ], function( i, name ) {
       -        jQuery.cssHooks[ name ] = {
       -                get: function( elem, computed, extra ) {
       -                        if ( computed ) {
       -                                if ( elem.offsetWidth !== 0 ) {
       -                                        return getWidthOrHeight( elem, name, extra );
       -                                } else {
       -                                        return jQuery.swap( elem, cssShow, function() {
       -                                                return getWidthOrHeight( elem, name, extra );
       -                                        });
       -                                }
       -                        }
       -                },
       +function getWidthOrHeight( elem, name, extra ) {
        
       -                set: function( elem, value ) {
       -                        return rnum.test( value ) ?
       -                                value + "px" :
       -                                value;
       +        // Start with offset property, which is equivalent to the border-box value
       +        var val,
       +                valueIsBorderBox = true,
       +                styles = getStyles( elem ),
       +                isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
       +
       +        // Support: IE <=11 only
       +        // Running getBoundingClientRect on a disconnected node
       +        // in IE throws an error.
       +        if ( elem.getClientRects().length ) {
       +                val = elem.getBoundingClientRect()[ name ];
       +        }
       +
       +        // Some non-html elements return undefined for offsetWidth, so check for null/undefined
       +        // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
       +        // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
       +        if ( val <= 0 || val == null ) {
       +
       +                // Fall back to computed then uncomputed css if necessary
       +                val = curCSS( elem, name, styles );
       +                if ( val < 0 || val == null ) {
       +                        val = elem.style[ name ];
                        }
       -        };
       -});
        
       -if ( !jQuery.support.opacity ) {
       -        jQuery.cssHooks.opacity = {
       -                get: function( elem, computed ) {
       -                        // IE uses filters for opacity
       -                        return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
       -                                ( parseFloat( RegExp.$1 ) / 100 ) + "" :
       -                                computed ? "1" : "";
       -                },
       +                // Computed unit is not pixels. Stop here and return.
       +                if ( rnumnonpx.test( val ) ) {
       +                        return val;
       +                }
        
       -                set: function( elem, value ) {
       -                        var style = elem.style,
       -                                currentStyle = elem.currentStyle,
       -                                opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
       -                                filter = currentStyle && currentStyle.filter || style.filter || "";
       +                // Check for style in case a browser which returns unreliable values
       +                // for getComputedStyle silently falls back to the reliable elem.style
       +                valueIsBorderBox = isBorderBox &&
       +                        ( support.boxSizingReliable() || val === elem.style[ name ] );
       +
       +                // Normalize "", auto, and prepare for extra
       +                val = parseFloat( val ) || 0;
       +        }
        
       -                        // IE has trouble with opacity if it does not have layout
       -                        // Force it by setting the zoom level
       -                        style.zoom = 1;
       +        // Use the active box-sizing model to add/subtract irrelevant styles
       +        return ( val +
       +                augmentWidthOrHeight(
       +                        elem,
       +                        name,
       +                        extra || ( isBorderBox ? "border" : "content" ),
       +                        valueIsBorderBox,
       +                        styles
       +                )
       +        ) + "px";
       +}
        
       -                        // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
       -                        if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
       +jQuery.extend( {
        
       -                                // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
       -                                // if "filter:" is present at all, clearType is disabled, we want to avoid this
       -                                // style.removeAttribute is IE Only, but so apparently is this code path...
       -                                style.removeAttribute( "filter" );
       +        // Add in style property hooks for overriding the default
       +        // behavior of getting and setting a style property
       +        cssHooks: {
       +                opacity: {
       +                        get: function( elem, computed ) {
       +                                if ( computed ) {
        
       -                                // if there there is no filter style applied in a css rule, we are done
       -                                if ( currentStyle && !currentStyle.filter ) {
       -                                        return;
       +                                        // We should always get a number back from opacity
       +                                        var ret = curCSS( elem, "opacity" );
       +                                        return ret === "" ? "1" : ret;
                                        }
                                }
       +                }
       +        },
       +
       +        // Don't automatically add "px" to these possibly-unitless properties
       +        cssNumber: {
       +                "animationIterationCount": true,
       +                "columnCount": true,
       +                "fillOpacity": true,
       +                "flexGrow": true,
       +                "flexShrink": true,
       +                "fontWeight": true,
       +                "lineHeight": true,
       +                "opacity": true,
       +                "order": true,
       +                "orphans": true,
       +                "widows": true,
       +                "zIndex": true,
       +                "zoom": true
       +        },
       +
       +        // Add in properties whose names you wish to fix before
       +        // setting or getting the value
       +        cssProps: {
       +                "float": "cssFloat"
       +        },
       +
       +        // Get and set the style property on a DOM Node
       +        style: function( elem, name, value, extra ) {
        
       -                        // otherwise, set new filter values
       -                        style.filter = ralpha.test( filter ) ?
       -                                filter.replace( ralpha, opacity ) :
       -                                filter + " " + opacity;
       +                // Don't set styles on text and comment nodes
       +                if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
       +                        return;
                        }
       -        };
       -}
        
       -jQuery(function() {
       -        // This hook cannot be added until DOM ready because the support test
       -        // for it is not run until after DOM ready
       -        if ( !jQuery.support.reliableMarginRight ) {
       -                jQuery.cssHooks.marginRight = {
       -                        get: function( elem, computed ) {
       -                                // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
       -                                // Work around by temporarily setting element display to inline-block
       -                                return jQuery.swap( elem, { "display": "inline-block" }, function() {
       -                                        if ( computed ) {
       -                                                return curCSS( elem, "margin-right" );
       -                                        } else {
       -                                                return elem.style.marginRight;
       -                                        }
       -                                });
       +                // Make sure that we're working with the right name
       +                var ret, type, hooks,
       +                        origName = jQuery.camelCase( name ),
       +                        style = elem.style;
       +
       +                name = jQuery.cssProps[ origName ] ||
       +                        ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
       +
       +                // Gets hook for the prefixed version, then unprefixed version
       +                hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
       +
       +                // Check if we're setting a value
       +                if ( value !== undefined ) {
       +                        type = typeof value;
       +
       +                        // Convert "+=" or "-=" to relative numbers (#7345)
       +                        if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
       +                                value = adjustCSS( elem, name, ret );
       +
       +                                // Fixes bug #9237
       +                                type = "number";
                                }
       -                };
       +
       +                        // Make sure that null and NaN values aren't set (#7116)
       +                        if ( value == null || value !== value ) {
       +                                return;
       +                        }
       +
       +                        // If a number was passed in, add the unit (except for certain CSS properties)
       +                        if ( type === "number" ) {
       +                                value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
       +                        }
       +
       +                        // background-* props affect original clone's values
       +                        if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
       +                                style[ name ] = "inherit";
       +                        }
       +
       +                        // If a hook was provided, use that value, otherwise just set the specified value
       +                        if ( !hooks || !( "set" in hooks ) ||
       +                                ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
       +
       +                                style[ name ] = value;
       +                        }
       +
       +                } else {
       +
       +                        // If a hook was provided get the non-computed value from there
       +                        if ( hooks && "get" in hooks &&
       +                                ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
       +
       +                                return ret;
       +                        }
       +
       +                        // Otherwise just get the value from the style object
       +                        return style[ name ];
       +                }
       +        },
       +
       +        css: function( elem, name, extra, styles ) {
       +                var val, num, hooks,
       +                        origName = jQuery.camelCase( name );
       +
       +                // Make sure that we're working with the right name
       +                name = jQuery.cssProps[ origName ] ||
       +                        ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
       +
       +                // Try prefixed name followed by the unprefixed name
       +                hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
       +
       +                // If a hook was provided get the computed value from there
       +                if ( hooks && "get" in hooks ) {
       +                        val = hooks.get( elem, true, extra );
       +                }
       +
       +                // Otherwise, if a way to get the computed value exists, use that
       +                if ( val === undefined ) {
       +                        val = curCSS( elem, name, styles );
       +                }
       +
       +                // Convert "normal" to computed value
       +                if ( val === "normal" && name in cssNormalTransform ) {
       +                        val = cssNormalTransform[ name ];
       +                }
       +
       +                // Make numeric if forced or a qualifier was provided and val looks numeric
       +                if ( extra === "" || extra ) {
       +                        num = parseFloat( val );
       +                        return extra === true || isFinite( num ) ? num || 0 : val;
       +                }
       +                return val;
                }
       -});
       +} );
       +
       +jQuery.each( [ "height", "width" ], function( i, name ) {
       +        jQuery.cssHooks[ name ] = {
       +                get: function( elem, computed, extra ) {
       +                        if ( computed ) {
        
       -if ( jQuery.expr && jQuery.expr.filters ) {
       -        jQuery.expr.filters.hidden = function( elem ) {
       -                var width = elem.offsetWidth,
       -                        height = elem.offsetHeight;
       +                                // Certain elements can have dimension info if we invisibly show them
       +                                // but it must have a current display style that would benefit
       +                                return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
       +
       +                                        // Support: Safari 8+
       +                                        // Table columns in Safari have non-zero offsetWidth & zero
       +                                        // getBoundingClientRect().width unless display is changed.
       +                                        // Support: IE <=11 only
       +                                        // Running getBoundingClientRect on a disconnected node
       +                                        // in IE throws an error.
       +                                        ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
       +                                                swap( elem, cssShow, function() {
       +                                                        return getWidthOrHeight( elem, name, extra );
       +                                                } ) :
       +                                                getWidthOrHeight( elem, name, extra );
       +                        }
       +                },
        
       -                return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
       -        };
       +                set: function( elem, value, extra ) {
       +                        var matches,
       +                                styles = extra && getStyles( elem ),
       +                                subtract = extra && augmentWidthOrHeight(
       +                                        elem,
       +                                        name,
       +                                        extra,
       +                                        jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
       +                                        styles
       +                                );
       +
       +                        // Convert to pixels if value adjustment is needed
       +                        if ( subtract && ( matches = rcssNum.exec( value ) ) &&
       +                                ( matches[ 3 ] || "px" ) !== "px" ) {
       +
       +                                elem.style[ name ] = value;
       +                                value = jQuery.css( elem, name );
       +                        }
        
       -        jQuery.expr.filters.visible = function( elem ) {
       -                return !jQuery.expr.filters.hidden( elem );
       +                        return setPositiveNumber( elem, value, subtract );
       +                }
                };
       -}
       +} );
       +
       +jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
       +        function( elem, computed ) {
       +                if ( computed ) {
       +                        return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
       +                                elem.getBoundingClientRect().left -
       +                                        swap( elem, { marginLeft: 0 }, function() {
       +                                                return elem.getBoundingClientRect().left;
       +                                        } )
       +                                ) + "px";
       +                }
       +        }
       +);
        
        // These hooks are used by animate to expand properties
       -jQuery.each({
       +jQuery.each( {
                margin: "",
                padding: "",
                border: "Width"
        }, function( prefix, suffix ) {
       -
                jQuery.cssHooks[ prefix + suffix ] = {
                        expand: function( value ) {
       -                        var i,
       +                        var i = 0,
       +                                expanded = {},
        
       -                                // assumes a single number if not a string
       -                                parts = typeof value === "string" ? value.split(" ") : [ value ],
       -                                expanded = {};
       +                                // Assumes a single number if not a string
       +                                parts = typeof value === "string" ? value.split( " " ) : [ value ];
        
       -                        for ( i = 0; i < 4; i++ ) {
       +                        for ( ; i < 4; i++ ) {
                                        expanded[ prefix + cssExpand[ i ] + suffix ] =
                                                parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
                                }
       t@@ -6963,881 +6593,2007 @@ jQuery.each({
                                return expanded;
                        }
                };
       -});
       -
       -
        
       +        if ( !rmargin.test( prefix ) ) {
       +                jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
       +        }
       +} );
        
       -var r20 = /%20/g,
       -        rbracket = /\[\]$/,
       -        rCRLF = /\r?\n/g,
       -        rhash = /#.*$/,
       -        rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
       -        rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
       -        // #7653, #8125, #8152: local protocol detection
       -        rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
       -        rnoContent = /^(?:GET|HEAD)$/,
       -        rprotocol = /^\/\//,
       -        rquery = /\?/,
       -        rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
       -        rselectTextarea = /^(?:select|textarea)/i,
       -        rspacesAjax = /\s+/,
       -        rts = /([?&])_=[^&]*/,
       -        rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
       -
       -        // Keep a copy of the old load method
       -        _load = jQuery.fn.load,
       +jQuery.fn.extend( {
       +        css: function( name, value ) {
       +                return access( this, function( elem, name, value ) {
       +                        var styles, len,
       +                                map = {},
       +                                i = 0;
        
       -        /* Prefilters
       -         * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
       -         * 2) These are called:
       -         *    - BEFORE asking for a transport
       -         *    - AFTER param serialization (s.data is a string if s.processData is true)
       -         * 3) key is the dataType
       -         * 4) the catchall symbol "*" can be used
       -         * 5) execution will start with transport dataType and THEN continue down to "*" if needed
       -         */
       -        prefilters = {},
       +                        if ( jQuery.isArray( name ) ) {
       +                                styles = getStyles( elem );
       +                                len = name.length;
        
       -        /* Transports bindings
       -         * 1) key is the dataType
       -         * 2) the catchall symbol "*" can be used
       -         * 3) selection will start with transport dataType and THEN go to "*" if needed
       -         */
       -        transports = {},
       +                                for ( ; i < len; i++ ) {
       +                                        map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
       +                                }
        
       -        // Document location
       -        ajaxLocation,
       +                                return map;
       +                        }
        
       -        // Document location segments
       -        ajaxLocParts,
       +                        return value !== undefined ?
       +                                jQuery.style( elem, name, value ) :
       +                                jQuery.css( elem, name );
       +                }, name, value, arguments.length > 1 );
       +        }
       +} );
        
       -        // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
       -        allTypes = ["*/"] + ["*"];
        
       -// #8138, IE may throw an exception when accessing
       -// a field from window.location if document.domain has been set
       -try {
       -        ajaxLocation = location.href;
       -} catch( e ) {
       -        // Use the href attribute of an A element
       -        // since IE will modify it given document.location
       -        ajaxLocation = document.createElement( "a" );
       -        ajaxLocation.href = "";
       -        ajaxLocation = ajaxLocation.href;
       +function Tween( elem, options, prop, end, easing ) {
       +        return new Tween.prototype.init( elem, options, prop, end, easing );
        }
       +jQuery.Tween = Tween;
        
       -// Segment location into parts
       -ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
       -
       -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
       -function addToPrefiltersOrTransports( structure ) {
       +Tween.prototype = {
       +        constructor: Tween,
       +        init: function( elem, options, prop, end, easing, unit ) {
       +                this.elem = elem;
       +                this.prop = prop;
       +                this.easing = easing || jQuery.easing._default;
       +                this.options = options;
       +                this.start = this.now = this.cur();
       +                this.end = end;
       +                this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
       +        },
       +        cur: function() {
       +                var hooks = Tween.propHooks[ this.prop ];
        
       -        // dataTypeExpression is optional and defaults to "*"
       -        return function( dataTypeExpression, func ) {
       +                return hooks && hooks.get ?
       +                        hooks.get( this ) :
       +                        Tween.propHooks._default.get( this );
       +        },
       +        run: function( percent ) {
       +                var eased,
       +                        hooks = Tween.propHooks[ this.prop ];
        
       -                if ( typeof dataTypeExpression !== "string" ) {
       -                        func = dataTypeExpression;
       -                        dataTypeExpression = "*";
       +                if ( this.options.duration ) {
       +                        this.pos = eased = jQuery.easing[ this.easing ](
       +                                percent, this.options.duration * percent, 0, 1, this.options.duration
       +                        );
       +                } else {
       +                        this.pos = eased = percent;
                        }
       +                this.now = ( this.end - this.start ) * eased + this.start;
        
       -                if ( jQuery.isFunction( func ) ) {
       -                        var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
       -                                i = 0,
       -                                length = dataTypes.length,
       -                                dataType,
       -                                list,
       -                                placeBefore;
       +                if ( this.options.step ) {
       +                        this.options.step.call( this.elem, this.now, this );
       +                }
        
       -                        // For each dataType in the dataTypeExpression
       -                        for ( ; i < length; i++ ) {
       -                                dataType = dataTypes[ i ];
       -                                // We control if we're asked to add before
       -                                // any existing element
       -                                placeBefore = /^\+/.test( dataType );
       -                                if ( placeBefore ) {
       -                                        dataType = dataType.substr( 1 ) || "*";
       -                                }
       -                                list = structure[ dataType ] = structure[ dataType ] || [];
       -                                // then we add to the structure accordingly
       -                                list[ placeBefore ? "unshift" : "push" ]( func );
       -                        }
       +                if ( hooks && hooks.set ) {
       +                        hooks.set( this );
       +                } else {
       +                        Tween.propHooks._default.set( this );
                        }
       -        };
       -}
       +                return this;
       +        }
       +};
        
       -// Base inspection function for prefilters and transports
       -function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
       -                dataType /* internal */, inspected /* internal */ ) {
       +Tween.prototype.init.prototype = Tween.prototype;
       +
       +Tween.propHooks = {
       +        _default: {
       +                get: function( tween ) {
       +                        var result;
        
       -        dataType = dataType || options.dataTypes[ 0 ];
       -        inspected = inspected || {};
       +                        // Use a property on the element directly when it is not a DOM element,
       +                        // or when there is no matching style property that exists.
       +                        if ( tween.elem.nodeType !== 1 ||
       +                                tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
       +                                return tween.elem[ tween.prop ];
       +                        }
        
       -        inspected[ dataType ] = true;
       +                        // Passing an empty string as a 3rd parameter to .css will automatically
       +                        // attempt a parseFloat and fallback to a string if the parse fails.
       +                        // Simple values such as "10px" are parsed to Float;
       +                        // complex values such as "rotate(1rad)" are returned as-is.
       +                        result = jQuery.css( tween.elem, tween.prop, "" );
        
       -        var list = structure[ dataType ],
       -                i = 0,
       -                length = list ? list.length : 0,
       -                executeOnly = ( structure === prefilters ),
       -                selection;
       -
       -        for ( ; i < length && ( executeOnly || !selection ); i++ ) {
       -                selection = list[ i ]( options, originalOptions, jqXHR );
       -                // If we got redirected to another dataType
       -                // we try there if executing only and not done already
       -                if ( typeof selection === "string" ) {
       -                        if ( !executeOnly || inspected[ selection ] ) {
       -                                selection = undefined;
       +                        // Empty strings, null, undefined and "auto" are converted to 0.
       +                        return !result || result === "auto" ? 0 : result;
       +                },
       +                set: function( tween ) {
       +
       +                        // Use step hook for back compat.
       +                        // Use cssHook if its there.
       +                        // Use .style if available and use plain properties where available.
       +                        if ( jQuery.fx.step[ tween.prop ] ) {
       +                                jQuery.fx.step[ tween.prop ]( tween );
       +                        } else if ( tween.elem.nodeType === 1 &&
       +                                ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
       +                                        jQuery.cssHooks[ tween.prop ] ) ) {
       +                                jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
                                } else {
       -                                options.dataTypes.unshift( selection );
       -                                selection = inspectPrefiltersOrTransports(
       -                                                structure, options, originalOptions, jqXHR, selection, inspected );
       +                                tween.elem[ tween.prop ] = tween.now;
                                }
                        }
                }
       -        // If we're only executing or nothing was selected
       -        // we try the catchall dataType if not done already
       -        if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
       -                selection = inspectPrefiltersOrTransports(
       -                                structure, options, originalOptions, jqXHR, "*", inspected );
       -        }
       -        // unnecessary when only executing (prefilters)
       -        // but it'll be ignored by the caller in that case
       -        return selection;
       -}
       +};
        
       -// A special extend for ajax options
       -// that takes "flat" options (not to be deep extended)
       -// Fixes #9887
       -function ajaxExtend( target, src ) {
       -        var key, deep,
       -                flatOptions = jQuery.ajaxSettings.flatOptions || {};
       -        for ( key in src ) {
       -                if ( src[ key ] !== undefined ) {
       -                        ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
       +// Support: IE <=9 only
       +// Panic based approach to setting things on disconnected nodes
       +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
       +        set: function( tween ) {
       +                if ( tween.elem.nodeType && tween.elem.parentNode ) {
       +                        tween.elem[ tween.prop ] = tween.now;
                        }
                }
       -        if ( deep ) {
       -                jQuery.extend( true, target, deep );
       -        }
       -}
       +};
        
       -jQuery.fn.extend({
       -        load: function( url, params, callback ) {
       -                if ( typeof url !== "string" && _load ) {
       -                        return _load.apply( this, arguments );
       +jQuery.easing = {
       +        linear: function( p ) {
       +                return p;
       +        },
       +        swing: function( p ) {
       +                return 0.5 - Math.cos( p * Math.PI ) / 2;
       +        },
       +        _default: "swing"
       +};
        
       -                // Don't do a request if no elements are being requested
       -                } else if ( !this.length ) {
       -                        return this;
       -                }
       +jQuery.fx = Tween.prototype.init;
        
       -                var off = url.indexOf( " " );
       -                if ( off >= 0 ) {
       -                        var selector = url.slice( off, url.length );
       -                        url = url.slice( 0, off );
       -                }
       +// Back compat <1.8 extension point
       +jQuery.fx.step = {};
        
       -                // Default to a GET request
       -                var type = "GET";
        
       -                // If the second parameter was provided
       -                if ( params ) {
       -                        // If it's a function
       -                        if ( jQuery.isFunction( params ) ) {
       -                                // We assume that it's the callback
       -                                callback = params;
       -                                params = undefined;
        
       -                        // Otherwise, build a param string
       -                        } else if ( typeof params === "object" ) {
       -                                params = jQuery.param( params, jQuery.ajaxSettings.traditional );
       -                                type = "POST";
       -                        }
       -                }
        
       -                var self = this;
       +var
       +        fxNow, timerId,
       +        rfxtypes = /^(?:toggle|show|hide)$/,
       +        rrun = /queueHooks$/;
        
       -                // Request the remote document
       -                jQuery.ajax({
       -                        url: url,
       -                        type: type,
       -                        dataType: "html",
       -                        data: params,
       -                        // Complete callback (responseText is used internally)
       -                        complete: function( jqXHR, status, responseText ) {
       -                                // Store the response as specified by the jqXHR object
       -                                responseText = jqXHR.responseText;
       -                                // If successful, inject the HTML into all the matched elements
       -                                if ( jqXHR.isResolved() ) {
       -                                        // #4825: Get the actual response in case
       -                                        // a dataFilter is present in ajaxSettings
       -                                        jqXHR.done(function( r ) {
       -                                                responseText = r;
       -                                        });
       -                                        // See if a selector was specified
       -                                        self.html( selector ?
       -                                                // Create a dummy div to hold the results
       -                                                jQuery("<div>")
       -                                                        // inject the contents of the document in, removing the scripts
       -                                                        // to avoid any 'Permission Denied' errors in IE
       -                                                        .append(responseText.replace(rscript, ""))
       -
       -                                                        // Locate the specified elements
       -                                                        .find(selector) :
       -
       -                                                // If not, just inject the full result
       -                                                responseText );
       -                                }
       +function raf() {
       +        if ( timerId ) {
       +                window.requestAnimationFrame( raf );
       +                jQuery.fx.tick();
       +        }
       +}
        
       -                                if ( callback ) {
       -                                        self.each( callback, [ responseText, status, jqXHR ] );
       -                                }
       -                        }
       -                });
       +// Animations created synchronously will run synchronously
       +function createFxNow() {
       +        window.setTimeout( function() {
       +                fxNow = undefined;
       +        } );
       +        return ( fxNow = jQuery.now() );
       +}
        
       -                return this;
       -        },
       +// Generate parameters to create a standard animation
       +function genFx( type, includeWidth ) {
       +        var which,
       +                i = 0,
       +                attrs = { height: type };
       +
       +        // If we include width, step value is 1 to do all cssExpand values,
       +        // otherwise step value is 2 to skip over Left and Right
       +        includeWidth = includeWidth ? 1 : 0;
       +        for ( ; i < 4; i += 2 - includeWidth ) {
       +                which = cssExpand[ i ];
       +                attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
       +        }
        
       -        serialize: function() {
       -                return jQuery.param( this.serializeArray() );
       -        },
       +        if ( includeWidth ) {
       +                attrs.opacity = attrs.width = type;
       +        }
        
       -        serializeArray: function() {
       -                return this.map(function(){
       -                        return this.elements ? jQuery.makeArray( this.elements ) : this;
       -                })
       -                .filter(function(){
       -                        return this.name && !this.disabled &&
       -                                ( this.checked || rselectTextarea.test( this.nodeName ) ||
       -                                        rinput.test( this.type ) );
       -                })
       -                .map(function( i, elem ){
       -                        var val = jQuery( this ).val();
       +        return attrs;
       +}
        
       -                        return val == null ?
       -                                null :
       -                                jQuery.isArray( val ) ?
       -                                        jQuery.map( val, function( val, i ){
       -                                                return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
       -                                        }) :
       -                                        { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
       -                }).get();
       +function createTween( value, prop, animation ) {
       +        var tween,
       +                collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
       +                index = 0,
       +                length = collection.length;
       +        for ( ; index < length; index++ ) {
       +                if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
       +
       +                        // We're done with this property
       +                        return tween;
       +                }
                }
       -});
       +}
        
       -// Attach a bunch of functions for handling common AJAX events
       -jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
       -        jQuery.fn[ o ] = function( f ){
       -                return this.on( o, f );
       -        };
       -});
       +function defaultPrefilter( elem, props, opts ) {
       +        var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
       +                isBox = "width" in props || "height" in props,
       +                anim = this,
       +                orig = {},
       +                style = elem.style,
       +                hidden = elem.nodeType && isHiddenWithinTree( elem ),
       +                dataShow = dataPriv.get( elem, "fxshow" );
       +
       +        // Queue-skipping animations hijack the fx hooks
       +        if ( !opts.queue ) {
       +                hooks = jQuery._queueHooks( elem, "fx" );
       +                if ( hooks.unqueued == null ) {
       +                        hooks.unqueued = 0;
       +                        oldfire = hooks.empty.fire;
       +                        hooks.empty.fire = function() {
       +                                if ( !hooks.unqueued ) {
       +                                        oldfire();
       +                                }
       +                        };
       +                }
       +                hooks.unqueued++;
        
       -jQuery.each( [ "get", "post" ], function( i, method ) {
       -        jQuery[ method ] = function( url, data, callback, type ) {
       -                // shift arguments if data argument was omitted
       -                if ( jQuery.isFunction( data ) ) {
       -                        type = type || callback;
       -                        callback = data;
       -                        data = undefined;
       +                anim.always( function() {
       +
       +                        // Ensure the complete handler is called before this completes
       +                        anim.always( function() {
       +                                hooks.unqueued--;
       +                                if ( !jQuery.queue( elem, "fx" ).length ) {
       +                                        hooks.empty.fire();
       +                                }
       +                        } );
       +                } );
       +        }
       +
       +        // Detect show/hide animations
       +        for ( prop in props ) {
       +                value = props[ prop ];
       +                if ( rfxtypes.test( value ) ) {
       +                        delete props[ prop ];
       +                        toggle = toggle || value === "toggle";
       +                        if ( value === ( hidden ? "hide" : "show" ) ) {
       +
       +                                // Pretend to be hidden if this is a "show" and
       +                                // there is still data from a stopped show/hide
       +                                if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
       +                                        hidden = true;
       +
       +                                // Ignore all other no-op show/hide data
       +                                } else {
       +                                        continue;
       +                                }
       +                        }
       +                        orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
                        }
       +        }
        
       -                return jQuery.ajax({
       -                        type: method,
       -                        url: url,
       -                        data: data,
       -                        success: callback,
       -                        dataType: type
       -                });
       -        };
       -});
       +        // Bail out if this is a no-op like .hide().hide()
       +        propTween = !jQuery.isEmptyObject( props );
       +        if ( !propTween && jQuery.isEmptyObject( orig ) ) {
       +                return;
       +        }
        
       -jQuery.extend({
       +        // Restrict "overflow" and "display" styles during box animations
       +        if ( isBox && elem.nodeType === 1 ) {
        
       -        getScript: function( url, callback ) {
       -                return jQuery.get( url, undefined, callback, "script" );
       -        },
       +                // Support: IE <=9 - 11, Edge 12 - 13
       +                // Record all 3 overflow attributes because IE does not infer the shorthand
       +                // from identically-valued overflowX and overflowY
       +                opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
        
       -        getJSON: function( url, data, callback ) {
       -                return jQuery.get( url, data, callback, "json" );
       -        },
       +                // Identify a display type, preferring old show/hide data over the CSS cascade
       +                restoreDisplay = dataShow && dataShow.display;
       +                if ( restoreDisplay == null ) {
       +                        restoreDisplay = dataPriv.get( elem, "display" );
       +                }
       +                display = jQuery.css( elem, "display" );
       +                if ( display === "none" ) {
       +                        if ( restoreDisplay ) {
       +                                display = restoreDisplay;
       +                        } else {
        
       -        // Creates a full fledged settings object into target
       -        // with both ajaxSettings and settings fields.
       -        // If target is omitted, writes into ajaxSettings.
       -        ajaxSetup: function( target, settings ) {
       -                if ( settings ) {
       -                        // Building a settings object
       -                        ajaxExtend( target, jQuery.ajaxSettings );
       -                } else {
       -                        // Extending ajaxSettings
       -                        settings = target;
       -                        target = jQuery.ajaxSettings;
       +                                // Get nonempty value(s) by temporarily forcing visibility
       +                                showHide( [ elem ], true );
       +                                restoreDisplay = elem.style.display || restoreDisplay;
       +                                display = jQuery.css( elem, "display" );
       +                                showHide( [ elem ] );
       +                        }
                        }
       -                ajaxExtend( target, settings );
       -                return target;
       -        },
        
       -        ajaxSettings: {
       -                url: ajaxLocation,
       -                isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
       -                global: true,
       -                type: "GET",
       -                contentType: "application/x-www-form-urlencoded; charset=UTF-8",
       -                processData: true,
       -                async: true,
       -                /*
       -                timeout: 0,
       -                data: null,
       -                dataType: null,
       -                username: null,
       -                password: null,
       -                cache: null,
       -                traditional: false,
       -                headers: {},
       -                */
       +                // Animate inline elements as inline-block
       +                if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
       +                        if ( jQuery.css( elem, "float" ) === "none" ) {
        
       -                accepts: {
       -                        xml: "application/xml, text/xml",
       -                        html: "text/html",
       -                        text: "text/plain",
       -                        json: "application/json, text/javascript",
       -                        "*": allTypes
       -                },
       +                                // Restore the original display value at the end of pure show/hide animations
       +                                if ( !propTween ) {
       +                                        anim.done( function() {
       +                                                style.display = restoreDisplay;
       +                                        } );
       +                                        if ( restoreDisplay == null ) {
       +                                                display = style.display;
       +                                                restoreDisplay = display === "none" ? "" : display;
       +                                        }
       +                                }
       +                                style.display = "inline-block";
       +                        }
       +                }
       +        }
        
       -                contents: {
       -                        xml: /xml/,
       -                        html: /html/,
       -                        json: /json/
       -                },
       +        if ( opts.overflow ) {
       +                style.overflow = "hidden";
       +                anim.always( function() {
       +                        style.overflow = opts.overflow[ 0 ];
       +                        style.overflowX = opts.overflow[ 1 ];
       +                        style.overflowY = opts.overflow[ 2 ];
       +                } );
       +        }
        
       -                responseFields: {
       -                        xml: "responseXML",
       -                        text: "responseText"
       -                },
       +        // Implement show/hide animations
       +        propTween = false;
       +        for ( prop in orig ) {
        
       -                // List of data converters
       -                // 1) key format is "source_type destination_type" (a single space in-between)
       -                // 2) the catchall symbol "*" can be used for source_type
       -                converters: {
       +                // General show/hide setup for this element animation
       +                if ( !propTween ) {
       +                        if ( dataShow ) {
       +                                if ( "hidden" in dataShow ) {
       +                                        hidden = dataShow.hidden;
       +                                }
       +                        } else {
       +                                dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
       +                        }
        
       -                        // Convert anything to text
       -                        "* text": window.String,
       +                        // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
       +                        if ( toggle ) {
       +                                dataShow.hidden = !hidden;
       +                        }
        
       -                        // Text to html (true = no transformation)
       -                        "text html": true,
       +                        // Show elements before animating them
       +                        if ( hidden ) {
       +                                showHide( [ elem ], true );
       +                        }
        
       -                        // Evaluate text as a json expression
       -                        "text json": jQuery.parseJSON,
       +                        /* eslint-disable no-loop-func */
        
       -                        // Parse text as xml
       -                        "text xml": jQuery.parseXML
       -                },
       +                        anim.done( function() {
        
       -                // For options that shouldn't be deep extended:
       -                // you can add your own custom options here if
       -                // and when you create one that shouldn't be
       -                // deep extended (see ajaxExtend)
       -                flatOptions: {
       -                        context: true,
       -                        url: true
       +                        /* eslint-enable no-loop-func */
       +
       +                                // The final step of a "hide" animation is actually hiding the element
       +                                if ( !hidden ) {
       +                                        showHide( [ elem ] );
       +                                }
       +                                dataPriv.remove( elem, "fxshow" );
       +                                for ( prop in orig ) {
       +                                        jQuery.style( elem, prop, orig[ prop ] );
       +                                }
       +                        } );
                        }
       -        },
        
       -        ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
       -        ajaxTransport: addToPrefiltersOrTransports( transports ),
       +                // Per-property setup
       +                propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
       +                if ( !( prop in dataShow ) ) {
       +                        dataShow[ prop ] = propTween.start;
       +                        if ( hidden ) {
       +                                propTween.end = propTween.start;
       +                                propTween.start = 0;
       +                        }
       +                }
       +        }
       +}
        
       -        // Main method
       -        ajax: function( url, options ) {
       +function propFilter( props, specialEasing ) {
       +        var index, name, easing, value, hooks;
        
       -                // If url is an object, simulate pre-1.5 signature
       -                if ( typeof url === "object" ) {
       -                        options = url;
       -                        url = undefined;
       +        // camelCase, specialEasing and expand cssHook pass
       +        for ( index in props ) {
       +                name = jQuery.camelCase( index );
       +                easing = specialEasing[ name ];
       +                value = props[ index ];
       +                if ( jQuery.isArray( value ) ) {
       +                        easing = value[ 1 ];
       +                        value = props[ index ] = value[ 0 ];
                        }
        
       -                // Force options to be an object
       -                options = options || {};
       +                if ( index !== name ) {
       +                        props[ name ] = value;
       +                        delete props[ index ];
       +                }
        
       -                var // Create the final options object
       -                        s = jQuery.ajaxSetup( {}, options ),
       -                        // Callbacks context
       -                        callbackContext = s.context || s,
       -                        // Context for global events
       -                        // It's the callbackContext if one was provided in the options
       -                        // and if it's a DOM node or a jQuery collection
       -                        globalEventContext = callbackContext !== s &&
       -                                ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
       -                                                jQuery( callbackContext ) : jQuery.event,
       -                        // Deferreds
       -                        deferred = jQuery.Deferred(),
       -                        completeDeferred = jQuery.Callbacks( "once memory" ),
       -                        // Status-dependent callbacks
       -                        statusCode = s.statusCode || {},
       -                        // ifModified key
       -                        ifModifiedKey,
       -                        // Headers (they are sent all at once)
       -                        requestHeaders = {},
       -                        requestHeadersNames = {},
       -                        // Response headers
       -                        responseHeadersString,
       -                        responseHeaders,
       -                        // transport
       -                        transport,
       -                        // timeout handle
       -                        timeoutTimer,
       -                        // Cross-domain detection vars
       -                        parts,
       -                        // The jqXHR state
       -                        state = 0,
       -                        // To know if global events are to be dispatched
       -                        fireGlobals,
       -                        // Loop variable
       -                        i,
       -                        // Fake xhr
       -                        jqXHR = {
       +                hooks = jQuery.cssHooks[ name ];
       +                if ( hooks && "expand" in hooks ) {
       +                        value = hooks.expand( value );
       +                        delete props[ name ];
        
       -                                readyState: 0,
       +                        // Not quite $.extend, this won't overwrite existing keys.
       +                        // Reusing 'index' because we have the correct "name"
       +                        for ( index in value ) {
       +                                if ( !( index in props ) ) {
       +                                        props[ index ] = value[ index ];
       +                                        specialEasing[ index ] = easing;
       +                                }
       +                        }
       +                } else {
       +                        specialEasing[ name ] = easing;
       +                }
       +        }
       +}
        
       -                                // Caches the header
       -                                setRequestHeader: function( name, value ) {
       -                                        if ( !state ) {
       -                                                var lname = name.toLowerCase();
       -                                                name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
       -                                                requestHeaders[ name ] = value;
       -                                        }
       -                                        return this;
       -                                },
       +function Animation( elem, properties, options ) {
       +        var result,
       +                stopped,
       +                index = 0,
       +                length = Animation.prefilters.length,
       +                deferred = jQuery.Deferred().always( function() {
       +
       +                        // Don't match elem in the :animated selector
       +                        delete tick.elem;
       +                } ),
       +                tick = function() {
       +                        if ( stopped ) {
       +                                return false;
       +                        }
       +                        var currentTime = fxNow || createFxNow(),
       +                                remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
        
       -                                // Raw string
       -                                getAllResponseHeaders: function() {
       -                                        return state === 2 ? responseHeadersString : null;
       -                                },
       +                                // Support: Android 2.3 only
       +                                // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
       +                                temp = remaining / animation.duration || 0,
       +                                percent = 1 - temp,
       +                                index = 0,
       +                                length = animation.tweens.length;
        
       -                                // Builds headers hashtable if needed
       -                                getResponseHeader: function( key ) {
       -                                        var match;
       -                                        if ( state === 2 ) {
       -                                                if ( !responseHeaders ) {
       -                                                        responseHeaders = {};
       -                                                        while( ( match = rheaders.exec( responseHeadersString ) ) ) {
       -                                                                responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
       -                                                        }
       -                                                }
       -                                                match = responseHeaders[ key.toLowerCase() ];
       -                                        }
       -                                        return match === undefined ? null : match;
       -                                },
       +                        for ( ; index < length; index++ ) {
       +                                animation.tweens[ index ].run( percent );
       +                        }
        
       -                                // Overrides response content-type header
       -                                overrideMimeType: function( type ) {
       -                                        if ( !state ) {
       -                                                s.mimeType = type;
       -                                        }
       -                                        return this;
       -                                },
       +                        deferred.notifyWith( elem, [ animation, percent, remaining ] );
        
       -                                // Cancel the request
       -                                abort: function( statusText ) {
       -                                        statusText = statusText || "abort";
       -                                        if ( transport ) {
       -                                                transport.abort( statusText );
       -                                        }
       -                                        done( 0, statusText );
       +                        if ( percent < 1 && length ) {
       +                                return remaining;
       +                        } else {
       +                                deferred.resolveWith( elem, [ animation ] );
       +                                return false;
       +                        }
       +                },
       +                animation = deferred.promise( {
       +                        elem: elem,
       +                        props: jQuery.extend( {}, properties ),
       +                        opts: jQuery.extend( true, {
       +                                specialEasing: {},
       +                                easing: jQuery.easing._default
       +                        }, options ),
       +                        originalProperties: properties,
       +                        originalOptions: options,
       +                        startTime: fxNow || createFxNow(),
       +                        duration: options.duration,
       +                        tweens: [],
       +                        createTween: function( prop, end ) {
       +                                var tween = jQuery.Tween( elem, animation.opts, prop, end,
       +                                                animation.opts.specialEasing[ prop ] || animation.opts.easing );
       +                                animation.tweens.push( tween );
       +                                return tween;
       +                        },
       +                        stop: function( gotoEnd ) {
       +                                var index = 0,
       +
       +                                        // If we are going to the end, we want to run all the tweens
       +                                        // otherwise we skip this part
       +                                        length = gotoEnd ? animation.tweens.length : 0;
       +                                if ( stopped ) {
                                                return this;
                                        }
       -                        };
       -
       -                // Callback for when everything is done
       -                // It is defined here because jslint complains if it is declared
       -                // at the end of the function (which would be more logical and readable)
       -                function done( status, nativeStatusText, responses, headers ) {
       +                                stopped = true;
       +                                for ( ; index < length; index++ ) {
       +                                        animation.tweens[ index ].run( 1 );
       +                                }
        
       -                        // Called once
       -                        if ( state === 2 ) {
       -                                return;
       +                                // Resolve when we played the last frame; otherwise, reject
       +                                if ( gotoEnd ) {
       +                                        deferred.notifyWith( elem, [ animation, 1, 0 ] );
       +                                        deferred.resolveWith( elem, [ animation, gotoEnd ] );
       +                                } else {
       +                                        deferred.rejectWith( elem, [ animation, gotoEnd ] );
       +                                }
       +                                return this;
                                }
       +                } ),
       +                props = animation.props;
        
       -                        // State is "done" now
       -                        state = 2;
       +        propFilter( props, animation.opts.specialEasing );
        
       -                        // Clear timeout if it exists
       -                        if ( timeoutTimer ) {
       -                                clearTimeout( timeoutTimer );
       +        for ( ; index < length; index++ ) {
       +                result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
       +                if ( result ) {
       +                        if ( jQuery.isFunction( result.stop ) ) {
       +                                jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
       +                                        jQuery.proxy( result.stop, result );
                                }
       +                        return result;
       +                }
       +        }
        
       -                        // Dereference transport for early garbage collection
       -                        // (no matter how long the jqXHR object will be used)
       -                        transport = undefined;
       +        jQuery.map( props, createTween, animation );
        
       -                        // Cache response headers
       -                        responseHeadersString = headers || "";
       +        if ( jQuery.isFunction( animation.opts.start ) ) {
       +                animation.opts.start.call( elem, animation );
       +        }
        
       -                        // Set readyState
       -                        jqXHR.readyState = status > 0 ? 4 : 0;
       +        jQuery.fx.timer(
       +                jQuery.extend( tick, {
       +                        elem: elem,
       +                        anim: animation,
       +                        queue: animation.opts.queue
       +                } )
       +        );
       +
       +        // attach callbacks from options
       +        return animation.progress( animation.opts.progress )
       +                .done( animation.opts.done, animation.opts.complete )
       +                .fail( animation.opts.fail )
       +                .always( animation.opts.always );
       +}
        
       -                        var isSuccess,
       -                                success,
       -                                error,
       -                                statusText = nativeStatusText,
       -                                response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
       -                                lastModified,
       -                                etag;
       +jQuery.Animation = jQuery.extend( Animation, {
        
       -                        // If successful, handle type chaining
       -                        if ( status >= 200 && status < 300 || status === 304 ) {
       +        tweeners: {
       +                "*": [ function( prop, value ) {
       +                        var tween = this.createTween( prop, value );
       +                        adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
       +                        return tween;
       +                } ]
       +        },
        
       -                                // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
       -                                if ( s.ifModified ) {
       +        tweener: function( props, callback ) {
       +                if ( jQuery.isFunction( props ) ) {
       +                        callback = props;
       +                        props = [ "*" ];
       +                } else {
       +                        props = props.match( rnothtmlwhite );
       +                }
        
       -                                        if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
       -                                                jQuery.lastModified[ ifModifiedKey ] = lastModified;
       -                                        }
       -                                        if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
       -                                                jQuery.etag[ ifModifiedKey ] = etag;
       -                                        }
       -                                }
       +                var prop,
       +                        index = 0,
       +                        length = props.length;
        
       -                                // If not modified
       -                                if ( status === 304 ) {
       +                for ( ; index < length; index++ ) {
       +                        prop = props[ index ];
       +                        Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
       +                        Animation.tweeners[ prop ].unshift( callback );
       +                }
       +        },
        
       -                                        statusText = "notmodified";
       -                                        isSuccess = true;
       +        prefilters: [ defaultPrefilter ],
        
       -                                // If we have data
       -                                } else {
       +        prefilter: function( callback, prepend ) {
       +                if ( prepend ) {
       +                        Animation.prefilters.unshift( callback );
       +                } else {
       +                        Animation.prefilters.push( callback );
       +                }
       +        }
       +} );
       +
       +jQuery.speed = function( speed, easing, fn ) {
       +        var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
       +                complete: fn || !fn && easing ||
       +                        jQuery.isFunction( speed ) && speed,
       +                duration: speed,
       +                easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
       +        };
        
       -                                        try {
       -                                                success = ajaxConvert( s, response );
       -                                                statusText = "success";
       -                                                isSuccess = true;
       -                                        } catch(e) {
       -                                                // We have a parsererror
       -                                                statusText = "parsererror";
       -                                                error = e;
       -                                        }
       +        // Go to the end state if fx are off or if document is hidden
       +        if ( jQuery.fx.off || document.hidden ) {
       +                opt.duration = 0;
       +
       +        } else {
       +                if ( typeof opt.duration !== "number" ) {
       +                        if ( opt.duration in jQuery.fx.speeds ) {
       +                                opt.duration = jQuery.fx.speeds[ opt.duration ];
       +
       +                        } else {
       +                                opt.duration = jQuery.fx.speeds._default;
       +                        }
       +                }
       +        }
       +
       +        // Normalize opt.queue - true/undefined/null -> "fx"
       +        if ( opt.queue == null || opt.queue === true ) {
       +                opt.queue = "fx";
       +        }
       +
       +        // Queueing
       +        opt.old = opt.complete;
       +
       +        opt.complete = function() {
       +                if ( jQuery.isFunction( opt.old ) ) {
       +                        opt.old.call( this );
       +                }
       +
       +                if ( opt.queue ) {
       +                        jQuery.dequeue( this, opt.queue );
       +                }
       +        };
       +
       +        return opt;
       +};
       +
       +jQuery.fn.extend( {
       +        fadeTo: function( speed, to, easing, callback ) {
       +
       +                // Show any hidden elements after setting opacity to 0
       +                return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
       +
       +                        // Animate to the value specified
       +                        .end().animate( { opacity: to }, speed, easing, callback );
       +        },
       +        animate: function( prop, speed, easing, callback ) {
       +                var empty = jQuery.isEmptyObject( prop ),
       +                        optall = jQuery.speed( speed, easing, callback ),
       +                        doAnimation = function() {
       +
       +                                // Operate on a copy of prop so per-property easing won't be lost
       +                                var anim = Animation( this, jQuery.extend( {}, prop ), optall );
       +
       +                                // Empty animations, or finishing resolves immediately
       +                                if ( empty || dataPriv.get( this, "finish" ) ) {
       +                                        anim.stop( true );
       +                                }
       +                        };
       +                        doAnimation.finish = doAnimation;
       +
       +                return empty || optall.queue === false ?
       +                        this.each( doAnimation ) :
       +                        this.queue( optall.queue, doAnimation );
       +        },
       +        stop: function( type, clearQueue, gotoEnd ) {
       +                var stopQueue = function( hooks ) {
       +                        var stop = hooks.stop;
       +                        delete hooks.stop;
       +                        stop( gotoEnd );
       +                };
       +
       +                if ( typeof type !== "string" ) {
       +                        gotoEnd = clearQueue;
       +                        clearQueue = type;
       +                        type = undefined;
       +                }
       +                if ( clearQueue && type !== false ) {
       +                        this.queue( type || "fx", [] );
       +                }
       +
       +                return this.each( function() {
       +                        var dequeue = true,
       +                                index = type != null && type + "queueHooks",
       +                                timers = jQuery.timers,
       +                                data = dataPriv.get( this );
       +
       +                        if ( index ) {
       +                                if ( data[ index ] && data[ index ].stop ) {
       +                                        stopQueue( data[ index ] );
                                        }
                                } else {
       -                                // We extract error from statusText
       -                                // then normalize statusText and status for non-aborts
       -                                error = statusText;
       -                                if ( !statusText || status ) {
       -                                        statusText = "error";
       -                                        if ( status < 0 ) {
       -                                                status = 0;
       +                                for ( index in data ) {
       +                                        if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
       +                                                stopQueue( data[ index ] );
                                                }
                                        }
                                }
        
       -                        // Set data for the fake xhr object
       -                        jqXHR.status = status;
       -                        jqXHR.statusText = "" + ( nativeStatusText || statusText );
       +                        for ( index = timers.length; index--; ) {
       +                                if ( timers[ index ].elem === this &&
       +                                        ( type == null || timers[ index ].queue === type ) ) {
        
       -                        // Success/Error
       -                        if ( isSuccess ) {
       -                                deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
       -                        } else {
       -                                deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
       +                                        timers[ index ].anim.stop( gotoEnd );
       +                                        dequeue = false;
       +                                        timers.splice( index, 1 );
       +                                }
                                }
        
       -                        // Status-dependent callbacks
       -                        jqXHR.statusCode( statusCode );
       -                        statusCode = undefined;
       +                        // Start the next in the queue if the last step wasn't forced.
       +                        // Timers currently will call their complete callbacks, which
       +                        // will dequeue but only if they were gotoEnd.
       +                        if ( dequeue || !gotoEnd ) {
       +                                jQuery.dequeue( this, type );
       +                        }
       +                } );
       +        },
       +        finish: function( type ) {
       +                if ( type !== false ) {
       +                        type = type || "fx";
       +                }
       +                return this.each( function() {
       +                        var index,
       +                                data = dataPriv.get( this ),
       +                                queue = data[ type + "queue" ],
       +                                hooks = data[ type + "queueHooks" ],
       +                                timers = jQuery.timers,
       +                                length = queue ? queue.length : 0;
        
       -                        if ( fireGlobals ) {
       -                                globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
       -                                                [ jqXHR, s, isSuccess ? success : error ] );
       +                        // Enable finishing flag on private data
       +                        data.finish = true;
       +
       +                        // Empty the queue first
       +                        jQuery.queue( this, type, [] );
       +
       +                        if ( hooks && hooks.stop ) {
       +                                hooks.stop.call( this, true );
                                }
        
       -                        // Complete
       -                        completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
       +                        // Look for any active animations, and finish them
       +                        for ( index = timers.length; index--; ) {
       +                                if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
       +                                        timers[ index ].anim.stop( true );
       +                                        timers.splice( index, 1 );
       +                                }
       +                        }
        
       -                        if ( fireGlobals ) {
       -                                globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
       -                                // Handle the global AJAX counter
       -                                if ( !( --jQuery.active ) ) {
       -                                        jQuery.event.trigger( "ajaxStop" );
       +                        // Look for any animations in the old queue and finish them
       +                        for ( index = 0; index < length; index++ ) {
       +                                if ( queue[ index ] && queue[ index ].finish ) {
       +                                        queue[ index ].finish.call( this );
                                        }
                                }
       +
       +                        // Turn off finishing flag
       +                        delete data.finish;
       +                } );
       +        }
       +} );
       +
       +jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
       +        var cssFn = jQuery.fn[ name ];
       +        jQuery.fn[ name ] = function( speed, easing, callback ) {
       +                return speed == null || typeof speed === "boolean" ?
       +                        cssFn.apply( this, arguments ) :
       +                        this.animate( genFx( name, true ), speed, easing, callback );
       +        };
       +} );
       +
       +// Generate shortcuts for custom animations
       +jQuery.each( {
       +        slideDown: genFx( "show" ),
       +        slideUp: genFx( "hide" ),
       +        slideToggle: genFx( "toggle" ),
       +        fadeIn: { opacity: "show" },
       +        fadeOut: { opacity: "hide" },
       +        fadeToggle: { opacity: "toggle" }
       +}, function( name, props ) {
       +        jQuery.fn[ name ] = function( speed, easing, callback ) {
       +                return this.animate( props, speed, easing, callback );
       +        };
       +} );
       +
       +jQuery.timers = [];
       +jQuery.fx.tick = function() {
       +        var timer,
       +                i = 0,
       +                timers = jQuery.timers;
       +
       +        fxNow = jQuery.now();
       +
       +        for ( ; i < timers.length; i++ ) {
       +                timer = timers[ i ];
       +
       +                // Checks the timer has not already been removed
       +                if ( !timer() && timers[ i ] === timer ) {
       +                        timers.splice( i--, 1 );
                        }
       +        }
        
       -                // Attach deferreds
       -                deferred.promise( jqXHR );
       -                jqXHR.success = jqXHR.done;
       -                jqXHR.error = jqXHR.fail;
       -                jqXHR.complete = completeDeferred.add;
       -
       -                // Status-dependent callbacks
       -                jqXHR.statusCode = function( map ) {
       -                        if ( map ) {
       -                                var tmp;
       -                                if ( state < 2 ) {
       -                                        for ( tmp in map ) {
       -                                                statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
       +        if ( !timers.length ) {
       +                jQuery.fx.stop();
       +        }
       +        fxNow = undefined;
       +};
       +
       +jQuery.fx.timer = function( timer ) {
       +        jQuery.timers.push( timer );
       +        if ( timer() ) {
       +                jQuery.fx.start();
       +        } else {
       +                jQuery.timers.pop();
       +        }
       +};
       +
       +jQuery.fx.interval = 13;
       +jQuery.fx.start = function() {
       +        if ( !timerId ) {
       +                timerId = window.requestAnimationFrame ?
       +                        window.requestAnimationFrame( raf ) :
       +                        window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
       +        }
       +};
       +
       +jQuery.fx.stop = function() {
       +        if ( window.cancelAnimationFrame ) {
       +                window.cancelAnimationFrame( timerId );
       +        } else {
       +                window.clearInterval( timerId );
       +        }
       +
       +        timerId = null;
       +};
       +
       +jQuery.fx.speeds = {
       +        slow: 600,
       +        fast: 200,
       +
       +        // Default speed
       +        _default: 400
       +};
       +
       +
       +// Based off of the plugin by Clint Helfers, with permission.
       +// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
       +jQuery.fn.delay = function( time, type ) {
       +        time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
       +        type = type || "fx";
       +
       +        return this.queue( type, function( next, hooks ) {
       +                var timeout = window.setTimeout( next, time );
       +                hooks.stop = function() {
       +                        window.clearTimeout( timeout );
       +                };
       +        } );
       +};
       +
       +
       +( function() {
       +        var input = document.createElement( "input" ),
       +                select = document.createElement( "select" ),
       +                opt = select.appendChild( document.createElement( "option" ) );
       +
       +        input.type = "checkbox";
       +
       +        // Support: Android <=4.3 only
       +        // Default value for a checkbox should be "on"
       +        support.checkOn = input.value !== "";
       +
       +        // Support: IE <=11 only
       +        // Must access selectedIndex to make default options select
       +        support.optSelected = opt.selected;
       +
       +        // Support: IE <=11 only
       +        // An input loses its value after becoming a radio
       +        input = document.createElement( "input" );
       +        input.value = "t";
       +        input.type = "radio";
       +        support.radioValue = input.value === "t";
       +} )();
       +
       +
       +var boolHook,
       +        attrHandle = jQuery.expr.attrHandle;
       +
       +jQuery.fn.extend( {
       +        attr: function( name, value ) {
       +                return access( this, jQuery.attr, name, value, arguments.length > 1 );
       +        },
       +
       +        removeAttr: function( name ) {
       +                return this.each( function() {
       +                        jQuery.removeAttr( this, name );
       +                } );
       +        }
       +} );
       +
       +jQuery.extend( {
       +        attr: function( elem, name, value ) {
       +                var ret, hooks,
       +                        nType = elem.nodeType;
       +
       +                // Don't get/set attributes on text, comment and attribute nodes
       +                if ( nType === 3 || nType === 8 || nType === 2 ) {
       +                        return;
       +                }
       +
       +                // Fallback to prop when attributes are not supported
       +                if ( typeof elem.getAttribute === "undefined" ) {
       +                        return jQuery.prop( elem, name, value );
       +                }
       +
       +                // Attribute hooks are determined by the lowercase version
       +                // Grab necessary hook if one is defined
       +                if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
       +                        hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
       +                                ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
       +                }
       +
       +                if ( value !== undefined ) {
       +                        if ( value === null ) {
       +                                jQuery.removeAttr( elem, name );
       +                                return;
       +                        }
       +
       +                        if ( hooks && "set" in hooks &&
       +                                ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
       +                                return ret;
       +                        }
       +
       +                        elem.setAttribute( name, value + "" );
       +                        return value;
       +                }
       +
       +                if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
       +                        return ret;
       +                }
       +
       +                ret = jQuery.find.attr( elem, name );
       +
       +                // Non-existent attributes return null, we normalize to undefined
       +                return ret == null ? undefined : ret;
       +        },
       +
       +        attrHooks: {
       +                type: {
       +                        set: function( elem, value ) {
       +                                if ( !support.radioValue && value === "radio" &&
       +                                        jQuery.nodeName( elem, "input" ) ) {
       +                                        var val = elem.value;
       +                                        elem.setAttribute( "type", value );
       +                                        if ( val ) {
       +                                                elem.value = val;
                                                }
       -                                } else {
       -                                        tmp = map[ jqXHR.status ];
       -                                        jqXHR.then( tmp, tmp );
       +                                        return value;
                                        }
                                }
       -                        return this;
       -                };
       +                }
       +        },
        
       -                // Remove hash character (#7531: and string promotion)
       -                // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
       -                // We also use the url parameter if available
       -                s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
       +        removeAttr: function( elem, value ) {
       +                var name,
       +                        i = 0,
        
       -                // Extract dataTypes list
       -                s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
       +                        // Attribute names can contain non-HTML whitespace characters
       +                        // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
       +                        attrNames = value && value.match( rnothtmlwhite );
        
       -                // Determine if a cross-domain request is in order
       -                if ( s.crossDomain == null ) {
       -                        parts = rurl.exec( s.url.toLowerCase() );
       -                        s.crossDomain = !!( parts &&
       -                                ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
       -                                        ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
       -                                                ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
       -                        );
       +                if ( attrNames && elem.nodeType === 1 ) {
       +                        while ( ( name = attrNames[ i++ ] ) ) {
       +                                elem.removeAttribute( name );
       +                        }
                        }
       +        }
       +} );
        
       -                // Convert data if not already a string
       -                if ( s.data && s.processData && typeof s.data !== "string" ) {
       -                        s.data = jQuery.param( s.data, s.traditional );
       +// Hooks for boolean attributes
       +boolHook = {
       +        set: function( elem, value, name ) {
       +                if ( value === false ) {
       +
       +                        // Remove boolean attributes when set to false
       +                        jQuery.removeAttr( elem, name );
       +                } else {
       +                        elem.setAttribute( name, name );
                        }
       +                return name;
       +        }
       +};
        
       -                // Apply prefilters
       -                inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
       +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
       +        var getter = attrHandle[ name ] || jQuery.find.attr;
        
       -                // If request was aborted inside a prefilter, stop there
       -                if ( state === 2 ) {
       -                        return false;
       +        attrHandle[ name ] = function( elem, name, isXML ) {
       +                var ret, handle,
       +                        lowercaseName = name.toLowerCase();
       +
       +                if ( !isXML ) {
       +
       +                        // Avoid an infinite loop by temporarily removing this function from the getter
       +                        handle = attrHandle[ lowercaseName ];
       +                        attrHandle[ lowercaseName ] = ret;
       +                        ret = getter( elem, name, isXML ) != null ?
       +                                lowercaseName :
       +                                null;
       +                        attrHandle[ lowercaseName ] = handle;
                        }
       +                return ret;
       +        };
       +} );
        
       -                // We can fire global events as of now if asked to
       -                fireGlobals = s.global;
        
       -                // Uppercase the type
       -                s.type = s.type.toUpperCase();
        
       -                // Determine if request has content
       -                s.hasContent = !rnoContent.test( s.type );
        
       -                // Watch for a new set of requests
       -                if ( fireGlobals && jQuery.active++ === 0 ) {
       -                        jQuery.event.trigger( "ajaxStart" );
       +var rfocusable = /^(?:input|select|textarea|button)$/i,
       +        rclickable = /^(?:a|area)$/i;
       +
       +jQuery.fn.extend( {
       +        prop: function( name, value ) {
       +                return access( this, jQuery.prop, name, value, arguments.length > 1 );
       +        },
       +
       +        removeProp: function( name ) {
       +                return this.each( function() {
       +                        delete this[ jQuery.propFix[ name ] || name ];
       +                } );
       +        }
       +} );
       +
       +jQuery.extend( {
       +        prop: function( elem, name, value ) {
       +                var ret, hooks,
       +                        nType = elem.nodeType;
       +
       +                // Don't get/set properties on text, comment and attribute nodes
       +                if ( nType === 3 || nType === 8 || nType === 2 ) {
       +                        return;
                        }
        
       -                // More options handling for requests with no content
       -                if ( !s.hasContent ) {
       +                if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
        
       -                        // If data is available, append data to url
       -                        if ( s.data ) {
       -                                s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
       -                                // #9682: remove data so that it's not used in an eventual retry
       -                                delete s.data;
       +                        // Fix name and attach hooks
       +                        name = jQuery.propFix[ name ] || name;
       +                        hooks = jQuery.propHooks[ name ];
       +                }
       +
       +                if ( value !== undefined ) {
       +                        if ( hooks && "set" in hooks &&
       +                                ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
       +                                return ret;
                                }
        
       -                        // Get ifModifiedKey before adding the anti-cache parameter
       -                        ifModifiedKey = s.url;
       +                        return ( elem[ name ] = value );
       +                }
       +
       +                if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
       +                        return ret;
       +                }
       +
       +                return elem[ name ];
       +        },
       +
       +        propHooks: {
       +                tabIndex: {
       +                        get: function( elem ) {
       +
       +                                // Support: IE <=9 - 11 only
       +                                // elem.tabIndex doesn't always return the
       +                                // correct value when it hasn't been explicitly set
       +                                // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
       +                                // Use proper attribute retrieval(#12072)
       +                                var tabindex = jQuery.find.attr( elem, "tabindex" );
       +
       +                                if ( tabindex ) {
       +                                        return parseInt( tabindex, 10 );
       +                                }
       +
       +                                if (
       +                                        rfocusable.test( elem.nodeName ) ||
       +                                        rclickable.test( elem.nodeName ) &&
       +                                        elem.href
       +                                ) {
       +                                        return 0;
       +                                }
       +
       +                                return -1;
       +                        }
       +                }
       +        },
       +
       +        propFix: {
       +                "for": "htmlFor",
       +                "class": "className"
       +        }
       +} );
       +
       +// Support: IE <=11 only
       +// Accessing the selectedIndex property
       +// forces the browser to respect setting selected
       +// on the option
       +// The getter ensures a default option is selected
       +// when in an optgroup
       +// eslint rule "no-unused-expressions" is disabled for this code
       +// since it considers such accessions noop
       +if ( !support.optSelected ) {
       +        jQuery.propHooks.selected = {
       +                get: function( elem ) {
       +
       +                        /* eslint no-unused-expressions: "off" */
       +
       +                        var parent = elem.parentNode;
       +                        if ( parent && parent.parentNode ) {
       +                                parent.parentNode.selectedIndex;
       +                        }
       +                        return null;
       +                },
       +                set: function( elem ) {
       +
       +                        /* eslint no-unused-expressions: "off" */
       +
       +                        var parent = elem.parentNode;
       +                        if ( parent ) {
       +                                parent.selectedIndex;
       +
       +                                if ( parent.parentNode ) {
       +                                        parent.parentNode.selectedIndex;
       +                                }
       +                        }
       +                }
       +        };
       +}
       +
       +jQuery.each( [
       +        "tabIndex",
       +        "readOnly",
       +        "maxLength",
       +        "cellSpacing",
       +        "cellPadding",
       +        "rowSpan",
       +        "colSpan",
       +        "useMap",
       +        "frameBorder",
       +        "contentEditable"
       +], function() {
       +        jQuery.propFix[ this.toLowerCase() ] = this;
       +} );
       +
       +
       +
       +
       +        // Strip and collapse whitespace according to HTML spec
       +        // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace
       +        function stripAndCollapse( value ) {
       +                var tokens = value.match( rnothtmlwhite ) || [];
       +                return tokens.join( " " );
       +        }
       +
       +
       +function getClass( elem ) {
       +        return elem.getAttribute && elem.getAttribute( "class" ) || "";
       +}
       +
       +jQuery.fn.extend( {
       +        addClass: function( value ) {
       +                var classes, elem, cur, curValue, clazz, j, finalValue,
       +                        i = 0;
       +
       +                if ( jQuery.isFunction( value ) ) {
       +                        return this.each( function( j ) {
       +                                jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
       +                        } );
       +                }
       +
       +                if ( typeof value === "string" && value ) {
       +                        classes = value.match( rnothtmlwhite ) || [];
       +
       +                        while ( ( elem = this[ i++ ] ) ) {
       +                                curValue = getClass( elem );
       +                                cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
       +
       +                                if ( cur ) {
       +                                        j = 0;
       +                                        while ( ( clazz = classes[ j++ ] ) ) {
       +                                                if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
       +                                                        cur += clazz + " ";
       +                                                }
       +                                        }
       +
       +                                        // Only assign if different to avoid unneeded rendering.
       +                                        finalValue = stripAndCollapse( cur );
       +                                        if ( curValue !== finalValue ) {
       +                                                elem.setAttribute( "class", finalValue );
       +                                        }
       +                                }
       +                        }
       +                }
       +
       +                return this;
       +        },
       +
       +        removeClass: function( value ) {
       +                var classes, elem, cur, curValue, clazz, j, finalValue,
       +                        i = 0;
       +
       +                if ( jQuery.isFunction( value ) ) {
       +                        return this.each( function( j ) {
       +                                jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
       +                        } );
       +                }
       +
       +                if ( !arguments.length ) {
       +                        return this.attr( "class", "" );
       +                }
       +
       +                if ( typeof value === "string" && value ) {
       +                        classes = value.match( rnothtmlwhite ) || [];
       +
       +                        while ( ( elem = this[ i++ ] ) ) {
       +                                curValue = getClass( elem );
       +
       +                                // This expression is here for better compressibility (see addClass)
       +                                cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
       +
       +                                if ( cur ) {
       +                                        j = 0;
       +                                        while ( ( clazz = classes[ j++ ] ) ) {
       +
       +                                                // Remove *all* instances
       +                                                while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
       +                                                        cur = cur.replace( " " + clazz + " ", " " );
       +                                                }
       +                                        }
       +
       +                                        // Only assign if different to avoid unneeded rendering.
       +                                        finalValue = stripAndCollapse( cur );
       +                                        if ( curValue !== finalValue ) {
       +                                                elem.setAttribute( "class", finalValue );
       +                                        }
       +                                }
       +                        }
       +                }
       +
       +                return this;
       +        },
       +
       +        toggleClass: function( value, stateVal ) {
       +                var type = typeof value;
       +
       +                if ( typeof stateVal === "boolean" && type === "string" ) {
       +                        return stateVal ? this.addClass( value ) : this.removeClass( value );
       +                }
       +
       +                if ( jQuery.isFunction( value ) ) {
       +                        return this.each( function( i ) {
       +                                jQuery( this ).toggleClass(
       +                                        value.call( this, i, getClass( this ), stateVal ),
       +                                        stateVal
       +                                );
       +                        } );
       +                }
       +
       +                return this.each( function() {
       +                        var className, i, self, classNames;
       +
       +                        if ( type === "string" ) {
       +
       +                                // Toggle individual class names
       +                                i = 0;
       +                                self = jQuery( this );
       +                                classNames = value.match( rnothtmlwhite ) || [];
       +
       +                                while ( ( className = classNames[ i++ ] ) ) {
       +
       +                                        // Check each className given, space separated list
       +                                        if ( self.hasClass( className ) ) {
       +                                                self.removeClass( className );
       +                                        } else {
       +                                                self.addClass( className );
       +                                        }
       +                                }
       +
       +                        // Toggle whole class name
       +                        } else if ( value === undefined || type === "boolean" ) {
       +                                className = getClass( this );
       +                                if ( className ) {
       +
       +                                        // Store className if set
       +                                        dataPriv.set( this, "__className__", className );
       +                                }
       +
       +                                // If the element has a class name or if we're passed `false`,
       +                                // then remove the whole classname (if there was one, the above saved it).
       +                                // Otherwise bring back whatever was previously saved (if anything),
       +                                // falling back to the empty string if nothing was stored.
       +                                if ( this.setAttribute ) {
       +                                        this.setAttribute( "class",
       +                                                className || value === false ?
       +                                                "" :
       +                                                dataPriv.get( this, "__className__" ) || ""
       +                                        );
       +                                }
       +                        }
       +                } );
       +        },
       +
       +        hasClass: function( selector ) {
       +                var className, elem,
       +                        i = 0;
       +
       +                className = " " + selector + " ";
       +                while ( ( elem = this[ i++ ] ) ) {
       +                        if ( elem.nodeType === 1 &&
       +                                ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
       +                                        return true;
       +                        }
       +                }
       +
       +                return false;
       +        }
       +} );
       +
       +
       +
       +
       +var rreturn = /\r/g;
       +
       +jQuery.fn.extend( {
       +        val: function( value ) {
       +                var hooks, ret, isFunction,
       +                        elem = this[ 0 ];
       +
       +                if ( !arguments.length ) {
       +                        if ( elem ) {
       +                                hooks = jQuery.valHooks[ elem.type ] ||
       +                                        jQuery.valHooks[ elem.nodeName.toLowerCase() ];
       +
       +                                if ( hooks &&
       +                                        "get" in hooks &&
       +                                        ( ret = hooks.get( elem, "value" ) ) !== undefined
       +                                ) {
       +                                        return ret;
       +                                }
       +
       +                                ret = elem.value;
       +
       +                                // Handle most common string cases
       +                                if ( typeof ret === "string" ) {
       +                                        return ret.replace( rreturn, "" );
       +                                }
       +
       +                                // Handle cases where value is null/undef or number
       +                                return ret == null ? "" : ret;
       +                        }
       +
       +                        return;
       +                }
       +
       +                isFunction = jQuery.isFunction( value );
       +
       +                return this.each( function( i ) {
       +                        var val;
       +
       +                        if ( this.nodeType !== 1 ) {
       +                                return;
       +                        }
       +
       +                        if ( isFunction ) {
       +                                val = value.call( this, i, jQuery( this ).val() );
       +                        } else {
       +                                val = value;
       +                        }
       +
       +                        // Treat null/undefined as ""; convert numbers to string
       +                        if ( val == null ) {
       +                                val = "";
       +
       +                        } else if ( typeof val === "number" ) {
       +                                val += "";
       +
       +                        } else if ( jQuery.isArray( val ) ) {
       +                                val = jQuery.map( val, function( value ) {
       +                                        return value == null ? "" : value + "";
       +                                } );
       +                        }
       +
       +                        hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
       +
       +                        // If set returns undefined, fall back to normal setting
       +                        if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
       +                                this.value = val;
       +                        }
       +                } );
       +        }
       +} );
       +
       +jQuery.extend( {
       +        valHooks: {
       +                option: {
       +                        get: function( elem ) {
       +
       +                                var val = jQuery.find.attr( elem, "value" );
       +                                return val != null ?
       +                                        val :
       +
       +                                        // Support: IE <=10 - 11 only
       +                                        // option.text throws exceptions (#14686, #14858)
       +                                        // Strip and collapse whitespace
       +                                        // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
       +                                        stripAndCollapse( jQuery.text( elem ) );
       +                        }
       +                },
       +                select: {
       +                        get: function( elem ) {
       +                                var value, option, i,
       +                                        options = elem.options,
       +                                        index = elem.selectedIndex,
       +                                        one = elem.type === "select-one",
       +                                        values = one ? null : [],
       +                                        max = one ? index + 1 : options.length;
       +
       +                                if ( index < 0 ) {
       +                                        i = max;
       +
       +                                } else {
       +                                        i = one ? index : 0;
       +                                }
       +
       +                                // Loop through all the selected options
       +                                for ( ; i < max; i++ ) {
       +                                        option = options[ i ];
       +
       +                                        // Support: IE <=9 only
       +                                        // IE8-9 doesn't update selected after form reset (#2551)
       +                                        if ( ( option.selected || i === index ) &&
       +
       +                                                        // Don't return options that are disabled or in a disabled optgroup
       +                                                        !option.disabled &&
       +                                                        ( !option.parentNode.disabled ||
       +                                                                !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
       +
       +                                                // Get the specific value for the option
       +                                                value = jQuery( option ).val();
       +
       +                                                // We don't need an array for one selects
       +                                                if ( one ) {
       +                                                        return value;
       +                                                }
       +
       +                                                // Multi-Selects return an array
       +                                                values.push( value );
       +                                        }
       +                                }
       +
       +                                return values;
       +                        },
       +
       +                        set: function( elem, value ) {
       +                                var optionSet, option,
       +                                        options = elem.options,
       +                                        values = jQuery.makeArray( value ),
       +                                        i = options.length;
       +
       +                                while ( i-- ) {
       +                                        option = options[ i ];
       +
       +                                        /* eslint-disable no-cond-assign */
       +
       +                                        if ( option.selected =
       +                                                jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
       +                                        ) {
       +                                                optionSet = true;
       +                                        }
       +
       +                                        /* eslint-enable no-cond-assign */
       +                                }
       +
       +                                // Force browsers to behave consistently when non-matching value is set
       +                                if ( !optionSet ) {
       +                                        elem.selectedIndex = -1;
       +                                }
       +                                return values;
       +                        }
       +                }
       +        }
       +} );
       +
       +// Radios and checkboxes getter/setter
       +jQuery.each( [ "radio", "checkbox" ], function() {
       +        jQuery.valHooks[ this ] = {
       +                set: function( elem, value ) {
       +                        if ( jQuery.isArray( value ) ) {
       +                                return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
       +                        }
       +                }
       +        };
       +        if ( !support.checkOn ) {
       +                jQuery.valHooks[ this ].get = function( elem ) {
       +                        return elem.getAttribute( "value" ) === null ? "on" : elem.value;
       +                };
       +        }
       +} );
       +
       +
       +
       +
       +// Return jQuery for attributes-only inclusion
       +
       +
       +var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
       +
       +jQuery.extend( jQuery.event, {
       +
       +        trigger: function( event, data, elem, onlyHandlers ) {
       +
       +                var i, cur, tmp, bubbleType, ontype, handle, special,
       +                        eventPath = [ elem || document ],
       +                        type = hasOwn.call( event, "type" ) ? event.type : event,
       +                        namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
       +
       +                cur = tmp = elem = elem || document;
       +
       +                // Don't do events on text and comment nodes
       +                if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
       +                        return;
       +                }
       +
       +                // focus/blur morphs to focusin/out; ensure we're not firing them right now
       +                if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
       +                        return;
       +                }
       +
       +                if ( type.indexOf( "." ) > -1 ) {
       +
       +                        // Namespaced trigger; create a regexp to match event type in handle()
       +                        namespaces = type.split( "." );
       +                        type = namespaces.shift();
       +                        namespaces.sort();
       +                }
       +                ontype = type.indexOf( ":" ) < 0 && "on" + type;
       +
       +                // Caller can pass in a jQuery.Event object, Object, or just an event type string
       +                event = event[ jQuery.expando ] ?
       +                        event :
       +                        new jQuery.Event( type, typeof event === "object" && event );
       +
       +                // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
       +                event.isTrigger = onlyHandlers ? 2 : 3;
       +                event.namespace = namespaces.join( "." );
       +                event.rnamespace = event.namespace ?
       +                        new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
       +                        null;
       +
       +                // Clean up the event in case it is being reused
       +                event.result = undefined;
       +                if ( !event.target ) {
       +                        event.target = elem;
       +                }
       +
       +                // Clone any incoming data and prepend the event, creating the handler arg list
       +                data = data == null ?
       +                        [ event ] :
       +                        jQuery.makeArray( data, [ event ] );
       +
       +                // Allow special events to draw outside the lines
       +                special = jQuery.event.special[ type ] || {};
       +                if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
       +                        return;
       +                }
       +
       +                // Determine event propagation path in advance, per W3C events spec (#9951)
       +                // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
       +                if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
       +
       +                        bubbleType = special.delegateType || type;
       +                        if ( !rfocusMorph.test( bubbleType + type ) ) {
       +                                cur = cur.parentNode;
       +                        }
       +                        for ( ; cur; cur = cur.parentNode ) {
       +                                eventPath.push( cur );
       +                                tmp = cur;
       +                        }
       +
       +                        // Only add window if we got to document (e.g., not plain obj or detached DOM)
       +                        if ( tmp === ( elem.ownerDocument || document ) ) {
       +                                eventPath.push( tmp.defaultView || tmp.parentWindow || window );
       +                        }
       +                }
       +
       +                // Fire handlers on the event path
       +                i = 0;
       +                while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
       +
       +                        event.type = i > 1 ?
       +                                bubbleType :
       +                                special.bindType || type;
       +
       +                        // jQuery handler
       +                        handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
       +                                dataPriv.get( cur, "handle" );
       +                        if ( handle ) {
       +                                handle.apply( cur, data );
       +                        }
       +
       +                        // Native handler
       +                        handle = ontype && cur[ ontype ];
       +                        if ( handle && handle.apply && acceptData( cur ) ) {
       +                                event.result = handle.apply( cur, data );
       +                                if ( event.result === false ) {
       +                                        event.preventDefault();
       +                                }
       +                        }
       +                }
       +                event.type = type;
       +
       +                // If nobody prevented the default action, do it now
       +                if ( !onlyHandlers && !event.isDefaultPrevented() ) {
       +
       +                        if ( ( !special._default ||
       +                                special._default.apply( eventPath.pop(), data ) === false ) &&
       +                                acceptData( elem ) ) {
       +
       +                                // Call a native DOM method on the target with the same name as the event.
       +                                // Don't do default actions on window, that's where global variables be (#6170)
       +                                if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
       +
       +                                        // Don't re-trigger an onFOO event when we call its FOO() method
       +                                        tmp = elem[ ontype ];
       +
       +                                        if ( tmp ) {
       +                                                elem[ ontype ] = null;
       +                                        }
       +
       +                                        // Prevent re-triggering of the same event, since we already bubbled it above
       +                                        jQuery.event.triggered = type;
       +                                        elem[ type ]();
       +                                        jQuery.event.triggered = undefined;
       +
       +                                        if ( tmp ) {
       +                                                elem[ ontype ] = tmp;
       +                                        }
       +                                }
       +                        }
       +                }
       +
       +                return event.result;
       +        },
       +
       +        // Piggyback on a donor event to simulate a different one
       +        // Used only for `focus(in | out)` events
       +        simulate: function( type, elem, event ) {
       +                var e = jQuery.extend(
       +                        new jQuery.Event(),
       +                        event,
       +                        {
       +                                type: type,
       +                                isSimulated: true
       +                        }
       +                );
       +
       +                jQuery.event.trigger( e, null, elem );
       +        }
       +
       +} );
       +
       +jQuery.fn.extend( {
       +
       +        trigger: function( type, data ) {
       +                return this.each( function() {
       +                        jQuery.event.trigger( type, data, this );
       +                } );
       +        },
       +        triggerHandler: function( type, data ) {
       +                var elem = this[ 0 ];
       +                if ( elem ) {
       +                        return jQuery.event.trigger( type, data, elem, true );
       +                }
       +        }
       +} );
       +
        
       -                        // Add anti-cache in url if needed
       -                        if ( s.cache === false ) {
       +jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
       +        "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
       +        "change select submit keydown keypress keyup contextmenu" ).split( " " ),
       +        function( i, name ) {
        
       -                                var ts = jQuery.now(),
       -                                        // try replacing _= if it is there
       -                                        ret = s.url.replace( rts, "$1_=" + ts );
       +        // Handle event binding
       +        jQuery.fn[ name ] = function( data, fn ) {
       +                return arguments.length > 0 ?
       +                        this.on( name, null, data, fn ) :
       +                        this.trigger( name );
       +        };
       +} );
        
       -                                // if nothing was replaced, add timestamp to the end
       -                                s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
       -                        }
       -                }
       +jQuery.fn.extend( {
       +        hover: function( fnOver, fnOut ) {
       +                return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
       +        }
       +} );
        
       -                // Set the correct header, if data is being sent
       -                if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
       -                        jqXHR.setRequestHeader( "Content-Type", s.contentType );
       -                }
        
       -                // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
       -                if ( s.ifModified ) {
       -                        ifModifiedKey = ifModifiedKey || s.url;
       -                        if ( jQuery.lastModified[ ifModifiedKey ] ) {
       -                                jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
       -                        }
       -                        if ( jQuery.etag[ ifModifiedKey ] ) {
       -                                jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
       -                        }
       -                }
        
       -                // Set the Accepts header for the server, depending on the dataType
       -                jqXHR.setRequestHeader(
       -                        "Accept",
       -                        s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
       -                                s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
       -                                s.accepts[ "*" ]
       -                );
        
       -                // Check for headers option
       -                for ( i in s.headers ) {
       -                        jqXHR.setRequestHeader( i, s.headers[ i ] );
       -                }
       +support.focusin = "onfocusin" in window;
        
       -                // Allow custom headers/mimetypes and early abort
       -                if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
       -                                // Abort if not done already
       -                                jqXHR.abort();
       -                                return false;
        
       -                }
       +// Support: Firefox <=44
       +// Firefox doesn't have focus(in | out) events
       +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
       +//
       +// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
       +// focus(in | out) events fire after focus & blur events,
       +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
       +// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
       +if ( !support.focusin ) {
       +        jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
        
       -                // Install callbacks on deferreds
       -                for ( i in { success: 1, error: 1, complete: 1 } ) {
       -                        jqXHR[ i ]( s[ i ] );
       -                }
       +                // Attach a single capturing handler on the document while someone wants focusin/focusout
       +                var handler = function( event ) {
       +                        jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
       +                };
        
       -                // Get transport
       -                transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
       +                jQuery.event.special[ fix ] = {
       +                        setup: function() {
       +                                var doc = this.ownerDocument || this,
       +                                        attaches = dataPriv.access( doc, fix );
        
       -                // If no transport, we auto-abort
       -                if ( !transport ) {
       -                        done( -1, "No Transport" );
       -                } else {
       -                        jqXHR.readyState = 1;
       -                        // Send global event
       -                        if ( fireGlobals ) {
       -                                globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
       -                        }
       -                        // Timeout
       -                        if ( s.async && s.timeout > 0 ) {
       -                                timeoutTimer = setTimeout( function(){
       -                                        jqXHR.abort( "timeout" );
       -                                }, s.timeout );
       -                        }
       +                                if ( !attaches ) {
       +                                        doc.addEventListener( orig, handler, true );
       +                                }
       +                                dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
       +                        },
       +                        teardown: function() {
       +                                var doc = this.ownerDocument || this,
       +                                        attaches = dataPriv.access( doc, fix ) - 1;
       +
       +                                if ( !attaches ) {
       +                                        doc.removeEventListener( orig, handler, true );
       +                                        dataPriv.remove( doc, fix );
        
       -                        try {
       -                                state = 1;
       -                                transport.send( requestHeaders, done );
       -                        } catch (e) {
       -                                // Propagate exception as error if not done
       -                                if ( state < 2 ) {
       -                                        done( -1, e );
       -                                // Simply rethrow otherwise
                                        } else {
       -                                        throw e;
       +                                        dataPriv.access( doc, fix, attaches );
                                        }
                                }
       -                }
       +                };
       +        } );
       +}
       +var location = window.location;
        
       -                return jqXHR;
       -        },
       +var nonce = jQuery.now();
        
       -        // Serialize an array of form elements or a set of
       -        // key/values into a query string
       -        param: function( a, traditional ) {
       -                var s = [],
       -                        add = function( key, value ) {
       -                                // If value is a function, invoke it and return its value
       -                                value = jQuery.isFunction( value ) ? value() : value;
       -                                s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
       -                        };
       +var rquery = ( /\?/ );
        
       -                // Set traditional to true for jQuery <= 1.3.2 behavior.
       -                if ( traditional === undefined ) {
       -                        traditional = jQuery.ajaxSettings.traditional;
       -                }
        
       -                // If an array was passed in, assume that it is an array of form elements.
       -                if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
       -                        // Serialize the form elements
       -                        jQuery.each( a, function() {
       -                                add( this.name, this.value );
       -                        });
        
       -                } else {
       -                        // If traditional, encode the "old" way (the way 1.3.2 or older
       -                        // did it), otherwise encode params recursively.
       -                        for ( var prefix in a ) {
       -                                buildParams( prefix, a[ prefix ], traditional, add );
       -                        }
       -                }
       +// Cross-browser xml parsing
       +jQuery.parseXML = function( data ) {
       +        var xml;
       +        if ( !data || typeof data !== "string" ) {
       +                return null;
       +        }
        
       -                // Return the resulting serialization
       -                return s.join( "&" ).replace( r20, "+" );
       +        // Support: IE 9 - 11 only
       +        // IE throws on parseFromString with invalid input.
       +        try {
       +                xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
       +        } catch ( e ) {
       +                xml = undefined;
                }
       -});
       +
       +        if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
       +                jQuery.error( "Invalid XML: " + data );
       +        }
       +        return xml;
       +};
       +
       +
       +var
       +        rbracket = /\[\]$/,
       +        rCRLF = /\r?\n/g,
       +        rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
       +        rsubmittable = /^(?:input|select|textarea|keygen)/i;
        
        function buildParams( prefix, obj, traditional, add ) {
       +        var name;
       +
                if ( jQuery.isArray( obj ) ) {
       +
                        // Serialize array item.
                        jQuery.each( obj, function( i, v ) {
                                if ( traditional || rbracket.test( prefix ) ) {
       +
                                        // Treat each array item as a scalar.
                                        add( prefix, v );
        
                                } else {
       -                                // If array item is non-scalar (array or object), encode its
       -                                // numeric index to resolve deserialization ambiguity issues.
       -                                // Note that rack (as of 1.0.0) can't currently deserialize
       -                                // nested arrays properly, and attempting to do so may cause
       -                                // a server error. Possible fixes are to modify rack's
       -                                // deserialization algorithm or to provide an option or flag
       -                                // to force array serialization to be shallow.
       -                                buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
       +
       +                                // Item is non-scalar (array or object), encode its numeric index.
       +                                buildParams(
       +                                        prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
       +                                        v,
       +                                        traditional,
       +                                        add
       +                                );
                                }
       -                });
       +                } );
        
                } else if ( !traditional && jQuery.type( obj ) === "object" ) {
       +
                        // Serialize object item.
       -                for ( var name in obj ) {
       +                for ( name in obj ) {
                                buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
                        }
        
                } else {
       +
                        // Serialize scalar item.
                        add( prefix, obj );
                }
        }
        
       -// This is still on the jQuery object... for now
       -// Want to move this to jQuery.ajax some day
       -jQuery.extend({
       +// Serialize an array of form elements or a set of
       +// key/values into a query string
       +jQuery.param = function( a, traditional ) {
       +        var prefix,
       +                s = [],
       +                add = function( key, valueOrFunction ) {
        
       -        // Counter for holding the number of active queries
       -        active: 0,
       +                        // If value is a function, invoke it and use its return value
       +                        var value = jQuery.isFunction( valueOrFunction ) ?
       +                                valueOrFunction() :
       +                                valueOrFunction;
        
       -        // Last-Modified header cache for next request
       -        lastModified: {},
       -        etag: {}
       +                        s[ s.length ] = encodeURIComponent( key ) + "=" +
       +                                encodeURIComponent( value == null ? "" : value );
       +                };
        
       -});
       +        // If an array was passed in, assume that it is an array of form elements.
       +        if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
       +
       +                // Serialize the form elements
       +                jQuery.each( a, function() {
       +                        add( this.name, this.value );
       +                } );
       +
       +        } else {
       +
       +                // If traditional, encode the "old" way (the way 1.3.2 or older
       +                // did it), otherwise encode params recursively.
       +                for ( prefix in a ) {
       +                        buildParams( prefix, a[ prefix ], traditional, add );
       +                }
       +        }
       +
       +        // Return the resulting serialization
       +        return s.join( "&" );
       +};
       +
       +jQuery.fn.extend( {
       +        serialize: function() {
       +                return jQuery.param( this.serializeArray() );
       +        },
       +        serializeArray: function() {
       +                return this.map( function() {
       +
       +                        // Can add propHook for "elements" to filter or add form elements
       +                        var elements = jQuery.prop( this, "elements" );
       +                        return elements ? jQuery.makeArray( elements ) : this;
       +                } )
       +                .filter( function() {
       +                        var type = this.type;
       +
       +                        // Use .is( ":disabled" ) so that fieldset[disabled] works
       +                        return this.name && !jQuery( this ).is( ":disabled" ) &&
       +                                rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
       +                                ( this.checked || !rcheckableType.test( type ) );
       +                } )
       +                .map( function( i, elem ) {
       +                        var val = jQuery( this ).val();
       +
       +                        if ( val == null ) {
       +                                return null;
       +                        }
       +
       +                        if ( jQuery.isArray( val ) ) {
       +                                return jQuery.map( val, function( val ) {
       +                                        return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
       +                                } );
       +                        }
       +
       +                        return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
       +                } ).get();
       +        }
       +} );
       +
       +
       +var
       +        r20 = /%20/g,
       +        rhash = /#.*$/,
       +        rantiCache = /([?&])_=[^&]*/,
       +        rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
       +
       +        // #7653, #8125, #8152: local protocol detection
       +        rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
       +        rnoContent = /^(?:GET|HEAD)$/,
       +        rprotocol = /^\/\//,
       +
       +        /* Prefilters
       +         * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
       +         * 2) These are called:
       +         *    - BEFORE asking for a transport
       +         *    - AFTER param serialization (s.data is a string if s.processData is true)
       +         * 3) key is the dataType
       +         * 4) the catchall symbol "*" can be used
       +         * 5) execution will start with transport dataType and THEN continue down to "*" if needed
       +         */
       +        prefilters = {},
       +
       +        /* Transports bindings
       +         * 1) key is the dataType
       +         * 2) the catchall symbol "*" can be used
       +         * 3) selection will start with transport dataType and THEN go to "*" if needed
       +         */
       +        transports = {},
       +
       +        // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
       +        allTypes = "*/".concat( "*" ),
       +
       +        // Anchor tag for parsing the document origin
       +        originAnchor = document.createElement( "a" );
       +        originAnchor.href = location.href;
       +
       +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
       +function addToPrefiltersOrTransports( structure ) {
       +
       +        // dataTypeExpression is optional and defaults to "*"
       +        return function( dataTypeExpression, func ) {
       +
       +                if ( typeof dataTypeExpression !== "string" ) {
       +                        func = dataTypeExpression;
       +                        dataTypeExpression = "*";
       +                }
       +
       +                var dataType,
       +                        i = 0,
       +                        dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
       +
       +                if ( jQuery.isFunction( func ) ) {
       +
       +                        // For each dataType in the dataTypeExpression
       +                        while ( ( dataType = dataTypes[ i++ ] ) ) {
       +
       +                                // Prepend if requested
       +                                if ( dataType[ 0 ] === "+" ) {
       +                                        dataType = dataType.slice( 1 ) || "*";
       +                                        ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
       +
       +                                // Otherwise append
       +                                } else {
       +                                        ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
       +                                }
       +                        }
       +                }
       +        };
       +}
       +
       +// Base inspection function for prefilters and transports
       +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
       +
       +        var inspected = {},
       +                seekingTransport = ( structure === transports );
       +
       +        function inspect( dataType ) {
       +                var selected;
       +                inspected[ dataType ] = true;
       +                jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
       +                        var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
       +                        if ( typeof dataTypeOrTransport === "string" &&
       +                                !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
       +
       +                                options.dataTypes.unshift( dataTypeOrTransport );
       +                                inspect( dataTypeOrTransport );
       +                                return false;
       +                        } else if ( seekingTransport ) {
       +                                return !( selected = dataTypeOrTransport );
       +                        }
       +                } );
       +                return selected;
       +        }
       +
       +        return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
       +}
       +
       +// A special extend for ajax options
       +// that takes "flat" options (not to be deep extended)
       +// Fixes #9887
       +function ajaxExtend( target, src ) {
       +        var key, deep,
       +                flatOptions = jQuery.ajaxSettings.flatOptions || {};
       +
       +        for ( key in src ) {
       +                if ( src[ key ] !== undefined ) {
       +                        ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
       +                }
       +        }
       +        if ( deep ) {
       +                jQuery.extend( true, target, deep );
       +        }
       +
       +        return target;
       +}
        
        /* Handles responses to an ajax request:
       - * - sets all responseXXX fields accordingly
         * - finds the right dataType (mediates between content-type and expected dataType)
         * - returns the corresponding response
         */
        function ajaxHandleResponses( s, jqXHR, responses ) {
        
       -        var contents = s.contents,
       -                dataTypes = s.dataTypes,
       -                responseFields = s.responseFields,
       -                ct,
       -                type,
       -                finalDataType,
       -                firstDataType;
       -
       -        // Fill responseXXX fields
       -        for ( type in responseFields ) {
       -                if ( type in responses ) {
       -                        jqXHR[ responseFields[type] ] = responses[ type ];
       -                }
       -        }
       +        var ct, type, finalDataType, firstDataType,
       +                contents = s.contents,
       +                dataTypes = s.dataTypes;
        
                // Remove auto dataType and get content-type in the process
       -        while( dataTypes[ 0 ] === "*" ) {
       +        while ( dataTypes[ 0 ] === "*" ) {
                        dataTypes.shift();
                        if ( ct === undefined ) {
       -                        ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
       +                        ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
                        }
                }
        
       t@@ -7855,9 +8611,10 @@ function ajaxHandleResponses( s, jqXHR, responses ) {
                if ( dataTypes[ 0 ] in responses ) {
                        finalDataType = dataTypes[ 0 ];
                } else {
       +
                        // Try convertible dataTypes
                        for ( type in responses ) {
       -                        if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
       +                        if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
                                        finalDataType = type;
                                        break;
                                }
       t@@ -7865,6 +8622,7 @@ function ajaxHandleResponses( s, jqXHR, responses ) {
                                        firstDataType = type;
                                }
                        }
       +
                        // Or just use first one
                        finalDataType = finalDataType || firstDataType;
                }
       t@@ -7880,1331 +8638,1285 @@ function ajaxHandleResponses( s, jqXHR, responses ) {
                }
        }
        
       -// Chain conversions given the request and the original response
       -function ajaxConvert( s, response ) {
       +/* Chain conversions given the request and the original response
       + * Also sets the responseXXX fields on the jqXHR instance
       + */
       +function ajaxConvert( s, response, jqXHR, isSuccess ) {
       +        var conv2, current, conv, tmp, prev,
       +                converters = {},
        
       -        // Apply the dataFilter if provided
       -        if ( s.dataFilter ) {
       -                response = s.dataFilter( response, s.dataType );
       +                // Work with a copy of dataTypes in case we need to modify it for conversion
       +                dataTypes = s.dataTypes.slice();
       +
       +        // Create converters map with lowercased keys
       +        if ( dataTypes[ 1 ] ) {
       +                for ( conv in s.converters ) {
       +                        converters[ conv.toLowerCase() ] = s.converters[ conv ];
       +                }
                }
        
       -        var dataTypes = s.dataTypes,
       -                converters = {},
       -                i,
       -                key,
       -                length = dataTypes.length,
       -                tmp,
       -                // Current and previous dataTypes
       -                current = dataTypes[ 0 ],
       -                prev,
       -                // Conversion expression
       -                conversion,
       -                // Conversion function
       -                conv,
       -                // Conversion functions (transitive conversion)
       -                conv1,
       -                conv2;
       -
       -        // For each dataType in the chain
       -        for ( i = 1; i < length; i++ ) {
       -
       -                // Create converters map
       -                // with lowercased keys
       -                if ( i === 1 ) {
       -                        for ( key in s.converters ) {
       -                                if ( typeof key === "string" ) {
       -                                        converters[ key.toLowerCase() ] = s.converters[ key ];
       -                                }
       -                        }
       -                }
       -
       -                // Get the dataTypes
       +        current = dataTypes.shift();
       +
       +        // Convert to each sequential dataType
       +        while ( current ) {
       +
       +                if ( s.responseFields[ current ] ) {
       +                        jqXHR[ s.responseFields[ current ] ] = response;
       +                }
       +
       +                // Apply the dataFilter if provided
       +                if ( !prev && isSuccess && s.dataFilter ) {
       +                        response = s.dataFilter( response, s.dataType );
       +                }
       +
                        prev = current;
       -                current = dataTypes[ i ];
       -
       -                // If current is auto dataType, update it to prev
       -                if ( current === "*" ) {
       -                        current = prev;
       -                // If no auto and dataTypes are actually different
       -                } else if ( prev !== "*" && prev !== current ) {
       -
       -                        // Get the converter
       -                        conversion = prev + " " + current;
       -                        conv = converters[ conversion ] || converters[ "* " + current ];
       -
       -                        // If there is no direct converter, search transitively
       -                        if ( !conv ) {
       -                                conv2 = undefined;
       -                                for ( conv1 in converters ) {
       -                                        tmp = conv1.split( " " );
       -                                        if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
       -                                                conv2 = converters[ tmp[1] + " " + current ];
       -                                                if ( conv2 ) {
       -                                                        conv1 = converters[ conv1 ];
       -                                                        if ( conv1 === true ) {
       -                                                                conv = conv2;
       -                                                        } else if ( conv2 === true ) {
       -                                                                conv = conv1;
       +                current = dataTypes.shift();
       +
       +                if ( current ) {
       +
       +                        // There's only work to do if current dataType is non-auto
       +                        if ( current === "*" ) {
       +
       +                                current = prev;
       +
       +                        // Convert response if prev dataType is non-auto and differs from current
       +                        } else if ( prev !== "*" && prev !== current ) {
       +
       +                                // Seek a direct converter
       +                                conv = converters[ prev + " " + current ] || converters[ "* " + current ];
       +
       +                                // If none found, seek a pair
       +                                if ( !conv ) {
       +                                        for ( conv2 in converters ) {
       +
       +                                                // If conv2 outputs current
       +                                                tmp = conv2.split( " " );
       +                                                if ( tmp[ 1 ] === current ) {
       +
       +                                                        // If prev can be converted to accepted input
       +                                                        conv = converters[ prev + " " + tmp[ 0 ] ] ||
       +                                                                converters[ "* " + tmp[ 0 ] ];
       +                                                        if ( conv ) {
       +
       +                                                                // Condense equivalence converters
       +                                                                if ( conv === true ) {
       +                                                                        conv = converters[ conv2 ];
       +
       +                                                                // Otherwise, insert the intermediate dataType
       +                                                                } else if ( converters[ conv2 ] !== true ) {
       +                                                                        current = tmp[ 0 ];
       +                                                                        dataTypes.unshift( tmp[ 1 ] );
       +                                                                }
       +                                                                break;
                                                                }
       -                                                        break;
                                                        }
                                                }
                                        }
       -                        }
       -                        // If we found no converter, dispatch an error
       -                        if ( !( conv || conv2 ) ) {
       -                                jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
       -                        }
       -                        // If found converter is not an equivalence
       -                        if ( conv !== true ) {
       -                                // Convert with 1 or 2 converters accordingly
       -                                response = conv ? conv( response ) : conv2( conv1(response) );
       +
       +                                // Apply converter (if not an equivalence)
       +                                if ( conv !== true ) {
       +
       +                                        // Unless errors are allowed to bubble, catch and return them
       +                                        if ( conv && s.throws ) {
       +                                                response = conv( response );
       +                                        } else {
       +                                                try {
       +                                                        response = conv( response );
       +                                                } catch ( e ) {
       +                                                        return {
       +                                                                state: "parsererror",
       +                                                                error: conv ? e : "No conversion from " + prev + " to " + current
       +                                                        };
       +                                                }
       +                                        }
       +                                }
                                }
                        }
                }
       -        return response;
       +
       +        return { state: "success", data: response };
        }
        
       +jQuery.extend( {
       +
       +        // Counter for holding the number of active queries
       +        active: 0,
       +
       +        // Last-Modified header cache for next request
       +        lastModified: {},
       +        etag: {},
       +
       +        ajaxSettings: {
       +                url: location.href,
       +                type: "GET",
       +                isLocal: rlocalProtocol.test( location.protocol ),
       +                global: true,
       +                processData: true,
       +                async: true,
       +                contentType: "application/x-www-form-urlencoded; charset=UTF-8",
       +
       +                /*
       +                timeout: 0,
       +                data: null,
       +                dataType: null,
       +                username: null,
       +                password: null,
       +                cache: null,
       +                throws: false,
       +                traditional: false,
       +                headers: {},
       +                */
        
       +                accepts: {
       +                        "*": allTypes,
       +                        text: "text/plain",
       +                        html: "text/html",
       +                        xml: "application/xml, text/xml",
       +                        json: "application/json, text/javascript"
       +                },
        
       +                contents: {
       +                        xml: /\bxml\b/,
       +                        html: /\bhtml/,
       +                        json: /\bjson\b/
       +                },
        
       -var jsc = jQuery.now(),
       -        jsre = /(\=)\?(&|$)|\?\?/i;
       +                responseFields: {
       +                        xml: "responseXML",
       +                        text: "responseText",
       +                        json: "responseJSON"
       +                },
        
       -// Default jsonp settings
       -jQuery.ajaxSetup({
       -        jsonp: "callback",
       -        jsonpCallback: function() {
       -                return jQuery.expando + "_" + ( jsc++ );
       -        }
       -});
       +                // Data converters
       +                // Keys separate source (or catchall "*") and destination types with a single space
       +                converters: {
        
       -// Detect, normalize options and install callbacks for jsonp requests
       -jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
       +                        // Convert anything to text
       +                        "* text": String,
        
       -        var inspectData = ( typeof s.data === "string" ) && /^application\/x\-www\-form\-urlencoded/.test( s.contentType );
       +                        // Text to html (true = no transformation)
       +                        "text html": true,
        
       -        if ( s.dataTypes[ 0 ] === "jsonp" ||
       -                s.jsonp !== false && ( jsre.test( s.url ) ||
       -                                inspectData && jsre.test( s.data ) ) ) {
       +                        // Evaluate text as a json expression
       +                        "text json": JSON.parse,
        
       -                var responseContainer,
       -                        jsonpCallback = s.jsonpCallback =
       -                                jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
       -                        previous = window[ jsonpCallback ],
       -                        url = s.url,
       -                        data = s.data,
       -                        replace = "$1" + jsonpCallback + "$2";
       +                        // Parse text as xml
       +                        "text xml": jQuery.parseXML
       +                },
        
       -                if ( s.jsonp !== false ) {
       -                        url = url.replace( jsre, replace );
       -                        if ( s.url === url ) {
       -                                if ( inspectData ) {
       -                                        data = data.replace( jsre, replace );
       -                                }
       -                                if ( s.data === data ) {
       -                                        // Add callback manually
       -                                        url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
       -                                }
       -                        }
       +                // For options that shouldn't be deep extended:
       +                // you can add your own custom options here if
       +                // and when you create one that shouldn't be
       +                // deep extended (see ajaxExtend)
       +                flatOptions: {
       +                        url: true,
       +                        context: true
                        }
       +        },
        
       -                s.url = url;
       -                s.data = data;
       -
       -                // Install callback
       -                window[ jsonpCallback ] = function( response ) {
       -                        responseContainer = [ response ];
       -                };
       +        // Creates a full fledged settings object into target
       +        // with both ajaxSettings and settings fields.
       +        // If target is omitted, writes into ajaxSettings.
       +        ajaxSetup: function( target, settings ) {
       +                return settings ?
        
       -                // Clean-up function
       -                jqXHR.always(function() {
       -                        // Set callback back to previous value
       -                        window[ jsonpCallback ] = previous;
       -                        // Call if it was a function and we have a response
       -                        if ( responseContainer && jQuery.isFunction( previous ) ) {
       -                                window[ jsonpCallback ]( responseContainer[ 0 ] );
       -                        }
       -                });
       +                        // Building a settings object
       +                        ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
        
       -                // Use data converter to retrieve json after script execution
       -                s.converters["script json"] = function() {
       -                        if ( !responseContainer ) {
       -                                jQuery.error( jsonpCallback + " was not called" );
       -                        }
       -                        return responseContainer[ 0 ];
       -                };
       +                        // Extending ajaxSettings
       +                        ajaxExtend( jQuery.ajaxSettings, target );
       +        },
        
       -                // force json dataType
       -                s.dataTypes[ 0 ] = "json";
       +        ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
       +        ajaxTransport: addToPrefiltersOrTransports( transports ),
        
       -                // Delegate to script
       -                return "script";
       -        }
       -});
       +        // Main method
       +        ajax: function( url, options ) {
        
       +                // If url is an object, simulate pre-1.5 signature
       +                if ( typeof url === "object" ) {
       +                        options = url;
       +                        url = undefined;
       +                }
        
       +                // Force options to be an object
       +                options = options || {};
        
       +                var transport,
        
       -// Install script dataType
       -jQuery.ajaxSetup({
       -        accepts: {
       -                script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
       -        },
       -        contents: {
       -                script: /javascript|ecmascript/
       -        },
       -        converters: {
       -                "text script": function( text ) {
       -                        jQuery.globalEval( text );
       -                        return text;
       -                }
       -        }
       -});
       +                        // URL without anti-cache param
       +                        cacheURL,
        
       -// Handle cache's special case and global
       -jQuery.ajaxPrefilter( "script", function( s ) {
       -        if ( s.cache === undefined ) {
       -                s.cache = false;
       -        }
       -        if ( s.crossDomain ) {
       -                s.type = "GET";
       -                s.global = false;
       -        }
       -});
       +                        // Response headers
       +                        responseHeadersString,
       +                        responseHeaders,
        
       -// Bind script tag hack transport
       -jQuery.ajaxTransport( "script", function(s) {
       +                        // timeout handle
       +                        timeoutTimer,
        
       -        // This transport only deals with cross domain requests
       -        if ( s.crossDomain ) {
       +                        // Url cleanup var
       +                        urlAnchor,
        
       -                var script,
       -                        head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
       +                        // Request state (becomes false upon send and true upon completion)
       +                        completed,
        
       -                return {
       +                        // To know if global events are to be dispatched
       +                        fireGlobals,
        
       -                        send: function( _, callback ) {
       +                        // Loop variable
       +                        i,
        
       -                                script = document.createElement( "script" );
       +                        // uncached part of the url
       +                        uncached,
        
       -                                script.async = "async";
       +                        // Create the final options object
       +                        s = jQuery.ajaxSetup( {}, options ),
        
       -                                if ( s.scriptCharset ) {
       -                                        script.charset = s.scriptCharset;
       -                                }
       +                        // Callbacks context
       +                        callbackContext = s.context || s,
        
       -                                script.src = s.url;
       +                        // Context for global events is callbackContext if it is a DOM node or jQuery collection
       +                        globalEventContext = s.context &&
       +                                ( callbackContext.nodeType || callbackContext.jquery ) ?
       +                                        jQuery( callbackContext ) :
       +                                        jQuery.event,
        
       -                                // Attach handlers for all browsers
       -                                script.onload = script.onreadystatechange = function( _, isAbort ) {
       +                        // Deferreds
       +                        deferred = jQuery.Deferred(),
       +                        completeDeferred = jQuery.Callbacks( "once memory" ),
        
       -                                        if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
       +                        // Status-dependent callbacks
       +                        statusCode = s.statusCode || {},
        
       -                                                // Handle memory leak in IE
       -                                                script.onload = script.onreadystatechange = null;
       +                        // Headers (they are sent all at once)
       +                        requestHeaders = {},
       +                        requestHeadersNames = {},
        
       -                                                // Remove the script
       -                                                if ( head && script.parentNode ) {
       -                                                        head.removeChild( script );
       -                                                }
       +                        // Default abort message
       +                        strAbort = "canceled",
        
       -                                                // Dereference the script
       -                                                script = undefined;
       +                        // Fake xhr
       +                        jqXHR = {
       +                                readyState: 0,
        
       -                                                // Callback if not abort
       -                                                if ( !isAbort ) {
       -                                                        callback( 200, "success" );
       +                                // Builds headers hashtable if needed
       +                                getResponseHeader: function( key ) {
       +                                        var match;
       +                                        if ( completed ) {
       +                                                if ( !responseHeaders ) {
       +                                                        responseHeaders = {};
       +                                                        while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
       +                                                                responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
       +                                                        }
                                                        }
       +                                                match = responseHeaders[ key.toLowerCase() ];
                                                }
       -                                };
       -                                // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
       -                                // This arises when a base node is used (#2709 and #4378).
       -                                head.insertBefore( script, head.firstChild );
       -                        },
       +                                        return match == null ? null : match;
       +                                },
        
       -                        abort: function() {
       -                                if ( script ) {
       -                                        script.onload( 0, 1 );
       -                                }
       -                        }
       -                };
       -        }
       -});
       +                                // Raw string
       +                                getAllResponseHeaders: function() {
       +                                        return completed ? responseHeadersString : null;
       +                                },
        
       +                                // Caches the header
       +                                setRequestHeader: function( name, value ) {
       +                                        if ( completed == null ) {
       +                                                name = requestHeadersNames[ name.toLowerCase() ] =
       +                                                        requestHeadersNames[ name.toLowerCase() ] || name;
       +                                                requestHeaders[ name ] = value;
       +                                        }
       +                                        return this;
       +                                },
        
       +                                // Overrides response content-type header
       +                                overrideMimeType: function( type ) {
       +                                        if ( completed == null ) {
       +                                                s.mimeType = type;
       +                                        }
       +                                        return this;
       +                                },
        
       +                                // Status-dependent callbacks
       +                                statusCode: function( map ) {
       +                                        var code;
       +                                        if ( map ) {
       +                                                if ( completed ) {
        
       -var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
       -        xhrOnUnloadAbort = window.ActiveXObject ? function() {
       -                // Abort all pending requests
       -                for ( var key in xhrCallbacks ) {
       -                        xhrCallbacks[ key ]( 0, 1 );
       -                }
       -        } : false,
       -        xhrId = 0,
       -        xhrCallbacks;
       +                                                        // Execute the appropriate callbacks
       +                                                        jqXHR.always( map[ jqXHR.status ] );
       +                                                } else {
        
       -// Functions to create xhrs
       -function createStandardXHR() {
       -        try {
       -                return new window.XMLHttpRequest();
       -        } catch( e ) {}
       -}
       +                                                        // Lazy-add the new callbacks in a way that preserves old ones
       +                                                        for ( code in map ) {
       +                                                                statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
       +                                                        }
       +                                                }
       +                                        }
       +                                        return this;
       +                                },
        
       -function createActiveXHR() {
       -        try {
       -                return new window.ActiveXObject( "Microsoft.XMLHTTP" );
       -        } catch( e ) {}
       -}
       +                                // Cancel the request
       +                                abort: function( statusText ) {
       +                                        var finalText = statusText || strAbort;
       +                                        if ( transport ) {
       +                                                transport.abort( finalText );
       +                                        }
       +                                        done( 0, finalText );
       +                                        return this;
       +                                }
       +                        };
        
       -// Create the request object
       -// (This is still attached to ajaxSettings for backward compatibility)
       -jQuery.ajaxSettings.xhr = window.ActiveXObject ?
       -        /* Microsoft failed to properly
       -         * implement the XMLHttpRequest in IE7 (can't request local files),
       -         * so we use the ActiveXObject when it is available
       -         * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
       -         * we need a fallback.
       -         */
       -        function() {
       -                return !this.isLocal && createStandardXHR() || createActiveXHR();
       -        } :
       -        // For all other browsers, use the standard XMLHttpRequest object
       -        createStandardXHR;
       -
       -// Determine support properties
       -(function( xhr ) {
       -        jQuery.extend( jQuery.support, {
       -                ajax: !!xhr,
       -                cors: !!xhr && ( "withCredentials" in xhr )
       -        });
       -})( jQuery.ajaxSettings.xhr() );
       +                // Attach deferreds
       +                deferred.promise( jqXHR );
        
       -// Create transport if the browser can provide an xhr
       -if ( jQuery.support.ajax ) {
       +                // Add protocol if not provided (prefilters might expect it)
       +                // Handle falsy url in the settings object (#10093: consistency with old signature)
       +                // We also use the url parameter if available
       +                s.url = ( ( url || s.url || location.href ) + "" )
       +                        .replace( rprotocol, location.protocol + "//" );
        
       -        jQuery.ajaxTransport(function( s ) {
       -                // Cross domain only allowed if supported through XMLHttpRequest
       -                if ( !s.crossDomain || jQuery.support.cors ) {
       +                // Alias method option to type as per ticket #12004
       +                s.type = options.method || options.type || s.method || s.type;
        
       -                        var callback;
       +                // Extract dataTypes list
       +                s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
        
       -                        return {
       -                                send: function( headers, complete ) {
       +                // A cross-domain request is in order when the origin doesn't match the current origin.
       +                if ( s.crossDomain == null ) {
       +                        urlAnchor = document.createElement( "a" );
        
       -                                        // Get a new xhr
       -                                        var xhr = s.xhr(),
       -                                                handle,
       -                                                i;
       +                        // Support: IE <=8 - 11, Edge 12 - 13
       +                        // IE throws exception on accessing the href property if url is malformed,
       +                        // e.g. http://example.com:80x/
       +                        try {
       +                                urlAnchor.href = s.url;
        
       -                                        // Open the socket
       -                                        // Passing null username, generates a login popup on Opera (#2865)
       -                                        if ( s.username ) {
       -                                                xhr.open( s.type, s.url, s.async, s.username, s.password );
       -                                        } else {
       -                                                xhr.open( s.type, s.url, s.async );
       -                                        }
       +                                // Support: IE <=8 - 11 only
       +                                // Anchor's host property isn't correctly set when s.url is relative
       +                                urlAnchor.href = urlAnchor.href;
       +                                s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
       +                                        urlAnchor.protocol + "//" + urlAnchor.host;
       +                        } catch ( e ) {
        
       -                                        // Apply custom fields if provided
       -                                        if ( s.xhrFields ) {
       -                                                for ( i in s.xhrFields ) {
       -                                                        xhr[ i ] = s.xhrFields[ i ];
       -                                                }
       -                                        }
       +                                // If there is an error parsing the URL, assume it is crossDomain,
       +                                // it can be rejected by the transport if it is invalid
       +                                s.crossDomain = true;
       +                        }
       +                }
        
       -                                        // Override mime type if needed
       -                                        if ( s.mimeType && xhr.overrideMimeType ) {
       -                                                xhr.overrideMimeType( s.mimeType );
       -                                        }
       +                // Convert data if not already a string
       +                if ( s.data && s.processData && typeof s.data !== "string" ) {
       +                        s.data = jQuery.param( s.data, s.traditional );
       +                }
        
       -                                        // X-Requested-With header
       -                                        // For cross-domain requests, seeing as conditions for a preflight are
       -                                        // akin to a jigsaw puzzle, we simply never set it to be sure.
       -                                        // (it can always be set on a per-request basis or even using ajaxSetup)
       -                                        // For same-domain requests, won't change header if already provided.
       -                                        if ( !s.crossDomain && !headers["X-Requested-With"] ) {
       -                                                headers[ "X-Requested-With" ] = "XMLHttpRequest";
       -                                        }
       +                // Apply prefilters
       +                inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
        
       -                                        // Need an extra try/catch for cross domain requests in Firefox 3
       -                                        try {
       -                                                for ( i in headers ) {
       -                                                        xhr.setRequestHeader( i, headers[ i ] );
       -                                                }
       -                                        } catch( _ ) {}
       +                // If request was aborted inside a prefilter, stop there
       +                if ( completed ) {
       +                        return jqXHR;
       +                }
        
       -                                        // Do send the request
       -                                        // This may raise an exception which is actually
       -                                        // handled in jQuery.ajax (so no try/catch here)
       -                                        xhr.send( ( s.hasContent && s.data ) || null );
       +                // We can fire global events as of now if asked to
       +                // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
       +                fireGlobals = jQuery.event && s.global;
        
       -                                        // Listener
       -                                        callback = function( _, isAbort ) {
       +                // Watch for a new set of requests
       +                if ( fireGlobals && jQuery.active++ === 0 ) {
       +                        jQuery.event.trigger( "ajaxStart" );
       +                }
        
       -                                                var status,
       -                                                        statusText,
       -                                                        responseHeaders,
       -                                                        responses,
       -                                                        xml;
       +                // Uppercase the type
       +                s.type = s.type.toUpperCase();
        
       -                                                // Firefox throws exceptions when accessing properties
       -                                                // of an xhr when a network error occured
       -                                                // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
       -                                                try {
       +                // Determine if request has content
       +                s.hasContent = !rnoContent.test( s.type );
        
       -                                                        // Was never called and is aborted or complete
       -                                                        if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
       +                // Save the URL in case we're toying with the If-Modified-Since
       +                // and/or If-None-Match header later on
       +                // Remove hash to simplify url manipulation
       +                cacheURL = s.url.replace( rhash, "" );
        
       -                                                                // Only called once
       -                                                                callback = undefined;
       +                // More options handling for requests with no content
       +                if ( !s.hasContent ) {
        
       -                                                                // Do not keep as active anymore
       -                                                                if ( handle ) {
       -                                                                        xhr.onreadystatechange = jQuery.noop;
       -                                                                        if ( xhrOnUnloadAbort ) {
       -                                                                                delete xhrCallbacks[ handle ];
       -                                                                        }
       -                                                                }
       +                        // Remember the hash so we can put it back
       +                        uncached = s.url.slice( cacheURL.length );
        
       -                                                                // If it's an abort
       -                                                                if ( isAbort ) {
       -                                                                        // Abort it manually if needed
       -                                                                        if ( xhr.readyState !== 4 ) {
       -                                                                                xhr.abort();
       -                                                                        }
       -                                                                } else {
       -                                                                        status = xhr.status;
       -                                                                        responseHeaders = xhr.getAllResponseHeaders();
       -                                                                        responses = {};
       -                                                                        xml = xhr.responseXML;
       -
       -                                                                        // Construct response list
       -                                                                        if ( xml && xml.documentElement /* #4958 */ ) {
       -                                                                                responses.xml = xml;
       -                                                                        }
       +                        // If data is available, append data to url
       +                        if ( s.data ) {
       +                                cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
        
       -                                                                        // When requesting binary data, IE6-9 will throw an exception
       -                                                                        // on any attempt to access responseText (#11426)
       -                                                                        try {
       -                                                                                responses.text = xhr.responseText;
       -                                                                        } catch( _ ) {
       -                                                                        }
       +                                // #9682: remove data so that it's not used in an eventual retry
       +                                delete s.data;
       +                        }
        
       -                                                                        // Firefox throws an exception when accessing
       -                                                                        // statusText for faulty cross-domain requests
       -                                                                        try {
       -                                                                                statusText = xhr.statusText;
       -                                                                        } catch( e ) {
       -                                                                                // We normalize with Webkit giving an empty statusText
       -                                                                                statusText = "";
       -                                                                        }
       +                        // Add or update anti-cache param if needed
       +                        if ( s.cache === false ) {
       +                                cacheURL = cacheURL.replace( rantiCache, "$1" );
       +                                uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
       +                        }
        
       -                                                                        // Filter status for non standard behaviors
       +                        // Put hash and anti-cache on the URL that will be requested (gh-1732)
       +                        s.url = cacheURL + uncached;
        
       -                                                                        // If the request is local and we have data: assume a success
       -                                                                        // (success with no data won't get notified, that's the best we
       -                                                                        // can do given current implementations)
       -                                                                        if ( !status && s.isLocal && !s.crossDomain ) {
       -                                                                                status = responses.text ? 200 : 404;
       -                                                                        // IE - #1450: sometimes returns 1223 when it should be 204
       -                                                                        } else if ( status === 1223 ) {
       -                                                                                status = 204;
       -                                                                        }
       -                                                                }
       -                                                        }
       -                                                } catch( firefoxAccessException ) {
       -                                                        if ( !isAbort ) {
       -                                                                complete( -1, firefoxAccessException );
       -                                                        }
       -                                                }
       +                // Change '%20' to '+' if this is encoded form body content (gh-2658)
       +                } else if ( s.data && s.processData &&
       +                        ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
       +                        s.data = s.data.replace( r20, "+" );
       +                }
        
       -                                                // Call complete if needed
       -                                                if ( responses ) {
       -                                                        complete( status, statusText, responses, responseHeaders );
       -                                                }
       -                                        };
       +                // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
       +                if ( s.ifModified ) {
       +                        if ( jQuery.lastModified[ cacheURL ] ) {
       +                                jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
       +                        }
       +                        if ( jQuery.etag[ cacheURL ] ) {
       +                                jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
       +                        }
       +                }
        
       -                                        // if we're in sync mode or it's in cache
       -                                        // and has been retrieved directly (IE6 & IE7)
       -                                        // we need to manually fire the callback
       -                                        if ( !s.async || xhr.readyState === 4 ) {
       -                                                callback();
       -                                        } else {
       -                                                handle = ++xhrId;
       -                                                if ( xhrOnUnloadAbort ) {
       -                                                        // Create the active xhrs callbacks list if needed
       -                                                        // and attach the unload handler
       -                                                        if ( !xhrCallbacks ) {
       -                                                                xhrCallbacks = {};
       -                                                                jQuery( window ).unload( xhrOnUnloadAbort );
       -                                                        }
       -                                                        // Add to list of active xhrs callbacks
       -                                                        xhrCallbacks[ handle ] = callback;
       -                                                }
       -                                                xhr.onreadystatechange = callback;
       -                                        }
       -                                },
       +                // Set the correct header, if data is being sent
       +                if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
       +                        jqXHR.setRequestHeader( "Content-Type", s.contentType );
       +                }
       +
       +                // Set the Accepts header for the server, depending on the dataType
       +                jqXHR.setRequestHeader(
       +                        "Accept",
       +                        s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
       +                                s.accepts[ s.dataTypes[ 0 ] ] +
       +                                        ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
       +                                s.accepts[ "*" ]
       +                );
        
       -                                abort: function() {
       -                                        if ( callback ) {
       -                                                callback(0,1);
       -                                        }
       -                                }
       -                        };
       +                // Check for headers option
       +                for ( i in s.headers ) {
       +                        jqXHR.setRequestHeader( i, s.headers[ i ] );
                        }
       -        });
       -}
        
       +                // Allow custom headers/mimetypes and early abort
       +                if ( s.beforeSend &&
       +                        ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
        
       +                        // Abort if not done already and return
       +                        return jqXHR.abort();
       +                }
        
       +                // Aborting is no longer a cancellation
       +                strAbort = "abort";
        
       -var elemdisplay = {},
       -        iframe, iframeDoc,
       -        rfxtypes = /^(?:toggle|show|hide)$/,
       -        rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
       -        timerId,
       -        fxAttrs = [
       -                // height animations
       -                [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
       -                // width animations
       -                [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
       -                // opacity animations
       -                [ "opacity" ]
       -        ],
       -        fxNow;
       -
       -jQuery.fn.extend({
       -        show: function( speed, easing, callback ) {
       -                var elem, display;
       -
       -                if ( speed || speed === 0 ) {
       -                        return this.animate( genFx("show", 3), speed, easing, callback );
       +                // Install callbacks on deferreds
       +                completeDeferred.add( s.complete );
       +                jqXHR.done( s.success );
       +                jqXHR.fail( s.error );
        
       -                } else {
       -                        for ( var i = 0, j = this.length; i < j; i++ ) {
       -                                elem = this[ i ];
       +                // Get transport
       +                transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
        
       -                                if ( elem.style ) {
       -                                        display = elem.style.display;
       +                // If no transport, we auto-abort
       +                if ( !transport ) {
       +                        done( -1, "No Transport" );
       +                } else {
       +                        jqXHR.readyState = 1;
        
       -                                        // Reset the inline display of this element to learn if it is
       -                                        // being hidden by cascaded rules or not
       -                                        if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
       -                                                display = elem.style.display = "";
       -                                        }
       +                        // Send global event
       +                        if ( fireGlobals ) {
       +                                globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
       +                        }
        
       -                                        // Set elements which have been overridden with display: none
       -                                        // in a stylesheet to whatever the default browser style is
       -                                        // for such an element
       -                                        if ( (display === "" && jQuery.css(elem, "display") === "none") ||
       -                                                !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
       -                                                jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
       -                                        }
       -                                }
       +                        // If request was aborted inside ajaxSend, stop there
       +                        if ( completed ) {
       +                                return jqXHR;
                                }
        
       -                        // Set the display of most of the elements in a second loop
       -                        // to avoid the constant reflow
       -                        for ( i = 0; i < j; i++ ) {
       -                                elem = this[ i ];
       +                        // Timeout
       +                        if ( s.async && s.timeout > 0 ) {
       +                                timeoutTimer = window.setTimeout( function() {
       +                                        jqXHR.abort( "timeout" );
       +                                }, s.timeout );
       +                        }
        
       -                                if ( elem.style ) {
       -                                        display = elem.style.display;
       +                        try {
       +                                completed = false;
       +                                transport.send( requestHeaders, done );
       +                        } catch ( e ) {
        
       -                                        if ( display === "" || display === "none" ) {
       -                                                elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
       -                                        }
       +                                // Rethrow post-completion exceptions
       +                                if ( completed ) {
       +                                        throw e;
                                        }
       -                        }
        
       -                        return this;
       +                                // Propagate others as results
       +                                done( -1, e );
       +                        }
                        }
       -        },
        
       -        hide: function( speed, easing, callback ) {
       -                if ( speed || speed === 0 ) {
       -                        return this.animate( genFx("hide", 3), speed, easing, callback);
       +                // Callback for when everything is done
       +                function done( status, nativeStatusText, responses, headers ) {
       +                        var isSuccess, success, error, response, modified,
       +                                statusText = nativeStatusText;
        
       -                } else {
       -                        var elem, display,
       -                                i = 0,
       -                                j = this.length;
       +                        // Ignore repeat invocations
       +                        if ( completed ) {
       +                                return;
       +                        }
        
       -                        for ( ; i < j; i++ ) {
       -                                elem = this[i];
       -                                if ( elem.style ) {
       -                                        display = jQuery.css( elem, "display" );
       +                        completed = true;
        
       -                                        if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
       -                                                jQuery._data( elem, "olddisplay", display );
       -                                        }
       -                                }
       +                        // Clear timeout if it exists
       +                        if ( timeoutTimer ) {
       +                                window.clearTimeout( timeoutTimer );
                                }
        
       -                        // Set the display of the elements in a second loop
       -                        // to avoid the constant reflow
       -                        for ( i = 0; i < j; i++ ) {
       -                                if ( this[i].style ) {
       -                                        this[i].style.display = "none";
       -                                }
       -                        }
       +                        // Dereference transport for early garbage collection
       +                        // (no matter how long the jqXHR object will be used)
       +                        transport = undefined;
        
       -                        return this;
       -                }
       -        },
       +                        // Cache response headers
       +                        responseHeadersString = headers || "";
        
       -        // Save the old toggle function
       -        _toggle: jQuery.fn.toggle,
       +                        // Set readyState
       +                        jqXHR.readyState = status > 0 ? 4 : 0;
        
       -        toggle: function( fn, fn2, callback ) {
       -                var bool = typeof fn === "boolean";
       +                        // Determine if successful
       +                        isSuccess = status >= 200 && status < 300 || status === 304;
        
       -                if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
       -                        this._toggle.apply( this, arguments );
       +                        // Get response data
       +                        if ( responses ) {
       +                                response = ajaxHandleResponses( s, jqXHR, responses );
       +                        }
        
       -                } else if ( fn == null || bool ) {
       -                        this.each(function() {
       -                                var state = bool ? fn : jQuery(this).is(":hidden");
       -                                jQuery(this)[ state ? "show" : "hide" ]();
       -                        });
       +                        // Convert no matter what (that way responseXXX fields are always set)
       +                        response = ajaxConvert( s, response, jqXHR, isSuccess );
        
       -                } else {
       -                        this.animate(genFx("toggle", 3), fn, fn2, callback);
       -                }
       +                        // If successful, handle type chaining
       +                        if ( isSuccess ) {
        
       -                return this;
       -        },
       +                                // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
       +                                if ( s.ifModified ) {
       +                                        modified = jqXHR.getResponseHeader( "Last-Modified" );
       +                                        if ( modified ) {
       +                                                jQuery.lastModified[ cacheURL ] = modified;
       +                                        }
       +                                        modified = jqXHR.getResponseHeader( "etag" );
       +                                        if ( modified ) {
       +                                                jQuery.etag[ cacheURL ] = modified;
       +                                        }
       +                                }
        
       -        fadeTo: function( speed, to, easing, callback ) {
       -                return this.filter(":hidden").css("opacity", 0).show().end()
       -                                        .animate({opacity: to}, speed, easing, callback);
       -        },
       +                                // if no content
       +                                if ( status === 204 || s.type === "HEAD" ) {
       +                                        statusText = "nocontent";
        
       -        animate: function( prop, speed, easing, callback ) {
       -                var optall = jQuery.speed( speed, easing, callback );
       +                                // if not modified
       +                                } else if ( status === 304 ) {
       +                                        statusText = "notmodified";
        
       -                if ( jQuery.isEmptyObject( prop ) ) {
       -                        return this.each( optall.complete, [ false ] );
       -                }
       +                                // If we have data, let's convert it
       +                                } else {
       +                                        statusText = response.state;
       +                                        success = response.data;
       +                                        error = response.error;
       +                                        isSuccess = !error;
       +                                }
       +                        } else {
        
       -                // Do not change referenced properties as per-property easing will be lost
       -                prop = jQuery.extend( {}, prop );
       +                                // Extract error from statusText and normalize for non-aborts
       +                                error = statusText;
       +                                if ( status || !statusText ) {
       +                                        statusText = "error";
       +                                        if ( status < 0 ) {
       +                                                status = 0;
       +                                        }
       +                                }
       +                        }
        
       -                function doAnimation() {
       -                        // XXX 'this' does not always have a nodeName when running the
       -                        // test suite
       +                        // Set data for the fake xhr object
       +                        jqXHR.status = status;
       +                        jqXHR.statusText = ( nativeStatusText || statusText ) + "";
        
       -                        if ( optall.queue === false ) {
       -                                jQuery._mark( this );
       +                        // Success/Error
       +                        if ( isSuccess ) {
       +                                deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
       +                        } else {
       +                                deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
                                }
        
       -                        var opt = jQuery.extend( {}, optall ),
       -                                isElement = this.nodeType === 1,
       -                                hidden = isElement && jQuery(this).is(":hidden"),
       -                                name, val, p, e, hooks, replace,
       -                                parts, start, end, unit,
       -                                method;
       +                        // Status-dependent callbacks
       +                        jqXHR.statusCode( statusCode );
       +                        statusCode = undefined;
        
       -                        // will store per property easing and be used to determine when an animation is complete
       -                        opt.animatedProperties = {};
       +                        if ( fireGlobals ) {
       +                                globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
       +                                        [ jqXHR, s, isSuccess ? success : error ] );
       +                        }
        
       -                        // first pass over propertys to expand / normalize
       -                        for ( p in prop ) {
       -                                name = jQuery.camelCase( p );
       -                                if ( p !== name ) {
       -                                        prop[ name ] = prop[ p ];
       -                                        delete prop[ p ];
       -                                }
       +                        // Complete
       +                        completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
        
       -                                if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) {
       -                                        replace = hooks.expand( prop[ name ] );
       -                                        delete prop[ name ];
       +                        if ( fireGlobals ) {
       +                                globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
        
       -                                        // not quite $.extend, this wont overwrite keys already present.
       -                                        // also - reusing 'p' from above because we have the correct "name"
       -                                        for ( p in replace ) {
       -                                                if ( ! ( p in prop ) ) {
       -                                                        prop[ p ] = replace[ p ];
       -                                                }
       -                                        }
       +                                // Handle the global AJAX counter
       +                                if ( !( --jQuery.active ) ) {
       +                                        jQuery.event.trigger( "ajaxStop" );
                                        }
                                }
       +                }
        
       -                        for ( name in prop ) {
       -                                val = prop[ name ];
       -                                // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
       -                                if ( jQuery.isArray( val ) ) {
       -                                        opt.animatedProperties[ name ] = val[ 1 ];
       -                                        val = prop[ name ] = val[ 0 ];
       -                                } else {
       -                                        opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
       -                                }
       +                return jqXHR;
       +        },
        
       -                                if ( val === "hide" && hidden || val === "show" && !hidden ) {
       -                                        return opt.complete.call( this );
       -                                }
       +        getJSON: function( url, data, callback ) {
       +                return jQuery.get( url, data, callback, "json" );
       +        },
       +
       +        getScript: function( url, callback ) {
       +                return jQuery.get( url, undefined, callback, "script" );
       +        }
       +} );
        
       -                                if ( isElement && ( name === "height" || name === "width" ) ) {
       -                                        // Make sure that nothing sneaks out
       -                                        // Record all 3 overflow attributes because IE does not
       -                                        // change the overflow attribute when overflowX and
       -                                        // overflowY are set to the same value
       -                                        opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
       +jQuery.each( [ "get", "post" ], function( i, method ) {
       +        jQuery[ method ] = function( url, data, callback, type ) {
        
       -                                        // Set display property to inline-block for height/width
       -                                        // animations on inline elements that are having width/height animated
       -                                        if ( jQuery.css( this, "display" ) === "inline" &&
       -                                                        jQuery.css( this, "float" ) === "none" ) {
       +                // Shift arguments if data argument was omitted
       +                if ( jQuery.isFunction( data ) ) {
       +                        type = type || callback;
       +                        callback = data;
       +                        data = undefined;
       +                }
        
       -                                                // inline-level elements accept inline-block;
       -                                                // block-level elements need to be inline with layout
       -                                                if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
       -                                                        this.style.display = "inline-block";
       +                // The url can be an options object (which then must have .url)
       +                return jQuery.ajax( jQuery.extend( {
       +                        url: url,
       +                        type: method,
       +                        dataType: type,
       +                        data: data,
       +                        success: callback
       +                }, jQuery.isPlainObject( url ) && url ) );
       +        };
       +} );
        
       -                                                } else {
       -                                                        this.style.zoom = 1;
       -                                                }
       -                                        }
       -                                }
       -                        }
        
       -                        if ( opt.overflow != null ) {
       -                                this.style.overflow = "hidden";
       -                        }
       +jQuery._evalUrl = function( url ) {
       +        return jQuery.ajax( {
       +                url: url,
        
       -                        for ( p in prop ) {
       -                                e = new jQuery.fx( this, opt, p );
       -                                val = prop[ p ];
       +                // Make this explicit, since user can override this through ajaxSetup (#11264)
       +                type: "GET",
       +                dataType: "script",
       +                cache: true,
       +                async: false,
       +                global: false,
       +                "throws": true
       +        } );
       +};
        
       -                                if ( rfxtypes.test( val ) ) {
        
       -                                        // Tracks whether to show or hide based on private
       -                                        // data attached to the element
       -                                        method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
       -                                        if ( method ) {
       -                                                jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
       -                                                e[ method ]();
       -                                        } else {
       -                                                e[ val ]();
       -                                        }
       +jQuery.fn.extend( {
       +        wrapAll: function( html ) {
       +                var wrap;
        
       -                                } else {
       -                                        parts = rfxnum.exec( val );
       -                                        start = e.cur();
       -
       -                                        if ( parts ) {
       -                                                end = parseFloat( parts[2] );
       -                                                unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
       -
       -                                                // We need to compute starting value
       -                                                if ( unit !== "px" ) {
       -                                                        jQuery.style( this, p, (end || 1) + unit);
       -                                                        start = ( (end || 1) / e.cur() ) * start;
       -                                                        jQuery.style( this, p, start + unit);
       -                                                }
       +                if ( this[ 0 ] ) {
       +                        if ( jQuery.isFunction( html ) ) {
       +                                html = html.call( this[ 0 ] );
       +                        }
        
       -                                                // If a +=/-= token was provided, we're doing a relative animation
       -                                                if ( parts[1] ) {
       -                                                        end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
       -                                                }
       +                        // The elements to wrap the target around
       +                        wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
       +
       +                        if ( this[ 0 ].parentNode ) {
       +                                wrap.insertBefore( this[ 0 ] );
       +                        }
        
       -                                                e.custom( start, end, unit );
       +                        wrap.map( function() {
       +                                var elem = this;
        
       -                                        } else {
       -                                                e.custom( start, val, "" );
       -                                        }
       +                                while ( elem.firstElementChild ) {
       +                                        elem = elem.firstElementChild;
                                        }
       -                        }
        
       -                        // For JS strict compliance
       -                        return true;
       +                                return elem;
       +                        } ).append( this );
                        }
        
       -                return optall.queue === false ?
       -                        this.each( doAnimation ) :
       -                        this.queue( optall.queue, doAnimation );
       +                return this;
                },
        
       -        stop: function( type, clearQueue, gotoEnd ) {
       -                if ( typeof type !== "string" ) {
       -                        gotoEnd = clearQueue;
       -                        clearQueue = type;
       -                        type = undefined;
       -                }
       -                if ( clearQueue && type !== false ) {
       -                        this.queue( type || "fx", [] );
       +        wrapInner: function( html ) {
       +                if ( jQuery.isFunction( html ) ) {
       +                        return this.each( function( i ) {
       +                                jQuery( this ).wrapInner( html.call( this, i ) );
       +                        } );
                        }
        
       -                return this.each(function() {
       -                        var index,
       -                                hadTimers = false,
       -                                timers = jQuery.timers,
       -                                data = jQuery._data( this );
       -
       -                        // clear marker counters if we know they won't be
       -                        if ( !gotoEnd ) {
       -                                jQuery._unmark( true, this );
       -                        }
       +                return this.each( function() {
       +                        var self = jQuery( this ),
       +                                contents = self.contents();
        
       -                        function stopQueue( elem, data, index ) {
       -                                var hooks = data[ index ];
       -                                jQuery.removeData( elem, index, true );
       -                                hooks.stop( gotoEnd );
       -                        }
       +                        if ( contents.length ) {
       +                                contents.wrapAll( html );
        
       -                        if ( type == null ) {
       -                                for ( index in data ) {
       -                                        if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
       -                                                stopQueue( this, data, index );
       -                                        }
       -                                }
       -                        } else if ( data[ index = type + ".run" ] && data[ index ].stop ){
       -                                stopQueue( this, data, index );
       +                        } else {
       +                                self.append( html );
                                }
       +                } );
       +        },
        
       -                        for ( index = timers.length; index--; ) {
       -                                if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
       -                                        if ( gotoEnd ) {
       +        wrap: function( html ) {
       +                var isFunction = jQuery.isFunction( html );
        
       -                                                // force the next step to be the last
       -                                                timers[ index ]( true );
       -                                        } else {
       -                                                timers[ index ].saveState();
       -                                        }
       -                                        hadTimers = true;
       -                                        timers.splice( index, 1 );
       -                                }
       -                        }
       +                return this.each( function( i ) {
       +                        jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
       +                } );
       +        },
        
       -                        // start the next in the queue if the last step wasn't forced
       -                        // timers currently will call their complete callbacks, which will dequeue
       -                        // but only if they were gotoEnd
       -                        if ( !( gotoEnd && hadTimers ) ) {
       -                                jQuery.dequeue( this, type );
       -                        }
       -                });
       +        unwrap: function( selector ) {
       +                this.parent( selector ).not( "body" ).each( function() {
       +                        jQuery( this ).replaceWith( this.childNodes );
       +                } );
       +                return this;
                }
       +} );
        
       -});
        
       -// Animations created synchronously will run synchronously
       -function createFxNow() {
       -        setTimeout( clearFxNow, 0 );
       -        return ( fxNow = jQuery.now() );
       -}
       +jQuery.expr.pseudos.hidden = function( elem ) {
       +        return !jQuery.expr.pseudos.visible( elem );
       +};
       +jQuery.expr.pseudos.visible = function( elem ) {
       +        return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
       +};
        
       -function clearFxNow() {
       -        fxNow = undefined;
       -}
        
       -// Generate parameters to create a standard animation
       -function genFx( type, num ) {
       -        var obj = {};
        
       -        jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
       -                obj[ this ] = type;
       -        });
        
       -        return obj;
       -}
       +jQuery.ajaxSettings.xhr = function() {
       +        try {
       +                return new window.XMLHttpRequest();
       +        } catch ( e ) {}
       +};
        
       -// Generate shortcuts for custom animations
       -jQuery.each({
       -        slideDown: genFx( "show", 1 ),
       -        slideUp: genFx( "hide", 1 ),
       -        slideToggle: genFx( "toggle", 1 ),
       -        fadeIn: { opacity: "show" },
       -        fadeOut: { opacity: "hide" },
       -        fadeToggle: { opacity: "toggle" }
       -}, function( name, props ) {
       -        jQuery.fn[ name ] = function( speed, easing, callback ) {
       -                return this.animate( props, speed, easing, callback );
       -        };
       -});
       +var xhrSuccessStatus = {
        
       -jQuery.extend({
       -        speed: function( speed, easing, fn ) {
       -                var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
       -                        complete: fn || !fn && easing ||
       -                                jQuery.isFunction( speed ) && speed,
       -                        duration: speed,
       -                        easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
       -                };
       +                // File protocol always yields status code 0, assume 200
       +                0: 200,
        
       -                opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
       -                        opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
       +                // Support: IE <=9 only
       +                // #1450: sometimes IE returns 1223 when it should be 204
       +                1223: 204
       +        },
       +        xhrSupported = jQuery.ajaxSettings.xhr();
        
       -                // normalize opt.queue - true/undefined/null -> "fx"
       -                if ( opt.queue == null || opt.queue === true ) {
       -                        opt.queue = "fx";
       -                }
       +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
       +support.ajax = xhrSupported = !!xhrSupported;
        
       -                // Queueing
       -                opt.old = opt.complete;
       +jQuery.ajaxTransport( function( options ) {
       +        var callback, errorCallback;
        
       -                opt.complete = function( noUnmark ) {
       -                        if ( jQuery.isFunction( opt.old ) ) {
       -                                opt.old.call( this );
       -                        }
       +        // Cross domain only allowed if supported through XMLHttpRequest
       +        if ( support.cors || xhrSupported && !options.crossDomain ) {
       +                return {
       +                        send: function( headers, complete ) {
       +                                var i,
       +                                        xhr = options.xhr();
       +
       +                                xhr.open(
       +                                        options.type,
       +                                        options.url,
       +                                        options.async,
       +                                        options.username,
       +                                        options.password
       +                                );
        
       -                        if ( opt.queue ) {
       -                                jQuery.dequeue( this, opt.queue );
       -                        } else if ( noUnmark !== false ) {
       -                                jQuery._unmark( this );
       -                        }
       -                };
       +                                // Apply custom fields if provided
       +                                if ( options.xhrFields ) {
       +                                        for ( i in options.xhrFields ) {
       +                                                xhr[ i ] = options.xhrFields[ i ];
       +                                        }
       +                                }
        
       -                return opt;
       -        },
       +                                // Override mime type if needed
       +                                if ( options.mimeType && xhr.overrideMimeType ) {
       +                                        xhr.overrideMimeType( options.mimeType );
       +                                }
        
       -        easing: {
       -                linear: function( p ) {
       -                        return p;
       -                },
       -                swing: function( p ) {
       -                        return ( -Math.cos( p*Math.PI ) / 2 ) + 0.5;
       -                }
       -        },
       +                                // X-Requested-With header
       +                                // For cross-domain requests, seeing as conditions for a preflight are
       +                                // akin to a jigsaw puzzle, we simply never set it to be sure.
       +                                // (it can always be set on a per-request basis or even using ajaxSetup)
       +                                // For same-domain requests, won't change header if already provided.
       +                                if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
       +                                        headers[ "X-Requested-With" ] = "XMLHttpRequest";
       +                                }
        
       -        timers: [],
       +                                // Set headers
       +                                for ( i in headers ) {
       +                                        xhr.setRequestHeader( i, headers[ i ] );
       +                                }
        
       -        fx: function( elem, options, prop ) {
       -                this.options = options;
       -                this.elem = elem;
       -                this.prop = prop;
       +                                // Callback
       +                                callback = function( type ) {
       +                                        return function() {
       +                                                if ( callback ) {
       +                                                        callback = errorCallback = xhr.onload =
       +                                                                xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
        
       -                options.orig = options.orig || {};
       -        }
       +                                                        if ( type === "abort" ) {
       +                                                                xhr.abort();
       +                                                        } else if ( type === "error" ) {
        
       -});
       +                                                                // Support: IE <=9 only
       +                                                                // On a manual native abort, IE9 throws
       +                                                                // errors on any property access that is not readyState
       +                                                                if ( typeof xhr.status !== "number" ) {
       +                                                                        complete( 0, "error" );
       +                                                                } else {
       +                                                                        complete(
        
       -jQuery.fx.prototype = {
       -        // Simple function for setting a style value
       -        update: function() {
       -                if ( this.options.step ) {
       -                        this.options.step.call( this.elem, this.now, this );
       -                }
       +                                                                                // File: protocol always yields status 0; see #8605, #14207
       +                                                                                xhr.status,
       +                                                                                xhr.statusText
       +                                                                        );
       +                                                                }
       +                                                        } else {
       +                                                                complete(
       +                                                                        xhrSuccessStatus[ xhr.status ] || xhr.status,
       +                                                                        xhr.statusText,
       +
       +                                                                        // Support: IE <=9 only
       +                                                                        // IE9 has no XHR2 but throws on binary (trac-11426)
       +                                                                        // For XHR2 non-text, let the caller handle it (gh-2498)
       +                                                                        ( xhr.responseType || "text" ) !== "text"  ||
       +                                                                        typeof xhr.responseText !== "string" ?
       +                                                                                { binary: xhr.response } :
       +                                                                                { text: xhr.responseText },
       +                                                                        xhr.getAllResponseHeaders()
       +                                                                );
       +                                                        }
       +                                                }
       +                                        };
       +                                };
        
       -                ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
       -        },
       +                                // Listen to events
       +                                xhr.onload = callback();
       +                                errorCallback = xhr.onerror = callback( "error" );
        
       -        // Get the current size
       -        cur: function() {
       -                if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
       -                        return this.elem[ this.prop ];
       -                }
       +                                // Support: IE 9 only
       +                                // Use onreadystatechange to replace onabort
       +                                // to handle uncaught aborts
       +                                if ( xhr.onabort !== undefined ) {
       +                                        xhr.onabort = errorCallback;
       +                                } else {
       +                                        xhr.onreadystatechange = function() {
       +
       +                                                // Check readyState before timeout as it changes
       +                                                if ( xhr.readyState === 4 ) {
       +
       +                                                        // Allow onerror to be called first,
       +                                                        // but that will not handle a native abort
       +                                                        // Also, save errorCallback to a variable
       +                                                        // as xhr.onerror cannot be accessed
       +                                                        window.setTimeout( function() {
       +                                                                if ( callback ) {
       +                                                                        errorCallback();
       +                                                                }
       +                                                        } );
       +                                                }
       +                                        };
       +                                }
        
       -                var parsed,
       -                        r = jQuery.css( this.elem, this.prop );
       -                // Empty strings, null, undefined and "auto" are converted to 0,
       -                // complex values such as "rotate(1rad)" are returned as is,
       -                // simple values such as "10px" are parsed to Float.
       -                return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
       -        },
       +                                // Create the abort callback
       +                                callback = callback( "abort" );
        
       -        // Start an animation from one number to another
       -        custom: function( from, to, unit ) {
       -                var self = this,
       -                        fx = jQuery.fx;
       +                                try {
        
       -                this.startTime = fxNow || createFxNow();
       -                this.end = to;
       -                this.now = this.start = from;
       -                this.pos = this.state = 0;
       -                this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
       +                                        // Do send the request (this may raise an exception)
       +                                        xhr.send( options.hasContent && options.data || null );
       +                                } catch ( e ) {
        
       -                function t( gotoEnd ) {
       -                        return self.step( gotoEnd );
       -                }
       +                                        // #14683: Only rethrow if this hasn't been notified as an error yet
       +                                        if ( callback ) {
       +                                                throw e;
       +                                        }
       +                                }
       +                        },
        
       -                t.queue = this.options.queue;
       -                t.elem = this.elem;
       -                t.saveState = function() {
       -                        if ( jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
       -                                if ( self.options.hide ) {
       -                                        jQuery._data( self.elem, "fxshow" + self.prop, self.start );
       -                                } else if ( self.options.show ) {
       -                                        jQuery._data( self.elem, "fxshow" + self.prop, self.end );
       +                        abort: function() {
       +                                if ( callback ) {
       +                                        callback();
                                        }
                                }
                        };
       +        }
       +} );
        
       -                if ( t() && jQuery.timers.push(t) && !timerId ) {
       -                        timerId = setInterval( fx.tick, fx.interval );
       -                }
       -        },
        
       -        // Simple 'show' function
       -        show: function() {
       -                var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
        
       -                // Remember where we started, so that we can go back to it later
       -                this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
       -                this.options.show = true;
        
       -                // Begin the animation
       -                // Make sure that we start at a small width/height to avoid any flash of content
       -                if ( dataShow !== undefined ) {
       -                        // This show is picking up where a previous hide or show left off
       -                        this.custom( this.cur(), dataShow );
       -                } else {
       -                        this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
       -                }
       +// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
       +jQuery.ajaxPrefilter( function( s ) {
       +        if ( s.crossDomain ) {
       +                s.contents.script = false;
       +        }
       +} );
        
       -                // Start by showing the element
       -                jQuery( this.elem ).show();
       +// Install script dataType
       +jQuery.ajaxSetup( {
       +        accepts: {
       +                script: "text/javascript, application/javascript, " +
       +                        "application/ecmascript, application/x-ecmascript"
                },
       -
       -        // Simple 'hide' function
       -        hide: function() {
       -                // Remember where we started, so that we can go back to it later
       -                this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
       -                this.options.hide = true;
       -
       -                // Begin the animation
       -                this.custom( this.cur(), 0 );
       +        contents: {
       +                script: /\b(?:java|ecma)script\b/
                },
       +        converters: {
       +                "text script": function( text ) {
       +                        jQuery.globalEval( text );
       +                        return text;
       +                }
       +        }
       +} );
        
       -        // Each step of an animation
       -        step: function( gotoEnd ) {
       -                var p, n, complete,
       -                        t = fxNow || createFxNow(),
       -                        done = true,
       -                        elem = this.elem,
       -                        options = this.options;
       +// Handle cache's special case and crossDomain
       +jQuery.ajaxPrefilter( "script", function( s ) {
       +        if ( s.cache === undefined ) {
       +                s.cache = false;
       +        }
       +        if ( s.crossDomain ) {
       +                s.type = "GET";
       +        }
       +} );
        
       -                if ( gotoEnd || t >= options.duration + this.startTime ) {
       -                        this.now = this.end;
       -                        this.pos = this.state = 1;
       -                        this.update();
       +// Bind script tag hack transport
       +jQuery.ajaxTransport( "script", function( s ) {
        
       -                        options.animatedProperties[ this.prop ] = true;
       +        // This transport only deals with cross domain requests
       +        if ( s.crossDomain ) {
       +                var script, callback;
       +                return {
       +                        send: function( _, complete ) {
       +                                script = jQuery( "<script>" ).prop( {
       +                                        charset: s.scriptCharset,
       +                                        src: s.url
       +                                } ).on(
       +                                        "load error",
       +                                        callback = function( evt ) {
       +                                                script.remove();
       +                                                callback = null;
       +                                                if ( evt ) {
       +                                                        complete( evt.type === "error" ? 404 : 200, evt.type );
       +                                                }
       +                                        }
       +                                );
        
       -                        for ( p in options.animatedProperties ) {
       -                                if ( options.animatedProperties[ p ] !== true ) {
       -                                        done = false;
       +                                // Use native DOM manipulation to avoid our domManip AJAX trickery
       +                                document.head.appendChild( script[ 0 ] );
       +                        },
       +                        abort: function() {
       +                                if ( callback ) {
       +                                        callback();
                                        }
                                }
       +                };
       +        }
       +} );
        
       -                        if ( done ) {
       -                                // Reset the overflow
       -                                if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
        
       -                                        jQuery.each( [ "", "X", "Y" ], function( index, value ) {
       -                                                elem.style[ "overflow" + value ] = options.overflow[ index ];
       -                                        });
       -                                }
        
       -                                // Hide the element if the "hide" operation was done
       -                                if ( options.hide ) {
       -                                        jQuery( elem ).hide();
       -                                }
        
       -                                // Reset the properties, if the item has been hidden or shown
       -                                if ( options.hide || options.show ) {
       -                                        for ( p in options.animatedProperties ) {
       -                                                jQuery.style( elem, p, options.orig[ p ] );
       -                                                jQuery.removeData( elem, "fxshow" + p, true );
       -                                                // Toggle data is no longer needed
       -                                                jQuery.removeData( elem, "toggle" + p, true );
       -                                        }
       -                                }
       +var oldCallbacks = [],
       +        rjsonp = /(=)\?(?=&|$)|\?\?/;
        
       -                                // Execute the complete function
       -                                // in the event that the complete function throws an exception
       -                                // we must ensure it won't be called twice. #5684
       +// Default jsonp settings
       +jQuery.ajaxSetup( {
       +        jsonp: "callback",
       +        jsonpCallback: function() {
       +                var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
       +                this[ callback ] = true;
       +                return callback;
       +        }
       +} );
        
       -                                complete = options.complete;
       -                                if ( complete ) {
       +// Detect, normalize options and install callbacks for jsonp requests
       +jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
        
       -                                        options.complete = false;
       -                                        complete.call( elem );
       -                                }
       -                        }
       +        var callbackName, overwritten, responseContainer,
       +                jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
       +                        "url" :
       +                        typeof s.data === "string" &&
       +                                ( s.contentType || "" )
       +                                        .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
       +                                rjsonp.test( s.data ) && "data"
       +                );
        
       -                        return false;
       +        // Handle iff the expected data type is "jsonp" or we have a parameter to set
       +        if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
        
       -                } else {
       -                        // classical easing cannot be used with an Infinity duration
       -                        if ( options.duration == Infinity ) {
       -                                this.now = t;
       -                        } else {
       -                                n = t - this.startTime;
       -                                this.state = n / options.duration;
       +                // Get callback name, remembering preexisting value associated with it
       +                callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
       +                        s.jsonpCallback() :
       +                        s.jsonpCallback;
        
       -                                // Perform the easing function, defaults to swing
       -                                this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
       -                                this.now = this.start + ( (this.end - this.start) * this.pos );
       -                        }
       -                        // Perform the next step of the animation
       -                        this.update();
       +                // Insert callback into url or form data
       +                if ( jsonProp ) {
       +                        s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
       +                } else if ( s.jsonp !== false ) {
       +                        s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
                        }
        
       -                return true;
       -        }
       -};
       +                // Use data converter to retrieve json after script execution
       +                s.converters[ "script json" ] = function() {
       +                        if ( !responseContainer ) {
       +                                jQuery.error( callbackName + " was not called" );
       +                        }
       +                        return responseContainer[ 0 ];
       +                };
        
       -jQuery.extend( jQuery.fx, {
       -        tick: function() {
       -                var timer,
       -                        timers = jQuery.timers,
       -                        i = 0;
       +                // Force json dataType
       +                s.dataTypes[ 0 ] = "json";
        
       -                for ( ; i < timers.length; i++ ) {
       -                        timer = timers[ i ];
       -                        // Checks the timer has not already been removed
       -                        if ( !timer() && timers[ i ] === timer ) {
       -                                timers.splice( i--, 1 );
       -                        }
       -                }
       +                // Install callback
       +                overwritten = window[ callbackName ];
       +                window[ callbackName ] = function() {
       +                        responseContainer = arguments;
       +                };
        
       -                if ( !timers.length ) {
       -                        jQuery.fx.stop();
       -                }
       -        },
       +                // Clean-up function (fires after converters)
       +                jqXHR.always( function() {
        
       -        interval: 13,
       +                        // If previous value didn't exist - remove it
       +                        if ( overwritten === undefined ) {
       +                                jQuery( window ).removeProp( callbackName );
        
       -        stop: function() {
       -                clearInterval( timerId );
       -                timerId = null;
       -        },
       +                        // Otherwise restore preexisting value
       +                        } else {
       +                                window[ callbackName ] = overwritten;
       +                        }
        
       -        speeds: {
       -                slow: 600,
       -                fast: 200,
       -                // Default speed
       -                _default: 400
       -        },
       +                        // Save back as free
       +                        if ( s[ callbackName ] ) {
        
       -        step: {
       -                opacity: function( fx ) {
       -                        jQuery.style( fx.elem, "opacity", fx.now );
       -                },
       +                                // Make sure that re-using the options doesn't screw things around
       +                                s.jsonpCallback = originalSettings.jsonpCallback;
        
       -                _default: function( fx ) {
       -                        if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
       -                                fx.elem.style[ fx.prop ] = fx.now + fx.unit;
       -                        } else {
       -                                fx.elem[ fx.prop ] = fx.now;
       +                                // Save the callback name for future use
       +                                oldCallbacks.push( callbackName );
                                }
       -                }
       -        }
       -});
        
       -// Ensure props that can't be negative don't go there on undershoot easing
       -jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) {
       -        // exclude marginTop, marginLeft, marginBottom and marginRight from this list
       -        if ( prop.indexOf( "margin" ) ) {
       -                jQuery.fx.step[ prop ] = function( fx ) {
       -                        jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
       -                };
       +                        // Call if it was a function and we have a response
       +                        if ( responseContainer && jQuery.isFunction( overwritten ) ) {
       +                                overwritten( responseContainer[ 0 ] );
       +                        }
       +
       +                        responseContainer = overwritten = undefined;
       +                } );
       +
       +                // Delegate to script
       +                return "script";
                }
       -});
       +} );
        
       -if ( jQuery.expr && jQuery.expr.filters ) {
       -        jQuery.expr.filters.animated = function( elem ) {
       -                return jQuery.grep(jQuery.timers, function( fn ) {
       -                        return elem === fn.elem;
       -                }).length;
       -        };
       -}
        
       -// Try to restore the default display value of an element
       -function defaultDisplay( nodeName ) {
        
       -        if ( !elemdisplay[ nodeName ] ) {
        
       -                var body = document.body,
       -                        elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
       -                        display = elem.css( "display" );
       -                elem.remove();
       +// Support: Safari 8 only
       +// In Safari 8 documents created via document.implementation.createHTMLDocument
       +// collapse sibling forms: the second one becomes a child of the first one.
       +// Because of that, this security measure has to be disabled in Safari 8.
       +// https://bugs.webkit.org/show_bug.cgi?id=137337
       +support.createHTMLDocument = ( function() {
       +        var body = document.implementation.createHTMLDocument( "" ).body;
       +        body.innerHTML = "<form></form><form></form>";
       +        return body.childNodes.length === 2;
       +} )();
        
       -                // If the simple way fails,
       -                // get element's real default display by attaching it to a temp iframe
       -                if ( display === "none" || display === "" ) {
       -                        // No iframe to use yet, so create it
       -                        if ( !iframe ) {
       -                                iframe = document.createElement( "iframe" );
       -                                iframe.frameBorder = iframe.width = iframe.height = 0;
       -                        }
        
       -                        body.appendChild( iframe );
       +// Argument "data" should be string of html
       +// context (optional): If specified, the fragment will be created in this context,
       +// defaults to document
       +// keepScripts (optional): If true, will include scripts passed in the html string
       +jQuery.parseHTML = function( data, context, keepScripts ) {
       +        if ( typeof data !== "string" ) {
       +                return [];
       +        }
       +        if ( typeof context === "boolean" ) {
       +                keepScripts = context;
       +                context = false;
       +        }
        
       -                        // Create a cacheable copy of the iframe document on first call.
       -                        // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
       -                        // document to it; WebKit & Firefox won't allow reusing the iframe document.
       -                        if ( !iframeDoc || !iframe.createElement ) {
       -                                iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
       -                                iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" );
       -                                iframeDoc.close();
       -                        }
       +        var base, parsed, scripts;
        
       -                        elem = iframeDoc.createElement( nodeName );
       +        if ( !context ) {
        
       -                        iframeDoc.body.appendChild( elem );
       +                // Stop scripts or inline event handlers from being executed immediately
       +                // by using document.implementation
       +                if ( support.createHTMLDocument ) {
       +                        context = document.implementation.createHTMLDocument( "" );
        
       -                        display = jQuery.css( elem, "display" );
       -                        body.removeChild( iframe );
       +                        // Set the base href for the created document
       +                        // so any parsed elements with URLs
       +                        // are based on the document's URL (gh-2965)
       +                        base = context.createElement( "base" );
       +                        base.href = document.location.href;
       +                        context.head.appendChild( base );
       +                } else {
       +                        context = document;
                        }
       +        }
        
       -                // Store the correct default display
       -                elemdisplay[ nodeName ] = display;
       +        parsed = rsingleTag.exec( data );
       +        scripts = !keepScripts && [];
       +
       +        // Single tag
       +        if ( parsed ) {
       +                return [ context.createElement( parsed[ 1 ] ) ];
                }
        
       -        return elemdisplay[ nodeName ];
       -}
       +        parsed = buildFragment( [ data ], context, scripts );
        
       +        if ( scripts && scripts.length ) {
       +                jQuery( scripts ).remove();
       +        }
        
       +        return jQuery.merge( [], parsed.childNodes );
       +};
        
        
       -var getOffset,
       -        rtable = /^t(?:able|d|h)$/i,
       -        rroot = /^(?:body|html)$/i;
       +/**
       + * Load a url into a page
       + */
       +jQuery.fn.load = function( url, params, callback ) {
       +        var selector, type, response,
       +                self = this,
       +                off = url.indexOf( " " );
       +
       +        if ( off > -1 ) {
       +                selector = stripAndCollapse( url.slice( off ) );
       +                url = url.slice( 0, off );
       +        }
        
       -if ( "getBoundingClientRect" in document.documentElement ) {
       -        getOffset = function( elem, doc, docElem, box ) {
       -                try {
       -                        box = elem.getBoundingClientRect();
       -                } catch(e) {}
       +        // If it's a function
       +        if ( jQuery.isFunction( params ) ) {
        
       -                // Make sure we're not dealing with a disconnected DOM node
       -                if ( !box || !jQuery.contains( docElem, elem ) ) {
       -                        return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
       -                }
       +                // We assume that it's the callback
       +                callback = params;
       +                params = undefined;
        
       -                var body = doc.body,
       -                        win = getWindow( doc ),
       -                        clientTop  = docElem.clientTop  || body.clientTop  || 0,
       -                        clientLeft = docElem.clientLeft || body.clientLeft || 0,
       -                        scrollTop  = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop,
       -                        scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
       -                        top  = box.top  + scrollTop  - clientTop,
       -                        left = box.left + scrollLeft - clientLeft;
       +        // Otherwise, build a param string
       +        } else if ( params && typeof params === "object" ) {
       +                type = "POST";
       +        }
        
       -                return { top: top, left: left };
       -        };
       +        // If we have elements to modify, make the request
       +        if ( self.length > 0 ) {
       +                jQuery.ajax( {
       +                        url: url,
        
       -} else {
       -        getOffset = function( elem, doc, docElem ) {
       -                var computedStyle,
       -                        offsetParent = elem.offsetParent,
       -                        prevOffsetParent = elem,
       -                        body = doc.body,
       -                        defaultView = doc.defaultView,
       -                        prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
       -                        top = elem.offsetTop,
       -                        left = elem.offsetLeft;
       -
       -                while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
       -                        if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
       -                                break;
       -                        }
       +                        // If "type" variable is undefined, then "GET" method will be used.
       +                        // Make value of this field explicit since
       +                        // user can override it through ajaxSetup method
       +                        type: type || "GET",
       +                        dataType: "html",
       +                        data: params
       +                } ).done( function( responseText ) {
        
       -                        computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
       -                        top  -= elem.scrollTop;
       -                        left -= elem.scrollLeft;
       +                        // Save response for use in complete callback
       +                        response = arguments;
        
       -                        if ( elem === offsetParent ) {
       -                                top  += elem.offsetTop;
       -                                left += elem.offsetLeft;
       +                        self.html( selector ?
        
       -                                if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
       -                                        top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
       -                                        left += parseFloat( computedStyle.borderLeftWidth ) || 0;
       -                                }
       +                                // If a selector was specified, locate the right elements in a dummy div
       +                                // Exclude scripts to avoid IE 'Permission Denied' errors
       +                                jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
        
       -                                prevOffsetParent = offsetParent;
       -                                offsetParent = elem.offsetParent;
       -                        }
       +                                // Otherwise use the full result
       +                                responseText );
        
       -                        if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
       -                                top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
       -                                left += parseFloat( computedStyle.borderLeftWidth ) || 0;
       -                        }
       +                // If the request succeeds, this function gets "data", "status", "jqXHR"
       +                // but they are ignored because response was set above.
       +                // If it fails, this function gets "jqXHR", "status", "error"
       +                } ).always( callback && function( jqXHR, status ) {
       +                        self.each( function() {
       +                                callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
       +                        } );
       +                } );
       +        }
        
       -                        prevComputedStyle = computedStyle;
       -                }
       +        return this;
       +};
        
       -                if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
       -                        top  += body.offsetTop;
       -                        left += body.offsetLeft;
       -                }
        
       -                if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
       -                        top  += Math.max( docElem.scrollTop, body.scrollTop );
       -                        left += Math.max( docElem.scrollLeft, body.scrollLeft );
       -                }
        
       -                return { top: top, left: left };
       -        };
       -}
        
       -jQuery.fn.offset = function( options ) {
       -        if ( arguments.length ) {
       -                return options === undefined ?
       -                        this :
       -                        this.each(function( i ) {
       -                                jQuery.offset.setOffset( this, options, i );
       -                        });
       -        }
       +// Attach a bunch of functions for handling common AJAX events
       +jQuery.each( [
       +        "ajaxStart",
       +        "ajaxStop",
       +        "ajaxComplete",
       +        "ajaxError",
       +        "ajaxSuccess",
       +        "ajaxSend"
       +], function( i, type ) {
       +        jQuery.fn[ type ] = function( fn ) {
       +                return this.on( type, fn );
       +        };
       +} );
        
       -        var elem = this[0],
       -                doc = elem && elem.ownerDocument;
        
       -        if ( !doc ) {
       -                return null;
       -        }
        
       -        if ( elem === doc.body ) {
       -                return jQuery.offset.bodyOffset( elem );
       -        }
        
       -        return getOffset( elem, doc, doc.documentElement );
       +jQuery.expr.pseudos.animated = function( elem ) {
       +        return jQuery.grep( jQuery.timers, function( fn ) {
       +                return elem === fn.elem;
       +        } ).length;
        };
        
       -jQuery.offset = {
        
       -        bodyOffset: function( body ) {
       -                var top = body.offsetTop,
       -                        left = body.offsetLeft;
        
       -                if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
       -                        top  += parseFloat( jQuery.css(body, "marginTop") ) || 0;
       -                        left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
       -                }
        
       -                return { top: top, left: left };
       -        },
       +/**
       + * Gets a window from an element
       + */
       +function getWindow( elem ) {
       +        return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
       +}
        
       +jQuery.offset = {
                setOffset: function( elem, options, i ) {
       -                var position = jQuery.css( elem, "position" );
       +                var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
       +                        position = jQuery.css( elem, "position" ),
       +                        curElem = jQuery( elem ),
       +                        props = {};
        
       -                // set position first, in-case top/left are set even on static elem
       +                // Set position first, in-case top/left are set even on static elem
                        if ( position === "static" ) {
                                elem.style.position = "relative";
                        }
        
       -                var curElem = jQuery( elem ),
       -                        curOffset = curElem.offset(),
       -                        curCSSTop = jQuery.css( elem, "top" ),
       -                        curCSSLeft = jQuery.css( elem, "left" ),
       -                        calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
       -                        props = {}, curPosition = {}, curTop, curLeft;
       +                curOffset = curElem.offset();
       +                curCSSTop = jQuery.css( elem, "top" );
       +                curCSSLeft = jQuery.css( elem, "left" );
       +                calculatePosition = ( position === "absolute" || position === "fixed" ) &&
       +                        ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
        
       -                // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
       +                // Need to be able to calculate position if either
       +                // top or left is auto and position is either absolute or fixed
                        if ( calculatePosition ) {
                                curPosition = curElem.position();
                                curTop = curPosition.top;
                                curLeft = curPosition.left;
       +
                        } else {
                                curTop = parseFloat( curCSSTop ) || 0;
                                curLeft = parseFloat( curCSSLeft ) || 0;
                        }
        
                        if ( jQuery.isFunction( options ) ) {
       -                        options = options.call( elem, i, curOffset );
       +
       +                        // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
       +                        options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
                        }
        
                        if ( options.top != null ) {
       t@@ -9216,189 +9928,292 @@ jQuery.offset = {
        
                        if ( "using" in options ) {
                                options.using.call( elem, props );
       +
                        } else {
                                curElem.css( props );
                        }
                }
        };
        
       +jQuery.fn.extend( {
       +        offset: function( options ) {
       +
       +                // Preserve chaining for setter
       +                if ( arguments.length ) {
       +                        return options === undefined ?
       +                                this :
       +                                this.each( function( i ) {
       +                                        jQuery.offset.setOffset( this, options, i );
       +                                } );
       +                }
       +
       +                var docElem, win, rect, doc,
       +                        elem = this[ 0 ];
       +
       +                if ( !elem ) {
       +                        return;
       +                }
       +
       +                // Support: IE <=11 only
       +                // Running getBoundingClientRect on a
       +                // disconnected node in IE throws an error
       +                if ( !elem.getClientRects().length ) {
       +                        return { top: 0, left: 0 };
       +                }
       +
       +                rect = elem.getBoundingClientRect();
       +
       +                // Make sure element is not hidden (display: none)
       +                if ( rect.width || rect.height ) {
       +                        doc = elem.ownerDocument;
       +                        win = getWindow( doc );
       +                        docElem = doc.documentElement;
        
       -jQuery.fn.extend({
       +                        return {
       +                                top: rect.top + win.pageYOffset - docElem.clientTop,
       +                                left: rect.left + win.pageXOffset - docElem.clientLeft
       +                        };
       +                }
       +
       +                // Return zeros for disconnected and hidden elements (gh-2310)
       +                return rect;
       +        },
        
                position: function() {
       -                if ( !this[0] ) {
       -                        return null;
       +                if ( !this[ 0 ] ) {
       +                        return;
                        }
        
       -                var elem = this[0],
       +                var offsetParent, offset,
       +                        elem = this[ 0 ],
       +                        parentOffset = { top: 0, left: 0 };
       +
       +                // Fixed elements are offset from window (parentOffset = {top:0, left: 0},
       +                // because it is its only offset parent
       +                if ( jQuery.css( elem, "position" ) === "fixed" ) {
        
       -                // Get *real* offsetParent
       -                offsetParent = this.offsetParent(),
       +                        // Assume getBoundingClientRect is there when computed position is fixed
       +                        offset = elem.getBoundingClientRect();
        
       -                // Get correct offsets
       -                offset       = this.offset(),
       -                parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
       +                } else {
       +
       +                        // Get *real* offsetParent
       +                        offsetParent = this.offsetParent();
        
       -                // Subtract element margins
       -                // note: when an element has margin: auto the offsetLeft and marginLeft
       -                // are the same in Safari causing offset.left to incorrectly be 0
       -                offset.top  -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
       -                offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
       +                        // Get correct offsets
       +                        offset = this.offset();
       +                        if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
       +                                parentOffset = offsetParent.offset();
       +                        }
        
       -                // Add offsetParent borders
       -                parentOffset.top  += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
       -                parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
       +                        // Add offsetParent borders
       +                        parentOffset = {
       +                                top: parentOffset.top + jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ),
       +                                left: parentOffset.left + jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true )
       +                        };
       +                }
        
       -                // Subtract the two offsets
       +                // Subtract parent offsets and element margins
                        return {
       -                        top:  offset.top  - parentOffset.top,
       -                        left: offset.left - parentOffset.left
       +                        top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
       +                        left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
                        };
                },
        
       +        // This method will return documentElement in the following cases:
       +        // 1) For the element inside the iframe without offsetParent, this method will return
       +        //    documentElement of the parent window
       +        // 2) For the hidden or detached element
       +        // 3) For body or html element, i.e. in case of the html node - it will return itself
       +        //
       +        // but those exceptions were never presented as a real life use-cases
       +        // and might be considered as more preferable results.
       +        //
       +        // This logic, however, is not guaranteed and can change at any point in the future
                offsetParent: function() {
       -                return this.map(function() {
       -                        var offsetParent = this.offsetParent || document.body;
       -                        while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
       +                return this.map( function() {
       +                        var offsetParent = this.offsetParent;
       +
       +                        while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
                                        offsetParent = offsetParent.offsetParent;
                                }
       -                        return offsetParent;
       -                });
       -        }
       -});
        
       +                        return offsetParent || documentElement;
       +                } );
       +        }
       +} );
        
        // Create scrollLeft and scrollTop methods
       -jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
       -        var top = /Y/.test( prop );
       +jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
       +        var top = "pageYOffset" === prop;
        
                jQuery.fn[ method ] = function( val ) {
       -                return jQuery.access( this, function( elem, method, val ) {
       +                return access( this, function( elem, method, val ) {
                                var win = getWindow( elem );
        
                                if ( val === undefined ) {
       -                                return win ? (prop in win) ? win[ prop ] :
       -                                        jQuery.support.boxModel && win.document.documentElement[ method ] ||
       -                                                win.document.body[ method ] :
       -                                        elem[ method ];
       +                                return win ? win[ prop ] : elem[ method ];
                                }
        
                                if ( win ) {
                                        win.scrollTo(
       -                                        !top ? val : jQuery( win ).scrollLeft(),
       -                                         top ? val : jQuery( win ).scrollTop()
       +                                        !top ? val : win.pageXOffset,
       +                                        top ? val : win.pageYOffset
                                        );
        
                                } else {
                                        elem[ method ] = val;
                                }
       -                }, method, val, arguments.length, null );
       +                }, method, val, arguments.length );
                };
       -});
       -
       -function getWindow( elem ) {
       -        return jQuery.isWindow( elem ) ?
       -                elem :
       -                elem.nodeType === 9 ?
       -                        elem.defaultView || elem.parentWindow :
       -                        false;
       -}
       -
       +} );
       +
       +// Support: Safari <=7 - 9.1, Chrome <=37 - 49
       +// Add the top/left cssHooks using jQuery.fn.position
       +// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
       +// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
       +// getComputedStyle returns percent when specified for top/left/bottom/right;
       +// rather than make the css module depend on the offset module, just check for it here
       +jQuery.each( [ "top", "left" ], function( i, prop ) {
       +        jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
       +                function( elem, computed ) {
       +                        if ( computed ) {
       +                                computed = curCSS( elem, prop );
        
       +                                // If curCSS returns percentage, fallback to offset
       +                                return rnumnonpx.test( computed ) ?
       +                                        jQuery( elem ).position()[ prop ] + "px" :
       +                                        computed;
       +                        }
       +                }
       +        );
       +} );
        
        
       -// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
       +// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
        jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
       -        var clientProp = "client" + name,
       -                scrollProp = "scroll" + name,
       -                offsetProp = "offset" + name;
       -
       -        // innerHeight and innerWidth
       -        jQuery.fn[ "inner" + name ] = function() {
       -                var elem = this[0];
       -                return elem ?
       -                        elem.style ?
       -                        parseFloat( jQuery.css( elem, type, "padding" ) ) :
       -                        this[ type ]() :
       -                        null;
       -        };
       +        jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
       +                function( defaultExtra, funcName ) {
        
       -        // outerHeight and outerWidth
       -        jQuery.fn[ "outer" + name ] = function( margin ) {
       -                var elem = this[0];
       -                return elem ?
       -                        elem.style ?
       -                        parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
       -                        this[ type ]() :
       -                        null;
       -        };
       +                // Margin is only for outerHeight, outerWidth
       +                jQuery.fn[ funcName ] = function( margin, value ) {
       +                        var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
       +                                extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
        
       -        jQuery.fn[ type ] = function( value ) {
       -                return jQuery.access( this, function( elem, type, value ) {
       -                        var doc, docElemProp, orig, ret;
       +                        return access( this, function( elem, type, value ) {
       +                                var doc;
        
       -                        if ( jQuery.isWindow( elem ) ) {
       -                                // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
       -                                doc = elem.document;
       -                                docElemProp = doc.documentElement[ clientProp ];
       -                                return jQuery.support.boxModel && docElemProp ||
       -                                        doc.body && doc.body[ clientProp ] || docElemProp;
       -                        }
       +                                if ( jQuery.isWindow( elem ) ) {
       +
       +                                        // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
       +                                        return funcName.indexOf( "outer" ) === 0 ?
       +                                                elem[ "inner" + name ] :
       +                                                elem.document.documentElement[ "client" + name ];
       +                                }
        
       -                        // Get document width or height
       -                        if ( elem.nodeType === 9 ) {
       -                                // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
       -                                doc = elem.documentElement;
       +                                // Get document width or height
       +                                if ( elem.nodeType === 9 ) {
       +                                        doc = elem.documentElement;
        
       -                                // when a window > document, IE6 reports a offset[Width/Height] > client[Width/Height]
       -                                // so we can't use max, as it'll choose the incorrect offset[Width/Height]
       -                                // instead we use the correct client[Width/Height]
       -                                // support:IE6
       -                                if ( doc[ clientProp ] >= doc[ scrollProp ] ) {
       -                                        return doc[ clientProp ];
       +                                        // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
       +                                        // whichever is greatest
       +                                        return Math.max(
       +                                                elem.body[ "scroll" + name ], doc[ "scroll" + name ],
       +                                                elem.body[ "offset" + name ], doc[ "offset" + name ],
       +                                                doc[ "client" + name ]
       +                                        );
                                        }
        
       -                                return Math.max(
       -                                        elem.body[ scrollProp ], doc[ scrollProp ],
       -                                        elem.body[ offsetProp ], doc[ offsetProp ]
       -                                );
       -                        }
       +                                return value === undefined ?
        
       -                        // Get width or height on the element
       -                        if ( value === undefined ) {
       -                                orig = jQuery.css( elem, type );
       -                                ret = parseFloat( orig );
       -                                return jQuery.isNumeric( ret ) ? ret : orig;
       -                        }
       +                                        // Get width or height on the element, requesting but not forcing parseFloat
       +                                        jQuery.css( elem, type, extra ) :
        
       -                        // Set the width or height on the element
       -                        jQuery( elem ).css( type, value );
       -                }, type, value, arguments.length, null );
       -        };
       -});
       +                                        // Set width or height on the element
       +                                        jQuery.style( elem, type, value, extra );
       +                        }, type, chainable ? margin : undefined, chainable );
       +                };
       +        } );
       +} );
       +
       +
       +jQuery.fn.extend( {
       +
       +        bind: function( types, data, fn ) {
       +                return this.on( types, null, data, fn );
       +        },
       +        unbind: function( types, fn ) {
       +                return this.off( types, null, fn );
       +        },
       +
       +        delegate: function( selector, types, data, fn ) {
       +                return this.on( types, selector, data, fn );
       +        },
       +        undelegate: function( selector, types, fn ) {
       +
       +                // ( namespace ) or ( selector, types [, fn] )
       +                return arguments.length === 1 ?
       +                        this.off( selector, "**" ) :
       +                        this.off( types, selector || "**", fn );
       +        }
       +} );
       +
       +jQuery.parseJSON = JSON.parse;
        
        
        
        
       -// Expose jQuery to the global object
       -window.jQuery = window.$ = jQuery;
       +// Register as a named AMD module, since jQuery can be concatenated with other
       +// files that may use define, but not via a proper concatenation script that
       +// understands anonymous AMD modules. A named AMD is safest and most robust
       +// way to register. Lowercase jquery is used because AMD module names are
       +// derived from file names, and jQuery is normally delivered in a lowercase
       +// file name. Do this after creating the global so that if an AMD module wants
       +// to call noConflict to hide this version of jQuery, it will work.
        
       -// Expose jQuery as an AMD module, but only for AMD loaders that
       -// understand the issues with loading multiple versions of jQuery
       -// in a page that all might call define(). The loader will indicate
       -// they have special allowances for multiple jQuery versions by
       -// specifying define.amd.jQuery = true. Register as a named module,
       -// since jQuery can be concatenated with other files that may use define,
       -// but not use a proper concatenation script that understands anonymous
       -// AMD modules. A named AMD is safest and most robust way to register.
       -// Lowercase jquery is used because AMD module names are derived from
       -// file names, and jQuery is normally delivered in a lowercase file name.
       -// Do this after creating the global so that if an AMD module wants to call
       -// noConflict to hide this version of jQuery, it will work.
       -if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
       -        define( "jquery", [], function () { return jQuery; } );
       +// Note that for maximum portability, libraries that are not jQuery should
       +// declare themselves as anonymous modules, and avoid setting a global if an
       +// AMD loader is present. jQuery is a special case. For more information, see
       +// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
       +
       +if ( typeof define === "function" && define.amd ) {
       +        define( "jquery", [], function() {
       +                return jQuery;
       +        } );
        }
        
        
        
       -})( window );
       +
       +var
       +
       +        // Map over jQuery in case of overwrite
       +        _jQuery = window.jQuery,
       +
       +        // Map over the $ in case of overwrite
       +        _$ = window.$;
       +
       +jQuery.noConflict = function( deep ) {
       +        if ( window.$ === jQuery ) {
       +                window.$ = _$;
       +        }
       +
       +        if ( deep && window.jQuery === jQuery ) {
       +                window.jQuery = _jQuery;
       +        }
       +
       +        return jQuery;
       +};
       +
       +// Expose jQuery and $ identifiers, even in AMD
       +// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
       +// and CommonJS for browser emulators (#13566)
       +if ( !noGlobal ) {
       +        window.jQuery = window.$ = jQuery;
       +}
       +
       +
       +
       +
       +return jQuery;
       +} );
 (DIR) diff --git a/doc/html/_static/minus.png b/doc/html/_static/minus.png
       Binary files differ.
 (DIR) diff --git a/doc/html/_static/plus.png b/doc/html/_static/plus.png
       Binary files differ.
 (DIR) diff --git a/doc/html/_static/pygments.css b/doc/html/_static/pygments.css
       t@@ -4,8 +4,10 @@
        .highlight .err { border: 1px solid #FF0000 } /* Error */
        .highlight .k { color: #007020; font-weight: bold } /* Keyword */
        .highlight .o { color: #666666 } /* Operator */
       +.highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */
        .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
        .highlight .cp { color: #007020 } /* Comment.Preproc */
       +.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */
        .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */
        .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
        .highlight .gd { color: #A00000 } /* Generic.Deleted */
       t@@ -40,12 +42,15 @@
        .highlight .nv { color: #bb60d5 } /* Name.Variable */
        .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
        .highlight .w { color: #bbbbbb } /* Text.Whitespace */
       +.highlight .mb { color: #208050 } /* Literal.Number.Bin */
        .highlight .mf { color: #208050 } /* Literal.Number.Float */
        .highlight .mh { color: #208050 } /* Literal.Number.Hex */
        .highlight .mi { color: #208050 } /* Literal.Number.Integer */
        .highlight .mo { color: #208050 } /* Literal.Number.Oct */
       +.highlight .sa { color: #4070a0 } /* Literal.String.Affix */
        .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
        .highlight .sc { color: #4070a0 } /* Literal.String.Char */
       +.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */
        .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
        .highlight .s2 { color: #4070a0 } /* Literal.String.Double */
        .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
       t@@ -56,7 +61,9 @@
        .highlight .s1 { color: #4070a0 } /* Literal.String.Single */
        .highlight .ss { color: #517918 } /* Literal.String.Symbol */
        .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
       +.highlight .fm { color: #06287e } /* Name.Function.Magic */
        .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
        .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
        .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
       +.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */
        .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */
        \ No newline at end of file
 (DIR) diff --git a/doc/html/_static/searchtools.js b/doc/html/_static/searchtools.js
       t@@ -2,41 +2,15 @@
         * searchtools.js_t
         * ~~~~~~~~~~~~~~~~
         *
       - * Sphinx JavaScript utilties for the full-text search.
       + * Sphinx JavaScript utilities for the full-text search.
         *
       - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
       + * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
         * :license: BSD, see LICENSE for details.
         *
         */
        
       -/**
       - * helper function to return a node containing the
       - * search summary for a given text. keywords is a list
       - * of stemmed words, hlwords is the list of normal, unstemmed
       - * words. the first one is used to find the occurance, the
       - * latter for highlighting it.
       - */
       -
       -jQuery.makeSearchSummary = function(text, keywords, hlwords) {
       -  var textLower = text.toLowerCase();
       -  var start = 0;
       -  $.each(keywords, function() {
       -    var i = textLower.indexOf(this.toLowerCase());
       -    if (i > -1)
       -      start = i;
       -  });
       -  start = Math.max(start - 120, 0);
       -  var excerpt = ((start > 0) ? '...' : '') +
       -  $.trim(text.substr(start, 240)) +
       -  ((start + 240 - text.length) ? '...' : '');
       -  var rv = $('<div class="context"></div>').text(excerpt);
       -  $.each(hlwords, function() {
       -    rv = rv.highlightText(this, 'highlighted');
       -  });
       -  return rv;
       -}
       -
        
       +/* Non-minified version JS is _stemmer.js if file is provided */ 
        /**
         * Porter Stemmer
         */
       t@@ -220,6 +194,138 @@ var Stemmer = function() {
        }
        
        
       +
       +/**
       + * Simple result scoring code.
       + */
       +var Scorer = {
       +  // Implement the following function to further tweak the score for each result
       +  // The function takes a result array [filename, title, anchor, descr, score]
       +  // and returns the new score.
       +  /*
       +  score: function(result) {
       +    return result[4];
       +  },
       +  */
       +
       +  // query matches the full name of an object
       +  objNameMatch: 11,
       +  // or matches in the last dotted part of the object name
       +  objPartialMatch: 6,
       +  // Additive scores depending on the priority of the object
       +  objPrio: {0:  15,   // used to be importantResults
       +            1:  5,   // used to be objectResults
       +            2: -5},  // used to be unimportantResults
       +  //  Used when the priority is not in the mapping.
       +  objPrioDefault: 0,
       +
       +  // query found in title
       +  title: 15,
       +  // query found in terms
       +  term: 5
       +};
       +
       +
       +
       +
       +
       +var splitChars = (function() {
       +    var result = {};
       +    var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
       +         1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,
       +         2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,
       +         2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345,
       +         3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761,
       +         3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823,
       +         4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125,
       +         8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695,
       +         11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587,
       +         43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];
       +    var i, j, start, end;
       +    for (i = 0; i < singles.length; i++) {
       +        result[singles[i]] = true;
       +    }
       +    var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709],
       +         [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161],
       +         [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568],
       +         [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807],
       +         [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047],
       +         [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383],
       +         [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450],
       +         [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547],
       +         [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673],
       +         [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820],
       +         [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946],
       +         [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023],
       +         [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173],
       +         [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332],
       +         [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481],
       +         [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718],
       +         [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791],
       +         [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095],
       +         [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205],
       +         [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687],
       +         [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968],
       +         [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869],
       +         [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102],
       +         [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271],
       +         [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592],
       +         [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822],
       +         [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167],
       +         [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959],
       +         [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143],
       +         [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318],
       +         [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483],
       +         [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101],
       +         [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567],
       +         [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292],
       +         [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444],
       +         [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783],
       +         [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311],
       +         [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511],
       +         [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774],
       +         [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071],
       +         [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263],
       +         [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519],
       +         [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647],
       +         [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967],
       +         [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295],
       +         [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274],
       +         [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007],
       +         [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381],
       +         [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]];
       +    for (i = 0; i < ranges.length; i++) {
       +        start = ranges[i][0];
       +        end = ranges[i][1];
       +        for (j = start; j <= end; j++) {
       +            result[j] = true;
       +        }
       +    }
       +    return result;
       +})();
       +
       +function splitQuery(query) {
       +    var result = [];
       +    var start = -1;
       +    for (var i = 0; i < query.length; i++) {
       +        if (splitChars[query.charCodeAt(i)]) {
       +            if (start !== -1) {
       +                result.push(query.slice(start, i));
       +                start = -1;
       +            }
       +        } else if (start === -1) {
       +            start = i;
       +        }
       +    }
       +    if (start !== -1) {
       +        result.push(query.slice(start));
       +    }
       +    return result;
       +}
       +
       +
       +
       +
        /**
         * Search Module
         */
       t@@ -273,19 +379,20 @@ var Search = {
            if (this._pulse_status >= 0)
                return;
            function pulse() {
       +      var i;
              Search._pulse_status = (Search._pulse_status + 1) % 4;
              var dotString = '';
       -      for (var i = 0; i < Search._pulse_status; i++)
       +      for (i = 0; i < Search._pulse_status; i++)
                dotString += '.';
              Search.dots.text(dotString);
              if (Search._pulse_status > -1)
                window.setTimeout(pulse, 500);
       -    };
       +    }
            pulse();
          },
        
          /**
       -   * perform a search for something
       +   * perform a search for something (or wait until index is loaded)
           */
          performSearch : function(query) {
            // create the required interface elements
       t@@ -305,41 +412,46 @@ var Search = {
              this.deferQuery(query);
          },
        
       +  /**
       +   * execute search (requires search index to be loaded)
       +   */
          query : function(query) {
       +    var i;
            var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
        
       -    // Stem the searchterms and add them to the correct list
       +    // stem the searchterms and add them to the correct list
            var stemmer = new Stemmer();
            var searchterms = [];
            var excluded = [];
            var hlterms = [];
       -    var tmp = query.split(/\s+/);
       +    var tmp = splitQuery(query);
            var objectterms = [];
       -    for (var i = 0; i < tmp.length; i++) {
       -      if (tmp[i] != "") {
       +    for (i = 0; i < tmp.length; i++) {
       +      if (tmp[i] !== "") {
                  objectterms.push(tmp[i].toLowerCase());
              }
        
       -      if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) ||
       -          tmp[i] == "") {
       +      if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) ||
       +          tmp[i] === "") {
                // skip this "word"
                continue;
              }
              // stem the word
       -      var word = stemmer.stemWord(tmp[i]).toLowerCase();
       +      var word = stemmer.stemWord(tmp[i].toLowerCase());
       +      var toAppend;
              // select the correct list
              if (word[0] == '-') {
       -        var toAppend = excluded;
       +        toAppend = excluded;
                word = word.substr(1);
              }
              else {
       -        var toAppend = searchterms;
       +        toAppend = searchterms;
                hlterms.push(tmp[i].toLowerCase());
              }
              // only add if not already in the list
       -      if (!$.contains(toAppend, word))
       +      if (!$u.contains(toAppend, word))
                toAppend.push(word);
       -    };
       +    }
            var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
        
            // console.debug('SEARCH: searching for:');
       t@@ -347,89 +459,50 @@ var Search = {
            // console.info('excluded: ', excluded);
        
            // prepare search
       -    var filenames = this._index.filenames;
       -    var titles = this._index.titles;
            var terms = this._index.terms;
       -    var fileMap = {};
       -    var files = null;
       -    // different result priorities
       -    var importantResults = [];
       -    var objectResults = [];
       -    var regularResults = [];
       -    var unimportantResults = [];
       +    var titleterms = this._index.titleterms;
       +
       +    // array of [filename, title, anchor, descr, score]
       +    var results = [];
            $('#search-progress').empty();
        
            // lookup as object
       -    for (var i = 0; i < objectterms.length; i++) {
       -      var others = [].concat(objectterms.slice(0,i),
       -                             objectterms.slice(i+1, objectterms.length))
       -      var results = this.performObjectSearch(objectterms[i], others);
       -      // Assume first word is most likely to be the object,
       -      // other words more likely to be in description.
       -      // Therefore put matches for earlier words first.
       -      // (Results are eventually used in reverse order).
       -      objectResults = results[0].concat(objectResults);
       -      importantResults = results[1].concat(importantResults);
       -      unimportantResults = results[2].concat(unimportantResults);
       -    }
       -
       -    // perform the search on the required terms
       -    for (var i = 0; i < searchterms.length; i++) {
       -      var word = searchterms[i];
       -      // no match but word was a required one
       -      if ((files = terms[word]) == null)
       -        break;
       -      if (files.length == undefined) {
       -        files = [files];
       -      }
       -      // create the mapping
       -      for (var j = 0; j < files.length; j++) {
       -        var file = files[j];
       -        if (file in fileMap)
       -          fileMap[file].push(word);
       -        else
       -          fileMap[file] = [word];
       -      }
       +    for (i = 0; i < objectterms.length; i++) {
       +      var others = [].concat(objectterms.slice(0, i),
       +                             objectterms.slice(i+1, objectterms.length));
       +      results = results.concat(this.performObjectSearch(objectterms[i], others));
            }
        
       -    // now check if the files don't contain excluded terms
       -    for (var file in fileMap) {
       -      var valid = true;
       -
       -      // check if all requirements are matched
       -      if (fileMap[file].length != searchterms.length)
       -        continue;
       -
       -      // ensure that none of the excluded terms is in the
       -      // search result.
       -      for (var i = 0; i < excluded.length; i++) {
       -        if (terms[excluded[i]] == file ||
       -            $.contains(terms[excluded[i]] || [], file)) {
       -          valid = false;
       -          break;
       -        }
       -      }
       +    // lookup as search terms in fulltext
       +    results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms));
        
       -      // if we have still a valid result we can add it
       -      // to the result list
       -      if (valid)
       -        regularResults.push([filenames[file], titles[file], '', null]);
       +    // let the scorer override scores with a custom scoring function
       +    if (Scorer.score) {
       +      for (i = 0; i < results.length; i++)
       +        results[i][4] = Scorer.score(results[i]);
            }
        
       -    // delete unused variables in order to not waste
       -    // memory until list is retrieved completely
       -    delete filenames, titles, terms;
       -
       -    // now sort the regular results descending by title
       -    regularResults.sort(function(a, b) {
       -      var left = a[1].toLowerCase();
       -      var right = b[1].toLowerCase();
       -      return (left > right) ? -1 : ((left < right) ? 1 : 0);
       +    // now sort the results by score (in opposite order of appearance, since the
       +    // display function below uses pop() to retrieve items) and then
       +    // alphabetically
       +    results.sort(function(a, b) {
       +      var left = a[4];
       +      var right = b[4];
       +      if (left > right) {
       +        return 1;
       +      } else if (left < right) {
       +        return -1;
       +      } else {
       +        // same score: sort alphabetically
       +        left = a[1].toLowerCase();
       +        right = b[1].toLowerCase();
       +        return (left > right) ? -1 : ((left < right) ? 1 : 0);
       +      }
            });
        
       -    // combine all results
       -    var results = unimportantResults.concat(regularResults)
       -      .concat(objectResults).concat(importantResults);
       +    // for debugging
       +    //Search.lastresults = results.slice();  // a copy
       +    //console.info('search results:', Search.lastresults);
        
            // print the results
            var resultCount = results.length;
       t@@ -438,7 +511,7 @@ var Search = {
              if (results.length) {
                var item = results.pop();
                var listItem = $('<li style="display:none"></li>');
       -        if (DOCUMENTATION_OPTIONS.FILE_SUFFIX == '') {
       +        if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') {
                  // dirhtml builder
                  var dirname = item[0] + '/';
                  if (dirname.match(/\/index\/$/)) {
       t@@ -466,8 +539,8 @@ var Search = {
                          dataType: "text",
                          complete: function(jqxhr, textstatus) {
                            var data = jqxhr.responseText;
       -                    if (data !== '') {
       -                      listItem.append($.makeSearchSummary(data, searchterms, hlterms));
       +                    if (data !== '' && data !== undefined) {
       +                      listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
                            }
                            Search.output.append(listItem);
                            listItem.slideDown(5, function() {
       t@@ -496,20 +569,32 @@ var Search = {
            displayNextItem();
          },
        
       +  /**
       +   * search for object names
       +   */
          performObjectSearch : function(object, otherterms) {
            var filenames = this._index.filenames;
            var objects = this._index.objects;
            var objnames = this._index.objnames;
            var titles = this._index.titles;
        
       -    var importantResults = [];
       -    var objectResults = [];
       -    var unimportantResults = [];
       +    var i;
       +    var results = [];
        
            for (var prefix in objects) {
              for (var name in objects[prefix]) {
                var fullname = (prefix ? prefix + '.' : '') + name;
                if (fullname.toLowerCase().indexOf(object) > -1) {
       +          var score = 0;
       +          var parts = fullname.split('.');
       +          // check for different match types: exact matches of full name or
       +          // "last name" (i.e. last dotted part)
       +          if (fullname == object || parts[parts.length - 1] == object) {
       +            score += Scorer.objNameMatch;
       +          // matches in last name
       +          } else if (parts[parts.length - 1].indexOf(object) > -1) {
       +            score += Scorer.objPartialMatch;
       +          }
                  var match = objects[prefix][name];
                  var objname = objnames[match[1]][2];
                  var title = titles[match[0]];
       t@@ -519,7 +604,7 @@ var Search = {
                    var haystack = (prefix + ' ' + name + ' ' +
                                    objname + ' ' + title).toLowerCase();
                    var allfound = true;
       -            for (var i = 0; i < otherterms.length; i++) {
       +            for (i = 0; i < otherterms.length; i++) {
                      if (haystack.indexOf(otherterms[i]) == -1) {
                        allfound = false;
                        break;
       t@@ -530,37 +615,136 @@ var Search = {
                    }
                  }
                  var descr = objname + _(', in ') + title;
       -          anchor = match[3];
       -          if (anchor == '')
       +
       +          var anchor = match[3];
       +          if (anchor === '')
                    anchor = fullname;
                  else if (anchor == '-')
                    anchor = objnames[match[1]][1] + '-' + fullname;
       -          result = [filenames[match[0]], fullname, '#'+anchor, descr];
       -          switch (match[2]) {
       -          case 1: objectResults.push(result); break;
       -          case 0: importantResults.push(result); break;
       -          case 2: unimportantResults.push(result); break;
       +          // add custom score for some objects according to scorer
       +          if (Scorer.objPrio.hasOwnProperty(match[2])) {
       +            score += Scorer.objPrio[match[2]];
       +          } else {
       +            score += Scorer.objPrioDefault;
                  }
       +          results.push([filenames[match[0]], fullname, '#'+anchor, descr, score]);
                }
              }
            }
        
       -    // sort results descending
       -    objectResults.sort(function(a, b) {
       -      return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
       -    });
       +    return results;
       +  },
        
       -    importantResults.sort(function(a, b) {
       -      return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
       -    });
       +  /**
       +   * search for full-text terms in the index
       +   */
       +  performTermsSearch : function(searchterms, excluded, terms, titleterms) {
       +    var filenames = this._index.filenames;
       +    var titles = this._index.titles;
        
       -    unimportantResults.sort(function(a, b) {
       -      return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
       -    });
       +    var i, j, file;
       +    var fileMap = {};
       +    var scoreMap = {};
       +    var results = [];
        
       -    return [importantResults, objectResults, unimportantResults]
       +    // perform the search on the required terms
       +    for (i = 0; i < searchterms.length; i++) {
       +      var word = searchterms[i];
       +      var files = [];
       +      var _o = [
       +        {files: terms[word], score: Scorer.term},
       +        {files: titleterms[word], score: Scorer.title}
       +      ];
       +
       +      // no match but word was a required one
       +      if ($u.every(_o, function(o){return o.files === undefined;})) {
       +        break;
       +      }
       +      // found search word in contents
       +      $u.each(_o, function(o) {
       +        var _files = o.files;
       +        if (_files === undefined)
       +          return
       +
       +        if (_files.length === undefined)
       +          _files = [_files];
       +        files = files.concat(_files);
       +
       +        // set score for the word in each file to Scorer.term
       +        for (j = 0; j < _files.length; j++) {
       +          file = _files[j];
       +          if (!(file in scoreMap))
       +            scoreMap[file] = {}
       +          scoreMap[file][word] = o.score;
       +        }
       +      });
       +
       +      // create the mapping
       +      for (j = 0; j < files.length; j++) {
       +        file = files[j];
       +        if (file in fileMap)
       +          fileMap[file].push(word);
       +        else
       +          fileMap[file] = [word];
       +      }
       +    }
       +
       +    // now check if the files don't contain excluded terms
       +    for (file in fileMap) {
       +      var valid = true;
       +
       +      // check if all requirements are matched
       +      if (fileMap[file].length != searchterms.length)
       +          continue;
       +
       +      // ensure that none of the excluded terms is in the search result
       +      for (i = 0; i < excluded.length; i++) {
       +        if (terms[excluded[i]] == file ||
       +            titleterms[excluded[i]] == file ||
       +            $u.contains(terms[excluded[i]] || [], file) ||
       +            $u.contains(titleterms[excluded[i]] || [], file)) {
       +          valid = false;
       +          break;
       +        }
       +      }
       +
       +      // if we have still a valid result we can add it to the result list
       +      if (valid) {
       +        // select one (max) score for the file.
       +        // for better ranking, we should calculate ranking by using words statistics like basic tf-idf...
       +        var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]}));
       +        results.push([filenames[file], titles[file], '', null, score]);
       +      }
       +    }
       +    return results;
       +  },
       +
       +  /**
       +   * helper function to return a node containing the
       +   * search summary for a given text. keywords is a list
       +   * of stemmed words, hlwords is the list of normal, unstemmed
       +   * words. the first one is used to find the occurrence, the
       +   * latter for highlighting it.
       +   */
       +  makeSearchSummary : function(text, keywords, hlwords) {
       +    var textLower = text.toLowerCase();
       +    var start = 0;
       +    $.each(keywords, function() {
       +      var i = textLower.indexOf(this.toLowerCase());
       +      if (i > -1)
       +        start = i;
       +    });
       +    start = Math.max(start - 120, 0);
       +    var excerpt = ((start > 0) ? '...' : '') +
       +      $.trim(text.substr(start, 240)) +
       +      ((start + 240 - text.length) ? '...' : '');
       +    var rv = $('<div class="context"></div>').text(excerpt);
       +    $.each(hlwords, function() {
       +      rv = rv.highlightText(this, 'highlighted');
       +    });
       +    return rv;
          }
       -}
       +};
        
        $(document).ready(function() {
          Search.init();
 (DIR) diff --git a/doc/html/_static/sidebar.js b/doc/html/_static/sidebar.js
       t@@ -16,12 +16,20 @@
         * Once the browser is closed the cookie is deleted and the position
         * reset to the default (expanded).
         *
       - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
       + * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
         * :license: BSD, see LICENSE for details.
         *
         */
        
        $(function() {
       +  
       +  
       +  
       +  
       +  
       +  
       +  
       +
          // global elements used by the functions.
          // the 'sidebarbutton' element is defined as global after its
          // creation, in the add_sidebar_button function
       t@@ -134,7 +142,7 @@ $(function() {
            var items = document.cookie.split(';');
            for(var k=0; k<items.length; k++) {
              var key_val = items[k].split('=');
       -      var key = key_val[0];
       +      var key = key_val[0].replace(/ /, "");  // strip leading spaces
              if (key == 'sidebar') {
                var value = key_val[1];
                if ((value == 'collapsed') && (!sidebar_is_collapsed()))
       t@@ -148,4 +156,4 @@ $(function() {
          add_sidebar_button();
          var sidebarbutton = $('#sidebarbutton');
          set_position_from_cookie();
       -});
       +});
       +\ No newline at end of file
 (DIR) diff --git a/doc/html/_static/underscore.js b/doc/html/_static/underscore.js
       t@@ -1,6 +1,6 @@
       -//     Underscore.js 1.4.4
       +//     Underscore.js 1.8.3
        //     http://underscorejs.org
       -//     (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
       +//     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
        //     Underscore may be freely distributed under the MIT license.
        
        (function() {
       t@@ -8,40 +8,32 @@
          // Baseline setup
          // --------------
        
       -  // Establish the root object, `window` in the browser, or `global` on the server.
       +  // Establish the root object, `window` in the browser, or `exports` on the server.
          var root = this;
        
          // Save the previous value of the `_` variable.
          var previousUnderscore = root._;
        
       -  // Establish the object that gets returned to break out of a loop iteration.
       -  var breaker = {};
       -
          // Save bytes in the minified (but not gzipped) version:
          var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
        
          // Create quick reference variables for speed access to core prototypes.
       -  var push             = ArrayProto.push,
       -      slice            = ArrayProto.slice,
       -      concat           = ArrayProto.concat,
       -      toString         = ObjProto.toString,
       -      hasOwnProperty   = ObjProto.hasOwnProperty;
       +  var
       +    push             = ArrayProto.push,
       +    slice            = ArrayProto.slice,
       +    toString         = ObjProto.toString,
       +    hasOwnProperty   = ObjProto.hasOwnProperty;
        
          // All **ECMAScript 5** native function implementations that we hope to use
          // are declared here.
          var
       -    nativeForEach      = ArrayProto.forEach,
       -    nativeMap          = ArrayProto.map,
       -    nativeReduce       = ArrayProto.reduce,
       -    nativeReduceRight  = ArrayProto.reduceRight,
       -    nativeFilter       = ArrayProto.filter,
       -    nativeEvery        = ArrayProto.every,
       -    nativeSome         = ArrayProto.some,
       -    nativeIndexOf      = ArrayProto.indexOf,
       -    nativeLastIndexOf  = ArrayProto.lastIndexOf,
            nativeIsArray      = Array.isArray,
            nativeKeys         = Object.keys,
       -    nativeBind         = FuncProto.bind;
       +    nativeBind         = FuncProto.bind,
       +    nativeCreate       = Object.create;
       +
       +  // Naked function reference for surrogate-prototype-swapping.
       +  var Ctor = function(){};
        
          // Create a safe reference to the Underscore object for use below.
          var _ = function(obj) {
       t@@ -52,8 +44,7 @@
        
          // Export the Underscore object for **Node.js**, with
          // backwards-compatibility for the old `require()` API. If we're in
       -  // the browser, add `_` as a global object via a string identifier,
       -  // for Closure Compiler "advanced" mode.
       +  // the browser, add `_` as a global object.
          if (typeof exports !== 'undefined') {
            if (typeof module !== 'undefined' && module.exports) {
              exports = module.exports = _;
       t@@ -64,161 +55,217 @@
          }
        
          // Current version.
       -  _.VERSION = '1.4.4';
       +  _.VERSION = '1.8.3';
       +
       +  // Internal function that returns an efficient (for current engines) version
       +  // of the passed-in callback, to be repeatedly applied in other Underscore
       +  // functions.
       +  var optimizeCb = function(func, context, argCount) {
       +    if (context === void 0) return func;
       +    switch (argCount == null ? 3 : argCount) {
       +      case 1: return function(value) {
       +        return func.call(context, value);
       +      };
       +      case 2: return function(value, other) {
       +        return func.call(context, value, other);
       +      };
       +      case 3: return function(value, index, collection) {
       +        return func.call(context, value, index, collection);
       +      };
       +      case 4: return function(accumulator, value, index, collection) {
       +        return func.call(context, accumulator, value, index, collection);
       +      };
       +    }
       +    return function() {
       +      return func.apply(context, arguments);
       +    };
       +  };
       +
       +  // A mostly-internal function to generate callbacks that can be applied
       +  // to each element in a collection, returning the desired result — either
       +  // identity, an arbitrary callback, a property matcher, or a property accessor.
       +  var cb = function(value, context, argCount) {
       +    if (value == null) return _.identity;
       +    if (_.isFunction(value)) return optimizeCb(value, context, argCount);
       +    if (_.isObject(value)) return _.matcher(value);
       +    return _.property(value);
       +  };
       +  _.iteratee = function(value, context) {
       +    return cb(value, context, Infinity);
       +  };
       +
       +  // An internal function for creating assigner functions.
       +  var createAssigner = function(keysFunc, undefinedOnly) {
       +    return function(obj) {
       +      var length = arguments.length;
       +      if (length < 2 || obj == null) return obj;
       +      for (var index = 1; index < length; index++) {
       +        var source = arguments[index],
       +            keys = keysFunc(source),
       +            l = keys.length;
       +        for (var i = 0; i < l; i++) {
       +          var key = keys[i];
       +          if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];
       +        }
       +      }
       +      return obj;
       +    };
       +  };
       +
       +  // An internal function for creating a new object that inherits from another.
       +  var baseCreate = function(prototype) {
       +    if (!_.isObject(prototype)) return {};
       +    if (nativeCreate) return nativeCreate(prototype);
       +    Ctor.prototype = prototype;
       +    var result = new Ctor;
       +    Ctor.prototype = null;
       +    return result;
       +  };
       +
       +  var property = function(key) {
       +    return function(obj) {
       +      return obj == null ? void 0 : obj[key];
       +    };
       +  };
       +
       +  // Helper for collection methods to determine whether a collection
       +  // should be iterated as an array or as an object
       +  // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
       +  // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
       +  var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
       +  var getLength = property('length');
       +  var isArrayLike = function(collection) {
       +    var length = getLength(collection);
       +    return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;
       +  };
        
          // Collection Functions
          // --------------------
        
          // The cornerstone, an `each` implementation, aka `forEach`.
       -  // Handles objects with the built-in `forEach`, arrays, and raw objects.
       -  // Delegates to **ECMAScript 5**'s native `forEach` if available.
       -  var each = _.each = _.forEach = function(obj, iterator, context) {
       -    if (obj == null) return;
       -    if (nativeForEach && obj.forEach === nativeForEach) {
       -      obj.forEach(iterator, context);
       -    } else if (obj.length === +obj.length) {
       -      for (var i = 0, l = obj.length; i < l; i++) {
       -        if (iterator.call(context, obj[i], i, obj) === breaker) return;
       +  // Handles raw objects in addition to array-likes. Treats all
       +  // sparse array-likes as if they were dense.
       +  _.each = _.forEach = function(obj, iteratee, context) {
       +    iteratee = optimizeCb(iteratee, context);
       +    var i, length;
       +    if (isArrayLike(obj)) {
       +      for (i = 0, length = obj.length; i < length; i++) {
       +        iteratee(obj[i], i, obj);
              }
            } else {
       -      for (var key in obj) {
       -        if (_.has(obj, key)) {
       -          if (iterator.call(context, obj[key], key, obj) === breaker) return;
       -        }
       +      var keys = _.keys(obj);
       +      for (i = 0, length = keys.length; i < length; i++) {
       +        iteratee(obj[keys[i]], keys[i], obj);
              }
            }
       +    return obj;
          };
        
       -  // Return the results of applying the iterator to each element.
       -  // Delegates to **ECMAScript 5**'s native `map` if available.
       -  _.map = _.collect = function(obj, iterator, context) {
       -    var results = [];
       -    if (obj == null) return results;
       -    if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
       -    each(obj, function(value, index, list) {
       -      results[results.length] = iterator.call(context, value, index, list);
       -    });
       +  // Return the results of applying the iteratee to each element.
       +  _.map = _.collect = function(obj, iteratee, context) {
       +    iteratee = cb(iteratee, context);
       +    var keys = !isArrayLike(obj) && _.keys(obj),
       +        length = (keys || obj).length,
       +        results = Array(length);
       +    for (var index = 0; index < length; index++) {
       +      var currentKey = keys ? keys[index] : index;
       +      results[index] = iteratee(obj[currentKey], currentKey, obj);
       +    }
            return results;
          };
        
       -  var reduceError = 'Reduce of empty array with no initial value';
       -
       -  // **Reduce** builds up a single result from a list of values, aka `inject`,
       -  // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
       -  _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
       -    var initial = arguments.length > 2;
       -    if (obj == null) obj = [];
       -    if (nativeReduce && obj.reduce === nativeReduce) {
       -      if (context) iterator = _.bind(iterator, context);
       -      return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
       +  // Create a reducing function iterating left or right.
       +  function createReduce(dir) {
       +    // Optimized iterator function as using arguments.length
       +    // in the main function will deoptimize the, see #1991.
       +    function iterator(obj, iteratee, memo, keys, index, length) {
       +      for (; index >= 0 && index < length; index += dir) {
       +        var currentKey = keys ? keys[index] : index;
       +        memo = iteratee(memo, obj[currentKey], currentKey, obj);
       +      }
       +      return memo;
            }
       -    each(obj, function(value, index, list) {
       -      if (!initial) {
       -        memo = value;
       -        initial = true;
       -      } else {
       -        memo = iterator.call(context, memo, value, index, list);
       +
       +    return function(obj, iteratee, memo, context) {
       +      iteratee = optimizeCb(iteratee, context, 4);
       +      var keys = !isArrayLike(obj) && _.keys(obj),
       +          length = (keys || obj).length,
       +          index = dir > 0 ? 0 : length - 1;
       +      // Determine the initial value if none is provided.
       +      if (arguments.length < 3) {
       +        memo = obj[keys ? keys[index] : index];
       +        index += dir;
              }
       -    });
       -    if (!initial) throw new TypeError(reduceError);
       -    return memo;
       -  };
       +      return iterator(obj, iteratee, memo, keys, index, length);
       +    };
       +  }
       +
       +  // **Reduce** builds up a single result from a list of values, aka `inject`,
       +  // or `foldl`.
       +  _.reduce = _.foldl = _.inject = createReduce(1);
        
          // The right-associative version of reduce, also known as `foldr`.
       -  // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
       -  _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
       -    var initial = arguments.length > 2;
       -    if (obj == null) obj = [];
       -    if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
       -      if (context) iterator = _.bind(iterator, context);
       -      return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
       -    }
       -    var length = obj.length;
       -    if (length !== +length) {
       -      var keys = _.keys(obj);
       -      length = keys.length;
       -    }
       -    each(obj, function(value, index, list) {
       -      index = keys ? keys[--length] : --length;
       -      if (!initial) {
       -        memo = obj[index];
       -        initial = true;
       -      } else {
       -        memo = iterator.call(context, memo, obj[index], index, list);
       -      }
       -    });
       -    if (!initial) throw new TypeError(reduceError);
       -    return memo;
       -  };
       +  _.reduceRight = _.foldr = createReduce(-1);
        
          // Return the first value which passes a truth test. Aliased as `detect`.
       -  _.find = _.detect = function(obj, iterator, context) {
       -    var result;
       -    any(obj, function(value, index, list) {
       -      if (iterator.call(context, value, index, list)) {
       -        result = value;
       -        return true;
       -      }
       -    });
       -    return result;
       +  _.find = _.detect = function(obj, predicate, context) {
       +    var key;
       +    if (isArrayLike(obj)) {
       +      key = _.findIndex(obj, predicate, context);
       +    } else {
       +      key = _.findKey(obj, predicate, context);
       +    }
       +    if (key !== void 0 && key !== -1) return obj[key];
          };
        
          // Return all the elements that pass a truth test.
       -  // Delegates to **ECMAScript 5**'s native `filter` if available.
          // Aliased as `select`.
       -  _.filter = _.select = function(obj, iterator, context) {
       +  _.filter = _.select = function(obj, predicate, context) {
            var results = [];
       -    if (obj == null) return results;
       -    if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
       -    each(obj, function(value, index, list) {
       -      if (iterator.call(context, value, index, list)) results[results.length] = value;
       +    predicate = cb(predicate, context);
       +    _.each(obj, function(value, index, list) {
       +      if (predicate(value, index, list)) results.push(value);
            });
            return results;
          };
        
          // Return all the elements for which a truth test fails.
       -  _.reject = function(obj, iterator, context) {
       -    return _.filter(obj, function(value, index, list) {
       -      return !iterator.call(context, value, index, list);
       -    }, context);
       +  _.reject = function(obj, predicate, context) {
       +    return _.filter(obj, _.negate(cb(predicate)), context);
          };
        
          // Determine whether all of the elements match a truth test.
       -  // Delegates to **ECMAScript 5**'s native `every` if available.
          // Aliased as `all`.
       -  _.every = _.all = function(obj, iterator, context) {
       -    iterator || (iterator = _.identity);
       -    var result = true;
       -    if (obj == null) return result;
       -    if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
       -    each(obj, function(value, index, list) {
       -      if (!(result = result && iterator.call(context, value, index, list))) return breaker;
       -    });
       -    return !!result;
       +  _.every = _.all = function(obj, predicate, context) {
       +    predicate = cb(predicate, context);
       +    var keys = !isArrayLike(obj) && _.keys(obj),
       +        length = (keys || obj).length;
       +    for (var index = 0; index < length; index++) {
       +      var currentKey = keys ? keys[index] : index;
       +      if (!predicate(obj[currentKey], currentKey, obj)) return false;
       +    }
       +    return true;
          };
        
          // Determine if at least one element in the object matches a truth test.
       -  // Delegates to **ECMAScript 5**'s native `some` if available.
          // Aliased as `any`.
       -  var any = _.some = _.any = function(obj, iterator, context) {
       -    iterator || (iterator = _.identity);
       -    var result = false;
       -    if (obj == null) return result;
       -    if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
       -    each(obj, function(value, index, list) {
       -      if (result || (result = iterator.call(context, value, index, list))) return breaker;
       -    });
       -    return !!result;
       +  _.some = _.any = function(obj, predicate, context) {
       +    predicate = cb(predicate, context);
       +    var keys = !isArrayLike(obj) && _.keys(obj),
       +        length = (keys || obj).length;
       +    for (var index = 0; index < length; index++) {
       +      var currentKey = keys ? keys[index] : index;
       +      if (predicate(obj[currentKey], currentKey, obj)) return true;
       +    }
       +    return false;
          };
        
       -  // Determine if the array or object contains a given value (using `===`).
       -  // Aliased as `include`.
       -  _.contains = _.include = function(obj, target) {
       -    if (obj == null) return false;
       -    if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
       -    return any(obj, function(value) {
       -      return value === target;
       -    });
       +  // Determine if the array or object contains a given item (using `===`).
       +  // Aliased as `includes` and `include`.
       +  _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) {
       +    if (!isArrayLike(obj)) obj = _.values(obj);
       +    if (typeof fromIndex != 'number' || guard) fromIndex = 0;
       +    return _.indexOf(obj, item, fromIndex) >= 0;
          };
        
          // Invoke a method (with arguments) on every item in a collection.
       t@@ -226,89 +273,111 @@
            var args = slice.call(arguments, 2);
            var isFunc = _.isFunction(method);
            return _.map(obj, function(value) {
       -      return (isFunc ? method : value[method]).apply(value, args);
       +      var func = isFunc ? method : value[method];
       +      return func == null ? func : func.apply(value, args);
            });
          };
        
          // Convenience version of a common use case of `map`: fetching a property.
          _.pluck = function(obj, key) {
       -    return _.map(obj, function(value){ return value[key]; });
       +    return _.map(obj, _.property(key));
          };
        
          // Convenience version of a common use case of `filter`: selecting only objects
          // containing specific `key:value` pairs.
       -  _.where = function(obj, attrs, first) {
       -    if (_.isEmpty(attrs)) return first ? null : [];
       -    return _[first ? 'find' : 'filter'](obj, function(value) {
       -      for (var key in attrs) {
       -        if (attrs[key] !== value[key]) return false;
       -      }
       -      return true;
       -    });
       +  _.where = function(obj, attrs) {
       +    return _.filter(obj, _.matcher(attrs));
          };
        
          // Convenience version of a common use case of `find`: getting the first object
          // containing specific `key:value` pairs.
          _.findWhere = function(obj, attrs) {
       -    return _.where(obj, attrs, true);
       -  };
       -
       -  // Return the maximum element or (element-based computation).
       -  // Can't optimize arrays of integers longer than 65,535 elements.
       -  // See: https://bugs.webkit.org/show_bug.cgi?id=80797
       -  _.max = function(obj, iterator, context) {
       -    if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
       -      return Math.max.apply(Math, obj);
       +    return _.find(obj, _.matcher(attrs));
       +  };
       +
       +  // Return the maximum element (or element-based computation).
       +  _.max = function(obj, iteratee, context) {
       +    var result = -Infinity, lastComputed = -Infinity,
       +        value, computed;
       +    if (iteratee == null && obj != null) {
       +      obj = isArrayLike(obj) ? obj : _.values(obj);
       +      for (var i = 0, length = obj.length; i < length; i++) {
       +        value = obj[i];
       +        if (value > result) {
       +          result = value;
       +        }
       +      }
       +    } else {
       +      iteratee = cb(iteratee, context);
       +      _.each(obj, function(value, index, list) {
       +        computed = iteratee(value, index, list);
       +        if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
       +          result = value;
       +          lastComputed = computed;
       +        }
       +      });
            }
       -    if (!iterator && _.isEmpty(obj)) return -Infinity;
       -    var result = {computed : -Infinity, value: -Infinity};
       -    each(obj, function(value, index, list) {
       -      var computed = iterator ? iterator.call(context, value, index, list) : value;
       -      computed >= result.computed && (result = {value : value, computed : computed});
       -    });
       -    return result.value;
       +    return result;
          };
        
          // Return the minimum element (or element-based computation).
       -  _.min = function(obj, iterator, context) {
       -    if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
       -      return Math.min.apply(Math, obj);
       +  _.min = function(obj, iteratee, context) {
       +    var result = Infinity, lastComputed = Infinity,
       +        value, computed;
       +    if (iteratee == null && obj != null) {
       +      obj = isArrayLike(obj) ? obj : _.values(obj);
       +      for (var i = 0, length = obj.length; i < length; i++) {
       +        value = obj[i];
       +        if (value < result) {
       +          result = value;
       +        }
       +      }
       +    } else {
       +      iteratee = cb(iteratee, context);
       +      _.each(obj, function(value, index, list) {
       +        computed = iteratee(value, index, list);
       +        if (computed < lastComputed || computed === Infinity && result === Infinity) {
       +          result = value;
       +          lastComputed = computed;
       +        }
       +      });
            }
       -    if (!iterator && _.isEmpty(obj)) return Infinity;
       -    var result = {computed : Infinity, value: Infinity};
       -    each(obj, function(value, index, list) {
       -      var computed = iterator ? iterator.call(context, value, index, list) : value;
       -      computed < result.computed && (result = {value : value, computed : computed});
       -    });
       -    return result.value;
       +    return result;
          };
        
       -  // Shuffle an array.
       +  // Shuffle a collection, using the modern version of the
       +  // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
          _.shuffle = function(obj) {
       -    var rand;
       -    var index = 0;
       -    var shuffled = [];
       -    each(obj, function(value) {
       -      rand = _.random(index++);
       -      shuffled[index - 1] = shuffled[rand];
       -      shuffled[rand] = value;
       -    });
       +    var set = isArrayLike(obj) ? obj : _.values(obj);
       +    var length = set.length;
       +    var shuffled = Array(length);
       +    for (var index = 0, rand; index < length; index++) {
       +      rand = _.random(0, index);
       +      if (rand !== index) shuffled[index] = shuffled[rand];
       +      shuffled[rand] = set[index];
       +    }
            return shuffled;
          };
        
       -  // An internal function to generate lookup iterators.
       -  var lookupIterator = function(value) {
       -    return _.isFunction(value) ? value : function(obj){ return obj[value]; };
       +  // Sample **n** random values from a collection.
       +  // If **n** is not specified, returns a single random element.
       +  // The internal `guard` argument allows it to work with `map`.
       +  _.sample = function(obj, n, guard) {
       +    if (n == null || guard) {
       +      if (!isArrayLike(obj)) obj = _.values(obj);
       +      return obj[_.random(obj.length - 1)];
       +    }
       +    return _.shuffle(obj).slice(0, Math.max(0, n));
          };
        
       -  // Sort the object's values by a criterion produced by an iterator.
       -  _.sortBy = function(obj, value, context) {
       -    var iterator = lookupIterator(value);
       +  // Sort the object's values by a criterion produced by an iteratee.
       +  _.sortBy = function(obj, iteratee, context) {
       +    iteratee = cb(iteratee, context);
            return _.pluck(_.map(obj, function(value, index, list) {
              return {
       -        value : value,
       -        index : index,
       -        criteria : iterator.call(context, value, index, list)
       +        value: value,
       +        index: index,
       +        criteria: iteratee(value, index, list)
              };
            }).sort(function(left, right) {
              var a = left.criteria;
       t@@ -317,64 +386,65 @@
                if (a > b || a === void 0) return 1;
                if (a < b || b === void 0) return -1;
              }
       -      return left.index < right.index ? -1 : 1;
       +      return left.index - right.index;
            }), 'value');
          };
        
          // An internal function used for aggregate "group by" operations.
       -  var group = function(obj, value, context, behavior) {
       -    var result = {};
       -    var iterator = lookupIterator(value || _.identity);
       -    each(obj, function(value, index) {
       -      var key = iterator.call(context, value, index, obj);
       -      behavior(result, key, value);
       -    });
       -    return result;
       +  var group = function(behavior) {
       +    return function(obj, iteratee, context) {
       +      var result = {};
       +      iteratee = cb(iteratee, context);
       +      _.each(obj, function(value, index) {
       +        var key = iteratee(value, index, obj);
       +        behavior(result, value, key);
       +      });
       +      return result;
       +    };
          };
        
          // Groups the object's values by a criterion. Pass either a string attribute
          // to group by, or a function that returns the criterion.
       -  _.groupBy = function(obj, value, context) {
       -    return group(obj, value, context, function(result, key, value) {
       -      (_.has(result, key) ? result[key] : (result[key] = [])).push(value);
       -    });
       -  };
       +  _.groupBy = group(function(result, value, key) {
       +    if (_.has(result, key)) result[key].push(value); else result[key] = [value];
       +  });
       +
       +  // Indexes the object's values by a criterion, similar to `groupBy`, but for
       +  // when you know that your index values will be unique.
       +  _.indexBy = group(function(result, value, key) {
       +    result[key] = value;
       +  });
        
          // Counts instances of an object that group by a certain criterion. Pass
          // either a string attribute to count by, or a function that returns the
          // criterion.
       -  _.countBy = function(obj, value, context) {
       -    return group(obj, value, context, function(result, key) {
       -      if (!_.has(result, key)) result[key] = 0;
       -      result[key]++;
       -    });
       -  };
       -
       -  // Use a comparator function to figure out the smallest index at which
       -  // an object should be inserted so as to maintain order. Uses binary search.
       -  _.sortedIndex = function(array, obj, iterator, context) {
       -    iterator = iterator == null ? _.identity : lookupIterator(iterator);
       -    var value = iterator.call(context, obj);
       -    var low = 0, high = array.length;
       -    while (low < high) {
       -      var mid = (low + high) >>> 1;
       -      iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;
       -    }
       -    return low;
       -  };
       +  _.countBy = group(function(result, value, key) {
       +    if (_.has(result, key)) result[key]++; else result[key] = 1;
       +  });
        
       -  // Safely convert anything iterable into a real, live array.
       +  // Safely create a real, live array from anything iterable.
          _.toArray = function(obj) {
            if (!obj) return [];
            if (_.isArray(obj)) return slice.call(obj);
       -    if (obj.length === +obj.length) return _.map(obj, _.identity);
       +    if (isArrayLike(obj)) return _.map(obj, _.identity);
            return _.values(obj);
          };
        
          // Return the number of elements in an object.
          _.size = function(obj) {
            if (obj == null) return 0;
       -    return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;
       +    return isArrayLike(obj) ? obj.length : _.keys(obj).length;
       +  };
       +
       +  // Split a collection into two arrays: one whose elements all satisfy the given
       +  // predicate, and one whose elements all do not satisfy the predicate.
       +  _.partition = function(obj, predicate, context) {
       +    predicate = cb(predicate, context);
       +    var pass = [], fail = [];
       +    _.each(obj, function(value, key, obj) {
       +      (predicate(value, key, obj) ? pass : fail).push(value);
       +    });
       +    return [pass, fail];
          };
        
          // Array Functions
       t@@ -385,34 +455,30 @@
          // allows it to work with `_.map`.
          _.first = _.head = _.take = function(array, n, guard) {
            if (array == null) return void 0;
       -    return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
       +    if (n == null || guard) return array[0];
       +    return _.initial(array, array.length - n);
          };
        
          // Returns everything but the last entry of the array. Especially useful on
          // the arguments object. Passing **n** will return all the values in
       -  // the array, excluding the last N. The **guard** check allows it to work with
       -  // `_.map`.
       +  // the array, excluding the last N.
          _.initial = function(array, n, guard) {
       -    return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
       +    return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
          };
        
          // Get the last element of an array. Passing **n** will return the last N
       -  // values in the array. The **guard** check allows it to work with `_.map`.
       +  // values in the array.
          _.last = function(array, n, guard) {
            if (array == null) return void 0;
       -    if ((n != null) && !guard) {
       -      return slice.call(array, Math.max(array.length - n, 0));
       -    } else {
       -      return array[array.length - 1];
       -    }
       +    if (n == null || guard) return array[array.length - 1];
       +    return _.rest(array, Math.max(0, array.length - n));
          };
        
          // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
          // Especially useful on the arguments object. Passing an **n** will return
       -  // the rest N values in the array. The **guard**
       -  // check allows it to work with `_.map`.
       +  // the rest N values in the array.
          _.rest = _.tail = _.drop = function(array, n, guard) {
       -    return slice.call(array, (n == null) || guard ? 1 : n);
       +    return slice.call(array, n == null || guard ? 1 : n);
          };
        
          // Trim out all falsy values from an array.
       t@@ -421,20 +487,28 @@
          };
        
          // Internal implementation of a recursive `flatten` function.
       -  var flatten = function(input, shallow, output) {
       -    each(input, function(value) {
       -      if (_.isArray(value)) {
       -        shallow ? push.apply(output, value) : flatten(value, shallow, output);
       -      } else {
       -        output.push(value);
       +  var flatten = function(input, shallow, strict, startIndex) {
       +    var output = [], idx = 0;
       +    for (var i = startIndex || 0, length = getLength(input); i < length; i++) {
       +      var value = input[i];
       +      if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {
       +        //flatten current level of array or arguments object
       +        if (!shallow) value = flatten(value, shallow, strict);
       +        var j = 0, len = value.length;
       +        output.length += len;
       +        while (j < len) {
       +          output[idx++] = value[j++];
       +        }
       +      } else if (!strict) {
       +        output[idx++] = value;
              }
       -    });
       +    }
            return output;
          };
        
       -  // Return a completely flattened version of an array.
       +  // Flatten out an array, either recursively (by default), or just one level.
          _.flatten = function(array, shallow) {
       -    return flatten(array, shallow, []);
       +    return flatten(array, shallow, false);
          };
        
          // Return a version of the array that does not contain the specified value(s).
       t@@ -445,67 +519,88 @@
          // Produce a duplicate-free version of the array. If the array has already
          // been sorted, you have the option of using a faster algorithm.
          // Aliased as `unique`.
       -  _.uniq = _.unique = function(array, isSorted, iterator, context) {
       -    if (_.isFunction(isSorted)) {
       -      context = iterator;
       -      iterator = isSorted;
       +  _.uniq = _.unique = function(array, isSorted, iteratee, context) {
       +    if (!_.isBoolean(isSorted)) {
       +      context = iteratee;
       +      iteratee = isSorted;
              isSorted = false;
            }
       -    var initial = iterator ? _.map(array, iterator, context) : array;
       -    var results = [];
       +    if (iteratee != null) iteratee = cb(iteratee, context);
       +    var result = [];
            var seen = [];
       -    each(initial, function(value, index) {
       -      if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {
       -        seen.push(value);
       -        results.push(array[index]);
       +    for (var i = 0, length = getLength(array); i < length; i++) {
       +      var value = array[i],
       +          computed = iteratee ? iteratee(value, i, array) : value;
       +      if (isSorted) {
       +        if (!i || seen !== computed) result.push(value);
       +        seen = computed;
       +      } else if (iteratee) {
       +        if (!_.contains(seen, computed)) {
       +          seen.push(computed);
       +          result.push(value);
       +        }
       +      } else if (!_.contains(result, value)) {
       +        result.push(value);
              }
       -    });
       -    return results;
       +    }
       +    return result;
          };
        
          // Produce an array that contains the union: each distinct element from all of
          // the passed-in arrays.
          _.union = function() {
       -    return _.uniq(concat.apply(ArrayProto, arguments));
       +    return _.uniq(flatten(arguments, true, true));
          };
        
          // Produce an array that contains every item shared between all the
          // passed-in arrays.
          _.intersection = function(array) {
       -    var rest = slice.call(arguments, 1);
       -    return _.filter(_.uniq(array), function(item) {
       -      return _.every(rest, function(other) {
       -        return _.indexOf(other, item) >= 0;
       -      });
       -    });
       +    var result = [];
       +    var argsLength = arguments.length;
       +    for (var i = 0, length = getLength(array); i < length; i++) {
       +      var item = array[i];
       +      if (_.contains(result, item)) continue;
       +      for (var j = 1; j < argsLength; j++) {
       +        if (!_.contains(arguments[j], item)) break;
       +      }
       +      if (j === argsLength) result.push(item);
       +    }
       +    return result;
          };
        
          // Take the difference between one array and a number of other arrays.
          // Only the elements present in just the first array will remain.
          _.difference = function(array) {
       -    var rest = concat.apply(ArrayProto, slice.call(arguments, 1));
       -    return _.filter(array, function(value){ return !_.contains(rest, value); });
       +    var rest = flatten(arguments, true, true, 1);
       +    return _.filter(array, function(value){
       +      return !_.contains(rest, value);
       +    });
          };
        
          // Zip together multiple lists into a single array -- elements that share
          // an index go together.
          _.zip = function() {
       -    var args = slice.call(arguments);
       -    var length = _.max(_.pluck(args, 'length'));
       -    var results = new Array(length);
       -    for (var i = 0; i < length; i++) {
       -      results[i] = _.pluck(args, "" + i);
       +    return _.unzip(arguments);
       +  };
       +
       +  // Complement of _.zip. Unzip accepts an array of arrays and groups
       +  // each array's elements on shared indices
       +  _.unzip = function(array) {
       +    var length = array && _.max(array, getLength).length || 0;
       +    var result = Array(length);
       +
       +    for (var index = 0; index < length; index++) {
       +      result[index] = _.pluck(array, index);
            }
       -    return results;
       +    return result;
          };
        
          // Converts lists into objects. Pass either a single array of `[key, value]`
          // pairs, or two parallel arrays of the same length -- one of keys, and one of
          // the corresponding values.
          _.object = function(list, values) {
       -    if (list == null) return {};
            var result = {};
       -    for (var i = 0, l = list.length; i < l; i++) {
       +    for (var i = 0, length = getLength(list); i < length; i++) {
              if (values) {
                result[list[i]] = values[i];
              } else {
       t@@ -515,57 +610,83 @@
            return result;
          };
        
       -  // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
       -  // we need this function. Return the position of the first occurrence of an
       -  // item in an array, or -1 if the item is not included in the array.
       -  // Delegates to **ECMAScript 5**'s native `indexOf` if available.
       -  // If the array is large and already in sort order, pass `true`
       -  // for **isSorted** to use binary search.
       -  _.indexOf = function(array, item, isSorted) {
       -    if (array == null) return -1;
       -    var i = 0, l = array.length;
       -    if (isSorted) {
       -      if (typeof isSorted == 'number') {
       -        i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted);
       -      } else {
       -        i = _.sortedIndex(array, item);
       -        return array[i] === item ? i : -1;
       +  // Generator function to create the findIndex and findLastIndex functions
       +  function createPredicateIndexFinder(dir) {
       +    return function(array, predicate, context) {
       +      predicate = cb(predicate, context);
       +      var length = getLength(array);
       +      var index = dir > 0 ? 0 : length - 1;
       +      for (; index >= 0 && index < length; index += dir) {
       +        if (predicate(array[index], index, array)) return index;
              }
       -    }
       -    if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);
       -    for (; i < l; i++) if (array[i] === item) return i;
       -    return -1;
       -  };
       +      return -1;
       +    };
       +  }
        
       -  // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
       -  _.lastIndexOf = function(array, item, from) {
       -    if (array == null) return -1;
       -    var hasIndex = from != null;
       -    if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {
       -      return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);
       +  // Returns the first index on an array-like that passes a predicate test
       +  _.findIndex = createPredicateIndexFinder(1);
       +  _.findLastIndex = createPredicateIndexFinder(-1);
       +
       +  // Use a comparator function to figure out the smallest index at which
       +  // an object should be inserted so as to maintain order. Uses binary search.
       +  _.sortedIndex = function(array, obj, iteratee, context) {
       +    iteratee = cb(iteratee, context, 1);
       +    var value = iteratee(obj);
       +    var low = 0, high = getLength(array);
       +    while (low < high) {
       +      var mid = Math.floor((low + high) / 2);
       +      if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
            }
       -    var i = (hasIndex ? from : array.length);
       -    while (i--) if (array[i] === item) return i;
       -    return -1;
       +    return low;
          };
        
       +  // Generator function to create the indexOf and lastIndexOf functions
       +  function createIndexFinder(dir, predicateFind, sortedIndex) {
       +    return function(array, item, idx) {
       +      var i = 0, length = getLength(array);
       +      if (typeof idx == 'number') {
       +        if (dir > 0) {
       +            i = idx >= 0 ? idx : Math.max(idx + length, i);
       +        } else {
       +            length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
       +        }
       +      } else if (sortedIndex && idx && length) {
       +        idx = sortedIndex(array, item);
       +        return array[idx] === item ? idx : -1;
       +      }
       +      if (item !== item) {
       +        idx = predicateFind(slice.call(array, i, length), _.isNaN);
       +        return idx >= 0 ? idx + i : -1;
       +      }
       +      for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
       +        if (array[idx] === item) return idx;
       +      }
       +      return -1;
       +    };
       +  }
       +
       +  // Return the position of the first occurrence of an item in an array,
       +  // or -1 if the item is not included in the array.
       +  // If the array is large and already in sort order, pass `true`
       +  // for **isSorted** to use binary search.
       +  _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);
       +  _.lastIndexOf = createIndexFinder(-1, _.findLastIndex);
       +
          // Generate an integer Array containing an arithmetic progression. A port of
          // the native Python `range()` function. See
          // [the Python documentation](http://docs.python.org/library/functions.html#range).
          _.range = function(start, stop, step) {
       -    if (arguments.length <= 1) {
       +    if (stop == null) {
              stop = start || 0;
              start = 0;
            }
       -    step = arguments[2] || 1;
       +    step = step || 1;
        
       -    var len = Math.max(Math.ceil((stop - start) / step), 0);
       -    var idx = 0;
       -    var range = new Array(len);
       +    var length = Math.max(Math.ceil((stop - start) / step), 0);
       +    var range = Array(length);
        
       -    while(idx < len) {
       -      range[idx++] = start;
       -      start += step;
       +    for (var idx = 0; idx < length; idx++, start += step) {
       +      range[idx] = start;
            }
        
            return range;
       t@@ -574,79 +695,115 @@
          // Function (ahem) Functions
          // ------------------
        
       +  // Determines whether to execute a function as a constructor
       +  // or a normal function with the provided arguments
       +  var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {
       +    if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
       +    var self = baseCreate(sourceFunc.prototype);
       +    var result = sourceFunc.apply(self, args);
       +    if (_.isObject(result)) return result;
       +    return self;
       +  };
       +
          // Create a function bound to a given object (assigning `this`, and arguments,
          // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
          // available.
          _.bind = function(func, context) {
       -    if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
       +    if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
       +    if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');
            var args = slice.call(arguments, 2);
       -    return function() {
       -      return func.apply(context, args.concat(slice.call(arguments)));
       +    var bound = function() {
       +      return executeBound(func, bound, context, this, args.concat(slice.call(arguments)));
            };
       +    return bound;
          };
        
          // Partially apply a function by creating a version that has had some of its
       -  // arguments pre-filled, without changing its dynamic `this` context.
       +  // arguments pre-filled, without changing its dynamic `this` context. _ acts
       +  // as a placeholder, allowing any combination of arguments to be pre-filled.
          _.partial = function(func) {
       -    var args = slice.call(arguments, 1);
       -    return function() {
       -      return func.apply(this, args.concat(slice.call(arguments)));
       +    var boundArgs = slice.call(arguments, 1);
       +    var bound = function() {
       +      var position = 0, length = boundArgs.length;
       +      var args = Array(length);
       +      for (var i = 0; i < length; i++) {
       +        args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i];
       +      }
       +      while (position < arguments.length) args.push(arguments[position++]);
       +      return executeBound(func, bound, this, this, args);
            };
       +    return bound;
          };
        
       -  // Bind all of an object's methods to that object. Useful for ensuring that
       -  // all callbacks defined on an object belong to it.
       +  // Bind a number of an object's methods to that object. Remaining arguments
       +  // are the method names to be bound. Useful for ensuring that all callbacks
       +  // defined on an object belong to it.
          _.bindAll = function(obj) {
       -    var funcs = slice.call(arguments, 1);
       -    if (funcs.length === 0) funcs = _.functions(obj);
       -    each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
       +    var i, length = arguments.length, key;
       +    if (length <= 1) throw new Error('bindAll must be passed function names');
       +    for (i = 1; i < length; i++) {
       +      key = arguments[i];
       +      obj[key] = _.bind(obj[key], obj);
       +    }
            return obj;
          };
        
          // Memoize an expensive function by storing its results.
          _.memoize = function(func, hasher) {
       -    var memo = {};
       -    hasher || (hasher = _.identity);
       -    return function() {
       -      var key = hasher.apply(this, arguments);
       -      return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
       +    var memoize = function(key) {
       +      var cache = memoize.cache;
       +      var address = '' + (hasher ? hasher.apply(this, arguments) : key);
       +      if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
       +      return cache[address];
            };
       +    memoize.cache = {};
       +    return memoize;
          };
        
          // Delays a function for the given number of milliseconds, and then calls
          // it with the arguments supplied.
          _.delay = function(func, wait) {
            var args = slice.call(arguments, 2);
       -    return setTimeout(function(){ return func.apply(null, args); }, wait);
       +    return setTimeout(function(){
       +      return func.apply(null, args);
       +    }, wait);
          };
        
          // Defers a function, scheduling it to run after the current call stack has
          // cleared.
       -  _.defer = function(func) {
       -    return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
       -  };
       +  _.defer = _.partial(_.delay, _, 1);
        
          // Returns a function, that, when invoked, will only be triggered at most once
       -  // during a given window of time.
       -  _.throttle = function(func, wait) {
       -    var context, args, timeout, result;
       +  // during a given window of time. Normally, the throttled function will run
       +  // as much as it can, without ever going more than once per `wait` duration;
       +  // but if you'd like to disable the execution on the leading edge, pass
       +  // `{leading: false}`. To disable execution on the trailing edge, ditto.
       +  _.throttle = function(func, wait, options) {
       +    var context, args, result;
       +    var timeout = null;
            var previous = 0;
       +    if (!options) options = {};
            var later = function() {
       -      previous = new Date;
       +      previous = options.leading === false ? 0 : _.now();
              timeout = null;
              result = func.apply(context, args);
       +      if (!timeout) context = args = null;
            };
            return function() {
       -      var now = new Date;
       +      var now = _.now();
       +      if (!previous && options.leading === false) previous = now;
              var remaining = wait - (now - previous);
              context = this;
              args = arguments;
       -      if (remaining <= 0) {
       -        clearTimeout(timeout);
       -        timeout = null;
       +      if (remaining <= 0 || remaining > wait) {
       +        if (timeout) {
       +          clearTimeout(timeout);
       +          timeout = null;
       +        }
                previous = now;
                result = func.apply(context, args);
       -      } else if (!timeout) {
       +        if (!timeout) context = args = null;
       +      } else if (!timeout && options.trailing !== false) {
                timeout = setTimeout(later, remaining);
              }
              return result;
       t@@ -658,31 +815,34 @@
          // N milliseconds. If `immediate` is passed, trigger the function on the
          // leading edge, instead of the trailing.
          _.debounce = function(func, wait, immediate) {
       -    var timeout, result;
       -    return function() {
       -      var context = this, args = arguments;
       -      var later = function() {
       +    var timeout, args, context, timestamp, result;
       +
       +    var later = function() {
       +      var last = _.now() - timestamp;
       +
       +      if (last < wait && last >= 0) {
       +        timeout = setTimeout(later, wait - last);
       +      } else {
                timeout = null;
       -        if (!immediate) result = func.apply(context, args);
       -      };
       -      var callNow = immediate && !timeout;
       -      clearTimeout(timeout);
       -      timeout = setTimeout(later, wait);
       -      if (callNow) result = func.apply(context, args);
       -      return result;
       +        if (!immediate) {
       +          result = func.apply(context, args);
       +          if (!timeout) context = args = null;
       +        }
       +      }
            };
       -  };
        
       -  // Returns a function that will be executed at most one time, no matter how
       -  // often you call it. Useful for lazy initialization.
       -  _.once = function(func) {
       -    var ran = false, memo;
            return function() {
       -      if (ran) return memo;
       -      ran = true;
       -      memo = func.apply(this, arguments);
       -      func = null;
       -      return memo;
       +      context = this;
       +      args = arguments;
       +      timestamp = _.now();
       +      var callNow = immediate && !timeout;
       +      if (!timeout) timeout = setTimeout(later, wait);
       +      if (callNow) {
       +        result = func.apply(context, args);
       +        context = args = null;
       +      }
       +
       +      return result;
            };
          };
        
       t@@ -690,29 +850,31 @@
          // allowing you to adjust arguments, run code before and after, and
          // conditionally execute the original function.
          _.wrap = function(func, wrapper) {
       +    return _.partial(wrapper, func);
       +  };
       +
       +  // Returns a negated version of the passed-in predicate.
       +  _.negate = function(predicate) {
            return function() {
       -      var args = [func];
       -      push.apply(args, arguments);
       -      return wrapper.apply(this, args);
       +      return !predicate.apply(this, arguments);
            };
          };
        
          // Returns a function that is the composition of a list of functions, each
          // consuming the return value of the function that follows.
          _.compose = function() {
       -    var funcs = arguments;
       +    var args = arguments;
       +    var start = args.length - 1;
            return function() {
       -      var args = arguments;
       -      for (var i = funcs.length - 1; i >= 0; i--) {
       -        args = [funcs[i].apply(this, args)];
       -      }
       -      return args[0];
       +      var i = start;
       +      var result = args[start].apply(this, arguments);
       +      while (i--) result = args[i].call(this, result);
       +      return result;
            };
          };
        
       -  // Returns a function that will only be executed after being called N times.
       +  // Returns a function that will only be executed on and after the Nth call.
          _.after = function(times, func) {
       -    if (times <= 0) return func();
            return function() {
              if (--times < 1) {
                return func.apply(this, arguments);
       t@@ -720,36 +882,113 @@
            };
          };
        
       +  // Returns a function that will only be executed up to (but not including) the Nth call.
       +  _.before = function(times, func) {
       +    var memo;
       +    return function() {
       +      if (--times > 0) {
       +        memo = func.apply(this, arguments);
       +      }
       +      if (times <= 1) func = null;
       +      return memo;
       +    };
       +  };
       +
       +  // Returns a function that will be executed at most one time, no matter how
       +  // often you call it. Useful for lazy initialization.
       +  _.once = _.partial(_.before, 2);
       +
          // Object Functions
          // ----------------
        
       -  // Retrieve the names of an object's properties.
       +  // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
       +  var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
       +  var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
       +                      'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
       +
       +  function collectNonEnumProps(obj, keys) {
       +    var nonEnumIdx = nonEnumerableProps.length;
       +    var constructor = obj.constructor;
       +    var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto;
       +
       +    // Constructor is a special case.
       +    var prop = 'constructor';
       +    if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);
       +
       +    while (nonEnumIdx--) {
       +      prop = nonEnumerableProps[nonEnumIdx];
       +      if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {
       +        keys.push(prop);
       +      }
       +    }
       +  }
       +
       +  // Retrieve the names of an object's own properties.
          // Delegates to **ECMAScript 5**'s native `Object.keys`
       -  _.keys = nativeKeys || function(obj) {
       -    if (obj !== Object(obj)) throw new TypeError('Invalid object');
       +  _.keys = function(obj) {
       +    if (!_.isObject(obj)) return [];
       +    if (nativeKeys) return nativeKeys(obj);
       +    var keys = [];
       +    for (var key in obj) if (_.has(obj, key)) keys.push(key);
       +    // Ahem, IE < 9.
       +    if (hasEnumBug) collectNonEnumProps(obj, keys);
       +    return keys;
       +  };
       +
       +  // Retrieve all the property names of an object.
       +  _.allKeys = function(obj) {
       +    if (!_.isObject(obj)) return [];
            var keys = [];
       -    for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
       +    for (var key in obj) keys.push(key);
       +    // Ahem, IE < 9.
       +    if (hasEnumBug) collectNonEnumProps(obj, keys);
            return keys;
          };
        
          // Retrieve the values of an object's properties.
          _.values = function(obj) {
       -    var values = [];
       -    for (var key in obj) if (_.has(obj, key)) values.push(obj[key]);
       +    var keys = _.keys(obj);
       +    var length = keys.length;
       +    var values = Array(length);
       +    for (var i = 0; i < length; i++) {
       +      values[i] = obj[keys[i]];
       +    }
            return values;
          };
        
       +  // Returns the results of applying the iteratee to each element of the object
       +  // In contrast to _.map it returns an object
       +  _.mapObject = function(obj, iteratee, context) {
       +    iteratee = cb(iteratee, context);
       +    var keys =  _.keys(obj),
       +          length = keys.length,
       +          results = {},
       +          currentKey;
       +      for (var index = 0; index < length; index++) {
       +        currentKey = keys[index];
       +        results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
       +      }
       +      return results;
       +  };
       +
          // Convert an object into a list of `[key, value]` pairs.
          _.pairs = function(obj) {
       -    var pairs = [];
       -    for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]);
       +    var keys = _.keys(obj);
       +    var length = keys.length;
       +    var pairs = Array(length);
       +    for (var i = 0; i < length; i++) {
       +      pairs[i] = [keys[i], obj[keys[i]]];
       +    }
            return pairs;
          };
        
          // Invert the keys and values of an object. The values must be serializable.
          _.invert = function(obj) {
            var result = {};
       -    for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key;
       +    var keys = _.keys(obj);
       +    for (var i = 0, length = keys.length; i < length; i++) {
       +      result[obj[keys[i]]] = keys[i];
       +    }
            return result;
          };
        
       t@@ -764,47 +1003,65 @@
          };
        
          // Extend a given object with all the properties in passed-in object(s).
       -  _.extend = function(obj) {
       -    each(slice.call(arguments, 1), function(source) {
       -      if (source) {
       -        for (var prop in source) {
       -          obj[prop] = source[prop];
       -        }
       -      }
       -    });
       -    return obj;
       +  _.extend = createAssigner(_.allKeys);
       +
       +  // Assigns a given object with all the own properties in the passed-in object(s)
       +  // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
       +  _.extendOwn = _.assign = createAssigner(_.keys);
       +
       +  // Returns the first key on an object that passes a predicate test
       +  _.findKey = function(obj, predicate, context) {
       +    predicate = cb(predicate, context);
       +    var keys = _.keys(obj), key;
       +    for (var i = 0, length = keys.length; i < length; i++) {
       +      key = keys[i];
       +      if (predicate(obj[key], key, obj)) return key;
       +    }
          };
        
          // Return a copy of the object only containing the whitelisted properties.
       -  _.pick = function(obj) {
       -    var copy = {};
       -    var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
       -    each(keys, function(key) {
       -      if (key in obj) copy[key] = obj[key];
       -    });
       -    return copy;
       +  _.pick = function(object, oiteratee, context) {
       +    var result = {}, obj = object, iteratee, keys;
       +    if (obj == null) return result;
       +    if (_.isFunction(oiteratee)) {
       +      keys = _.allKeys(obj);
       +      iteratee = optimizeCb(oiteratee, context);
       +    } else {
       +      keys = flatten(arguments, false, false, 1);
       +      iteratee = function(value, key, obj) { return key in obj; };
       +      obj = Object(obj);
       +    }
       +    for (var i = 0, length = keys.length; i < length; i++) {
       +      var key = keys[i];
       +      var value = obj[key];
       +      if (iteratee(value, key, obj)) result[key] = value;
       +    }
       +    return result;
          };
        
           // Return a copy of the object without the blacklisted properties.
       -  _.omit = function(obj) {
       -    var copy = {};
       -    var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
       -    for (var key in obj) {
       -      if (!_.contains(keys, key)) copy[key] = obj[key];
       +  _.omit = function(obj, iteratee, context) {
       +    if (_.isFunction(iteratee)) {
       +      iteratee = _.negate(iteratee);
       +    } else {
       +      var keys = _.map(flatten(arguments, false, false, 1), String);
       +      iteratee = function(value, key) {
       +        return !_.contains(keys, key);
       +      };
            }
       -    return copy;
       +    return _.pick(obj, iteratee, context);
          };
        
          // Fill in a given object with default properties.
       -  _.defaults = function(obj) {
       -    each(slice.call(arguments, 1), function(source) {
       -      if (source) {
       -        for (var prop in source) {
       -          if (obj[prop] == null) obj[prop] = source[prop];
       -        }
       -      }
       -    });
       -    return obj;
       +  _.defaults = createAssigner(_.allKeys, true);
       +
       +  // Creates an object that inherits from the given prototype object.
       +  // If additional properties are provided then they will be added to the
       +  // created object.
       +  _.create = function(prototype, props) {
       +    var result = baseCreate(prototype);
       +    if (props) _.extendOwn(result, props);
       +    return result;
          };
        
          // Create a (shallow-cloned) duplicate of an object.
       t@@ -821,11 +1078,24 @@
            return obj;
          };
        
       +  // Returns whether an object has a given set of `key:value` pairs.
       +  _.isMatch = function(object, attrs) {
       +    var keys = _.keys(attrs), length = keys.length;
       +    if (object == null) return !length;
       +    var obj = Object(object);
       +    for (var i = 0; i < length; i++) {
       +      var key = keys[i];
       +      if (attrs[key] !== obj[key] || !(key in obj)) return false;
       +    }
       +    return true;
       +  };
       +
       +
          // Internal recursive comparison function for `isEqual`.
          var eq = function(a, b, aStack, bStack) {
            // Identical objects are equal. `0 === -0`, but they aren't identical.
       -    // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
       -    if (a === b) return a !== 0 || 1 / a == 1 / b;
       +    // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
       +    if (a === b) return a !== 0 || 1 / a === 1 / b;
            // A strict comparison is necessary because `null == undefined`.
            if (a == null || b == null) return a === b;
            // Unwrap any wrapped objects.
       t@@ -833,97 +1103,98 @@
            if (b instanceof _) b = b._wrapped;
            // Compare `[[Class]]` names.
            var className = toString.call(a);
       -    if (className != toString.call(b)) return false;
       +    if (className !== toString.call(b)) return false;
            switch (className) {
       -      // Strings, numbers, dates, and booleans are compared by value.
       +      // Strings, numbers, regular expressions, dates, and booleans are compared by value.
       +      case '[object RegExp]':
       +      // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
              case '[object String]':
                // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
                // equivalent to `new String("5")`.
       -        return a == String(b);
       +        return '' + a === '' + b;
              case '[object Number]':
       -        // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
       -        // other numeric values.
       -        return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
       +        // `NaN`s are equivalent, but non-reflexive.
       +        // Object(NaN) is equivalent to NaN
       +        if (+a !== +a) return +b !== +b;
       +        // An `egal` comparison is performed for other numeric values.
       +        return +a === 0 ? 1 / +a === 1 / b : +a === +b;
              case '[object Date]':
              case '[object Boolean]':
                // Coerce dates and booleans to numeric primitive values. Dates are compared by their
                // millisecond representations. Note that invalid dates with millisecond representations
                // of `NaN` are not equivalent.
       -        return +a == +b;
       -      // RegExps are compared by their source patterns and flags.
       -      case '[object RegExp]':
       -        return a.source == b.source &&
       -               a.global == b.global &&
       -               a.multiline == b.multiline &&
       -               a.ignoreCase == b.ignoreCase;
       +        return +a === +b;
       +    }
       +
       +    var areArrays = className === '[object Array]';
       +    if (!areArrays) {
       +      if (typeof a != 'object' || typeof b != 'object') return false;
       +
       +      // Objects with different constructors are not equivalent, but `Object`s or `Array`s
       +      // from different frames are.
       +      var aCtor = a.constructor, bCtor = b.constructor;
       +      if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor &&
       +                               _.isFunction(bCtor) && bCtor instanceof bCtor)
       +                          && ('constructor' in a && 'constructor' in b)) {
       +        return false;
       +      }
            }
       -    if (typeof a != 'object' || typeof b != 'object') return false;
            // Assume equality for cyclic structures. The algorithm for detecting cyclic
            // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
       +
       +    // Initializing stack of traversed objects.
       +    // It's done here since we only need them for objects and arrays comparison.
       +    aStack = aStack || [];
       +    bStack = bStack || [];
            var length = aStack.length;
            while (length--) {
              // Linear search. Performance is inversely proportional to the number of
              // unique nested structures.
       -      if (aStack[length] == a) return bStack[length] == b;
       +      if (aStack[length] === a) return bStack[length] === b;
            }
       +
            // Add the first object to the stack of traversed objects.
            aStack.push(a);
            bStack.push(b);
       -    var size = 0, result = true;
       +
            // Recursively compare objects and arrays.
       -    if (className == '[object Array]') {
       +    if (areArrays) {
              // Compare array lengths to determine if a deep comparison is necessary.
       -      size = a.length;
       -      result = size == b.length;
       -      if (result) {
       -        // Deep compare the contents, ignoring non-numeric properties.
       -        while (size--) {
       -          if (!(result = eq(a[size], b[size], aStack, bStack))) break;
       -        }
       +      length = a.length;
       +      if (length !== b.length) return false;
       +      // Deep compare the contents, ignoring non-numeric properties.
       +      while (length--) {
       +        if (!eq(a[length], b[length], aStack, bStack)) return false;
              }
            } else {
       -      // Objects with different constructors are not equivalent, but `Object`s
       -      // from different frames are.
       -      var aCtor = a.constructor, bCtor = b.constructor;
       -      if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
       -                               _.isFunction(bCtor) && (bCtor instanceof bCtor))) {
       -        return false;
       -      }
              // Deep compare objects.
       -      for (var key in a) {
       -        if (_.has(a, key)) {
       -          // Count the expected number of properties.
       -          size++;
       -          // Deep compare each member.
       -          if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
       -        }
       -      }
       -      // Ensure that both objects contain the same number of properties.
       -      if (result) {
       -        for (key in b) {
       -          if (_.has(b, key) && !(size--)) break;
       -        }
       -        result = !size;
       +      var keys = _.keys(a), key;
       +      length = keys.length;
       +      // Ensure that both objects contain the same number of properties before comparing deep equality.
       +      if (_.keys(b).length !== length) return false;
       +      while (length--) {
       +        // Deep compare each member
       +        key = keys[length];
       +        if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
              }
            }
            // Remove the first object from the stack of traversed objects.
            aStack.pop();
            bStack.pop();
       -    return result;
       +    return true;
          };
        
          // Perform a deep comparison to check if two objects are equal.
          _.isEqual = function(a, b) {
       -    return eq(a, b, [], []);
       +    return eq(a, b);
          };
        
          // Is a given array, string, or object empty?
          // An "empty" object has no enumerable own-properties.
          _.isEmpty = function(obj) {
            if (obj == null) return true;
       -    if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
       -    for (var key in obj) if (_.has(obj, key)) return false;
       -    return true;
       +    if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;
       +    return _.keys(obj).length === 0;
          };
        
          // Is a given value a DOM element?
       t@@ -934,33 +1205,35 @@
          // Is a given value an array?
          // Delegates to ECMA5's native Array.isArray
          _.isArray = nativeIsArray || function(obj) {
       -    return toString.call(obj) == '[object Array]';
       +    return toString.call(obj) === '[object Array]';
          };
        
          // Is a given variable an object?
          _.isObject = function(obj) {
       -    return obj === Object(obj);
       +    var type = typeof obj;
       +    return type === 'function' || type === 'object' && !!obj;
          };
        
       -  // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
       -  each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
       +  // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.
       +  _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) {
            _['is' + name] = function(obj) {
       -      return toString.call(obj) == '[object ' + name + ']';
       +      return toString.call(obj) === '[object ' + name + ']';
            };
          });
        
       -  // Define a fallback version of the method in browsers (ahem, IE), where
       +  // Define a fallback version of the method in browsers (ahem, IE < 9), where
          // there isn't any inspectable "Arguments" type.
          if (!_.isArguments(arguments)) {
            _.isArguments = function(obj) {
       -      return !!(obj && _.has(obj, 'callee'));
       +      return _.has(obj, 'callee');
            };
          }
        
       -  // Optimize `isFunction` if appropriate.
       -  if (typeof (/./) !== 'function') {
       +  // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,
       +  // IE 11 (#1621), and in Safari 8 (#1929).
       +  if (typeof /./ != 'function' && typeof Int8Array != 'object') {
            _.isFunction = function(obj) {
       -      return typeof obj === 'function';
       +      return typeof obj == 'function' || false;
            };
          }
        
       t@@ -971,12 +1244,12 @@
        
          // Is the given value `NaN`? (NaN is the only number which does not equal itself).
          _.isNaN = function(obj) {
       -    return _.isNumber(obj) && obj != +obj;
       +    return _.isNumber(obj) && obj !== +obj;
          };
        
          // Is a given value a boolean?
          _.isBoolean = function(obj) {
       -    return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
       +    return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
          };
        
          // Is a given value equal to null?
       t@@ -992,7 +1265,7 @@
          // Shortcut function for checking if an object has a given property directly
          // on itself (in other words, not on a prototype).
          _.has = function(obj, key) {
       -    return hasOwnProperty.call(obj, key);
       +    return obj != null && hasOwnProperty.call(obj, key);
          };
        
          // Utility Functions
       t@@ -1005,15 +1278,43 @@
            return this;
          };
        
       -  // Keep the identity function around for default iterators.
       +  // Keep the identity function around for default iteratees.
          _.identity = function(value) {
            return value;
          };
        
       +  // Predicate-generating functions. Often useful outside of Underscore.
       +  _.constant = function(value) {
       +    return function() {
       +      return value;
       +    };
       +  };
       +
       +  _.noop = function(){};
       +
       +  _.property = property;
       +
       +  // Generates a function for a given object that returns a given property.
       +  _.propertyOf = function(obj) {
       +    return obj == null ? function(){} : function(key) {
       +      return obj[key];
       +    };
       +  };
       +
       +  // Returns a predicate for checking whether an object has a given set of
       +  // `key:value` pairs.
       +  _.matcher = _.matches = function(attrs) {
       +    attrs = _.extendOwn({}, attrs);
       +    return function(obj) {
       +      return _.isMatch(obj, attrs);
       +    };
       +  };
       +
          // Run a function **n** times.
       -  _.times = function(n, iterator, context) {
       -    var accum = Array(n);
       -    for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);
       +  _.times = function(n, iteratee, context) {
       +    var accum = Array(Math.max(0, n));
       +    iteratee = optimizeCb(iteratee, context, 1);
       +    for (var i = 0; i < n; i++) accum[i] = iteratee(i);
            return accum;
          };
        
       t@@ -1026,53 +1327,47 @@
            return min + Math.floor(Math.random() * (max - min + 1));
          };
        
       -  // List of HTML entities for escaping.
       -  var entityMap = {
       -    escape: {
       -      '&': '&amp;',
       -      '<': '&lt;',
       -      '>': '&gt;',
       -      '"': '&quot;',
       -      "'": '&#x27;',
       -      '/': '&#x2F;'
       -    }
       +  // A (possibly faster) way to get the current timestamp as an integer.
       +  _.now = Date.now || function() {
       +    return new Date().getTime();
          };
       -  entityMap.unescape = _.invert(entityMap.escape);
        
       -  // Regexes containing the keys and values listed immediately above.
       -  var entityRegexes = {
       -    escape:   new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),
       -    unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')
       +   // List of HTML entities for escaping.
       +  var escapeMap = {
       +    '&': '&amp;',
       +    '<': '&lt;',
       +    '>': '&gt;',
       +    '"': '&quot;',
       +    "'": '&#x27;',
       +    '`': '&#x60;'
          };
       +  var unescapeMap = _.invert(escapeMap);
        
          // Functions for escaping and unescaping strings to/from HTML interpolation.
       -  _.each(['escape', 'unescape'], function(method) {
       -    _[method] = function(string) {
       -      if (string == null) return '';
       -      return ('' + string).replace(entityRegexes[method], function(match) {
       -        return entityMap[method][match];
       -      });
       +  var createEscaper = function(map) {
       +    var escaper = function(match) {
       +      return map[match];
       +    };
       +    // Regexes for identifying a key that needs to be escaped
       +    var source = '(?:' + _.keys(map).join('|') + ')';
       +    var testRegexp = RegExp(source);
       +    var replaceRegexp = RegExp(source, 'g');
       +    return function(string) {
       +      string = string == null ? '' : '' + string;
       +      return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
            };
       -  });
       -
       -  // If the value of the named property is a function then invoke it;
       -  // otherwise, return it.
       -  _.result = function(object, property) {
       -    if (object == null) return null;
       -    var value = object[property];
       -    return _.isFunction(value) ? value.call(object) : value;
          };
       +  _.escape = createEscaper(escapeMap);
       +  _.unescape = createEscaper(unescapeMap);
        
       -  // Add your own custom functions to the Underscore object.
       -  _.mixin = function(obj) {
       -    each(_.functions(obj), function(name){
       -      var func = _[name] = obj[name];
       -      _.prototype[name] = function() {
       -        var args = [this._wrapped];
       -        push.apply(args, arguments);
       -        return result.call(this, func.apply(_, args));
       -      };
       -    });
       +  // If the value of the named `property` is a function then invoke it with the
       +  // `object` as context; otherwise, return it.
       +  _.result = function(object, property, fallback) {
       +    var value = object == null ? void 0 : object[property];
       +    if (value === void 0) {
       +      value = fallback;
       +    }
       +    return _.isFunction(value) ? value.call(object) : value;
          };
        
          // Generate a unique integer id (unique within the entire client session).
       t@@ -1103,22 +1398,26 @@
            '\\':     '\\',
            '\r':     'r',
            '\n':     'n',
       -    '\t':     't',
            '\u2028': 'u2028',
            '\u2029': 'u2029'
          };
        
       -  var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g;
       +  var escaper = /\\|'|\r|\n|\u2028|\u2029/g;
       +
       +  var escapeChar = function(match) {
       +    return '\\' + escapes[match];
       +  };
        
          // JavaScript micro-templating, similar to John Resig's implementation.
          // Underscore templating handles arbitrary delimiters, preserves whitespace,
          // and correctly escapes quotes within interpolated code.
       -  _.template = function(text, data, settings) {
       -    var render;
       +  // NB: `oldSettings` only exists for backwards compatibility.
       +  _.template = function(text, settings, oldSettings) {
       +    if (!settings && oldSettings) settings = oldSettings;
            settings = _.defaults({}, settings, _.templateSettings);
        
            // Combine delimiters into one regular expression via alternation.
       -    var matcher = new RegExp([
       +    var matcher = RegExp([
              (settings.escape || noMatch).source,
              (settings.interpolate || noMatch).source,
              (settings.evaluate || noMatch).source
       t@@ -1128,19 +1427,18 @@
            var index = 0;
            var source = "__p+='";
            text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
       -      source += text.slice(index, offset)
       -        .replace(escaper, function(match) { return '\\' + escapes[match]; });
       +      source += text.slice(index, offset).replace(escaper, escapeChar);
       +      index = offset + match.length;
        
              if (escape) {
                source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
       -      }
       -      if (interpolate) {
       +      } else if (interpolate) {
                source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
       -      }
       -      if (evaluate) {
       +      } else if (evaluate) {
                source += "';\n" + evaluate + "\n__p+='";
              }
       -      index = offset + match.length;
       +
       +      // Adobe VMs need the match returned to produce the correct offest.
              return match;
            });
            source += "';\n";
       t@@ -1150,29 +1448,31 @@
        
            source = "var __t,__p='',__j=Array.prototype.join," +
              "print=function(){__p+=__j.call(arguments,'');};\n" +
       -      source + "return __p;\n";
       +      source + 'return __p;\n';
        
            try {
       -      render = new Function(settings.variable || 'obj', '_', source);
       +      var render = new Function(settings.variable || 'obj', '_', source);
            } catch (e) {
              e.source = source;
              throw e;
            }
        
       -    if (data) return render(data, _);
            var template = function(data) {
              return render.call(this, data, _);
            };
        
       -    // Provide the compiled function source as a convenience for precompilation.
       -    template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}';
       +    // Provide the compiled source as a convenience for precompilation.
       +    var argument = settings.variable || 'obj';
       +    template.source = 'function(' + argument + '){\n' + source + '}';
        
            return template;
          };
        
       -  // Add a "chain" function, which will delegate to the wrapper.
       +  // Add a "chain" function. Start chaining a wrapped Underscore object.
          _.chain = function(obj) {
       -    return _(obj).chain();
       +    var instance = _(obj);
       +    instance._chain = true;
       +    return instance;
          };
        
          // OOP
       t@@ -1182,45 +1482,67 @@
          // underscore functions. Wrapped objects may be chained.
        
          // Helper function to continue chaining intermediate results.
       -  var result = function(obj) {
       -    return this._chain ? _(obj).chain() : obj;
       +  var result = function(instance, obj) {
       +    return instance._chain ? _(obj).chain() : obj;
       +  };
       +
       +  // Add your own custom functions to the Underscore object.
       +  _.mixin = function(obj) {
       +    _.each(_.functions(obj), function(name) {
       +      var func = _[name] = obj[name];
       +      _.prototype[name] = function() {
       +        var args = [this._wrapped];
       +        push.apply(args, arguments);
       +        return result(this, func.apply(_, args));
       +      };
       +    });
          };
        
          // Add all of the Underscore functions to the wrapper object.
          _.mixin(_);
        
          // Add all mutator Array functions to the wrapper.
       -  each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
       +  _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
            var method = ArrayProto[name];
            _.prototype[name] = function() {
              var obj = this._wrapped;
              method.apply(obj, arguments);
       -      if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];
       -      return result.call(this, obj);
       +      if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];
       +      return result(this, obj);
            };
          });
        
          // Add all accessor Array functions to the wrapper.
       -  each(['concat', 'join', 'slice'], function(name) {
       +  _.each(['concat', 'join', 'slice'], function(name) {
            var method = ArrayProto[name];
            _.prototype[name] = function() {
       -      return result.call(this, method.apply(this._wrapped, arguments));
       +      return result(this, method.apply(this._wrapped, arguments));
            };
          });
        
       -  _.extend(_.prototype, {
       -
       -    // Start chaining a wrapped Underscore object.
       -    chain: function() {
       -      this._chain = true;
       -      return this;
       -    },
       +  // Extracts the result from a wrapped and chained object.
       +  _.prototype.value = function() {
       +    return this._wrapped;
       +  };
        
       -    // Extracts the result from a wrapped and chained object.
       -    value: function() {
       -      return this._wrapped;
       -    }
       +  // Provide unwrapping proxy for some methods used in engine operations
       +  // such as arithmetic and JSON stringification.
       +  _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
        
       -  });
       +  _.prototype.toString = function() {
       +    return '' + this._wrapped;
       +  };
        
       -}).call(this);
       +  // AMD registration happens at the end for compatibility with AMD loaders
       +  // that may not enforce next-turn semantics on modules. Even though general
       +  // practice for AMD registration is to be anonymous, underscore registers
       +  // as a named module because, like jQuery, it is a base library that is
       +  // popular enough to be bundled in a third party lib, but not be part of
       +  // an AMD load request. Those cases could generate an error when an
       +  // anonymous define() is called outside of a loader request.
       +  if (typeof define === 'function' && define.amd) {
       +    define('underscore', [], function() {
       +      return _;
       +    });
       +  }
       +}.call(this));
 (DIR) diff --git a/doc/html/_static/up-pressed.png b/doc/html/_static/up-pressed.png
       Binary files differ.
 (DIR) diff --git a/doc/html/_static/up.png b/doc/html/_static/up.png
       Binary files differ.
 (DIR) diff --git a/doc/html/_static/websupport.js b/doc/html/_static/websupport.js
       t@@ -2,9 +2,9 @@
         * websupport.js
         * ~~~~~~~~~~~~~
         *
       - * sphinx.websupport utilties for all documentation.
       + * sphinx.websupport utilities for all documentation.
         *
       - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
       + * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
         * :license: BSD, see LICENSE for details.
         *
         */
       t@@ -50,51 +50,51 @@
          }
        
          function initEvents() {
       -    $('a.comment-close').live("click", function(event) {
       +    $(document).on("click", 'a.comment-close', function(event) {
              event.preventDefault();
              hide($(this).attr('id').substring(2));
            });
       -    $('a.vote').live("click", function(event) {
       +    $(document).on("click", 'a.vote', function(event) {
              event.preventDefault();
              handleVote($(this));
            });
       -    $('a.reply').live("click", function(event) {
       +    $(document).on("click", 'a.reply', function(event) {
              event.preventDefault();
              openReply($(this).attr('id').substring(2));
            });
       -    $('a.close-reply').live("click", function(event) {
       +    $(document).on("click", 'a.close-reply', function(event) {
              event.preventDefault();
              closeReply($(this).attr('id').substring(2));
            });
       -    $('a.sort-option').live("click", function(event) {
       +    $(document).on("click", 'a.sort-option', function(event) {
              event.preventDefault();
              handleReSort($(this));
            });
       -    $('a.show-proposal').live("click", function(event) {
       +    $(document).on("click", 'a.show-proposal', function(event) {
              event.preventDefault();
              showProposal($(this).attr('id').substring(2));
            });
       -    $('a.hide-proposal').live("click", function(event) {
       +    $(document).on("click", 'a.hide-proposal', function(event) {
              event.preventDefault();
              hideProposal($(this).attr('id').substring(2));
            });
       -    $('a.show-propose-change').live("click", function(event) {
       +    $(document).on("click", 'a.show-propose-change', function(event) {
              event.preventDefault();
              showProposeChange($(this).attr('id').substring(2));
            });
       -    $('a.hide-propose-change').live("click", function(event) {
       +    $(document).on("click", 'a.hide-propose-change', function(event) {
              event.preventDefault();
              hideProposeChange($(this).attr('id').substring(2));
            });
       -    $('a.accept-comment').live("click", function(event) {
       +    $(document).on("click", 'a.accept-comment', function(event) {
              event.preventDefault();
              acceptComment($(this).attr('id').substring(2));
            });
       -    $('a.delete-comment').live("click", function(event) {
       +    $(document).on("click", 'a.delete-comment', function(event) {
              event.preventDefault();
              deleteComment($(this).attr('id').substring(2));
            });
       -    $('a.comment-markup').live("click", function(event) {
       +    $(document).on("click", 'a.comment-markup', function(event) {
              event.preventDefault();
              toggleCommentMarkupBox($(this).attr('id').substring(2));
            });
       t@@ -700,8 +700,8 @@
                (<a href="#" class="comment-markup" id="ab<%id%>">markup</a>):</p>\
              <div class="comment-markup-box" id="mb<%id%>">\
                reStructured text markup: <i>*emph*</i>, <b>**strong**</b>, \
       -        <tt>``code``</tt>, \
       -        code blocks: <tt>::</tt> and an indented block after blank line</div>\
       +        <code>``code``</code>, \
       +        code blocks: <code>::</code> and an indented block after blank line</div>\
              <form method="post" id="cf<%id%>" class="comment-form" action="">\
                <textarea name="comment" cols="80"></textarea>\
                <p class="propose-button">\
 (DIR) diff --git a/doc/html/cfd.html b/doc/html/cfd.html
       t@@ -1,5 +1,3 @@
       -
       -
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
       t@@ -8,15 +6,14 @@
          <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            
       -    <title>Fluid simulation and particle-fluid interaction &mdash; sphere 1.00-alpha documentation</title>
       +    <title>Fluid simulation and particle-fluid interaction &#8212; sphere 1.00-alpha documentation</title>
            
       -    <link rel="stylesheet" href="_static/default.css" type="text/css" />
       +    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
            <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       -    <link rel="stylesheet" href="_static/breathe.css" type="text/css" />
            
            <script type="text/javascript">
              var DOCUMENTATION_OPTIONS = {
       -        URL_ROOT:    '',
       +        URL_ROOT:    './',
                VERSION:     '1.00-alpha',
                COLLAPSE_INDEX: false,
                FILE_SUFFIX: '.html',
       t@@ -26,12 +23,14 @@
            <script type="text/javascript" src="_static/jquery.js"></script>
            <script type="text/javascript" src="_static/underscore.js"></script>
            <script type="text/javascript" src="_static/doctools.js"></script>
       +    <link rel="index" title="Index" href="genindex.html" />
       +    <link rel="search" title="Search" href="search.html" />
            <link rel="top" title="sphere 1.00-alpha documentation" href="index.html" />
            <link rel="next" title="Python API" href="python_api.html" />
            <link rel="prev" title="Discrete element method" href="dem.html" /> 
          </head>
       -  <body>
       -    <div class="related">
       +  <body role="document">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -46,14 +45,14 @@
                <li class="right" >
                  <a href="dem.html" title="Discrete element method"
                     accesskey="P">previous</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>  
        
            <div class="document">
              <div class="documentwrapper">
                <div class="bodywrapper">
       -          <div class="body">
       +          <div class="body" role="main">
                    
          <div class="section" id="fluid-simulation-and-particle-fluid-interaction">
        <h1>Fluid simulation and particle-fluid interaction<a class="headerlink" href="#fluid-simulation-and-particle-fluid-interaction" title="Permalink to this headline">¶</a></h1>
       t@@ -69,31 +68,31 @@ solution procedure and the numerical implementation.</p>
        <p>Following the outline presented by <a class="reference external" href="http://www.cimec.org.ar/ojs/index.php/mc/article/view/486/464">Limache and Idelsohn (2006)</a>, the
        continuity equation for an incompressible fluid material is given by:</p>
        <div class="math">
       -<p><img src="_images/math/b588eea9cec4513a3be72255d8d3df214546bfe7.png" alt="\nabla \cdot \boldsymbol{v} = 0"/></p>
       +<p><img src="_images/math/341e857d6da62b73593a73dea371b22a955fd8e9.png" alt="\nabla \cdot \boldsymbol{v} = 0"/></p>
        </div><p>and the momentum equation:</p>
        <div class="math">
       -<p><img src="_images/math/a00f5eb30a7a379b737fd4fafa61160bc0fce4a8.png" alt="\rho \frac{\partial \boldsymbol{v}}{\partial t}
       +<p><img src="_images/math/f4c62b9c99051d7d2ca2b222af4b3394d02e1b1d.png" alt="\rho \frac{\partial \boldsymbol{v}}{\partial t}
        + \rho (\boldsymbol{v} \cdot \nabla \boldsymbol{v})
        = \nabla \cdot \boldsymbol{\sigma}
        - \boldsymbol{f}^i
        + \rho \boldsymbol{g}"/></p>
       -</div><p>Here, <img class="math" src="_images/math/d0b4b390a4806bb739c6b4adbdf572347ecda952.png" alt="\boldsymbol{v}"/> is the fluid velocity, <img class="math" src="_images/math/0027034d8a10372a06deaf4f4084c01956587479.png" alt="\rho"/> is the
       -fluid density, <img class="math" src="_images/math/769bfdcb2a43bde2cd368d82a6f64bd68c876c99.png" alt="\boldsymbol{\sigma}"/> is the <a class="reference external" href="https://en.wikipedia.org/wiki/Cauchy_stress_tensor">Cauchy stress tensor</a>,
       -<img class="math" src="_images/math/dbb95aa092c199cb518b2fdf22908d217988c251.png" alt="\boldsymbol{f}^i"/> is the particle-fluid interaction vector and
       -<img class="math" src="_images/math/a1e91a45b4858dfcbacc9b0d3b28418f1a990df1.png" alt="\boldsymbol{g}"/> is the gravitational acceleration. For incompressible
       +</div><p>Here, <img class="math" src="_images/math/c8e734bf3818506e254ebfa35047a7957546c2f8.png" alt="\boldsymbol{v}"/> is the fluid velocity, <img class="math" src="_images/math/f574498915fa9e02eeb5141c24835d077eba3e75.png" alt="\rho"/> is the
       +fluid density, <img class="math" src="_images/math/b4104067dcc504da8eada0697129bcae9f7cf9b6.png" alt="\boldsymbol{\sigma}"/> is the <a class="reference external" href="https://en.wikipedia.org/wiki/Cauchy_stress_tensor">Cauchy stress tensor</a>,
       +<img class="math" src="_images/math/3ac346ec0a0efeed60827b2d73c5776cf4605902.png" alt="\boldsymbol{f}^i"/> is the particle-fluid interaction vector and
       +<img class="math" src="_images/math/af2f4149a102bb8a3d74e9afbfd0d21b4c2f7084.png" alt="\boldsymbol{g}"/> is the gravitational acceleration. For incompressible
        Newtonian fluids, the Cauchy stress is given by:</p>
        <div class="math">
       -<p><img src="_images/math/c9264cc703654b5651cb89a1c9f5e178b5d15cd0.png" alt="\boldsymbol{\sigma} = -p \boldsymbol{I} + \boldsymbol{\tau}"/></p>
       -</div><p><img class="math" src="_images/math/36f73fc1312ee0349b3f3a0f3bd9eb5504339011.png" alt="p"/> is the fluid pressure, <img class="math" src="_images/math/9d909a12ad669a49e201a6d94b4211c7aeebb68c.png" alt="\boldsymbol{I}"/> is the identity
       -tensor, and <img class="math" src="_images/math/023a7668d083165ce2aa65b49e876b83c9cb97f9.png" alt="\boldsymbol{\tau}"/> is the deviatoric stress tensor, given
       +<p><img src="_images/math/9cb510f5a23b8a2cf167578e3197615a3cab7510.png" alt="\boldsymbol{\sigma} = -p \boldsymbol{I} + \boldsymbol{\tau}"/></p>
       +</div><p><img class="math" src="_images/math/3eca8557203e86160952e1c0f735f7417f3285b1.png" alt="p"/> is the fluid pressure, <img class="math" src="_images/math/cfe0e96f004950d55bc7f58233eedae9f8b6abc1.png" alt="\boldsymbol{I}"/> is the identity
       +tensor, and <img class="math" src="_images/math/e29be0a3b86507644c82abbc0adfcb22f0edb5e3.png" alt="\boldsymbol{\tau}"/> is the deviatoric stress tensor, given
        by:</p>
        <div class="math">
       -<p><img src="_images/math/25586671e456c2d987cd75cefd64d9cee69f50b9.png" alt="\boldsymbol{\tau} =
       +<p><img src="_images/math/2ac5fed54f92fbc94d2fefb2aa5f17a1e326282e.png" alt="\boldsymbol{\tau} =
        \mu_f \nabla \boldsymbol{v}
        + \mu_f (\nabla \boldsymbol{v})^T"/></p>
        </div><p>By using the following vector identities:</p>
        <div class="math">
       -<p><img src="_images/math/e4ca401f97df40e3568bc0624774cafa02d77cc1.png" alt="\nabla \cdot (p \boldsymbol{I}) = \nabla p
       +<p><img src="_images/math/ffe6c17031ff1e2333c5bdc57773967dda2bebcc.png" alt="\nabla \cdot (p \boldsymbol{I}) = \nabla p
        
        \nabla \cdot (\nabla \boldsymbol{v}) = \nabla^2 \boldsymbol{v}
        
       t@@ -102,29 +101,29 @@ by:</p>
        </div><p>the deviatoric component of the Cauchy stress tensor simplifies to the
        following, assuming that spatial variations in the viscosity can be neglected:</p>
        <div class="math">
       -<p><img src="_images/math/1053df745e2d73fc7ee27d39a01ad228c360072e.png" alt="= -\nabla p
       +<p><img src="_images/math/f220cc08054c66b15757b7073edbbfe33c2736e6.png" alt="= -\nabla p
        + \mu_f \nabla^2 \boldsymbol{v}"/></p>
        </div><p>Since we are dealing with fluid flow in a porous medium, additional terms are
        introduced to the equations for conservation of mass and momentum. In the
        following, the equations are derived for the first spatial component. The
        solution for the other components is trivial.</p>
        <p>The porosity value (in the saturated porous medium the volumetric fraction of
       -the fluid phase) denoted <img class="math" src="_images/math/2c175f60eecef1de7560c3bdea495d69f26f719d.png" alt="\phi"/> is incorporated in the continuity and
       +the fluid phase) denoted <img class="math" src="_images/math/10e009bdb83f96c5f47c58b34d5d4b12ef268d5b.png" alt="\phi"/> is incorporated in the continuity and
        momentum equations. The continuity equation becomes:</p>
        <div class="math">
       -<p><img src="_images/math/f8f0dc31c5c12bc6e3da6fc71519fa78ea04190b.png" alt="\frac{\partial \phi}{\partial t}
       +<p><img src="_images/math/6875433152b8a1a1624c131527286ababd8a8462.png" alt="\frac{\partial \phi}{\partial t}
        + \nabla \cdot (\phi \boldsymbol{v}) = 0"/></p>
       -</div><p>For the <img class="math" src="_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/> component, the Lagrangian formulation of the momentum equation
       -with a body force <img class="math" src="_images/math/69b1fdf87f9a78aaef8057a34aea7a6c17dad726.png" alt="\boldsymbol{f}"/> becomes:</p>
       +</div><p>For the <img class="math" src="_images/math/188c175aac0a8a9c22499336711b5d7256407254.png" alt="x"/> component, the Lagrangian formulation of the momentum equation
       +with a body force <img class="math" src="_images/math/ce4f41d90f3fea6e5313ad3c0e8aac4f969ef16b.png" alt="\boldsymbol{f}"/> becomes:</p>
        <div class="math">
       -<p><img src="_images/math/4fd7ec1b618d0e036da7606d6876e79d81480584.png" alt="\frac{D (\phi v_x)}{D t}
       +<p><img src="_images/math/60290a944b15183b06237a1483946560e640e1bf.png" alt="\frac{D (\phi v_x)}{D t}
        = \frac{1}{\rho} \left[ \nabla \cdot (\phi \boldsymbol{\sigma}) \right]_x
        - \frac{1}{\rho} f^i_x
        + \phi g"/></p>
        </div><p>In the Eulerian formulation, an advection term is added, and the Cauchy stress
        tensor is represented as isotropic and deviatoric components individually:</p>
        <div class="math">
       -<p><img src="_images/math/ff29b7920019a21a45545381f042a08acfba3530.png" alt="\frac{\partial (\phi v_x)}{\partial t}
       +<p><img src="_images/math/b991196699db1cde269ad006f427d8168fcfd679.png" alt="\frac{\partial (\phi v_x)}{\partial t}
        + \boldsymbol{v} \cdot \nabla (\phi v_x)
        = \frac{1}{\rho} \left[ \nabla \cdot (-\phi p \boldsymbol{I})
        + \phi \boldsymbol{\tau}) \right]_x
       t@@ -133,7 +132,7 @@ tensor is represented as isotropic and deviatoric components individually:</p>
        </div><p>Using vector identities to rewrite the advection term, and expanding the fluid
        stress tensor term:</p>
        <div class="math">
       -<p><img src="_images/math/0e86ca4660ab213ac57b980a736e32499978d2dc.png" alt="\frac{\partial (\phi v_x)}{\partial t}
       +<p><img src="_images/math/a85779399f71d0d2d7fd373c5c5f2b572cf3bfd7.png" alt="\frac{\partial (\phi v_x)}{\partial t}
        + \nabla \cdot (\phi v_x \boldsymbol{v})
        - \phi v_x (\nabla \cdot \boldsymbol{v})
        = \frac{1}{\rho} \left[ -\nabla \phi p \right]_x
       t@@ -142,24 +141,24 @@ stress tensor term:</p>
        + \phi g_x"/></p>
        </div><p>Spatial variations in the porosity are neglected,</p>
        <div class="math">
       -<p><img src="_images/math/c42a32017c99646f19bb5807728595d4526c3b30.png" alt="\nabla \phi := 0"/></p>
       +<p><img src="_images/math/249fc7f1e5fa5aa23b21d1fdf32ed10f0fcef400.png" alt="\nabla \phi := 0"/></p>
        </div><p>and the pressure is attributed to the fluid phase alone (model B in Zhu et al.
        2007 and Zhou et al. 2010). The divergence of fluid velocities is defined to be
        zero:</p>
        <div class="math">
       -<p><img src="_images/math/44fafcf5a158459730d0dd7c293b93cdcf62f0a4.png" alt="\nabla \cdot \boldsymbol{v} := 0"/></p>
       +<p><img src="_images/math/96df96ab11be34dbe17cb0837626b7cc2772013e.png" alt="\nabla \cdot \boldsymbol{v} := 0"/></p>
        </div><p>With these assumptions, the momentum equation simplifies to:</p>
        <div class="math">
       -<p><img src="_images/math/7f7495bf6b7e8e4c468863b6fd083f72f3a844ac.png" alt="\frac{\partial (\phi v_x)}{\partial t}
       +<p><img src="_images/math/e58aec0a9dc37c78b74f5c34874ff852d8839f43.png" alt="\frac{\partial (\phi v_x)}{\partial t}
        + \nabla \cdot (\phi v_x \boldsymbol{v})
        = -\frac{1}{\rho} \frac{\partial p}{\partial x}
        + \frac{1}{\rho} \left[ \nabla \cdot (\phi \boldsymbol{\tau}) \right]_x
        - \frac{1}{\rho} f^i_x
        + \phi g_x"/></p>
       -</div><p>The remaining part of the advection term is for the <img class="math" src="_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/> component
       +</div><p>The remaining part of the advection term is for the <img class="math" src="_images/math/188c175aac0a8a9c22499336711b5d7256407254.png" alt="x"/> component
        found as:</p>
        <div class="math">
       -<p><img src="_images/math/967116fa65cb7eb073c2f71309b21af6aca77a09.png" alt="\nabla \cdot (\phi v_x \boldsymbol{v}) =
       +<p><img src="_images/math/8bd85c906906e83dd3471973969959e831d271d7.png" alt="\nabla \cdot (\phi v_x \boldsymbol{v}) =
        \left[
            \frac{\partial}{\partial x},
            \frac{\partial}{\partial y},
       t@@ -176,10 +175,10 @@ found as:</p>
        \frac{\partial (\phi v_x v_x)}{\partial x} +
        \frac{\partial (\phi v_x v_y)}{\partial y} +
        \frac{\partial (\phi v_x v_z)}{\partial z}"/></p>
       -</div><p>The deviatoric stress tensor is in this case symmetrical, i.e. <img class="math" src="_images/math/70b8f6d6630631ad7de5c587e511247f1ce2afe9.png" alt="\tau_{ij}
       +</div><p>The deviatoric stress tensor is in this case symmetrical, i.e. <img class="math" src="_images/math/3a94e291e91082dc48a18009bdd3fd70ebedec76.png" alt="\tau_{ij}
        = \tau_{ji}"/>, and is found by:</p>
        <div class="math">
       -<p><img src="_images/math/9d3cd4785fd2621936d97aa60cb5005a7e95b5b7.png" alt="\frac{1}{\rho} \left[ \nabla \cdot (\phi \boldsymbol{\tau}) \right]_x
       +<p><img src="_images/math/66dc70aa131124c6f87d7f2cbb96350d8b0397b9.png" alt="\frac{1}{\rho} \left[ \nabla \cdot (\phi \boldsymbol{\tau}) \right]_x
        = \frac{1}{\rho}
        \left[
            \left[
       t@@ -218,17 +217,17 @@ found as:</p>
            + \frac{\partial (\phi \tau_{xz})}{\partial z}
        \right)"/></p>
        </div><p>In a linear viscous fluid, the stress and strain rate
       -(<img class="math" src="_images/math/7727554a4dfa1572695dec332d6f6ee255815c96.png" alt="\dot{\boldsymbol{\epsilon}}"/>) is linearly dependent, scaled by the
       -viscosity parameter <img class="math" src="_images/math/6160e3f2050b4cd56b336ff552386a169aa51db8.png" alt="\mu_f"/>:</p>
       +(<img class="math" src="_images/math/1ee5b5b2fe535711338cab9fde51ba86968186e2.png" alt="\dot{\boldsymbol{\epsilon}}"/>) is linearly dependent, scaled by the
       +viscosity parameter <img class="math" src="_images/math/a1a25b9ae9dc5911e30e15d5ca2fc5ee8234f1f1.png" alt="\mu_f"/>:</p>
        <div class="math">
       -<p><img src="_images/math/5fb7b1a39363304fc1fb9172ecd46e2f39274384.png" alt="\tau_{ij} = 2 \mu_f \dot{\epsilon}_{ij}
       +<p><img src="_images/math/2133ec642b2fa2a0bdc0612dc9080df18f64da53.png" alt="\tau_{ij} = 2 \mu_f \dot{\epsilon}_{ij}
        = \mu_f \left(
        \frac{\partial v_i}{\partial x_j} + \frac{\partial v_j}{\partial x_i}
        \right)"/></p>
        </div><p>With this relationship, the deviatoric stress tensor components can be
        calculated as:</p>
        <div class="math">
       -<p><img src="_images/math/f99450c7a8851772907f28ffd58be080f18894ae.png" alt="\tau_{xx} = 2 \mu_f \frac{\partial v_x}{\partial x} \qquad
       +<p><img src="_images/math/4d94b19a340ed5d6cfc3285e3c0678be914c3834.png" alt="\tau_{xx} = 2 \mu_f \frac{\partial v_x}{\partial x} \qquad
        \tau_{yy} = 2 \mu_f \frac{\partial v_y}{\partial y} \qquad
        \tau_{zz} = 2 \mu_f \frac{\partial v_z}{\partial z}
        
       t@@ -240,26 +239,26 @@ calculated as:</p>
        
        \tau_{yz} = \mu_f \left(
        \frac{\partial v_y}{\partial z} + \frac{\partial v_z}{\partial y} \right)"/></p>
       -</div><p>where <img class="math" src="_images/math/6160e3f2050b4cd56b336ff552386a169aa51db8.png" alt="\mu_f"/> is the dynamic viscosity. The above formulation of the
       +</div><p>where <img class="math" src="_images/math/a1a25b9ae9dc5911e30e15d5ca2fc5ee8234f1f1.png" alt="\mu_f"/> is the dynamic viscosity. The above formulation of the
        fluid rheology assumes identical bulk and shear viscosities. The derivation of
        the equations for the other spatial components is trivial.</p>
        </div>
        <div class="section" id="porosity-estimation">
        <h2>Porosity estimation<a class="headerlink" href="#porosity-estimation" title="Permalink to this headline">¶</a></h2>
        <p>The solid volume in each fluid cell is determined by the ratio of the
       -a cell-centered spherical cell volume (<img class="math" src="_images/math/24edc419058015022fc9ef15fb0f5d8ec3109f73.png" alt="V_c"/>) and the sum of intersecting
       -particle volumes (<img class="math" src="_images/math/3c93d2ecf99a3c5ee161c98a3ac0040e1b446e09.png" alt="V_s"/>). The spherical cell volume has a center at
       -<img class="math" src="_images/math/74958bc18d017328dd0fac99816d2184296bfd3d.png" alt="\boldsymbol{x}_i"/>, and a radius of <img class="math" src="_images/math/1ef7ab23d6fc7d336379d457f66aa6ed57d72ec9.png" alt="R_i"/>, which is equal to half
       +a cell-centered spherical cell volume (<img class="math" src="_images/math/db94af9f89e3d01956eca6e0dc1be147b0bd4246.png" alt="V_c"/>) and the sum of intersecting
       +particle volumes (<img class="math" src="_images/math/754decd655584a824e0979fc2df27ae24379558e.png" alt="V_s"/>). The spherical cell volume has a center at
       +<img class="math" src="_images/math/13e4be57cf47de5302fc2e1746d965a6ee0f332c.png" alt="\boldsymbol{x}_i"/>, and a radius of <img class="math" src="_images/math/e8522a3d29a2f0f886fe156c30351ba0489992b9.png" alt="R_i"/>, which is equal to half
        the fluid cell width. The nearby particles are characterized by position
       -<img class="math" src="_images/math/d1e970327c74ae0d8249c6283d2e3134d042f6ff.png" alt="\boldsymbol{x}_j"/> and radius <img class="math" src="_images/math/2da5f268da80c66e332f2a8d4520f7d6685699b6.png" alt="r_j"/>. The center distance is defined
       +<img class="math" src="_images/math/ec1ce56da06483e62a9456229761ff166b345ed2.png" alt="\boldsymbol{x}_j"/> and radius <img class="math" src="_images/math/b51a1f74e439e8b3b84c8fe25870d53a571391ef.png" alt="r_j"/>. The center distance is defined
        as:</p>
        <div class="math">
       -<p><img src="_images/math/7fe490dcbc6c9eb978f05b3334d2a5856dc66149.png" alt="d_{ij} = ||\boldsymbol{x}_i - \boldsymbol{x}_j||"/></p>
       +<p><img src="_images/math/68f7c3ca449a28047e11af58f55b159b3156685c.png" alt="d_{ij} = ||\boldsymbol{x}_i - \boldsymbol{x}_j||"/></p>
        </div><p>The common volume of the two intersecting spheres is zero if the volumes aren&#8217;t
        intersecting, lens shaped if they are intersecting, and spherical if the
        particle is fully contained by the spherical cell volume:</p>
        <div class="math">
       -<p><img src="_images/math/6d9a9e0ef32ea9506bb55413b682112d0f3308a6.png" alt="V^s_{i} = \sum_j
       +<p><img src="_images/math/2b8b39498e0fa8ab6324f088a2330d47ef18cbd5.png" alt="V^s_{i} = \sum_j
        \begin{cases}
            0 &amp; \textit{if } R_i + r_j \leq d_{ij} \\
            \frac{1}{12d_{ij}} \left[ \pi (R_i + r_j - d_{ij})^2
       t@@ -269,7 +268,7 @@ particle is fully contained by the spherical cell volume:</p>
        \end{cases}"/></p>
        </div><p>Using this method, the cell porosity values are continuous through time as
        particles enter and exit the cell volume. The rate of porosity change
       -(<img class="math" src="_images/math/38a6d1fc56073806115322bcd179578f05c88c02.png" alt="d\phi/dt"/>) is estimated by the backwards Euler method
       +(<img class="math" src="_images/math/de27eb4f973d27763dc4d176bf2453607ecaae42.png" alt="d\phi/dt"/>) is estimated by the backwards Euler method
        by considering the previous and current porosity.</p>
        </div>
        <div class="section" id="particle-fluid-interaction">
       t@@ -281,53 +280,53 @@ semi-empirical relationships. The drag force scales linearly with the relative
        difference in velocity between the fluid and particle phase. On the base of
        Newton&#8217;s third law, the resulting drag force is applied with opposite signs to
        the particle and fluid.</p>
       -<p>For fluid cells with porosities (<img class="math" src="_images/math/2c175f60eecef1de7560c3bdea495d69f26f719d.png" alt="\phi"/>) less or equal to 0.8, the drag
       +<p>For fluid cells with porosities (<img class="math" src="_images/math/10e009bdb83f96c5f47c58b34d5d4b12ef268d5b.png" alt="\phi"/>) less or equal to 0.8, the drag
        force is based on the Ergun (1952) equation:</p>
        <div class="math">
       -<p><img src="_images/math/baa542966f410097c2b4894388e41db6aa3cd996.png" alt="\bar{\boldsymbol{f}}_d = \left(
       +<p><img src="_images/math/c65c93ecc36954688972785ecbae82a6d7a14a3a.png" alt="\bar{\boldsymbol{f}}_d = \left(
        150 \frac{\mu_f (1-\phi)^2}{\phi\bar{d}^2}
        + 1.75 \frac{(1-\phi)\rho_f
          ||\boldsymbol{v}_f - \bar{\boldsymbol{v}}_p||}{\bar{d}}
        \right)
        (\boldsymbol{v}_f - \bar{\boldsymbol{v}}_p)"/></p>
       -</div><p>here, <img class="math" src="_images/math/46a84b389d8f594cd16c800ba4267f3cac5e2f30.png" alt="\bar{d}"/> denotes the average particle diameter in the cell,
       -<img class="math" src="_images/math/cbe3f817ae974accdf9d422c0df8f6c90721037c.png" alt="\boldsymbol{v}_f"/> is the fluid flow velocity, and
       -<img class="math" src="_images/math/3b432b0e58dea7c6cc143bf67184fc19b8cd4336.png" alt="\bar{\boldsymbol{v}}_p"/> is the average particle velocity in the cell. All
       +</div><p>here, <img class="math" src="_images/math/082bced08237667a772227c2e3eb8359ff9d4af8.png" alt="\bar{d}"/> denotes the average particle diameter in the cell,
       +<img class="math" src="_images/math/22b6d9dab340bfe13993da20589e4720449fe391.png" alt="\boldsymbol{v}_f"/> is the fluid flow velocity, and
       +<img class="math" src="_images/math/5b7072008fcf4dedaeed4d537fe5c808adedb826.png" alt="\bar{\boldsymbol{v}}_p"/> is the average particle velocity in the cell. All
        particles in contact with the previously mentioned cell-centered sphere for
        porosity estimation contribute to the average particle velocity and diameter in
        the fluid cell.</p>
        <p>If the porosity is greater than 0.8, the cell-averaged drag force
       -(<img class="math" src="_images/math/a6c493a071c2c31758bc2bc9adc2beb10d7acfd0.png" alt="\bar{\boldsymbol{f}}_d"/> is found from the Wen and Yu (1966) equation,
       +(<img class="math" src="_images/math/fa8a7b2fb896adf1c9f17077664691e511aeb8e5.png" alt="\bar{\boldsymbol{f}}_d"/> is found from the Wen and Yu (1966) equation,
        which considers the fluid flow situation:</p>
        <div class="math">
       -<p><img src="_images/math/7181906596d0aaac14cbde44ec57dd7e5866c81b.png" alt="\bar{\boldsymbol{f}}_d = \left(
       +<p><img src="_images/math/0949063a26c6869766d571d13e61cf78f3a38c06.png" alt="\bar{\boldsymbol{f}}_d = \left(
        \frac{3}{4}
        \frac{C_d (1-\phi) \phi^{-2.65} \mu_f \rho_f
        ||\boldsymbol{v}_f - \bar{\boldsymbol{v}}_p||}{\bar{d}}
        \right)
        (\boldsymbol{v}_f - \bar{\boldsymbol{v}}_p)"/></p>
       -</div><p>The drag coefficient <img class="math" src="_images/math/47bc1263e44f1b74fd90da02d9e7c26bf4b9edbe.png" alt="C_d"/> is evaluated depending on the magnitude of the
       -Reynolds number <img class="math" src="_images/math/16ef95610462b9c2c03cba4c272fe84208bf3c61.png" alt="Re"/>:</p>
       +</div><p>The drag coefficient <img class="math" src="_images/math/1beccd9a659ce57a6a8083a589fe91ad33fa3b06.png" alt="C_d"/> is evaluated depending on the magnitude of the
       +Reynolds number <img class="math" src="_images/math/0e0f0c7e69e0f315aed6d1762a66bf27dd9a155a.png" alt="Re"/>:</p>
        <div class="math">
       -<p><img src="_images/math/49a90589ae1e8a839b1ae6afb3dd1d162b6a094c.png" alt="C_d =
       +<p><img src="_images/math/e2872fb63d995fa1112c468dcb10669c69795aef.png" alt="C_d =
        \begin{cases}
        \frac{24}{Re} (1+0.15 (Re)^{0.687} &amp; \textit{if } Re &lt; 1,000 \\
        0.44 &amp; \textit{if } Re \geq 1,000
        \end{cases}"/></p>
        </div><p>where the Reynold&#8217;s number is found by:</p>
        <div class="math">
       -<p><img src="_images/math/8dbae01b96ab8dd591a50213f55caa3ac5958631.png" alt="Re = \frac{\phi\rho_f\bar{d}}{\mu_f}
       +<p><img src="_images/math/f4bf201ecead6e3486688493ab1b1e82c39d93df.png" alt="Re = \frac{\phi\rho_f\bar{d}}{\mu_f}
        ||\boldsymbol{v}_f - \bar{\boldsymbol{v}}_p||"/></p>
        </div><p>The interaction force is applied to the fluid with negative sign as a
       -contribution to the body force <img class="math" src="_images/math/69b1fdf87f9a78aaef8057a34aea7a6c17dad726.png" alt="\boldsymbol{f}"/>. The fluid interaction
       +contribution to the body force <img class="math" src="_images/math/ce4f41d90f3fea6e5313ad3c0e8aac4f969ef16b.png" alt="\boldsymbol{f}"/>. The fluid interaction
        force applied particles in the fluid cell is:</p>
        <div class="math">
       -<p><img src="_images/math/ac40b59145892a5a3c0141c5f35023ad85972855.png" alt="\boldsymbol{f}_i = \frac{\bar{\boldsymbol{f}}_d V_p}{1-\phi}"/></p>
       -</div><p>where <img class="math" src="_images/math/257ee6442468d7529f036a8a81e6050c3832fdbf.png" alt="V_p"/> denotes the particle volume. Optionally, the above
       +<p><img src="_images/math/c24e3d875b09e3973624f97802672222ca57c3be.png" alt="\boldsymbol{f}_i = \frac{\bar{\boldsymbol{f}}_d V_p}{1-\phi}"/></p>
       +</div><p>where <img class="math" src="_images/math/4d3f01b8ca8bdab3543eda695ff7e565bcb66381.png" alt="V_p"/> denotes the particle volume. Optionally, the above
        interaction force could be expanded to include the force induced by the fluid
        pressure gradient:</p>
        <div class="math">
       -<p><img src="_images/math/0fdafcde7733804669f8df4846e5bfdb36c7afa7.png" alt="\boldsymbol{f}_i = \left(
       +<p><img src="_images/math/f8484aaf38ecdf73f7489fe6b43dec92ae505398.png" alt="\boldsymbol{f}_i = \left(
        -\nabla p +
        \frac{\bar{\boldsymbol{f}}_d}{1-\phi}
        \right) V_p"/></p>
       t@@ -337,10 +336,10 @@ pressure gradient:</p>
        <p>The partial differential terms in the previously described equations are found
        using finite central differences. Modifying the operator splitting methodology
        presented by Langtangen et al.  (2002), the predicted velocity
       -<img class="math" src="_images/math/90c8bfc206db2d9f4d0dd102507c9646a70755db.png" alt="\boldsymbol{v}^*"/> after a finite time step
       -<img class="math" src="_images/math/a1ffc0a012620941fe660cedabff822ce7162eca.png" alt="\Delta t"/> is found by explicit integration of the momentum equation.</p>
       +<img class="math" src="_images/math/f5d499efbd23360f6e9229bdccf14e0951954730.png" alt="\boldsymbol{v}^*"/> after a finite time step
       +<img class="math" src="_images/math/5b4271afe7fc7c0ee84172e0ad19b82caf450c00.png" alt="\Delta t"/> is found by explicit integration of the momentum equation.</p>
        <div class="math">
       -<p><img src="_images/math/8d0831e0e18af6fd3f3f1060516faab8016dc054.png" alt="\frac{\Delta (\phi v_x)}{\Delta t}
       +<p><img src="_images/math/4414da5fcbe9d66f08400308688cad041ca9dd9c.png" alt="\frac{\Delta (\phi v_x)}{\Delta t}
        + \nabla \cdot (\phi v_x \boldsymbol{v})
        = - \frac{1}{\rho} \frac{\Delta p}{\Delta x}
        + \frac{1}{\rho} \left[ \nabla \cdot (\phi \boldsymbol{\tau}) \right]_x
       t@@ -356,10 +355,10 @@ presented by Langtangen et al.  (2002), the predicted velocity
        + \frac{1}{\rho} \left[ \nabla \cdot (\phi \boldsymbol{\tau}) \right]_x
        - \frac{1}{\rho} f^i_x
        + \phi g_x"/></p>
       -</div><p>We want to isolate <img class="math" src="_images/math/b5e8dba2403c0723e1ff60ac53116252af8aeb64.png" alt="\Delta v_x"/> in the above equation in order to project
       +</div><p>We want to isolate <img class="math" src="_images/math/eee8ed92791a9c140bb435f75178642c8bc57146.png" alt="\Delta v_x"/> in the above equation in order to project
        the new velocity.</p>
        <div class="math">
       -<p><img src="_images/math/faee932adbe0b3f8663c9be6fa88d65f456385a7.png" alt="\phi \frac{\Delta v_x}{\Delta t}
       +<p><img src="_images/math/609c6937a183637c7356d1ee9e2800015d73a5f4.png" alt="\phi \frac{\Delta v_x}{\Delta t}
        = - \frac{1}{\rho} \frac{\Delta p}{\Delta x}
        + \frac{1}{\rho} \left[ \nabla \cdot (\phi \boldsymbol{\tau}) \right]_x
        - \frac{1}{\rho} f^i_x
       t@@ -375,13 +374,13 @@ the new velocity.</p>
        + \Delta t g_x
        - v_x \frac{\Delta \phi}{\phi}
        - \nabla \cdot (\phi v_x \boldsymbol{v}) \frac{\Delta t}{\phi}"/></p>
       -</div><p>The term <img class="math" src="_images/math/fdb63b9e51abe6bbb16acfb5d7b773ddbb5bf4a8.png" alt="\beta"/> is introduced as an adjustable, dimensionless parameter
       -in the range <img class="math" src="_images/math/402b1a3c25643899cdefbe2e62d33eab43b4f616.png" alt="[0;1]"/>, and determines the importance of the old pressure
       +</div><p>The term <img class="math" src="_images/math/8ce03f78ed945f2ef3dac87c8799b55b393527e7.png" alt="\beta"/> is introduced as an adjustable, dimensionless parameter
       +in the range <img class="math" src="_images/math/30d3be82eb9bf820400a3dc3e46e84fe58e9f2c9.png" alt="[0;1]"/>, and determines the importance of the old pressure
        values in the solution procedure (Langtangen et al. 2002).  A value of 0
        corresponds to <a class="reference external" href="https://en.wikipedia.org/wiki/Projection_method_(fluid_dynamics)#Chorin.27s_projection_method">Chorin&#8217;s projection method</a> originally described
        in <a class="reference external" href="http://www.ams.org/journals/mcom/1968-22-104/S0025-5718-1968-0242392-2/S0025-5718-1968-0242392-2.pdf">Chorin (1968)</a>.</p>
        <div class="math">
       -<p><img src="_images/math/9ec27d87740d654f43e3238d5bfe718e521368ce.png" alt="v_x^* = v_x^t + \Delta v_x
       +<p><img src="_images/math/7ac8e5caca3e02a9a9b6c9576ed9bd5effddb2fb.png" alt="v_x^* = v_x^t + \Delta v_x
        
        v_x^* = v_x^t
        - \frac{\beta}{\rho} \frac{\Delta p^t}{\Delta x} \frac{\Delta t}{\phi^t}
       t@@ -391,22 +390,22 @@ v_x^* = v_x^t
        + \Delta t g_x
        - v^t_x \frac{\Delta \phi}{\phi^t}
        - \nabla \cdot (\phi^t v_x^t \boldsymbol{v}^t) \frac{\Delta t}{\phi^t}"/></p>
       -</div><p>Here, <img class="math" src="_images/math/1eb29f9de3753a59530941141fcb5c7aa3fa2e38.png" alt="\Delta x"/> denotes the cell spacing. The velocity found
       -(<img class="math" src="_images/math/f04823ba99f1452d779894f7a0745da23b55fbef.png" alt="v_x^*"/>) is only a prediction of the fluid velocity at time
       -<img class="math" src="_images/math/79c874e814b2550448c61e2627dc072653b68197.png" alt="t+\Delta t"/>, since the estimate isn&#8217;t constrained by the continuity
       +</div><p>Here, <img class="math" src="_images/math/98a432864561550105d4de621bc0a9b61068c043.png" alt="\Delta x"/> denotes the cell spacing. The velocity found
       +(<img class="math" src="_images/math/e6eadc1093d6e4f5a41f86b8301c0d7559d2c609.png" alt="v_x^*"/>) is only a prediction of the fluid velocity at time
       +<img class="math" src="_images/math/e35ec9f12692dad5164f15f68fc16f969099e241.png" alt="t+\Delta t"/>, since the estimate isn&#8217;t constrained by the continuity
        equation:</p>
        <div class="math">
       -<p><img src="_images/math/c305e13251e69e8ce59b2908f84afbbd085b5103.png" alt="\frac{\Delta \phi^t}{\Delta t} + \nabla \cdot (\phi^t
       +<p><img src="_images/math/5a4c725fb6cd73a97b137a6ddc218bd457e95ab1.png" alt="\frac{\Delta \phi^t}{\Delta t} + \nabla \cdot (\phi^t
        \boldsymbol{v}^{t+\Delta t}) = 0"/></p>
        </div><p>The divergence of a scalar and vector can be <a class="reference external" href="http://www.wolframalpha.com/input/?i=div(p+v)">split</a>:</p>
        <div class="math">
       -<p><img src="_images/math/41babe6999c89406f22db1ce5ed5e05ce939ed49.png" alt="\phi^t \nabla \cdot \boldsymbol{v}^{t+\Delta t} +
       +<p><img src="_images/math/6b14a983094b158179fe53e0a59ebe0d53891195.png" alt="\phi^t \nabla \cdot \boldsymbol{v}^{t+\Delta t} +
        \boldsymbol{v}^{t+\Delta t} \cdot \nabla \phi^t
        + \frac{\Delta \phi^t}{\Delta t} = 0"/></p>
        </div><p>The predicted velocity is corrected using the new pressure (Langtangen et al.
        2002):</p>
        <div class="math">
       -<p><img src="_images/math/52f771ea3758e7653af6c471262bbc0ff0d9cf5a.png" alt="\boldsymbol{v}^{t+\Delta t} = \boldsymbol{v}^*
       +<p><img src="_images/math/2fcd737952b690517150c61a5981d5e810d76268.png" alt="\boldsymbol{v}^{t+\Delta t} = \boldsymbol{v}^*
        %- \frac{\Delta t}{\rho} \nabla \epsilon
        - \frac{\Delta t}{\rho \phi^t} \nabla \epsilon
        \quad \text{where} \quad
       t@@ -414,21 +413,21 @@ equation:</p>
        </div><p>The above formulation of the future velocity is put into the continuity
        equation:</p>
        <div class="math">
       -<p><img src="_images/math/7b1a510ad1f355daa1f756cfd47f75a3a29f5660.png" alt="\Rightarrow
       +<p><img src="_images/math/915ee93516c4e9e5e9df4b596291692f2b283c00.png" alt="\Rightarrow
        \phi^t \nabla \cdot
        \left( \boldsymbol{v}^* - \frac{\Delta t}{\rho \phi^t} \nabla \epsilon \right)
        +
        \left( \boldsymbol{v}^* - \frac{\Delta t}{\rho \phi^t} \nabla \epsilon \right)
        \cdot \nabla \phi^t + \frac{\Delta \phi^t}{\Delta t} = 0"/></p>
        </div><div class="math">
       -<p><img src="_images/math/964fa43eb7c25fa23b82daf41b1b9e16e998ab55.png" alt="\Rightarrow
       +<p><img src="_images/math/a1bc6e0933f817147b43d6662c901ffc0b2b4151.png" alt="\Rightarrow
        \phi^t \nabla \cdot
        \boldsymbol{v}^* - \frac{\Delta t}{\rho \phi^t} \phi^t \nabla^2 \epsilon
        + \nabla \phi^t \cdot \boldsymbol{v}^*
        - \nabla \phi^t \cdot \nabla \epsilon \frac{\Delta t}{\rho \phi^t}
        + \frac{\Delta \phi^t}{\Delta t} = 0"/></p>
        </div><div class="math">
       -<p><img src="_images/math/177b8a21bb3d0e2a33950cd8ceec4f96f5950bd6.png" alt="\Rightarrow
       +<p><img src="_images/math/03b863159155c1ff0a1478a3a14f9ceecb42221e.png" alt="\Rightarrow
        \frac{\Delta t}{\rho} \nabla^2 \epsilon
        = \phi^t \nabla \cdot \boldsymbol{v}^*
        + \nabla \phi^t \cdot \boldsymbol{v}^*
       t@@ -436,38 +435,38 @@ equation:</p>
        + \frac{\Delta \phi^t}{\Delta t}"/></p>
        </div><p>The pressure difference in time becomes a <a class="reference external" href="https://en.wikipedia.org/wiki/Poisson's_equation">Poisson equation</a> with added terms:</p>
        <div class="math">
       -<p><img src="_images/math/22176d7707317572382e54a12e13095b61d90c26.png" alt="\Rightarrow
       +<p><img src="_images/math/49cc970cd820d4022dd996e66da2e453cf4aeeda.png" alt="\Rightarrow
        \nabla^2 \epsilon
        = \frac{\nabla \cdot \boldsymbol{v}^* \phi^t \rho}{\Delta t}
        + \frac{\nabla \phi^t \cdot \boldsymbol{v}^* \rho}{\Delta t}
        - \frac{\nabla \phi^t \cdot \nabla \epsilon}{\phi^t}
        + \frac{\Delta \phi^t \rho}{\Delta t^2}"/></p>
        </div><p>The right hand side of the above equation is termed the <em>forcing function</em>
       -<img class="math" src="_images/math/bb2c93730dbb48558bb3c4738c956c4e8f816437.png" alt="f"/>, which is decomposed into two terms, <img class="math" src="_images/math/37a9e7fca70e2dce829d902af2088735306bc1a3.png" alt="f_1"/> and <img class="math" src="_images/math/e31584cdce0b50ee39c63081564f6e2ec5a7dcbf.png" alt="f_2"/>:</p>
       +<img class="math" src="_images/math/0001d02b63ede2fe3219e05a7cd09c82ae6298b6.png" alt="f"/>, which is decomposed into two terms, <img class="math" src="_images/math/aad9832dd45598090e4be6aaeeaa038dfc093751.png" alt="f_1"/> and <img class="math" src="_images/math/ff9078c258266635e46b9767b0c7e248c865e4ab.png" alt="f_2"/>:</p>
        <div class="math">
       -<p><img src="_images/math/470d00b97569e3a8976841debcd99aaf9c78d7a8.png" alt="f_1
       +<p><img src="_images/math/ba756dc27a3f5d7f8ff7d7801d8c444393c13e6a.png" alt="f_1
        = \frac{\nabla \cdot \boldsymbol{v}^* \phi^t \rho}{\Delta t}
        + \frac{\nabla \phi^t \cdot \boldsymbol{v}^* \rho}{\Delta t}
        + \frac{\Delta \phi^t \rho}{\Delta t^2}
        
        f_2 =
        \frac{\nabla \phi^t \cdot \nabla \epsilon}{\phi^t}"/></p>
       -</div><p>During the <a class="reference external" href="http://www.rsmas.miami.edu/personal/miskandarani/Courses/MSC321/Projects/prjpoisson.pdf">Jacobi iterative solution procedure</a> <img class="math" src="_images/math/37a9e7fca70e2dce829d902af2088735306bc1a3.png" alt="f_1"/> remains constant,
       -while <img class="math" src="_images/math/e31584cdce0b50ee39c63081564f6e2ec5a7dcbf.png" alt="f_2"/> changes value. For this reason, <img class="math" src="_images/math/37a9e7fca70e2dce829d902af2088735306bc1a3.png" alt="f_1"/> is found only
       -during the first iteration, while <img class="math" src="_images/math/e31584cdce0b50ee39c63081564f6e2ec5a7dcbf.png" alt="f_2"/> is updated every time. The value
       +</div><p>During the <a class="reference external" href="http://www.rsmas.miami.edu/personal/miskandarani/Courses/MSC321/Projects/prjpoisson.pdf">Jacobi iterative solution procedure</a> <img class="math" src="_images/math/aad9832dd45598090e4be6aaeeaa038dfc093751.png" alt="f_1"/> remains constant,
       +while <img class="math" src="_images/math/ff9078c258266635e46b9767b0c7e248c865e4ab.png" alt="f_2"/> changes value. For this reason, <img class="math" src="_images/math/aad9832dd45598090e4be6aaeeaa038dfc093751.png" alt="f_1"/> is found only
       +during the first iteration, while <img class="math" src="_images/math/ff9078c258266635e46b9767b0c7e248c865e4ab.png" alt="f_2"/> is updated every time. The value
        of the forcing function is found as:</p>
        <div class="math">
       -<p><img src="_images/math/c4f23b63471bb0807346dc89db91e3a684cfa236.png" alt="f = f_1 - f_2"/></p>
       +<p><img src="_images/math/2a6ab5768c27f4033a07a2bd556e89a39cdff6c0.png" alt="f = f_1 - f_2"/></p>
        </div><p>Using second-order finite difference approximations of the Laplace operator
        second-order partial derivatives, the differential equations become a system of
        equations that is solved using <a class="reference external" href="https://en.wikipedia.org/wiki/Relaxation_(iterative_method)">iteratively</a> using Jacobi updates. The total
       -number of unknowns is <img class="math" src="_images/math/954afa1fc1c88d82f51ab22e64b4a7450a89f755.png" alt="(n_x - 1)(n_y - 1)(n_z - 1)"/>.</p>
       +number of unknowns is <img class="math" src="_images/math/7774004c6a3397305cc7616b705accbbbfb28632.png" alt="(n_x - 1)(n_y - 1)(n_z - 1)"/>.</p>
        <p>The discrete Laplacian (approximation of the Laplace operator) can be obtained
        by a finite-difference seven-point stencil in a three-dimensional, cubic
       -grid with cell spacing <img class="math" src="_images/math/3d41adff4943d60236fa626d0bae8e238483278a.png" alt="\Delta x, \Delta y, \Delta z"/>, considering the six
       +grid with cell spacing <img class="math" src="_images/math/43e42baf6cef7e9620082be300b7622d524b3a65.png" alt="\Delta x, \Delta y, \Delta z"/>, considering the six
        face neighbors:</p>
        <div class="math">
       -<p><img src="_images/math/6e1feb8f41fb33ffbf60f657c5e095c2bb780e4d.png" alt="\nabla^2 \epsilon_{i_x,i_y,i_z}  \approx
       +<p><img src="_images/math/ae70bc18ed864da95e96ab31ccce2f21f06d6979.png" alt="\nabla^2 \epsilon_{i_x,i_y,i_z}  \approx
        \frac{\epsilon_{i_x-1,i_y,i_z} - 2 \epsilon_{i_x,i_y,i_z}
        + \epsilon_{i_x+1,i_y,i_z}}{\Delta x^2}
        + \frac{\epsilon_{i_x,i_y-1,i_z} - 2 \epsilon_{i_x,i_y,i_z}
       t@@ -476,11 +475,11 @@ face neighbors:</p>
        + \frac{\epsilon_{i_x,i_y,i_z-1} - 2 \epsilon_{i_x,i_y,i_z}
        + \epsilon_{i_x,i_y,i_z+1}}{\Delta z^2}
        \approx f_{i_x,i_y,i_z}"/></p>
       -</div><p>Within a Jacobi iteration, the value of the unknowns (<img class="math" src="_images/math/07ff47f8ccf9ac490e023817a9241de75c30340c.png" alt="\epsilon^n"/>) is
       -used to find an updated solution estimate (<img class="math" src="_images/math/0f06d8c03699aa966cd6c94d11850ede3c97dc41.png" alt="\epsilon^{n+1}"/>).
       +</div><p>Within a Jacobi iteration, the value of the unknowns (<img class="math" src="_images/math/458d3955e23ef7ba378c27f284a2e426f756bd3e.png" alt="\epsilon^n"/>) is
       +used to find an updated solution estimate (<img class="math" src="_images/math/29bbcc61ff8f993f8eca2f33c8faf0c7ad80defc.png" alt="\epsilon^{n+1}"/>).
        The solution for the updated value takes the form:</p>
        <div class="math">
       -<p><img src="_images/math/5dfeda3ba68db3f629c37ad0b4cc75095c2d6570.png" alt="\epsilon^{n+1}_{i_x,i_y,i_z}
       +<p><img src="_images/math/11c52ddf6d9f9157b67c1334ccb39807a8ee777c.png" alt="\epsilon^{n+1}_{i_x,i_y,i_z}
        = \frac{-\Delta x^2 \Delta y^2 \Delta z^2 f_{i_x,i_y,i_z}
        + \Delta y^2 \Delta z^2 (\epsilon^n_{i_x-1,i_y,i_z} +
          \epsilon^n_{i_x+1,i_y,i_z})
       t@@ -494,42 +493,42 @@ The solution for the updated value takes the form:</p>
        </div><p>The difference between the current and updated value is termed the <em>normalized
        residual</em>:</p>
        <div class="math">
       -<p><img src="_images/math/c6e0b5935589b4f8948c91faa0de425bf2791db4.png" alt="r_{i_x,i_y,i_z} = \frac{(\epsilon^{n+1}_{i_x,i_y,i_z}
       +<p><img src="_images/math/a6f6238418bca503a9616e884c92c10d86d34fbc.png" alt="r_{i_x,i_y,i_z} = \frac{(\epsilon^{n+1}_{i_x,i_y,i_z}
        - \epsilon^n_{i_x,i_y,i_z})^2}{(\epsilon^{n+1}_{i_x,i_y,i_z})^2}"/></p>
       -</div><p>Note that the <img class="math" src="_images/math/eaf4418fbe935c15a606516d8f55dc380cd8e822.png" alt="\epsilon"/> values cannot be 0 due to the above normalization
       +</div><p>Note that the <img class="math" src="_images/math/19bc0073dde1bcd1a8e6a32b251e80cced668f04.png" alt="\epsilon"/> values cannot be 0 due to the above normalization
        of the residual.</p>
        <p>The updated values are at the end of the iteration stored as the current values,
        and the maximal value of the normalized residual is found. If this value is
        larger than a tolerance criteria, the procedure is repeated. The iterative
        procedure is ended if the number of iterations exceeds a defined limit.</p>
       -<p>After the values of <img class="math" src="_images/math/eaf4418fbe935c15a606516d8f55dc380cd8e822.png" alt="\epsilon"/> are found, they are used to find the new
       +<p>After the values of <img class="math" src="_images/math/19bc0073dde1bcd1a8e6a32b251e80cced668f04.png" alt="\epsilon"/> are found, they are used to find the new
        pressures and velocities:</p>
        <div class="math">
       -<p><img src="_images/math/c15067d0b2458f2c3bfd62743d7309f7e48213f9.png" alt="\bar{p}^{t+\Delta t} = \beta \bar{p}^t + \epsilon"/></p>
       +<p><img src="_images/math/e80afabbf8aabeec85a867c9c73d1f2df69743fa.png" alt="\bar{p}^{t+\Delta t} = \beta \bar{p}^t + \epsilon"/></p>
        </div><div class="math">
       -<p><img src="_images/math/e170ccb91735f4ecee2e5ad7821bf13f8c888c12.png" alt="\bar{\boldsymbol{v}}^{t+\Delta t} =
       +<p><img src="_images/math/26446b608e4ea66bd2ac56325be3b7dad3ec4261.png" alt="\bar{\boldsymbol{v}}^{t+\Delta t} =
        \bar{\boldsymbol{v}}^* - \frac{\Delta t}{\rho\phi} \nabla \epsilon"/></p>
        </div></div>
        <div class="section" id="boundary-conditions">
        <h2>Boundary conditions<a class="headerlink" href="#boundary-conditions" title="Permalink to this headline">¶</a></h2>
        <p>The lateral boundaries are periodic. This cannot be changed in the current
       -version of <tt class="docutils literal"><span class="pre">sphere</span></tt>. This means that the fluid properties at the paired,
       -parallel lateral (<img class="math" src="_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/> and <img class="math" src="_images/math/092e364e1d9d19ad5fffb0b46ef4cc7f2da02c1c.png" alt="y"/>) boundaries are identical. A flow
       +version of <code class="docutils literal"><span class="pre">sphere</span></code>. This means that the fluid properties at the paired,
       +parallel lateral (<img class="math" src="_images/math/188c175aac0a8a9c22499336711b5d7256407254.png" alt="x"/> and <img class="math" src="_images/math/b124ff74afb0914bb434e8fb849eb56d734412f8.png" alt="y"/>) boundaries are identical. A flow
        leaving through one side reappears on the opposite side.</p>
        <p>The top and bottom boundary conditions of the fluid grid can be either:
        prescribed pressure (Dirichlet), or prescribed velocity (Neumann). The
        (horizontal) velocities parallel to the boundaries are free to attain other
        values (free slip). The Dirichlet boundary condition is enforced by keeping the
       -value of <img class="math" src="_images/math/eaf4418fbe935c15a606516d8f55dc380cd8e822.png" alt="\epsilon"/> constant at the boundaries, e.g.:</p>
       +value of <img class="math" src="_images/math/19bc0073dde1bcd1a8e6a32b251e80cced668f04.png" alt="\epsilon"/> constant at the boundaries, e.g.:</p>
        <div class="math">
       -<p><img src="_images/math/01be15303939c78ee40a848a717482d046a9ad48.png" alt="\epsilon^{n+1}_{i_x,i_y,i_z = 1 \vee n_z}
       +<p><img src="_images/math/d04d640e7e6ee0fbcd4ba0e9fc6cb43f3e536d12.png" alt="\epsilon^{n+1}_{i_x,i_y,i_z = 1 \vee n_z}
        =
        \epsilon^{n}_{i_x,i_y,i_z = 1 \vee n_z}"/></p>
        </div><p>The Neumann boundary condition of no flow across the boundary is enforced by
       -setting the gradient of <img class="math" src="_images/math/eaf4418fbe935c15a606516d8f55dc380cd8e822.png" alt="\epsilon"/> perpendicular to the boundary to zero,
       +setting the gradient of <img class="math" src="_images/math/19bc0073dde1bcd1a8e6a32b251e80cced668f04.png" alt="\epsilon"/> perpendicular to the boundary to zero,
        e.g.:</p>
        <div class="math">
       -<p><img src="_images/math/bdc15139139f2cc22f5656d0456d7b432a72c4e8.png" alt="\nabla_z \epsilon^{n+1}_{i_x,i_y,i_z = 1 \vee n_z} = 0"/></p>
       +<p><img src="_images/math/f82d0eba51cfeff3da50b567ffa5126a8ed5b15f.png" alt="\nabla_z \epsilon^{n+1}_{i_x,i_y,i_z = 1 \vee n_z} = 0"/></p>
        </div></div>
        <div class="section" id="numerical-implementation">
        <h2>Numerical implementation<a class="headerlink" href="#numerical-implementation" title="Permalink to this headline">¶</a></h2>
       t@@ -542,7 +541,7 @@ e.g.:</p>
                  </div>
                </div>
              </div>
       -      <div class="sphinxsidebar">
       +      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
                <div class="sphinxsidebarwrapper">
          <h3><a href="index.html">Table Of Contents</a></h3>
          <ul>
       t@@ -563,29 +562,28 @@ e.g.:</p>
          <h4>Next topic</h4>
          <p class="topless"><a href="python_api.html"
                                title="next chapter">Python API</a></p>
       -  <h3>This Page</h3>
       -  <ul class="this-page-menu">
       -    <li><a href="_sources/cfd.txt"
       -           rel="nofollow">Show Source</a></li>
       -  </ul>
       -<div id="searchbox" style="display: none">
       +  <div role="note" aria-label="source link">
       +    <h3>This Page</h3>
       +    <ul class="this-page-menu">
       +      <li><a href="_sources/cfd.txt"
       +            rel="nofollow">Show Source</a></li>
       +    </ul>
       +   </div>
       +<div id="searchbox" style="display: none" role="search">
          <h3>Quick search</h3>
            <form class="search" action="search.html" method="get">
       -      <input type="text" name="q" />
       -      <input type="submit" value="Go" />
       +      <div><input type="text" name="q" /></div>
       +      <div><input type="submit" value="Go" /></div>
              <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 module, class or function name.
       -    </p>
        </div>
        <script type="text/javascript">$('#searchbox').show(0);</script>
                </div>
              </div>
              <div class="clearer"></div>
            </div>
       -    <div class="related">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -600,12 +598,12 @@ e.g.:</p>
                <li class="right" >
                  <a href="dem.html" title="Discrete element method"
                     >previous</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>
       -    <div class="footer">
       -        &copy; Copyright 2014, Anders Damsgaard.
       -      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
       +    <div class="footer" role="contentinfo">
       +        &#169; Copyright 2014, Anders Damsgaard.
       +      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
            </div>
          </body>
        </html>
        \ No newline at end of file
 (DIR) diff --git a/doc/html/dem.html b/doc/html/dem.html
       t@@ -1,5 +1,3 @@
       -
       -
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
       t@@ -8,15 +6,14 @@
          <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            
       -    <title>Discrete element method &mdash; sphere 1.00-alpha documentation</title>
       +    <title>Discrete element method &#8212; sphere 1.00-alpha documentation</title>
            
       -    <link rel="stylesheet" href="_static/default.css" type="text/css" />
       +    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
            <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       -    <link rel="stylesheet" href="_static/breathe.css" type="text/css" />
            
            <script type="text/javascript">
              var DOCUMENTATION_OPTIONS = {
       -        URL_ROOT:    '',
       +        URL_ROOT:    './',
                VERSION:     '1.00-alpha',
                COLLAPSE_INDEX: false,
                FILE_SUFFIX: '.html',
       t@@ -26,12 +23,14 @@
            <script type="text/javascript" src="_static/jquery.js"></script>
            <script type="text/javascript" src="_static/underscore.js"></script>
            <script type="text/javascript" src="_static/doctools.js"></script>
       +    <link rel="index" title="Index" href="genindex.html" />
       +    <link rel="search" title="Search" href="search.html" />
            <link rel="top" title="sphere 1.00-alpha documentation" href="index.html" />
            <link rel="next" title="Fluid simulation and particle-fluid interaction" href="cfd.html" />
       -    <link rel="prev" title="Introduction" href="introduction.html" /> 
       +    <link rel="prev" title="Introduction and Installation" href="introduction.html" /> 
          </head>
       -  <body>
       -    <div class="related">
       +  <body role="document">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -44,16 +43,16 @@
                  <a href="cfd.html" title="Fluid simulation and particle-fluid interaction"
                     accesskey="N">next</a> |</li>
                <li class="right" >
       -          <a href="introduction.html" title="Introduction"
       +          <a href="introduction.html" title="Introduction and Installation"
                     accesskey="P">previous</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>  
        
            <div class="document">
              <div class="documentwrapper">
                <div class="bodywrapper">
       -          <div class="body">
       +          <div class="body" role="main">
                    
          <div class="section" id="discrete-element-method">
        <h1>Discrete element method<a class="headerlink" href="#discrete-element-method" title="Permalink to this headline">¶</a></h1>
       t@@ -75,7 +74,7 @@ it simulates particles as separate entities, and calculates their positions,
        velocities, and accelerations through time. See Cundall and Strack (1979) and
        <a class="reference external" href="http://anders-dc.github.io/2013/10/16/the-discrete-element-method/">this blog post</a> for
        general introduction to the DEM. The following sections will highlight the
       -DEM implementation in <tt class="docutils literal"><span class="pre">sphere</span></tt>. Some of the details are also described in
       +DEM implementation in <code class="docutils literal"><span class="pre">sphere</span></code>. Some of the details are also described in
        Damsgaard et al. 2013. In the used notation, a bold symbol denotes a
        three-dimensional vector, and a dot denotes that the entity is a temporal
        derivative.</p>
       t@@ -83,10 +82,10 @@ derivative.</p>
        <h2>Contact search<a class="headerlink" href="#contact-search" title="Permalink to this headline">¶</a></h2>
        <p>Homogeneous cubic grid.</p>
        <div class="math">
       -<p><img src="_images/math/b2cd17a83bb89dc6b4ff954979dba3b2fbc8e043.png" alt="\delta_n^{ij} = ||\boldsymbol{x}^i - \boldsymbol{x}^j|| - (r^i + r^j)"/></p>
       -</div><p>where <img class="math" src="_images/math/b55ca7a0aa88ab7d58f4fc035317fdac39b17861.png" alt="r"/> is the particle radius, and <img class="math" src="_images/math/4f7d0530f1939c40a7c9e65b7ecee0e476ac4817.png" alt="\boldsymbol{x}"/> denotes the
       -positional vector of a particle, and <img class="math" src="_images/math/34857b3ba74ce5cd8607f3ebd23e9015908ada71.png" alt="i"/> and <img class="math" src="_images/math/8122aa89ea6e80784c6513d22787ad86e36ad0cc.png" alt="j"/> denote the indexes
       -of two particles. Negative values of <img class="math" src="_images/math/dd84cb843a3b1f44c09b5e49fb02ad7ff526920d.png" alt="\delta_n"/> denote that the particles
       +<p><img src="_images/math/7a1586ce67a2a8d709a374bb524625ca12559fd0.png" alt="\delta_n^{ij} = ||\boldsymbol{x}^i - \boldsymbol{x}^j|| - (r^i + r^j)"/></p>
       +</div><p>where <img class="math" src="_images/math/2ede365ad144ab396916ec60458da03860803078.png" alt="r"/> is the particle radius, and <img class="math" src="_images/math/80ba696b882e52c7e4d833039710ff8b4005e777.png" alt="\boldsymbol{x}"/> denotes the
       +positional vector of a particle, and <img class="math" src="_images/math/a581f053bbfa5115f42c13094857cdd12a37ec49.png" alt="i"/> and <img class="math" src="_images/math/d32c78b759903e3f4bd4fd2ce0b86358f7500c5d.png" alt="j"/> denote the indexes
       +of two particles. Negative values of <img class="math" src="_images/math/2822d1531935f7a072ebaa08533f4c5695731465.png" alt="\delta_n"/> denote that the particles
        are overlapping.</p>
        </div>
        <div class="section" id="contact-interaction">
       t@@ -97,12 +96,12 @@ interaction is decomposed into normal and tangential components, relative to the
        contact interface orientation. The normal vector to the contact interface is
        found by:</p>
        <div class="math">
       -<p><img src="_images/math/8bf1a4afd4cdf42bf3f7b27c9d9c99377a5d1898.png" alt="\boldsymbol{n}^{ij} =
       +<p><img src="_images/math/b2f647d3f64c336d2581f03558393e1dbb92c919.png" alt="\boldsymbol{n}^{ij} =
        \frac{\boldsymbol{x}^i - \boldsymbol{x}^j}
        {||\boldsymbol{x}^i - \boldsymbol{x}^j||}"/></p>
       -</div><p>The contact velocity <img class="math" src="_images/math/0dd32d7f3a000398f4982bdbe7cb1da880e33298.png" alt="\dot{\boldsymbol{\delta}}"/> is found by:</p>
       +</div><p>The contact velocity <img class="math" src="_images/math/522c9c96bc63142fa2b83abe960622dcafd75875.png" alt="\dot{\boldsymbol{\delta}}"/> is found by:</p>
        <div class="math">
       -<p><img src="_images/math/767762b2cd832672331c1421813b919298d7e3b8.png" alt="\dot{\boldsymbol{\delta}}^{ij} =
       +<p><img src="_images/math/3e0f4950bf4cf691a83dd643eddd240f024b9806.png" alt="\dot{\boldsymbol{\delta}}^{ij} =
        (\boldsymbol{x}^i - \boldsymbol{x}^j)
        + (r^i + \frac{\delta_n^{ij}}{2})
          (\boldsymbol{n}^{ij} \times \boldsymbol{\omega}^{i})
       t@@ -111,46 +110,46 @@ found by:</p>
        </div><p>The contact velocity is decomposed into normal and tangential components,
        relative to the contact interface. The normal component is:</p>
        <div class="math">
       -<p><img src="_images/math/c5671cc4a4d93628081c7bf7c0fd2cc6ff6c1cd3.png" alt="\dot{\delta}^{ij}_n =
       +<p><img src="_images/math/d5f7df718c75314abef3cc68396ac19229c2b55d.png" alt="\dot{\delta}^{ij}_n =
        -(\dot{\boldsymbol{\delta}}^{ij} \cdot \boldsymbol{n}^{ij})"/></p>
        </div><p>and the tangential velocity component is found as:</p>
        <div class="math">
       -<p><img src="_images/math/249d76d0a5d3773b138ce498e5df46c870f402b5.png" alt="\dot{\boldsymbol{\delta}}^{ij}_t =
       +<p><img src="_images/math/10eaed38fefc0732b59e674c14396ff74ea89c93.png" alt="\dot{\boldsymbol{\delta}}^{ij}_t =
        \dot{\boldsymbol{\delta}}^{ij}
        - \boldsymbol{n}^{ij}
          (\boldsymbol{n}^{ij} \cdot \dot{\boldsymbol{\delta}}^{ij})"/></p>
       -</div><p>where <img class="math" src="_images/math/6922b3e4505e825344dc326ade5f0c4be45ddd2f.png" alt="\boldsymbol{\omega}"/> is the rotational velocity vector of a
       +</div><p>where <img class="math" src="_images/math/b95363838d60e863c4cb530ba409fa56dd735728.png" alt="\boldsymbol{\omega}"/> is the rotational velocity vector of a
        particle. The total tangential displacement on the contact plane is found
        incrementally:</p>
        <div class="math">
       -<p><img src="_images/math/213a272621ce146fc9f90ce519bc3dc1ac3337e8.png" alt="\boldsymbol{\delta}_{t,\text{uncorrected}}^{ij} =
       +<p><img src="_images/math/904bfd360afed4f050929e89e2cc4f7c6f673e97.png" alt="\boldsymbol{\delta}_{t,\text{uncorrected}}^{ij} =
        \int_0^{t_c}
        \dot{\boldsymbol{\delta}}^{ij}_t \Delta t"/></p>
       -</div><p>where <img class="math" src="_images/math/dfc85915a4cda974f3bd5c3c52b7d2e59598a1eb.png" alt="t_c"/> is the duration of the contact and <img class="math" src="_images/math/a1ffc0a012620941fe660cedabff822ce7162eca.png" alt="\Delta t"/> is the
       +</div><p>where <img class="math" src="_images/math/42ea00932c36940fb8965e6e7f4fb2de5d616ee7.png" alt="t_c"/> is the duration of the contact and <img class="math" src="_images/math/5b4271afe7fc7c0ee84172e0ad19b82caf450c00.png" alt="\Delta t"/> is the
        computational time step length. The tangential contact interface displacement is
        set to zero when a contact pair no longer overlaps. At each time step, the value
       -of <img class="math" src="_images/math/bf7f4ceb6fce455ca0347cd7b704321b92e04f8c.png" alt="\boldsymbol{\delta}_t"/> is corrected for rotation of the contact
       +of <img class="math" src="_images/math/8cfa62046b3a57f37068f027941acea702d9bd8a.png" alt="\boldsymbol{\delta}_t"/> is corrected for rotation of the contact
        interface:</p>
        <div class="math">
       -<p><img src="_images/math/9c2a28916b33bc70a170729d2f237eabae96c0c0.png" alt="\boldsymbol{\delta}_t^{ij} = \boldsymbol{\delta}_{t,\text{uncorrected}}^{ij}
       +<p><img src="_images/math/ef61e2c4dfb9fcb1053c8d2557e00bcf3d871b80.png" alt="\boldsymbol{\delta}_t^{ij} = \boldsymbol{\delta}_{t,\text{uncorrected}}^{ij}
        - (\boldsymbol{n}
          (\boldsymbol{n} \cdot \boldsymbol{\delta}_{t,\text{uncorrected}}^{ij})"/></p>
        </div><p>With all the geometrical and kinetic components determined, the resulting forces
       -of the particle interaction can be determined using a contact model. <tt class="docutils literal"><span class="pre">sphere</span></tt>
       +of the particle interaction can be determined using a contact model. <code class="docutils literal"><span class="pre">sphere</span></code>
        features only one contact model in the normal direction to the contact; the
        linear-elastic-viscous (<em>Hookean</em> with viscous damping, or <em>Kelvin-Voigt</em>)
        contact model. The resulting force in the normal direction of the contact
       -interface on particle <img class="math" src="_images/math/34857b3ba74ce5cd8607f3ebd23e9015908ada71.png" alt="i"/> is:</p>
       +interface on particle <img class="math" src="_images/math/a581f053bbfa5115f42c13094857cdd12a37ec49.png" alt="i"/> is:</p>
        <div class="math">
       -<p><img src="_images/math/30d5d726338d5b3ac9d9b0003c564594fd6176ce.png" alt="\boldsymbol{f}_n^{ij} = \left(
       +<p><img src="_images/math/7d72e011d7f06b5df7ff7decf324f701eae33c3a.png" alt="\boldsymbol{f}_n^{ij} = \left(
        -k_n \delta_n^{ij} -\gamma_n \dot{\delta_n}^{ij}
        \right) \boldsymbol{n}^{ij}"/></p>
       -</div><p>The parameter <img class="math" src="_images/math/fd26dda3f4f507f3fdfaff4fe0b468bee54e7c09.png" alt="k_n"/> is the defined <a class="reference external" href="https://en.wikipedia.org/wiki/Hooke's_law">spring coefficient</a> in the normal direction of the
       -contact interface, and <img class="math" src="_images/math/55f6b5380d462f954b65d7a2cd05e02ff8cc832e.png" alt="\gamma_n"/> is the defined contact interface
       +</div><p>The parameter <img class="math" src="_images/math/66a1d8738af515286414e18d76a6e7f86b989afc.png" alt="k_n"/> is the defined <a class="reference external" href="https://en.wikipedia.org/wiki/Hooke's_law">spring coefficient</a> in the normal direction of the
       +contact interface, and <img class="math" src="_images/math/3640b174f15a44d33ad8f0622bc44dce8d8f1692.png" alt="\gamma_n"/> is the defined contact interface
        viscosity, also in the normal direction. The loss of energy in this interaction
       -due to the viscous component is for particle <img class="math" src="_images/math/34857b3ba74ce5cd8607f3ebd23e9015908ada71.png" alt="i"/> calculated as:</p>
       +due to the viscous component is for particle <img class="math" src="_images/math/a581f053bbfa5115f42c13094857cdd12a37ec49.png" alt="i"/> calculated as:</p>
        <div class="math">
       -<p><img src="_images/math/68e0c54203bc81b45ebe5dbf7d89fc61aa794c1e.png" alt="\dot{e}^i_v = \gamma_n (\dot{\delta}^{ij}_n)^2"/></p>
       +<p><img src="_images/math/4305b4408a39583be7a127c3039d65ff0cd8c954.png" alt="\dot{e}^i_v = \gamma_n (\dot{\delta}^{ij}_n)^2"/></p>
        </div><p>The tangential force is determined by either a viscous-frictional contact model,
        or a elastic-viscous-frictional contact model. The former contact model is very
        computationally efficient, but somewhat inaccurate relative to the mechanics of
       t@@ -158,24 +157,24 @@ real materials.  The latter contact model is therefore the default, even though
        it results in longer computational times. The tangential force in the
        visco-frictional contact model:</p>
        <div class="math">
       -<p><img src="_images/math/2e9b3638163af9fc450acac1aba9911e57a5c691.png" alt="\boldsymbol{f}_t^{ij} = -\gamma_t \dot{\boldsymbol{\delta}_t}^{ij}"/></p>
       -</div><p><img class="math" src="_images/math/55f6b5380d462f954b65d7a2cd05e02ff8cc832e.png" alt="\gamma_n"/> is the defined contact interface viscosity in the tangential
       +<p><img src="_images/math/f808e880e30ba99dc461a8dfdaaca903e8433bc1.png" alt="\boldsymbol{f}_t^{ij} = -\gamma_t \dot{\boldsymbol{\delta}_t}^{ij}"/></p>
       +</div><p><img class="math" src="_images/math/3640b174f15a44d33ad8f0622bc44dce8d8f1692.png" alt="\gamma_n"/> is the defined contact interface viscosity in the tangential
        direction. The tangential displacement along the contact interface
       -(<img class="math" src="_images/math/bf7f4ceb6fce455ca0347cd7b704321b92e04f8c.png" alt="\boldsymbol{\delta}_t"/>) is not calculated and stored for this contact
       +(<img class="math" src="_images/math/8cfa62046b3a57f37068f027941acea702d9bd8a.png" alt="\boldsymbol{\delta}_t"/>) is not calculated and stored for this contact
        model. The tangential force in the more realistic elastic-viscous-frictional
        contact model:</p>
        <div class="math">
       -<p><img src="_images/math/18950ecc92ecc7397337b5f39323453647e6434a.png" alt="\boldsymbol{f}_t^{ij} =
       +<p><img src="_images/math/e3d643e0cb551cafec2614062e50e2369d7949ab.png" alt="\boldsymbol{f}_t^{ij} =
        -k_t \boldsymbol{\delta}_t^{ij} -\gamma_t \dot{\boldsymbol{\delta}_t}^{ij}"/></p>
       -</div><p>The parameter <img class="math" src="_images/math/fd26dda3f4f507f3fdfaff4fe0b468bee54e7c09.png" alt="k_n"/> is the defined spring coefficient in the tangential
       +</div><p>The parameter <img class="math" src="_images/math/66a1d8738af515286414e18d76a6e7f86b989afc.png" alt="k_n"/> is the defined spring coefficient in the tangential
        direction of the contact interface. Note that the tangential force is only
       -found if the tangential displacement (<img class="math" src="_images/math/2ab5affb59066624277032c5076d7227db701fd9.png" alt="\delta_t"/>) or the tangential
       -velocity (<img class="math" src="_images/math/c51284f727b4cb7dac214d351742114146795074.png" alt="\dot{\delta}_t"/>) is non-zero, in order to avoid division by
       -zero. Otherwise it is defined as being <img class="math" src="_images/math/d5ba56a402179916023ef587910f0beff5ea1608.png" alt="[0,0,0]"/>.</p>
       +found if the tangential displacement (<img class="math" src="_images/math/d18b93994f644beb72edf4196d4efed3caf5b19c.png" alt="\delta_t"/>) or the tangential
       +velocity (<img class="math" src="_images/math/6b038d0d06f6fa38bcb85df9e6f8bed4155ded47.png" alt="\dot{\delta}_t"/>) is non-zero, in order to avoid division by
       +zero. Otherwise it is defined as being <img class="math" src="_images/math/b3cb421b6b325deff2bde26de2fa150f94c73246.png" alt="[0,0,0]"/>.</p>
        <p>For both types of contact model, the tangential force is limited by the Coulomb
        criterion of static and dynamic friction:</p>
        <div class="math">
       -<p><img src="_images/math/1d24d160d60604202abbae47aba869e96fb450aa.png" alt="||\boldsymbol{f}^{ij}_t|| \leq
       +<p><img src="_images/math/5cc160009025ab2cd3b77343dcea454fb8c93795.png" alt="||\boldsymbol{f}^{ij}_t|| \leq
        \begin{cases}
        \mu_s ||\boldsymbol{f}^{ij}_n|| &amp;
            \text{if} \quad ||\boldsymbol{f}_t^{ij}|| = 0 \\
       t@@ -186,7 +185,7 @@ criterion of static and dynamic friction:</p>
        reached, the tangential displacement along the contact interface is limited to
        this value:</p>
        <div class="math">
       -<p><img src="_images/math/ac73c7c8c596c32306e6ea203ebd039dd3538f06.png" alt="\boldsymbol{\delta}_t^{ij} =
       +<p><img src="_images/math/13ac3fb2c8f5e95101d362b1cb57b5fcb70e9a71.png" alt="\boldsymbol{\delta}_t^{ij} =
        \frac{1}{k_t} \left(
        \mu_d ||\boldsymbol{f}_n^{ij}||
        \frac{\boldsymbol{f}^{ij}_t}{||\boldsymbol{f}^{ij}_t||}
       t@@ -194,30 +193,30 @@ this value:</p>
        </div><p>If the tangential force reaches the Coulomb limit, the energy lost due to
        frictional dissipation is calculated as:</p>
        <div class="math">
       -<p><img src="_images/math/9d0d9139c35e749d7b4698592c91045d086d8b99.png" alt="\dot{e}^i_s = \frac{||\boldsymbol{f}^{ij}_t
       +<p><img src="_images/math/85bd2d6544d7812f80cc49d2b7e94be81541301c.png" alt="\dot{e}^i_s = \frac{||\boldsymbol{f}^{ij}_t
        \dot{\boldsymbol{\delta}}_t^{ij} \Delta t||}{\Delta t}"/></p>
        </div><p>The loss of energy by viscous dissipation in the tangential direction is not
        found.</p>
        </div>
        <div class="section" id="temporal-integration">
        <h2>Temporal integration<a class="headerlink" href="#temporal-integration" title="Permalink to this headline">¶</a></h2>
       -<p>In the DEM, the time is discretized into small steps (<img class="math" src="_images/math/a1ffc0a012620941fe660cedabff822ce7162eca.png" alt="\Delta t"/>). For each time
       +<p>In the DEM, the time is discretized into small steps (<img class="math" src="_images/math/5b4271afe7fc7c0ee84172e0ad19b82caf450c00.png" alt="\Delta t"/>). For each time
        step, the entire network of contacts is resolved, and the resulting forces and
        torques for each particle are found. With these values at hand, the new
        linear and rotational accelerations can be found using
        <a class="reference external" href="https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion">Newton&#8217;s second law</a>
       -of the motion of solid bodies. If a particle with mass <img class="math" src="_images/math/f5047d1e0cbb50ec208923a22cd517c55100fa7b.png" alt="m"/> at a point in time
       -experiences a sum of forces denoted <img class="math" src="_images/math/5ed37435199e280338e0e6dc0c225e4230719b0a.png" alt="\boldsymbol{F}"/>, the resultant acceleration
       -(<img class="math" src="_images/math/486938d1819df5972cb80ef2d101517b20412366.png" alt="\boldsymbol{a}"/>) can be found by rearranging Newton&#8217;s second law:</p>
       +of the motion of solid bodies. If a particle with mass <img class="math" src="_images/math/c4bb40dd65eae6c11b325989b14e0b8d35e4e3ef.png" alt="m"/> at a point in time
       +experiences a sum of forces denoted <img class="math" src="_images/math/8f28cef89dfa1989be5e263ac228a61a92736da9.png" alt="\boldsymbol{F}"/>, the resultant acceleration
       +(<img class="math" src="_images/math/701df29c5482cdf1e577052c537c176f5a12caf5.png" alt="\boldsymbol{a}"/>) can be found by rearranging Newton&#8217;s second law:</p>
        <div class="math">
       -<p><img src="_images/math/c78863bcf0ada3d17f98c21c00ca8b115f6b61de.png" alt="\boldsymbol{F} = m \boldsymbol{a} \Rightarrow \boldsymbol{a} = \frac{\boldsymbol{F}}{m}"/></p>
       +<p><img src="_images/math/5bab09e6e7765565f55e2f7119251f199f472a4a.png" alt="\boldsymbol{F} = m \boldsymbol{a} \Rightarrow \boldsymbol{a} = \frac{\boldsymbol{F}}{m}"/></p>
        </div><p>The new velocity and position is found by integrating the above equation
        with regards to time. The simplest integration scheme in this regard is the
        <a class="reference external" href="https://en.wikipedia.org/wiki/Euler_method">Euler method</a>:</p>
        <div class="math">
       -<p><img src="_images/math/fca2f0caf945233a44e5c1c1479f13d636edbf42.png" alt="\boldsymbol{v} = \boldsymbol{v}_{old} + \boldsymbol{a} \Delta t"/></p>
       +<p><img src="_images/math/a038fb9a65b9138665b4a5c9d0bbba6bdf3b6dbc.png" alt="\boldsymbol{v} = \boldsymbol{v}_{old} + \boldsymbol{a} \Delta t"/></p>
        </div><div class="math">
       -<p><img src="_images/math/93ddc61f81c056650ee9c02c3e62ed84e4a5327f.png" alt="\boldsymbol{p} = \boldsymbol{p}_{old} + \boldsymbol{v} \Delta t"/></p>
       +<p><img src="_images/math/ef4b452d768af650e6ddc2fd95aff430284f74f2.png" alt="\boldsymbol{p} = \boldsymbol{p}_{old} + \boldsymbol{v} \Delta t"/></p>
        </div></div>
        </div>
        
       t@@ -225,7 +224,7 @@ with regards to time. The simplest integration scheme in this regard is the
                  </div>
                </div>
              </div>
       -      <div class="sphinxsidebar">
       +      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
                <div class="sphinxsidebarwrapper">
          <h3><a href="index.html">Table Of Contents</a></h3>
          <ul>
       t@@ -239,33 +238,32 @@ with regards to time. The simplest integration scheme in this regard is the
        
          <h4>Previous topic</h4>
          <p class="topless"><a href="introduction.html"
       -                        title="previous chapter">Introduction</a></p>
       +                        title="previous chapter">Introduction and Installation</a></p>
          <h4>Next topic</h4>
          <p class="topless"><a href="cfd.html"
                                title="next chapter">Fluid simulation and particle-fluid interaction</a></p>
       -  <h3>This Page</h3>
       -  <ul class="this-page-menu">
       -    <li><a href="_sources/dem.txt"
       -           rel="nofollow">Show Source</a></li>
       -  </ul>
       -<div id="searchbox" style="display: none">
       +  <div role="note" aria-label="source link">
       +    <h3>This Page</h3>
       +    <ul class="this-page-menu">
       +      <li><a href="_sources/dem.txt"
       +            rel="nofollow">Show Source</a></li>
       +    </ul>
       +   </div>
       +<div id="searchbox" style="display: none" role="search">
          <h3>Quick search</h3>
            <form class="search" action="search.html" method="get">
       -      <input type="text" name="q" />
       -      <input type="submit" value="Go" />
       +      <div><input type="text" name="q" /></div>
       +      <div><input type="submit" value="Go" /></div>
              <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 module, class or function name.
       -    </p>
        </div>
        <script type="text/javascript">$('#searchbox').show(0);</script>
                </div>
              </div>
              <div class="clearer"></div>
            </div>
       -    <div class="related">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -278,14 +276,14 @@ with regards to time. The simplest integration scheme in this regard is the
                  <a href="cfd.html" title="Fluid simulation and particle-fluid interaction"
                     >next</a> |</li>
                <li class="right" >
       -          <a href="introduction.html" title="Introduction"
       +          <a href="introduction.html" title="Introduction and Installation"
                     >previous</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>
       -    <div class="footer">
       -        &copy; Copyright 2014, Anders Damsgaard.
       -      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
       +    <div class="footer" role="contentinfo">
       +        &#169; Copyright 2014, Anders Damsgaard.
       +      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
            </div>
          </body>
        </html>
        \ No newline at end of file
 (DIR) diff --git a/doc/html/genindex.html b/doc/html/genindex.html
       t@@ -1,7 +1,4 @@
        
       -
       -
       -
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
       t@@ -10,15 +7,14 @@
          <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            
       -    <title>Index &mdash; sphere 1.00-alpha documentation</title>
       +    <title>Index &#8212; sphere 1.00-alpha documentation</title>
            
       -    <link rel="stylesheet" href="_static/default.css" type="text/css" />
       +    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
            <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       -    <link rel="stylesheet" href="_static/breathe.css" type="text/css" />
            
            <script type="text/javascript">
              var DOCUMENTATION_OPTIONS = {
       -        URL_ROOT:    '',
       +        URL_ROOT:    './',
                VERSION:     '1.00-alpha',
                COLLAPSE_INDEX: false,
                FILE_SUFFIX: '.html',
       t@@ -28,10 +24,12 @@
            <script type="text/javascript" src="_static/jquery.js"></script>
            <script type="text/javascript" src="_static/underscore.js"></script>
            <script type="text/javascript" src="_static/doctools.js"></script>
       +    <link rel="index" title="Index" href="#" />
       +    <link rel="search" title="Search" href="search.html" />
            <link rel="top" title="sphere 1.00-alpha documentation" href="index.html" /> 
          </head>
       -  <body>
       -    <div class="related">
       +  <body role="document">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -40,14 +38,14 @@
                <li class="right" >
                  <a href="py-modindex.html" title="Python Module Index"
                     >modules</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>  
        
            <div class="document">
              <div class="documentwrapper">
                <div class="bodywrapper">
       -          <div class="body">
       +          <div class="body" role="main">
                    
        
        <h1 id="index">Index</h1>
       t@@ -60,6 +58,7 @@
         | <a href="#E"><strong>E</strong></a>
         | <a href="#F"><strong>F</strong></a>
         | <a href="#G"><strong>G</strong></a>
       + | <a href="#H"><strong>H</strong></a>
         | <a href="#I"><strong>I</strong></a>
         | <a href="#K"><strong>K</strong></a>
         | <a href="#L"><strong>L</strong></a>
       t@@ -83,12 +82,16 @@
          </dt>
        
              
       -  <dt><a href="python_api.html#sphere.sim.addParticle">addParticle() (sphere.sim method)</a>
       +  <dt><a href="python_api.html#sphere.sim.adaptiveGrid">adaptiveGrid() (sphere.sim method)</a>
          </dt>
        
          </dl></td>
          <td style="width: 33%" valign="top"><dl>
              
       +  <dt><a href="python_api.html#sphere.sim.addParticle">addParticle() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.adjustUpperWall">adjustUpperWall() (sphere.sim method)</a>
          </dt>
        
       t@@ -106,12 +109,12 @@
          <dt><a href="python_api.html#sphere.sim.bond">bond() (sphere.sim method)</a>
          </dt>
        
       +  </dl></td>
       +  <td style="width: 33%" valign="top"><dl>
              
          <dt><a href="python_api.html#sphere.sim.bondsRose">bondsRose() (sphere.sim method)</a>
          </dt>
        
       -  </dl></td>
       -  <td style="width: 33%" valign="top"><dl>
              
          <dt><a href="python_api.html#sphere.sim.bulkPorosity">bulkPorosity() (sphere.sim method)</a>
          </dt>
       t@@ -123,6 +126,10 @@
        <table style="width: 100%" class="indextable genindextable"><tr>
          <td style="width: 33%" valign="top"><dl>
              
       +  <dt><a href="python_api.html#sphere.sim.cellSize">cellSize() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.checkerboardColors">checkerboardColors() (sphere.sim method)</a>
          </dt>
        
       t@@ -147,6 +154,18 @@
          </dl></td>
          <td style="width: 33%" valign="top"><dl>
              
       +  <dt><a href="python_api.html#sphere.sim.contactParticleArea">contactParticleArea() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.contactSurfaceArea">contactSurfaceArea() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.convergence">convergence() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.convert">convert() (in module sphere)</a>
          </dt>
        
       t@@ -158,6 +177,10 @@
          <dt><a href="python_api.html#sphere.sim.currentNormalStress">currentNormalStress() (sphere.sim method)</a>
          </dt>
        
       +      
       +  <dt><a href="python_api.html#sphere.sim.currentTime">currentTime() (sphere.sim method)</a>
       +  </dt>
       +
          </dl></td>
        </tr></table>
        
       t@@ -176,16 +199,28 @@
          <dt><a href="python_api.html#sphere.sim.deleteAllParticles">deleteAllParticles() (sphere.sim method)</a>
          </dt>
        
       +      
       +  <dt><a href="python_api.html#sphere.sim.deleteParticle">deleteParticle() (sphere.sim method)</a>
       +  </dt>
       +
          </dl></td>
          <td style="width: 33%" valign="top"><dl>
              
       -  <dt><a href="python_api.html#sphere.sim.deleteParticle">deleteParticle() (sphere.sim method)</a>
       +  <dt><a href="sphere_internals.html#_CPPv23DEM">DEM (C++ class)</a>
          </dt>
        
              
          <dt><a href="python_api.html#sphere.sim.disableFluidPressureModulation">disableFluidPressureModulation() (sphere.sim method)</a>
          </dt>
        
       +      
       +  <dt><a href="python_api.html#sphere.sim.disableTopWallNormalStressModulation">disableTopWallNormalStressModulation() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.dry">dry() (sphere.sim method)</a>
       +  </dt>
       +
          </dl></td>
        </tr></table>
        
       t@@ -203,16 +238,56 @@
        <table style="width: 100%" class="indextable genindextable"><tr>
          <td style="width: 33%" valign="top"><dl>
              
       -  <dt><a href="python_api.html#sphere.sim.forcechains">forcechains() (sphere.sim method)</a>
       +  <dt><a href="python_api.html#sphere.sim.findAllAverageParticlePairAreas">findAllAverageParticlePairAreas() (sphere.sim method)</a>
          </dt>
        
              
       -  <dt><a href="python_api.html#sphere.sim.forcechainsRose">forcechainsRose() (sphere.sim method)</a>
       +  <dt><a href="python_api.html#sphere.sim.findAllContactSurfaceAreas">findAllContactSurfaceAreas() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.findContactStresses">findContactStresses() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.findCoordinationNumber">findCoordinationNumber() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.findHydraulicConductivities">findHydraulicConductivities() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.findLoadedContacts">findLoadedContacts() (sphere.sim method)</a>
          </dt>
        
          </dl></td>
          <td style="width: 33%" valign="top"><dl>
              
       +  <dt><a href="python_api.html#sphere.sim.findMeanCoordinationNumber">findMeanCoordinationNumber() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.findNormalForces">findNormalForces() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.findOverlaps">findOverlaps() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.findPermeabilities">findPermeabilities() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.forcechains">forcechains() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.forcechainsRose">forcechainsRose() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.frictionalEnergy">frictionalEnergy() (sphere.sim method)</a>
          </dt>
        
       t@@ -235,10 +310,38 @@
          </dl></td>
        </tr></table>
        
       +<h2 id="H">H</h2>
       +<table style="width: 100%" class="indextable genindextable"><tr>
       +  <td style="width: 33%" valign="top"><dl>
       +      
       +  <dt><a href="python_api.html#sphere.sim.hydraulicConductivity">hydraulicConductivity() (sphere.sim method)</a>
       +  </dt>
       +
       +  </dl></td>
       +  <td style="width: 33%" valign="top"><dl>
       +      
       +  <dt><a href="python_api.html#sphere.sim.hydraulicDiffusivity">hydraulicDiffusivity() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.hydraulicPermeability">hydraulicPermeability() (sphere.sim method)</a>
       +  </dt>
       +
       +  </dl></td>
       +</tr></table>
       +
        <h2 id="I">I</h2>
        <table style="width: 100%" class="indextable genindextable"><tr>
          <td style="width: 33%" valign="top"><dl>
              
       +  <dt><a href="python_api.html#sphere.sim.id">id() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.idAppend">idAppend() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.inertiaParameterPlanarShear">inertiaParameterPlanarShear() (sphere.sim method)</a>
          </dt>
        
       t@@ -250,12 +353,12 @@
          <dt><a href="python_api.html#sphere.sim.initGrid">initGrid() (sphere.sim method)</a>
          </dt>
        
       +  </dl></td>
       +  <td style="width: 33%" valign="top"><dl>
              
          <dt><a href="python_api.html#sphere.sim.initGridAndWorldsize">initGridAndWorldsize() (sphere.sim method)</a>
          </dt>
        
       -  </dl></td>
       -  <td style="width: 33%" valign="top"><dl>
              
          <dt><a href="python_api.html#sphere.sim.initGridPos">initGridPos() (sphere.sim method)</a>
          </dt>
       t@@ -289,6 +392,12 @@
        <table style="width: 100%" class="indextable genindextable"><tr>
          <td style="width: 33%" valign="top"><dl>
              
       +  <dt><a href="python_api.html#sphere.sim.largestFluidTimeStep">largestFluidTimeStep() (sphere.sim method)</a>
       +  </dt>
       +
       +  </dl></td>
       +  <td style="width: 33%" valign="top"><dl>
       +      
          <dt><a href="python_api.html#sphere.sim.largestMass">largestMass() (sphere.sim method)</a>
          </dt>
        
       t@@ -302,12 +411,12 @@
          <dt><a href="python_api.html#sphere.sim.mass">mass() (sphere.sim method)</a>
          </dt>
        
       +  </dl></td>
       +  <td style="width: 33%" valign="top"><dl>
              
          <dt><a href="python_api.html#sphere.sim.momentOfInertia">momentOfInertia() (sphere.sim method)</a>
          </dt>
        
       -  </dl></td>
       -  <td style="width: 33%" valign="top"><dl>
              
          <dt><a href="python_api.html#sphere.sim.momentum">momentum() (sphere.sim method)</a>
          </dt>
       t@@ -337,6 +446,10 @@
          </dt>
        
              
       +  <dt><a href="python_api.html#sphere.sim.plotContacts">plotContacts() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.plotConvergence">plotConvergence() (sphere.sim method)</a>
          </dt>
        
       t@@ -371,6 +484,10 @@
          </dt>
        
              
       +  <dt><a href="python_api.html#sphere.sim.plotSinFunction">plotSinFunction() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.porosities">porosities() (sphere.sim method)</a>
          </dt>
        
       t@@ -404,10 +521,14 @@
          <dt><a href="python_api.html#sphere.sim.readsecond">readsecond() (sphere.sim method)</a>
          </dt>
        
       +      
       +  <dt><a href="python_api.html#sphere.sim.readstep">readstep() (sphere.sim method)</a>
       +  </dt>
       +
          </dl></td>
          <td style="width: 33%" valign="top"><dl>
              
       -  <dt><a href="python_api.html#sphere.sim.readstep">readstep() (sphere.sim method)</a>
       +  <dt><a href="python_api.html#sphere.sim.readTime">readTime() (sphere.sim method)</a>
          </dt>
        
              
       t@@ -421,6 +542,10 @@
        
              </dl></dd>
              
       +  <dt><a href="python_api.html#sphere.sim.ReynoldsNumber">ReynoldsNumber() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.rotationalEnergy">rotationalEnergy() (sphere.sim method)</a>
          </dt>
        
       t@@ -441,6 +566,10 @@
        <table style="width: 100%" class="indextable genindextable"><tr>
          <td style="width: 33%" valign="top"><dl>
              
       +  <dt><a href="python_api.html#sphere.sim.scaleSize">scaleSize() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.setBeta">setBeta() (sphere.sim method)</a>
          </dt>
        
       t@@ -457,6 +586,14 @@
          </dt>
        
              
       +  <dt><a href="python_api.html#sphere.sim.setDynamicFriction">setDynamicFriction() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.setFluidBottomFixedFlux">setFluidBottomFixedFlux() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.setFluidBottomFixedPressure">setFluidBottomFixedPressure() (sphere.sim method)</a>
          </dt>
        
       t@@ -469,10 +606,22 @@
          </dt>
        
              
       +  <dt><a href="python_api.html#sphere.sim.setFluidCompressibility">setFluidCompressibility() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.setFluidDensity">setFluidDensity() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.setFluidPressureModulation">setFluidPressureModulation() (sphere.sim method)</a>
          </dt>
        
              
       +  <dt><a href="python_api.html#sphere.sim.setFluidTopFixedFlux">setFluidTopFixedFlux() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.setFluidTopFixedPressure">setFluidTopFixedPressure() (sphere.sim method)</a>
          </dt>
        
       t@@ -485,6 +634,34 @@
          </dt>
        
              
       +  <dt><a href="python_api.html#sphere.sim.setFluidViscosity">setFluidViscosity() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.setFluidXFixedPressure">setFluidXFixedPressure() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.setFluidXNoFlow">setFluidXNoFlow() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.setFluidXPeriodic">setFluidXPeriodic() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.setFluidYFixedPressure">setFluidYFixedPressure() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.setFluidYNoFlow">setFluidYNoFlow() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.setFluidYPeriodic">setFluidYPeriodic() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.setGamma">setGamma() (sphere.sim method)</a>
          </dt>
        
       t@@ -495,6 +672,26 @@
          </dt>
        
              
       +  <dt><a href="python_api.html#sphere.sim.setPermeabilityGrainSize">setPermeabilityGrainSize() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.setPermeabilityPrefactor">setPermeabilityPrefactor() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.setStaticFriction">setStaticFriction() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.setStiffnessNormal">setStiffnessNormal() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.setStiffnessTangential">setStiffnessTangential() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.setTheta">setTheta() (sphere.sim method)</a>
          </dt>
        
       t@@ -503,6 +700,14 @@
          </dt>
        
              
       +  <dt><a href="python_api.html#sphere.sim.setTopWallNormalStressModulation">setTopWallNormalStressModulation() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.setYoungsModulus">setYoungsModulus() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.shear">shear() (sphere.sim method)</a>
          </dt>
        
       t@@ -511,6 +716,10 @@
          </dt>
        
              
       +  <dt><a href="python_api.html#sphere.sim.shearDisplacement">shearDisplacement() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.shearStrain">shearStrain() (sphere.sim method)</a>
          </dt>
        
       t@@ -519,10 +728,22 @@
          </dt>
        
              
       +  <dt><a href="python_api.html#sphere.sim.shearStress">shearStress() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.shearVel">shearVel() (sphere.sim method)</a>
          </dt>
        
              
       +  <dt><a href="python_api.html#sphere.sim.shearVelocity">shearVelocity() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.show">show() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim">sim (class in sphere)</a>
          </dt>
        
       t@@ -535,6 +756,10 @@
          </dt>
        
              
       +  <dt><a href="python_api.html#sphere.sim.staticGrid">staticGrid() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.status">status() (in module sphere)</a>
          </dt>
        
       t@@ -544,6 +769,10 @@
          </dt>
        
              </dl></dd>
       +      
       +  <dt><a href="python_api.html#sphere.sim.surfaceArea">surfaceArea() (sphere.sim method)</a>
       +  </dt>
       +
          </dl></td>
        </tr></table>
        
       t@@ -567,6 +796,10 @@
          </dt>
        
              
       +  <dt><a href="python_api.html#sphere.sim.torqueScriptPenguin">torqueScriptPenguin() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.totalFrictionalEnergy">totalFrictionalEnergy() (sphere.sim method)</a>
          </dt>
        
       t@@ -577,6 +810,10 @@
          </dt>
        
              
       +  <dt><a href="python_api.html#sphere.sim.totalMass">totalMass() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.totalMomentum">totalMomentum() (sphere.sim method)</a>
          </dt>
        
       t@@ -622,12 +859,12 @@
          </dt>
        
              </dl></dd>
       +  </dl></td>
       +  <td style="width: 33%" valign="top"><dl>
              
          <dt><a href="python_api.html#sphere.sim.viscousEnergy">viscousEnergy() (sphere.sim method)</a>
          </dt>
        
       -  </dl></td>
       -  <td style="width: 33%" valign="top"><dl>
              
          <dt><a href="python_api.html#sphere.sim.visualize">visualize() (sphere.sim method)</a>
          </dt>
       t@@ -647,16 +884,24 @@
        <table style="width: 100%" class="indextable genindextable"><tr>
          <td style="width: 33%" valign="top"><dl>
              
       -  <dt><a href="python_api.html#sphere.sim.writebin">writebin() (sphere.sim method)</a>
       +  <dt><a href="python_api.html#sphere.sim.wall0iz">wall0iz() (sphere.sim method)</a>
          </dt>
        
              
       -  <dt><a href="python_api.html#sphere.sim.writeFluidVTK">writeFluidVTK() (sphere.sim method)</a>
       +  <dt><a href="python_api.html#sphere.sim.wet">wet() (sphere.sim method)</a>
       +  </dt>
       +
       +      
       +  <dt><a href="python_api.html#sphere.sim.writebin">writebin() (sphere.sim method)</a>
          </dt>
        
          </dl></td>
          <td style="width: 33%" valign="top"><dl>
              
       +  <dt><a href="python_api.html#sphere.sim.writeFluidVTK">writeFluidVTK() (sphere.sim method)</a>
       +  </dt>
       +
       +      
          <dt><a href="python_api.html#sphere.sim.writeVTK">writeVTK() (sphere.sim method)</a>
          </dt>
        
       t@@ -664,6 +909,10 @@
          <dt><a href="python_api.html#sphere.sim.writeVTKall">writeVTKall() (sphere.sim method)</a>
          </dt>
        
       +      
       +  <dt><a href="python_api.html#sphere.sim.writeVTKforces">writeVTKforces() (sphere.sim method)</a>
       +  </dt>
       +
          </dl></td>
        </tr></table>
        
       t@@ -682,29 +931,26 @@
                  </div>
                </div>
              </div>
       -      <div class="sphinxsidebar">
       +      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
                <div class="sphinxsidebarwrapper">
        
           
        
       -<div id="searchbox" style="display: none">
       +<div id="searchbox" style="display: none" role="search">
          <h3>Quick search</h3>
            <form class="search" action="search.html" method="get">
       -      <input type="text" name="q" />
       -      <input type="submit" value="Go" />
       +      <div><input type="text" name="q" /></div>
       +      <div><input type="submit" value="Go" /></div>
              <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 module, class or function name.
       -    </p>
        </div>
        <script type="text/javascript">$('#searchbox').show(0);</script>
                </div>
              </div>
              <div class="clearer"></div>
            </div>
       -    <div class="related">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -713,12 +959,12 @@
                <li class="right" >
                  <a href="py-modindex.html" title="Python Module Index"
                     >modules</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>
       -    <div class="footer">
       -        &copy; Copyright 2014, Anders Damsgaard.
       -      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
       +    <div class="footer" role="contentinfo">
       +        &#169; Copyright 2014, Anders Damsgaard.
       +      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
            </div>
          </body>
        </html>
        \ No newline at end of file
 (DIR) diff --git a/doc/html/index.html b/doc/html/index.html
       t@@ -1,5 +1,3 @@
       -
       -
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
       t@@ -8,15 +6,14 @@
          <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            
       -    <title>The sphere documentation &mdash; sphere 1.00-alpha documentation</title>
       +    <title>The sphere documentation &#8212; sphere 1.00-alpha documentation</title>
            
       -    <link rel="stylesheet" href="_static/default.css" type="text/css" />
       +    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
            <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       -    <link rel="stylesheet" href="_static/breathe.css" type="text/css" />
            
            <script type="text/javascript">
              var DOCUMENTATION_OPTIONS = {
       -        URL_ROOT:    '',
       +        URL_ROOT:    './',
                VERSION:     '1.00-alpha',
                COLLAPSE_INDEX: false,
                FILE_SUFFIX: '.html',
       t@@ -26,11 +23,13 @@
            <script type="text/javascript" src="_static/jquery.js"></script>
            <script type="text/javascript" src="_static/underscore.js"></script>
            <script type="text/javascript" src="_static/doctools.js"></script>
       +    <link rel="index" title="Index" href="genindex.html" />
       +    <link rel="search" title="Search" href="search.html" />
            <link rel="top" title="sphere 1.00-alpha documentation" href="#" />
       -    <link rel="next" title="Introduction" href="introduction.html" /> 
       +    <link rel="next" title="Introduction and Installation" href="introduction.html" /> 
          </head>
       -  <body>
       -    <div class="related">
       +  <body role="document">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -40,36 +39,36 @@
                  <a href="py-modindex.html" title="Python Module Index"
                     >modules</a> |</li>
                <li class="right" >
       -          <a href="introduction.html" title="Introduction"
       +          <a href="introduction.html" title="Introduction and Installation"
                     accesskey="N">next</a> |</li>
       -        <li><a href="#">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="#">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>  
        
            <div class="document">
              <div class="documentwrapper">
                <div class="bodywrapper">
       -          <div class="body">
       +          <div class="body" role="main">
                    
          <div class="section" id="the-sphere-documentation">
        <h1>The sphere documentation<a class="headerlink" href="#the-sphere-documentation" title="Permalink to this headline">¶</a></h1>
       -<p>This is the official documentation for the <tt class="docutils literal"><span class="pre">sphere</span></tt> discrete element modelling
       +<p>This is the official documentation for the <code class="docutils literal"><span class="pre">sphere</span></code> discrete element modelling
        software. This document aims at guiding the installation process, documenting
        the usage, and explaining the relevant theory.</p>
       -<p><tt class="docutils literal"><span class="pre">sphere</span></tt> is developed by Anders Damsgaard as part as his Ph.D. project, under
       +<p><code class="docutils literal"><span class="pre">sphere</span></code> is developed by Anders Damsgaard as part as his Ph.D. project, under
        supervision of David Lundbek Egholm and Jan A. Piotrowski, all of the Department
        of Geoscience, Aarhus University, Denmark. The author welcomes interested third
        party developers. This document is a work in progress.</p>
       -<p>Contact: Anders Damsgaard, <a class="reference external" href="http://cs.au.dk/~adc">http://cs.au.dk/~adc</a>,
       +<p>Contact: Anders Damsgaard, <a class="reference external" href="https://adamsgaard.dk">https://adamsgaard.dk</a>,
        <a class="reference external" href="mailto:anders&#46;damsgaard&#37;&#52;&#48;geo&#46;au&#46;dk">mailto:anders<span>&#46;</span>damsgaard<span>&#64;</span>geo<span>&#46;</span>au<span>&#46;</span>dk</a></p>
        <div class="section" id="contents">
        <h2>Contents<a class="headerlink" href="#contents" title="Permalink to this headline">¶</a></h2>
        <div class="toctree-wrapper compound">
        <ul>
       -<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a><ul>
       +<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction and Installation</a><ul>
        <li class="toctree-l2"><a class="reference internal" href="introduction.html#requirements">Requirements</a></li>
        <li class="toctree-l2"><a class="reference internal" href="introduction.html#obtaining-sphere">Obtaining sphere</a></li>
       -<li class="toctree-l2"><a class="reference internal" href="introduction.html#building-sphere">Building <tt class="docutils literal"><span class="pre">sphere</span></tt></a></li>
       +<li class="toctree-l2"><a class="reference internal" href="introduction.html#building-sphere">Building <code class="docutils literal"><span class="pre">sphere</span></code></a></li>
        <li class="toctree-l2"><a class="reference internal" href="introduction.html#updating-sphere">Updating sphere</a></li>
        <li class="toctree-l2"><a class="reference internal" href="introduction.html#work-flow">Work flow</a></li>
        </ul>
       t@@ -91,7 +90,12 @@ party developers. This document is a work in progress.</p>
        </li>
        <li class="toctree-l1"><a class="reference internal" href="python_api.html">Python API</a><ul>
        <li class="toctree-l2"><a class="reference internal" href="python_api.html#sample-usage">Sample usage</a></li>
       -<li class="toctree-l2"><a class="reference internal" href="python_api.html#module-sphere">The <tt class="docutils literal"><span class="pre">sphere</span></tt> module</a></li>
       +<li class="toctree-l2"><a class="reference internal" href="python_api.html#module-sphere">The <code class="docutils literal"><span class="pre">sphere</span></code> module</a></li>
       +</ul>
       +</li>
       +<li class="toctree-l1"><a class="reference internal" href="sphere_internals.html">sphere internals</a><ul>
       +<li class="toctree-l2"><a class="reference internal" href="sphere_internals.html#numerical-algorithm">Numerical algorithm</a></li>
       +<li class="toctree-l2"><a class="reference internal" href="sphere_internals.html#c-reference">C++ reference</a></li>
        </ul>
        </li>
        </ul>
       t@@ -100,8 +104,8 @@ party developers. This document is a work in progress.</p>
        <div class="section" id="indices-and-tables">
        <h2>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h2>
        <ul class="simple">
       -<li><a class="reference internal" href="genindex.html"><em>Index</em></a></li>
       -<li><a class="reference internal" href="search.html"><em>Search Page</em></a></li>
       +<li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
       +<li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
        </ul>
        </div>
        </div>
       t@@ -110,14 +114,12 @@ party developers. This document is a work in progress.</p>
                  </div>
                </div>
              </div>
       -      <div class="sphinxsidebar">
       +      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
                <div class="sphinxsidebarwrapper">
          <h3><a href="#">Table Of Contents</a></h3>
          <ul>
        <li><a class="reference internal" href="#">The sphere documentation</a><ul>
       -<li><a class="reference internal" href="#contents">Contents</a><ul>
       -</ul>
       -</li>
       +<li><a class="reference internal" href="#contents">Contents</a></li>
        <li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
        </ul>
        </li>
       t@@ -125,30 +127,29 @@ party developers. This document is a work in progress.</p>
        
          <h4>Next topic</h4>
          <p class="topless"><a href="introduction.html"
       -                        title="next chapter">Introduction</a></p>
       -  <h3>This Page</h3>
       -  <ul class="this-page-menu">
       -    <li><a href="_sources/index.txt"
       -           rel="nofollow">Show Source</a></li>
       -  </ul>
       -<div id="searchbox" style="display: none">
       +                        title="next chapter">Introduction and Installation</a></p>
       +  <div role="note" aria-label="source link">
       +    <h3>This Page</h3>
       +    <ul class="this-page-menu">
       +      <li><a href="_sources/index.txt"
       +            rel="nofollow">Show Source</a></li>
       +    </ul>
       +   </div>
       +<div id="searchbox" style="display: none" role="search">
          <h3>Quick search</h3>
            <form class="search" action="search.html" method="get">
       -      <input type="text" name="q" />
       -      <input type="submit" value="Go" />
       +      <div><input type="text" name="q" /></div>
       +      <div><input type="submit" value="Go" /></div>
              <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 module, class or function name.
       -    </p>
        </div>
        <script type="text/javascript">$('#searchbox').show(0);</script>
                </div>
              </div>
              <div class="clearer"></div>
            </div>
       -    <div class="related">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -158,14 +159,14 @@ party developers. This document is a work in progress.</p>
                  <a href="py-modindex.html" title="Python Module Index"
                     >modules</a> |</li>
                <li class="right" >
       -          <a href="introduction.html" title="Introduction"
       +          <a href="introduction.html" title="Introduction and Installation"
                     >next</a> |</li>
       -        <li><a href="#">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="#">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>
       -    <div class="footer">
       -        &copy; Copyright 2014, Anders Damsgaard.
       -      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
       +    <div class="footer" role="contentinfo">
       +        &#169; Copyright 2014, Anders Damsgaard.
       +      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
            </div>
          </body>
        </html>
        \ No newline at end of file
 (DIR) diff --git a/doc/html/introduction.html b/doc/html/introduction.html
       t@@ -1,5 +1,3 @@
       -
       -
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
       t@@ -8,15 +6,14 @@
          <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            
       -    <title>Introduction &mdash; sphere 1.00-alpha documentation</title>
       +    <title>Introduction and Installation &#8212; sphere 1.00-alpha documentation</title>
            
       -    <link rel="stylesheet" href="_static/default.css" type="text/css" />
       +    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
            <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       -    <link rel="stylesheet" href="_static/breathe.css" type="text/css" />
            
            <script type="text/javascript">
              var DOCUMENTATION_OPTIONS = {
       -        URL_ROOT:    '',
       +        URL_ROOT:    './',
                VERSION:     '1.00-alpha',
                COLLAPSE_INDEX: false,
                FILE_SUFFIX: '.html',
       t@@ -26,12 +23,14 @@
            <script type="text/javascript" src="_static/jquery.js"></script>
            <script type="text/javascript" src="_static/underscore.js"></script>
            <script type="text/javascript" src="_static/doctools.js"></script>
       +    <link rel="index" title="Index" href="genindex.html" />
       +    <link rel="search" title="Search" href="search.html" />
            <link rel="top" title="sphere 1.00-alpha documentation" href="index.html" />
            <link rel="next" title="Discrete element method" href="dem.html" />
            <link rel="prev" title="The sphere documentation" href="index.html" /> 
          </head>
       -  <body>
       -    <div class="related">
       +  <body role="document">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -46,34 +45,34 @@
                <li class="right" >
                  <a href="index.html" title="The sphere documentation"
                     accesskey="P">previous</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>  
        
            <div class="document">
              <div class="documentwrapper">
                <div class="bodywrapper">
       -          <div class="body">
       +          <div class="body" role="main">
                    
       -  <div class="section" id="introduction">
       -<h1>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h1>
       -<p>The <tt class="docutils literal"><span class="pre">sphere</span></tt>-software is used for three-dimensional discrete element method
       +  <div class="section" id="introduction-and-installation">
       +<h1>Introduction and Installation<a class="headerlink" href="#introduction-and-installation" title="Permalink to this headline">¶</a></h1>
       +<p>The <code class="docutils literal"><span class="pre">sphere</span></code>-software is used for three-dimensional discrete element method
        (DEM) particle simulations. The source code is written in C++, CUDA C and
        Python, and is compiled by the user. The main computations are performed on the
        graphics processing unit (GPU) using NVIDIA&#8217;s general purpose parallel computing
        architecture, CUDA. Simulation setup and data analysis is performed with the
        included Python API.</p>
       -<p>The ultimate aim of the <tt class="docutils literal"><span class="pre">sphere</span></tt> software is to simulate soft-bedded subglacial
       +<p>The ultimate aim of the <code class="docutils literal"><span class="pre">sphere</span></code> software is to simulate soft-bedded subglacial
        conditions, while retaining the flexibility to perform simulations of granular
        material in other environments.</p>
        <p>The purpose of this documentation is to provide the user with a walk-through of
        the installation, work-flow, data-analysis and visualization methods of
       -<tt class="docutils literal"><span class="pre">sphere</span></tt>. In addition, the <tt class="docutils literal"><span class="pre">sphere</span></tt> internals are exposed to provide a way of
       +<code class="docutils literal"><span class="pre">sphere</span></code>. In addition, the <code class="docutils literal"><span class="pre">sphere</span></code> internals are exposed to provide a way of
        understanding of the discrete element method numerical routines taking place.</p>
        <div class="admonition note">
        <p class="first admonition-title">Note</p>
       -<p class="last">Command examples in this document starting with the symbol <tt class="docutils literal"><span class="pre">$</span></tt> are
       -meant to be executed in the shell of the operational system, and <tt class="docutils literal"><span class="pre">&gt;&gt;&gt;</span></tt>
       +<p class="last">Command examples in this document starting with the symbol <code class="docutils literal"><span class="pre">$</span></code> are
       +meant to be executed in the shell of the operational system, and <code class="docutils literal"><span class="pre">&gt;&gt;&gt;</span></code>
        means execution in Python. <a class="reference external" href="http://ipython.org">IPython</a> is an excellent,
        interactive Python shell.</p>
        </div>
       t@@ -90,20 +89,21 @@ release notes</a> for more information)</li>
        <li><a class="reference external" href="http://www.cmake.org">CMake</a>, version 2.8 or newer</li>
        <li>The <a class="reference external" href="http://gcc.gnu.org/">GNU Compiler Collection</a> (GCC)</li>
        <li>The <a class="reference external" href="https://developer.nvidia.com/cuda-downloads">Nvidia CUDA toolkit</a>,
       -version 5.0 or newer</li>
       +version 8.0 or newer</li>
        </ul>
        </div></blockquote>
        <p>In Debian GNU/Linux, these dependencies can be installed by running:</p>
       -<div class="highlight-python"><pre>$ sudo apt-get install build-essential cmake nvidia-cuda-toolkit</pre>
       +<div class="highlight-default"><div class="highlight"><pre><span></span>$ sudo apt-get install build-essential cmake nvidia-cuda-toolkit clang-3.8
       +</pre></div>
        </div>
        <p>Unfortunately, the Nvidia Toolkit is shipped under a non-free license. In order
       -to install it in Debian GNU/Linux, add <tt class="docutils literal"><span class="pre">non-free</span></tt> archives to your
       -<tt class="docutils literal"><span class="pre">/etc/apt/sources.list</span></tt>.</p>
       +to install it in Debian GNU/Linux, add <code class="docutils literal"><span class="pre">non-free</span></code> archives to your
       +<code class="docutils literal"><span class="pre">/etc/apt/sources.list</span></code>.</p>
        <p>The runtime requirements are:</p>
        <blockquote>
        <div><ul class="simple">
        <li>A <a class="reference external" href="http://www.nvidia.com/object/cuda_gpus.html">CUDA-enabled GPU</a> with
       -compute capability 1.1 or greater.</li>
       +compute capability 2.0 or greater.</li>
        <li>A Nvidia CUDA-enabled GPU and device driver</li>
        </ul>
        </div></blockquote>
       t@@ -119,10 +119,11 @@ compute capability 1.1 or greater.</li>
        </ul>
        </div></blockquote>
        <p>In Debian GNU/Linux, these dependencies can be installed by running:</p>
       -<div class="highlight-python"><pre>$ sudo apt-get install python python-numpy python-matplotlib python-vtk \
       -    imagemagick libav-tools</pre>
       +<div class="highlight-default"><div class="highlight"><pre><span></span>$ sudo apt-get install python python-numpy python-matplotlib python-vtk \
       +    imagemagick libav-tools
       +</pre></div>
        </div>
       -<p><tt class="docutils literal"><span class="pre">sphere</span></tt> is distributed with a HTML and PDF build of the documentation. The
       +<p><code class="docutils literal"><span class="pre">sphere</span></code> is distributed with a HTML and PDF build of the documentation. The
        following tools are required for building the documentation:</p>
        <blockquote>
        <div><ul class="simple">
       t@@ -133,23 +134,25 @@ following tools are required for building the documentation:</p>
        <li><a class="reference external" href="http://www.stack.nl/~dimitri/doxygen/">Doxygen</a></li>
        <li><a class="reference external" href="http://michaeljones.github.com/breathe/">Breathe</a></li>
        <li><a class="reference external" href="http://www.nongnu.org/dvipng/">dvipng</a></li>
       -<li><a class="reference external" href="http://www.tug.org/texlive/">TeX Live</a>, including <tt class="docutils literal"><span class="pre">pdflatex</span></tt></li>
       +<li><a class="reference external" href="http://www.tug.org/texlive/">TeX Live</a>, including <code class="docutils literal"><span class="pre">pdflatex</span></code></li>
        </ul>
        </div></blockquote>
        <p>In Debian GNU/Linux, these dependencies can be installed by running:</p>
       -<div class="highlight-python"><pre>$ sudo apt-get install python-sphinx python-pip doxygen dvipng \
       +<div class="highlight-default"><div class="highlight"><pre><span></span>$ sudo apt-get install python-sphinx python-pip doxygen dvipng \
            python-sphinxcontrib-programoutput texlive-full
       -$ sudo pip install breathe</pre>
       +$ sudo pip install breathe
       +</pre></div>
        </div>
        <p><a class="reference external" href="http://git-scm.com">Git</a> is used as the distributed version control system
       -platform, and the source code is maintained at <a class="reference external" href="https://github.com/anders-dc/sphere/">Github</a>. <tt class="docutils literal"><span class="pre">sphere</span></tt> is licensed under the <a class="reference external" href="https://www.gnu.org/licenses/gpl.html">GNU
       +platform, and the source code is maintained at <a class="reference external" href="https://github.com/anders-dc/sphere/">Github</a>. <code class="docutils literal"><span class="pre">sphere</span></code> is licensed under the <a class="reference external" href="https://www.gnu.org/licenses/gpl.html">GNU
        Public License, v.3</a>.</p>
        <div class="admonition note">
        <p class="first admonition-title">Note</p>
        <p>All Debian GNU/Linux runtime, optional, and documentation dependencies
        mentioned above can be installed by executing the following command from the
       -<tt class="docutils literal"><span class="pre">doc/</span></tt> folder:</p>
       -<div class="last highlight-python"><pre>$ make install-debian-pkgs</pre>
       +<code class="docutils literal"><span class="pre">doc/</span></code> folder:</p>
       +<div class="last highlight-default"><div class="highlight"><pre><span></span>$ make install-debian-pkgs
       +</pre></div>
        </div>
        </div>
        </div>
       t@@ -158,92 +161,104 @@ mentioned above can be installed by executing the following command from the
        <p>The best way to keep up to date with subsequent updates, bugfixes and
        development, is to use the Git version control system. To obtain a local
        copy, execute:</p>
       -<div class="highlight-python"><pre>$ git clone git@github.com:anders-dc/sphere.git</pre>
       +<div class="highlight-default"><div class="highlight"><pre><span></span>$ git clone git@github.com:anders-dc/sphere.git
       +</pre></div>
        </div>
        </div>
        <div class="section" id="building-sphere">
       -<h2>Building <tt class="docutils literal"><span class="pre">sphere</span></tt><a class="headerlink" href="#building-sphere" title="Permalink to this headline">¶</a></h2>
       -<p><tt class="docutils literal"><span class="pre">sphere</span></tt> is built using <tt class="docutils literal"><span class="pre">cmake</span></tt>, the platform-specific C/C++ compilers,
       -and <tt class="docutils literal"><span class="pre">nvcc</span></tt> from the Nvidia CUDA toolkit.</p>
       -<p>If you plan to run <tt class="docutils literal"><span class="pre">sphere</span></tt> on a Kepler GPU, execute the following commands
       -from the root directory:</p>
       -<div class="highlight-python"><pre>$ cmake . &amp;&amp; make</pre>
       -</div>
       -<p>If you instead plan to execute it on a Fermi GPU, change <tt class="docutils literal"><span class="pre">set(GPU_GENERATION</span>
       -<span class="pre">1)</span></tt> to <tt class="docutils literal"><span class="pre">set(GPU_GENERATION</span> <span class="pre">0</span></tt> in <tt class="docutils literal"><span class="pre">CMakeLists.txt</span></tt>.</p>
       +<h2>Building <code class="docutils literal"><span class="pre">sphere</span></code><a class="headerlink" href="#building-sphere" title="Permalink to this headline">¶</a></h2>
       +<p><code class="docutils literal"><span class="pre">sphere</span></code> is built using <code class="docutils literal"><span class="pre">cmake</span></code>, the platform-specific C/C++ compilers,
       +and <code class="docutils literal"><span class="pre">nvcc</span></code> from the Nvidia CUDA toolkit.</p>
       +<p>If you instead plan to execute it on a Fermi GPU, change <code class="docutils literal"><span class="pre">set(GPU_GENERATION</span>
       +<span class="pre">1)</span></code> to <code class="docutils literal"><span class="pre">set(GPU_GENERATION</span> <span class="pre">0</span></code> in <code class="docutils literal"><span class="pre">CMakeLists.txt</span></code>.</p>
        <p>In some cases the CMake FindCUDA module will have troubles locating the
       -CUDA samples directory, and will complain about <tt class="docutils literal"><span class="pre">helper_math.h</span></tt> not being
       +CUDA samples directory, and will complain about <code class="docutils literal"><span class="pre">helper_math.h</span></code> not being
        found.</p>
       -<p>In that case, modify the <tt class="docutils literal"><span class="pre">CUDA_SDK_ROOT_DIR</span></tt> variable in
       -<tt class="docutils literal"><span class="pre">src/CMakeLists.txt</span></tt> to the path where you installed the CUDA samples, and run
       -<tt class="docutils literal"><span class="pre">cmake</span> <span class="pre">.</span> <span class="pre">&amp;&amp;</span> <span class="pre">make</span></tt> again. Alternatively, copy <tt class="docutils literal"><span class="pre">helper_math.h</span></tt> from the CUDA
       -sample subdirectory <tt class="docutils literal"><span class="pre">common/inc/helper_math.h</span></tt> into the sphere <tt class="docutils literal"><span class="pre">src/</span></tt>
       -directory, and run <tt class="docutils literal"><span class="pre">cmake</span></tt> and <tt class="docutils literal"><span class="pre">make</span></tt> again. Due to license restrictions,
       +<p>In that case, modify the <code class="docutils literal"><span class="pre">CUDA_SDK_ROOT_DIR</span></code> variable in
       +<code class="docutils literal"><span class="pre">src/CMakeLists.txt</span></code> to the path where you installed the CUDA samples, and run
       +<code class="docutils literal"><span class="pre">cmake</span> <span class="pre">.</span> <span class="pre">&amp;&amp;</span> <span class="pre">make</span></code> again. Alternatively, copy <code class="docutils literal"><span class="pre">helper_math.h</span></code> from the CUDA
       +sample subdirectory <code class="docutils literal"><span class="pre">common/inc/helper_math.h</span></code> into the sphere <code class="docutils literal"><span class="pre">src/</span></code>
       +directory, and run <code class="docutils literal"><span class="pre">cmake</span></code> and <code class="docutils literal"><span class="pre">make</span></code> again. Due to license restrictions,
        sphere cannot be distributed with this file.</p>
       -<p>After a successfull installation, the <tt class="docutils literal"><span class="pre">sphere</span></tt> executable will be located
       +<p>If you plan to run <code class="docutils literal"><span class="pre">sphere</span></code> on a Kepler GPU, execute the following commands
       +from the root directory:</p>
       +<div class="highlight-default"><div class="highlight"><pre><span></span>$ cmake . &amp;&amp; make
       +</pre></div>
       +</div>
       +<p>NOTE: If your system does not have a GCC compiler (e.g. GCC-5 for CUDA 8)
       +compatible with the installed CUDA version, try using <code class="docutils literal"><span class="pre">clang-3.8</span></code> instead:</p>
       +<div class="highlight-default"><div class="highlight"><pre><span></span>$ export CC=$(which clang-3.8) &amp;&amp; export CXX=$(which clang++-3.8) &amp;&amp; cmake . &amp;&amp; make
       +</pre></div>
       +</div>
       +<p>After a successfull installation, the <code class="docutils literal"><span class="pre">sphere</span></code> executable will be located
        in the root folder. To make sure that all components are working correctly,
        execute:</p>
       -<div class="highlight-python"><pre>$ make test</pre>
       -</div>
       -<p>All instructions required for building <tt class="docutils literal"><span class="pre">sphere</span></tt> are provided in a number of
       -<tt class="docutils literal"><span class="pre">Makefile</span></tt>&#8216;s. To generate the main <tt class="docutils literal"><span class="pre">sphere</span></tt> command-line executable, go to
       -the root directory, and invoke CMake and GNU Make:</p>
       -<div class="highlight-python"><pre>$ cmake . &amp;&amp; make</pre>
       +<div class="highlight-default"><div class="highlight"><pre><span></span>$ make test
       +</pre></div>
        </div>
       -<p>If successfull, the Makefiles will create the required data folders, object
       -files, as well as the <tt class="docutils literal"><span class="pre">sphere</span></tt> executable in the root folder. Issue the
       +<p>Disclaimer: On some systems the Navier-Stokes related tests will fail.  If you
       +do encounter these problems, but do not plan on using the Navier Stokes solver
       +for fluid dynamics, carry on.</p>
       +<p>If successful the Makefiles will create the required data folders, object
       +files, as well as the <code class="docutils literal"><span class="pre">sphere</span></code> executable in the root folder. Issue the
        following commands to check the executable:</p>
       -<div class="highlight-python"><pre>$ ./sphere --version</pre>
       +<div class="highlight-default"><div class="highlight"><pre><span></span>$ ./sphere --version
       +</pre></div>
        </div>
        <p>The output should look similar to this:</p>
       -<div class="highlight-text"><div class="highlight"><pre>.-------------------------------------.
       -|              _    Compiled for 3D   |
       +<div class="highlight-text"><div class="highlight"><pre><span></span>.-------------------------------------.
       +|              _                      |
        |             | |                     |
        |    ___ _ __ | |__   ___ _ __ ___    |
        |   / __| &#39;_ \| &#39;_ \ / _ \ &#39;__/ _ \   |
        |   \__ \ |_) | | | |  __/ | |  __/   |
        |   |___/ .__/|_| |_|\___|_|  \___|   |
        |       | |                           |
       -|       |_|           Version: 0.35   |
       +|       |_|           Version: 2.15   |
        `-------------------------------------´
         A discrete element method particle dynamics simulator.
       - Written by Anders Damsgaard Christensen, license GPLv3+.
       + Written by Anders Damsgaard, license GPLv3+.
       + https://cs.au.dk/~adc/
        </pre></div>
        </div>
        <p>The build can be verified by running a number of automated tests:</p>
       -<div class="highlight-python"><pre>$ make test</pre>
       +<div class="highlight-default"><div class="highlight"><pre><span></span>$ make test
       +</pre></div>
        </div>
        <p>The documentation can be read in the <a class="reference external" href="http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html">reStructuredText</a>-format in
       -the <tt class="docutils literal"><span class="pre">doc/sphinx/</span></tt> folder, or in the HTML or PDF formats in the folders
       -<tt class="docutils literal"><span class="pre">doc/html</span></tt> and <tt class="docutils literal"><span class="pre">doc/pdf</span></tt>.</p>
       +the <code class="docutils literal"><span class="pre">doc/sphinx/</span></code> folder, or in the HTML or PDF formats in the folders
       +<code class="docutils literal"><span class="pre">doc/html</span></code> and <code class="docutils literal"><span class="pre">doc/pdf</span></code>.</p>
        <p>Optionally, the documentation can be built using the following commands:</p>
       -<div class="highlight-python"><pre>$ cd doc/sphinx
       +<div class="highlight-default"><div class="highlight"><pre><span></span>$ cd doc/sphinx
        $ make html
       -$ make latexpdf</pre>
       +$ make latexpdf
       +</pre></div>
        </div>
        <p>To see all available output formats, execute:</p>
       -<div class="highlight-python"><pre>$ make help</pre>
       +<div class="highlight-default"><div class="highlight"><pre><span></span>$ make help
       +</pre></div>
        </div>
        </div>
        <div class="section" id="updating-sphere">
        <h2>Updating sphere<a class="headerlink" href="#updating-sphere" title="Permalink to this headline">¶</a></h2>
       -<p>To update your local version, type the following commands in the <tt class="docutils literal"><span class="pre">sphere</span></tt> root
       +<p>To update your local version, type the following commands in the <code class="docutils literal"><span class="pre">sphere</span></code> root
        directory:</p>
       -<div class="highlight-python"><pre>$ git pull &amp;&amp; cmake . &amp;&amp; make</pre>
       +<div class="highlight-default"><div class="highlight"><pre><span></span>$ git pull &amp;&amp; cmake . &amp;&amp; make
       +</pre></div>
        </div>
        </div>
        <div class="section" id="work-flow">
        <h2>Work flow<a class="headerlink" href="#work-flow" title="Permalink to this headline">¶</a></h2>
       -<p>After compiling the <tt class="docutils literal"><span class="pre">sphere</span></tt> binary, the procedure of a creating and handling
       +<p>After compiling the <code class="docutils literal"><span class="pre">sphere</span></code> binary, the procedure of a creating and handling
        a simulation is typically arranged in the following order:</p>
        <blockquote>
        <div><ul class="simple">
        <li>Setup of particle assemblage, physical properties and conditions using the
        Python API.</li>
       -<li>Execution of <tt class="docutils literal"><span class="pre">sphere</span></tt> software, which simulates the particle behavior as a
       +<li>Execution of <code class="docutils literal"><span class="pre">sphere</span></code> software, which simulates the particle behavior as a
        function of time, as a result of the conditions initially specified in the
        input file.</li>
       -<li>Inspection, analysis, interpretation and visualization of <tt class="docutils literal"><span class="pre">sphere</span></tt> output
       +<li>Inspection, analysis, interpretation and visualization of <code class="docutils literal"><span class="pre">sphere</span></code> output
        in Python, and/or scene rendering using the built-in ray tracer.</li>
        </ul>
        </div></blockquote>
       t@@ -254,14 +269,14 @@ in Python, and/or scene rendering using the built-in ray tracer.</li>
                  </div>
                </div>
              </div>
       -      <div class="sphinxsidebar">
       +      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
                <div class="sphinxsidebarwrapper">
          <h3><a href="index.html">Table Of Contents</a></h3>
          <ul>
       -<li><a class="reference internal" href="#">Introduction</a><ul>
       +<li><a class="reference internal" href="#">Introduction and Installation</a><ul>
        <li><a class="reference internal" href="#requirements">Requirements</a></li>
        <li><a class="reference internal" href="#obtaining-sphere">Obtaining sphere</a></li>
       -<li><a class="reference internal" href="#building-sphere">Building <tt class="docutils literal"><span class="pre">sphere</span></tt></a></li>
       +<li><a class="reference internal" href="#building-sphere">Building <code class="docutils literal"><span class="pre">sphere</span></code></a></li>
        <li><a class="reference internal" href="#updating-sphere">Updating sphere</a></li>
        <li><a class="reference internal" href="#work-flow">Work flow</a></li>
        </ul>
       t@@ -274,29 +289,28 @@ in Python, and/or scene rendering using the built-in ray tracer.</li>
          <h4>Next topic</h4>
          <p class="topless"><a href="dem.html"
                                title="next chapter">Discrete element method</a></p>
       -  <h3>This Page</h3>
       -  <ul class="this-page-menu">
       -    <li><a href="_sources/introduction.txt"
       -           rel="nofollow">Show Source</a></li>
       -  </ul>
       -<div id="searchbox" style="display: none">
       +  <div role="note" aria-label="source link">
       +    <h3>This Page</h3>
       +    <ul class="this-page-menu">
       +      <li><a href="_sources/introduction.txt"
       +            rel="nofollow">Show Source</a></li>
       +    </ul>
       +   </div>
       +<div id="searchbox" style="display: none" role="search">
          <h3>Quick search</h3>
            <form class="search" action="search.html" method="get">
       -      <input type="text" name="q" />
       -      <input type="submit" value="Go" />
       +      <div><input type="text" name="q" /></div>
       +      <div><input type="submit" value="Go" /></div>
              <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 module, class or function name.
       -    </p>
        </div>
        <script type="text/javascript">$('#searchbox').show(0);</script>
                </div>
              </div>
              <div class="clearer"></div>
            </div>
       -    <div class="related">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -311,12 +325,12 @@ in Python, and/or scene rendering using the built-in ray tracer.</li>
                <li class="right" >
                  <a href="index.html" title="The sphere documentation"
                     >previous</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>
       -    <div class="footer">
       -        &copy; Copyright 2014, Anders Damsgaard.
       -      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
       +    <div class="footer" role="contentinfo">
       +        &#169; Copyright 2014, Anders Damsgaard.
       +      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
            </div>
          </body>
        </html>
        \ No newline at end of file
 (DIR) diff --git a/doc/html/objects.inv b/doc/html/objects.inv
       Binary files differ.
 (DIR) diff --git a/doc/html/py-modindex.html b/doc/html/py-modindex.html
       t@@ -1,5 +1,3 @@
       -
       -
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
       t@@ -8,15 +6,14 @@
          <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            
       -    <title>Python Module Index &mdash; sphere 1.00-alpha documentation</title>
       +    <title>Python Module Index &#8212; sphere 1.00-alpha documentation</title>
            
       -    <link rel="stylesheet" href="_static/default.css" type="text/css" />
       +    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
            <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       -    <link rel="stylesheet" href="_static/breathe.css" type="text/css" />
            
            <script type="text/javascript">
              var DOCUMENTATION_OPTIONS = {
       -        URL_ROOT:    '',
       +        URL_ROOT:    './',
                VERSION:     '1.00-alpha',
                COLLAPSE_INDEX: false,
                FILE_SUFFIX: '.html',
       t@@ -26,6 +23,8 @@
            <script type="text/javascript" src="_static/jquery.js"></script>
            <script type="text/javascript" src="_static/underscore.js"></script>
            <script type="text/javascript" src="_static/doctools.js"></script>
       +    <link rel="index" title="Index" href="genindex.html" />
       +    <link rel="search" title="Search" href="search.html" />
            <link rel="top" title="sphere 1.00-alpha documentation" href="index.html" />
         
        
       t@@ -35,8 +34,8 @@
        
        
          </head>
       -  <body>
       -    <div class="related">
       +  <body role="document">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -45,14 +44,14 @@
                <li class="right" >
                  <a href="#" title="Python Module Index"
                     >modules</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>  
        
            <div class="document">
              <div class="documentwrapper">
                <div class="bodywrapper">
       -          <div class="body">
       +          <div class="body" role="main">
                    
        
           <h1>Python Module Index</h1>
       t@@ -62,13 +61,13 @@
           </div>
        
           <table class="indextable modindextable" cellspacing="0" cellpadding="2">
       -     <tr class="pcap"><td></td><td>&nbsp;</td><td></td></tr>
       +     <tr class="pcap"><td></td><td>&#160;</td><td></td></tr>
             <tr class="cap" id="cap-s"><td></td><td>
               <strong>s</strong></td><td></td></tr>
             <tr>
               <td></td>
               <td>
       -       <a href="python_api.html#module-sphere"><tt class="xref">sphere</tt></a></td><td>
       +       <a href="python_api.html#module-sphere"><code class="xref">sphere</code></a></td><td>
               <em></em></td></tr>
           </table>
        
       t@@ -76,26 +75,23 @@
                  </div>
                </div>
              </div>
       -      <div class="sphinxsidebar">
       +      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
                <div class="sphinxsidebarwrapper">
       -<div id="searchbox" style="display: none">
       +<div id="searchbox" style="display: none" role="search">
          <h3>Quick search</h3>
            <form class="search" action="search.html" method="get">
       -      <input type="text" name="q" />
       -      <input type="submit" value="Go" />
       +      <div><input type="text" name="q" /></div>
       +      <div><input type="submit" value="Go" /></div>
              <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 module, class or function name.
       -    </p>
        </div>
        <script type="text/javascript">$('#searchbox').show(0);</script>
                </div>
              </div>
              <div class="clearer"></div>
            </div>
       -    <div class="related">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -104,12 +100,12 @@
                <li class="right" >
                  <a href="#" title="Python Module Index"
                     >modules</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>
       -    <div class="footer">
       -        &copy; Copyright 2014, Anders Damsgaard.
       -      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
       +    <div class="footer" role="contentinfo">
       +        &#169; Copyright 2014, Anders Damsgaard.
       +      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
            </div>
          </body>
        </html>
        \ No newline at end of file
 (DIR) diff --git a/doc/html/python_api.html b/doc/html/python_api.html
       t@@ -1,5 +1,3 @@
       -
       -
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
       t@@ -8,15 +6,14 @@
          <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            
       -    <title>Python API &mdash; sphere 1.00-alpha documentation</title>
       +    <title>Python API &#8212; sphere 1.00-alpha documentation</title>
            
       -    <link rel="stylesheet" href="_static/default.css" type="text/css" />
       +    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
            <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       -    <link rel="stylesheet" href="_static/breathe.css" type="text/css" />
            
            <script type="text/javascript">
              var DOCUMENTATION_OPTIONS = {
       -        URL_ROOT:    '',
       +        URL_ROOT:    './',
                VERSION:     '1.00-alpha',
                COLLAPSE_INDEX: false,
                FILE_SUFFIX: '.html',
       t@@ -26,11 +23,13 @@
            <script type="text/javascript" src="_static/jquery.js"></script>
            <script type="text/javascript" src="_static/underscore.js"></script>
            <script type="text/javascript" src="_static/doctools.js"></script>
       +    <link rel="index" title="Index" href="genindex.html" />
       +    <link rel="search" title="Search" href="search.html" />
            <link rel="top" title="sphere 1.00-alpha documentation" href="index.html" />
            <link rel="prev" title="Fluid simulation and particle-fluid interaction" href="cfd.html" /> 
          </head>
       -  <body>
       -    <div class="related">
       +  <body role="document">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -42,27 +41,27 @@
                <li class="right" >
                  <a href="cfd.html" title="Fluid simulation and particle-fluid interaction"
                     accesskey="P">previous</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>  
        
            <div class="document">
              <div class="documentwrapper">
                <div class="bodywrapper">
       -          <div class="body">
       +          <div class="body" role="main">
                    
          <div class="section" id="python-api">
        <h1>Python API<a class="headerlink" href="#python-api" title="Permalink to this headline">¶</a></h1>
       -<p>The Python module <tt class="docutils literal"><span class="pre">sphere</span></tt> is intended as the main interface to the <tt class="docutils literal"><span class="pre">sphere</span></tt>
       +<p>The Python module <code class="docutils literal"><span class="pre">sphere</span></code> is intended as the main interface to the <code class="docutils literal"><span class="pre">sphere</span></code>
        application. It is recommended to use this module for simulation setup,
        simulation execution, and analysis of the simulation output data.</p>
       -<p>In order to use the API, the file <tt class="docutils literal"><span class="pre">sphere.py</span></tt> must be placed in the same
       +<p>In order to use the API, the file <code class="docutils literal"><span class="pre">sphere.py</span></code> must be placed in the same
        directory as the Python files.</p>
        <div class="section" id="sample-usage">
        <h2>Sample usage<a class="headerlink" href="#sample-usage" title="Permalink to this headline">¶</a></h2>
        <p>Below is a simple, annotated example of how to setup, execute, and post-process
       -a <tt class="docutils literal"><span class="pre">sphere</span></tt> simulation.  The example is also found in the <tt class="docutils literal"><span class="pre">python/</span></tt> folder as
       -<tt class="docutils literal"><span class="pre">collision.py</span></tt>.</p>
       +a <code class="docutils literal"><span class="pre">sphere</span></code> simulation.  The example is also found in the <code class="docutils literal"><span class="pre">python/</span></code> folder as
       +<code class="docutils literal"><span class="pre">collision.py</span></code>.</p>
        <div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
         2
         3
       t@@ -121,74 +120,74 @@ a <tt class="docutils literal"><span class="pre">sphere</span></tt> simulation. 
        56
        57
        58
       -59</pre></div></td><td class="code"><div class="highlight"><pre><span class="c">#!/usr/bin/env python</span>
       +59</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="ch">#!/usr/bin/env python</span>
        <span class="sd">&#39;&#39;&#39;</span>
        <span class="sd">Example of two particles colliding.</span>
        <span class="sd">Place script in sphere/python/ folder, and invoke with `python collision.py`</span>
        <span class="sd">&#39;&#39;&#39;</span>
        
       -<span class="c"># Import the sphere module for setting up, running, and analyzing the</span>
       -<span class="c"># experiment. We also need the numpy module when setting arrays in the sphere</span>
       -<span class="c"># object.</span>
       +<span class="c1"># Import the sphere module for setting up, running, and analyzing the</span>
       +<span class="c1"># experiment. We also need the numpy module when setting arrays in the sphere</span>
       +<span class="c1"># object.</span>
        <span class="kn">import</span> <span class="nn">sphere</span>
        <span class="kn">import</span> <span class="nn">numpy</span>
        
        
       -<span class="c">### SIMULATION SETUP</span>
       +<span class="c1">### SIMULATION SETUP</span>
        
       -<span class="c"># Create a sphere object with two preallocated particles and a simulation ID</span>
       -<span class="n">SB</span> <span class="o">=</span> <span class="n">sphere</span><span class="o">.</span><span class="n">sim</span><span class="p">(</span><span class="n">np</span> <span class="o">=</span> <span class="mi">2</span><span class="p">,</span> <span class="n">sid</span> <span class="o">=</span> <span class="s">&#39;collision&#39;</span><span class="p">)</span>
       +<span class="c1"># Create a sphere object with two preallocated particles and a simulation ID</span>
       +<span class="n">SB</span> <span class="o">=</span> <span class="n">sphere</span><span class="o">.</span><span class="n">sim</span><span class="p">(</span><span class="n">np</span> <span class="o">=</span> <span class="mi">2</span><span class="p">,</span> <span class="n">sid</span> <span class="o">=</span> <span class="s1">&#39;collision&#39;</span><span class="p">)</span>
        
       -<span class="n">SB</span><span class="o">.</span><span class="n">radius</span><span class="p">[:]</span> <span class="o">=</span> <span class="mf">0.3</span> <span class="c"># set radii to 0.3 m</span>
       +<span class="n">SB</span><span class="o">.</span><span class="n">radius</span><span class="p">[:]</span> <span class="o">=</span> <span class="mf">0.3</span> <span class="c1"># set radii to 0.3 m</span>
        
       -<span class="c"># Define the positions of the two particles</span>
       -<span class="n">SB</span><span class="o">.</span><span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="p">:]</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mf">10.0</span><span class="p">,</span> <span class="mf">5.0</span><span class="p">,</span> <span class="mf">5.0</span><span class="p">])</span>   <span class="c"># particle 1 (idx 0)</span>
       -<span class="n">SB</span><span class="o">.</span><span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="p">:]</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mf">11.0</span><span class="p">,</span> <span class="mf">5.0</span><span class="p">,</span> <span class="mf">5.0</span><span class="p">])</span>   <span class="c"># particle 2 (idx 1)</span>
       +<span class="c1"># Define the positions of the two particles</span>
       +<span class="n">SB</span><span class="o">.</span><span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="p">:]</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mf">10.0</span><span class="p">,</span> <span class="mf">5.0</span><span class="p">,</span> <span class="mf">5.0</span><span class="p">])</span>   <span class="c1"># particle 1 (idx 0)</span>
       +<span class="n">SB</span><span class="o">.</span><span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="p">:]</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mf">11.0</span><span class="p">,</span> <span class="mf">5.0</span><span class="p">,</span> <span class="mf">5.0</span><span class="p">])</span>   <span class="c1"># particle 2 (idx 1)</span>
        
       -<span class="c"># The default velocity is [0,0,0]. Slam particle 1 into particle 2 by defining</span>
       -<span class="c"># a positive x velocity for particle 1.</span>
       +<span class="c1"># The default velocity is [0,0,0]. Slam particle 1 into particle 2 by defining</span>
       +<span class="c1"># a positive x velocity for particle 1.</span>
        <span class="n">SB</span><span class="o">.</span><span class="n">vel</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="mf">1.0</span>
        
       -<span class="c"># Set the world limits and the particle sorting grid. The particles need to stay</span>
       -<span class="c"># within the world limits for the entire simulation, otherwise it will stop!</span>
       +<span class="c1"># Set the world limits and the particle sorting grid. The particles need to stay</span>
       +<span class="c1"># within the world limits for the entire simulation, otherwise it will stop!</span>
        <span class="n">SB</span><span class="o">.</span><span class="n">initGridAndWorldsize</span><span class="p">(</span><span class="n">margin</span> <span class="o">=</span> <span class="mf">5.0</span><span class="p">)</span>
        
       -<span class="c"># Define the temporal parameters, e.g. the total time (total) and the file</span>
       -<span class="c"># output interval (file_dt), both in seconds</span>
       +<span class="c1"># Define the temporal parameters, e.g. the total time (total) and the file</span>
       +<span class="c1"># output interval (file_dt), both in seconds</span>
        <span class="n">SB</span><span class="o">.</span><span class="n">initTemporal</span><span class="p">(</span><span class="n">total</span> <span class="o">=</span> <span class="mf">2.0</span><span class="p">,</span> <span class="n">file_dt</span> <span class="o">=</span> <span class="mf">0.1</span><span class="p">)</span>
        
       -<span class="c"># Using a &#39;dry&#39; run, the sphere main program will display important parameters.</span>
       -<span class="c"># sphere will end after displaying these values.</span>
       +<span class="c1"># Using a &#39;dry&#39; run, the sphere main program will display important parameters.</span>
       +<span class="c1"># sphere will end after displaying these values.</span>
        <span class="n">SB</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">dry</span> <span class="o">=</span> <span class="bp">True</span><span class="p">)</span>
        
        
       -<span class="c">### RUNNING THE SIMULATION</span>
       +<span class="c1">### RUNNING THE SIMULATION</span>
        
       -<span class="c"># Start the simulation on the GPU from the sphere program</span>
       +<span class="c1"># Start the simulation on the GPU from the sphere program</span>
        <span class="n">SB</span><span class="o">.</span><span class="n">run</span><span class="p">()</span>
        
        
       -<span class="c">### ANALYSIS OF SIMULATION RESULTS</span>
       +<span class="c1">### ANALYSIS OF SIMULATION RESULTS</span>
        
       -<span class="c"># Plot the system energy through time, image saved as collision-energy.png</span>
       -<span class="n">sphere</span><span class="o">.</span><span class="n">visualize</span><span class="p">(</span><span class="n">SB</span><span class="o">.</span><span class="n">sid</span><span class="p">,</span> <span class="n">method</span> <span class="o">=</span> <span class="s">&#39;energy&#39;</span><span class="p">)</span>
       +<span class="c1"># Plot the system energy through time, image saved as collision-energy.png</span>
       +<span class="n">SB</span><span class="o">.</span><span class="n">visualize</span><span class="p">(</span><span class="n">method</span> <span class="o">=</span> <span class="s1">&#39;energy&#39;</span><span class="p">)</span>
        
       -<span class="c"># Render the particles using the built-in raytracer</span>
       +<span class="c1"># Render the particles using the built-in raytracer</span>
        <span class="n">SB</span><span class="o">.</span><span class="n">render</span><span class="p">()</span>
        
       -<span class="c"># Alternative visualization using ParaView. See the documentation of</span>
       -<span class="c"># ``sim.writeVTKall()`` for more information about displaying the</span>
       -<span class="c"># particles in ParaView.</span>
       +<span class="c1"># Alternative visualization using ParaView. See the documentation of</span>
       +<span class="c1"># ``sim.writeVTKall()`` for more information about displaying the</span>
       +<span class="c1"># particles in ParaView.</span>
        <span class="n">SB</span><span class="o">.</span><span class="n">writeVTKall</span><span class="p">()</span>
        </pre></div>
        </td></tr></table></div>
       -<p>The full documentation of the <tt class="docutils literal"><span class="pre">sphere</span></tt> Python API can be found below.</p>
       +<p>The full documentation of the <code class="docutils literal"><span class="pre">sphere</span></code> Python API can be found below.</p>
        </div>
        <div class="section" id="module-sphere">
       -<span id="the-sphere-module"></span><h2>The <tt class="docutils literal"><span class="pre">sphere</span></tt> module<a class="headerlink" href="#module-sphere" title="Permalink to this headline">¶</a></h2>
       +<span id="the-sphere-module"></span><h2>The <code class="docutils literal"><span class="pre">sphere</span></code> module<a class="headerlink" href="#module-sphere" title="Permalink to this headline">¶</a></h2>
        <dl class="function">
        <dt id="sphere.V_sphere">
       -<tt class="descclassname">sphere.</tt><tt class="descname">V_sphere</tt><big>(</big><em>r</em><big>)</big><a class="headerlink" href="#sphere.V_sphere" title="Permalink to this definition">¶</a></dt>
       +<code class="descclassname">sphere.</code><code class="descname">V_sphere</code><span class="sig-paren">(</span><em>r</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.V_sphere" title="Permalink to this definition">¶</a></dt>
        <dd><p>Calculates the volume of a sphere with radius r</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -204,14 +203,14 @@ a <tt class="docutils literal"><span class="pre">sphere</span></tt> simulation. 
        
        <dl class="function">
        <dt id="sphere.cleanup">
       -<tt class="descclassname">sphere.</tt><tt class="descname">cleanup</tt><big>(</big><em>sim</em><big>)</big><a class="headerlink" href="#sphere.cleanup" title="Permalink to this definition">¶</a></dt>
       +<code class="descclassname">sphere.</code><code class="descname">cleanup</code><span class="sig-paren">(</span><em>sim</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.cleanup" title="Permalink to this definition">¶</a></dt>
        <dd><p>Removes the input/output files and images belonging to the object simulation
       -ID from the <tt class="docutils literal"><span class="pre">input/</span></tt>, <tt class="docutils literal"><span class="pre">output/</span></tt> and <tt class="docutils literal"><span class="pre">img_out/</span></tt> folders.</p>
       +ID from the <code class="docutils literal"><span class="pre">input/</span></code>, <code class="docutils literal"><span class="pre">output/</span></code> and <code class="docutils literal"><span class="pre">img_out/</span></code> folders.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
        <tbody valign="top">
       -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>spherebin</strong> (<em>sim</em>) &#8211; A sim object</td>
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>spherebin</strong> (<a class="reference internal" href="#sphere.sim" title="sphere.sim"><em>sim</em></a>) &#8211; A sim object</td>
        </tr>
        </tbody>
        </table>
       t@@ -219,7 +218,7 @@ ID from the <tt class="docutils literal"><span class="pre">input/</span></tt>, <
        
        <dl class="function">
        <dt id="sphere.convert">
       -<tt class="descclassname">sphere.</tt><tt class="descname">convert</tt><big>(</big><em>graphics_format='png'</em>, <em>folder='../img_out'</em><big>)</big><a class="headerlink" href="#sphere.convert" title="Permalink to this definition">¶</a></dt>
       +<code class="descclassname">sphere.</code><code class="descname">convert</code><span class="sig-paren">(</span><em>graphics_format='png'</em>, <em>folder='../img_out'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.convert" title="Permalink to this definition">¶</a></dt>
        <dd><p>Converts all PPM images in img_out to graphics_format using Imagemagick. All
        PPM images are subsequently removed.</p>
        <table class="docutils field-list" frame="void" rules="none">
       t@@ -238,8 +237,8 @@ PPM images are subsequently removed.</p>
        
        <dl class="function">
        <dt id="sphere.render">
       -<tt class="descclassname">sphere.</tt><tt class="descname">render</tt><big>(</big><em>binary</em>, <em>method='pres'</em>, <em>max_val=1000.0</em>, <em>lower_cutoff=0.0</em>, <em>graphics_format='png'</em>, <em>verbose=True</em><big>)</big><a class="headerlink" href="#sphere.render" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Render target binary using the <tt class="docutils literal"><span class="pre">sphere</span></tt> raytracer.</p>
       +<code class="descclassname">sphere.</code><code class="descname">render</code><span class="sig-paren">(</span><em>binary</em>, <em>method='pres'</em>, <em>max_val=1000.0</em>, <em>lower_cutoff=0.0</em>, <em>graphics_format='png'</em>, <em>verbose=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.render" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Render target binary using the <code class="docutils literal"><span class="pre">sphere</span></code> raytracer.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
       t@@ -253,7 +252,7 @@ total displacement along the x-axis, &#8216;angpos&#8217;: color by angular
        position.</li>
        <li><strong>max_val</strong> (<em>float</em>) &#8211; The maximum value of the color bar</li>
        <li><strong>lower_cutoff</strong> (<em>float</em>) &#8211; Do not render particles with a value below this
       -value, of the field selected by <tt class="docutils literal"><span class="pre">method</span></tt></li>
       +value, of the field selected by <code class="docutils literal"><span class="pre">method</span></code></li>
        <li><strong>graphics_format</strong> (<em>str</em>) &#8211; Convert the PPM images generated by the ray
        tracer to this image format using Imagemagick</li>
        <li><strong>verbose</strong> (<em>bool</em>) &#8211; Show verbose information during ray tracing</li>
       t@@ -266,15 +265,15 @@ tracer to this image format using Imagemagick</li>
        
        <dl class="function">
        <dt id="sphere.run">
       -<tt class="descclassname">sphere.</tt><tt class="descname">run</tt><big>(</big><em>binary</em>, <em>verbose=True</em>, <em>hideinputfile=False</em><big>)</big><a class="headerlink" href="#sphere.run" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Execute <tt class="docutils literal"><span class="pre">sphere</span></tt> with target binary file as input.</p>
       +<code class="descclassname">sphere.</code><code class="descname">run</code><span class="sig-paren">(</span><em>binary</em>, <em>verbose=True</em>, <em>hideinputfile=False</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.run" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Execute <code class="docutils literal"><span class="pre">sphere</span></code> with target binary file as input.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
        <tbody valign="top">
        <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
       -<li><strong>binary</strong> (<em>str</em>) &#8211; Input file for <tt class="docutils literal"><span class="pre">sphere</span></tt></li>
       -<li><strong>verbose</strong> (<em>bool</em>) &#8211; Show <tt class="docutils literal"><span class="pre">sphere</span></tt> output</li>
       +<li><strong>binary</strong> (<em>str</em>) &#8211; Input file for <code class="docutils literal"><span class="pre">sphere</span></code></li>
       +<li><strong>verbose</strong> (<em>bool</em>) &#8211; Show <code class="docutils literal"><span class="pre">sphere</span></code> output</li>
        <li><strong>hideinputfile</strong> (<em>bool</em>) &#8211; Hide the input file</li>
        </ul>
        </td>
       t@@ -285,8 +284,8 @@ tracer to this image format using Imagemagick</li>
        
        <dl class="class">
        <dt id="sphere.sim">
       -<em class="property">class </em><tt class="descclassname">sphere.</tt><tt class="descname">sim</tt><big>(</big><em>sid='unnamed'</em>, <em>np=0</em>, <em>nd=3</em>, <em>nw=0</em>, <em>fluid=False</em><big>)</big><a class="headerlink" href="#sphere.sim" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Class containing all <tt class="docutils literal"><span class="pre">sphere</span></tt> data.</p>
       +<em class="property">class </em><code class="descclassname">sphere.</code><code class="descname">sim</code><span class="sig-paren">(</span><em>sid='unnamed'</em>, <em>np=0</em>, <em>nd=3</em>, <em>nw=0</em>, <em>fluid=False</em>, <em>cfd_solver=0</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Class containing all <code class="docutils literal"><span class="pre">sphere</span></code> data.</p>
        <p>Contains functions for reading and writing binaries, as well as simulation
        setup and data analysis. Most arrays are initialized to default values.</p>
        <table class="docutils field-list" frame="void" rules="none">
       t@@ -301,14 +300,33 @@ setup and data analysis. Most arrays are initialized to default values.</p>
        <li><strong>sid</strong> (<em>str</em>) &#8211; The simulation id (default = &#8216;unnamed&#8217;). The simulation files
        will be written with this base name.</li>
        <li><strong>fluid</strong> (<em>bool</em>) &#8211; Setup fluid simulation (default = False)</li>
       +<li><strong>cfd_solver</strong> (<em>int</em>) &#8211; Fluid solver to use if fluid == True. 0: Navier-Stokes
       +(default), 1: Darcy.</li>
        </ul>
        </td>
        </tr>
        </tbody>
        </table>
        <dl class="method">
       +<dt id="sphere.sim.ReynoldsNumber">
       +<code class="descname">ReynoldsNumber</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.ReynoldsNumber" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Estimate the per-cell Reynolds number by: Re = rho * ||v_f|| * dx/mu.
       +This value is returned and also stored in <cite>self.Re</cite>.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Reynolds number</td>
       +</tr>
       +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">Numpy array with dimensions like the fluid grid</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
        <dt id="sphere.sim.acceleration">
       -<tt class="descname">acceleration</tt><big>(</big><em>idx=-1</em><big>)</big><a class="headerlink" href="#sphere.sim.acceleration" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">acceleration</code><span class="sig-paren">(</span><em>idx=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.acceleration" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the acceleration of one or more particles, selected by their
        index. If the index is equal to -1 (default value), all accelerations
        are returned.</p>
       t@@ -327,8 +345,18 @@ are returned.</p>
        </dd></dl>
        
        <dl class="method">
       +<dt id="sphere.sim.adaptiveGrid">
       +<code class="descname">adaptiveGrid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.adaptiveGrid" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the height of the fluid grid to automatically readjust to the
       +height of the granular assemblage, as dictated by the position of the
       +top wall.  This will readjust <cite>self.L[2]</cite> during the simulation to
       +equal the position of the top wall <cite>self.w_x[0]</cite>.</p>
       +<p>See also <a class="reference internal" href="#sphere.sim.staticGrid" title="sphere.sim.staticGrid"><code class="xref py py-func docutils literal"><span class="pre">staticGrid()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
        <dt id="sphere.sim.addParticle">
       -<tt class="descname">addParticle</tt><big>(</big><em>x</em>, <em>radius</em>, <em>xyzsum=array([ 0.</em>, <em>0.</em>, <em>0.])</em>, <em>vel=array([ 0.</em>, <em>0.</em>, <em>0.])</em>, <em>fixvel=array([ 0.])</em>, <em>force=array([ 0.</em>, <em>0.</em>, <em>0.])</em>, <em>angpos=array([ 0.</em>, <em>0.</em>, <em>0.])</em>, <em>angvel=array([ 0.</em>, <em>0.</em>, <em>0.])</em>, <em>torque=array([ 0.</em>, <em>0.</em>, <em>0.])</em>, <em>es_dot=array([ 0.])</em>, <em>es=array([ 0.])</em>, <em>ev_dot=array([ 0.])</em>, <em>ev=array([ 0.])</em>, <em>p=array([ 0.])</em>, <em>color=0</em><big>)</big><a class="headerlink" href="#sphere.sim.addParticle" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">addParticle</code><span class="sig-paren">(</span><em>x</em>, <em>radius</em>, <em>xyzsum=array([ 0.</em>, <em>0.</em>, <em>0.])</em>, <em>vel=array([ 0.</em>, <em>0.</em>, <em>0.])</em>, <em>fixvel=array([ 0.])</em>, <em>force=array([ 0.</em>, <em>0.</em>, <em>0.])</em>, <em>angpos=array([ 0.</em>, <em>0.</em>, <em>0.])</em>, <em>angvel=array([ 0.</em>, <em>0.</em>, <em>0.])</em>, <em>torque=array([ 0.</em>, <em>0.</em>, <em>0.])</em>, <em>es_dot=array([ 0.])</em>, <em>es=array([ 0.])</em>, <em>ev_dot=array([ 0.])</em>, <em>ev=array([ 0.])</em>, <em>p=array([ 0.])</em>, <em>color=0</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.addParticle" title="Permalink to this definition">¶</a></dt>
        <dd><p>Add a single particle to the simulation object. The only required
        parameters are the position (x) and the radius (radius).</p>
        <table class="docutils field-list" frame="void" rules="none">
       t@@ -359,8 +387,8 @@ velocity</li>
        
        <dl class="method">
        <dt id="sphere.sim.adjustUpperWall">
       -<tt class="descname">adjustUpperWall</tt><big>(</big><em>z_adjust=1.1</em><big>)</big><a class="headerlink" href="#sphere.sim.adjustUpperWall" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Included for legacy purposes, calls <a class="reference internal" href="#sphere.sim.adjustWall" title="sphere.sim.adjustWall"><tt class="xref py py-func docutils literal"><span class="pre">adjustWall()</span></tt></a> with <tt class="docutils literal"><span class="pre">idx=0</span></tt>.</p>
       +<code class="descname">adjustUpperWall</code><span class="sig-paren">(</span><em>z_adjust=1.1</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.adjustUpperWall" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Included for legacy purposes, calls <a class="reference internal" href="#sphere.sim.adjustWall" title="sphere.sim.adjustWall"><code class="xref py py-func docutils literal"><span class="pre">adjustWall()</span></code></a> with <code class="docutils literal"><span class="pre">idx=0</span></code>.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
       t@@ -374,7 +402,7 @@ allow for wall movement.</td>
        
        <dl class="method">
        <dt id="sphere.sim.adjustWall">
       -<tt class="descname">adjustWall</tt><big>(</big><em>idx</em>, <em>adjust=1.1</em>, <em>wall_mass_factor=1.0</em><big>)</big><a class="headerlink" href="#sphere.sim.adjustWall" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">adjustWall</code><span class="sig-paren">(</span><em>idx</em>, <em>adjust=1.1</em>, <em>wall_mass_factor=1.0</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.adjustWall" title="Permalink to this definition">¶</a></dt>
        <dd><p>Adjust grid and dynamic wall to max. particle position. The wall
        thickness will by standard equal the maximum particle diameter. The
        density equals the particle density, and the wall size is equal to the
       t@@ -385,7 +413,7 @@ parameter.</p>
        <col class="field-name" />
        <col class="field-body" />
        <tbody valign="top">
       -<tr class="field-odd field"><th class="field-name">Param :</th><td class="field-body">idx: The wall to adjust. 0 = +z, upper wall (default), 1 = -x,
       +<tr class="field-odd field"><th class="field-name">Param:</th><td class="field-body">idx: The wall to adjust. 0 = +z, upper wall (default), 1 = -x,
        left wall, 2 = +x, right wall, 3 = -y, front wall, 4 = +y, back
        wall.</td>
        </tr>
       t@@ -399,7 +427,7 @@ allow for wall movement.</td>
        
        <dl class="method">
        <dt id="sphere.sim.bond">
       -<tt class="descname">bond</tt><big>(</big><em>i</em>, <em>j</em><big>)</big><a class="headerlink" href="#sphere.sim.bond" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">bond</code><span class="sig-paren">(</span><em>i</em>, <em>j</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.bond" title="Permalink to this definition">¶</a></dt>
        <dd><p>Create a bond between particles with index i and j</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -417,7 +445,7 @@ allow for wall movement.</td>
        
        <dl class="method">
        <dt id="sphere.sim.bondsRose">
       -<tt class="descname">bondsRose</tt><big>(</big><em>graphics_format='pdf'</em><big>)</big><a class="headerlink" href="#sphere.sim.bondsRose" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">bondsRose</code><span class="sig-paren">(</span><em>graphics_format='pdf'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.bondsRose" title="Permalink to this definition">¶</a></dt>
        <dd><p>Visualize the trend and plunge angles of the bond pairs in a rose plot.
        The plot is saved in the current folder as
        &#8216;bonds-&lt;simulation id&gt;-rose.&lt;graphics_format&gt;&#8217;.</p>
       t@@ -433,23 +461,33 @@ The plot is saved in the current folder as
        
        <dl class="method">
        <dt id="sphere.sim.bulkPorosity">
       -<tt class="descname">bulkPorosity</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.bulkPorosity" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Calculates the bulk porosity</p>
       +<code class="descname">bulkPorosity</code><span class="sig-paren">(</span><em>trim=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.bulkPorosity" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Calculates the bulk porosity of the particle assemblage.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
        <tbody valign="top">
       -<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The bulk porosity, in [0:1]</td>
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>trim</strong> (<em>bool</em>) &#8211; Trim the total volume to the smallest axis-parallel cube
       +containing all particles.</td>
        </tr>
       -<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">float</td>
       +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The bulk porosity, in [0:1]</td>
       +</tr>
       +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">float</td>
        </tr>
        </tbody>
        </table>
        </dd></dl>
        
        <dl class="method">
       +<dt id="sphere.sim.cellSize">
       +<code class="descname">cellSize</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.cellSize" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Calculate the particle sorting (and fluid) cell dimensions.
       +These values are stored in <cite>self.dx</cite> and are NOT returned.</p>
       +</dd></dl>
       +
       +<dl class="method">
        <dt id="sphere.sim.checkerboardColors">
       -<tt class="descname">checkerboardColors</tt><big>(</big><em>nx=6</em>, <em>ny=6</em>, <em>nz=6</em><big>)</big><a class="headerlink" href="#sphere.sim.checkerboardColors" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">checkerboardColors</code><span class="sig-paren">(</span><em>nx=6</em>, <em>ny=6</em>, <em>nz=6</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.checkerboardColors" title="Permalink to this definition">¶</a></dt>
        <dd><p>Assign checkerboard color values to the particles in an orthogonal grid.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -468,14 +506,14 @@ The plot is saved in the current folder as
        
        <dl class="method">
        <dt id="sphere.sim.cleanup">
       -<tt class="descname">cleanup</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.cleanup" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">cleanup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.cleanup" title="Permalink to this definition">¶</a></dt>
        <dd><p>Removes the input/output files and images belonging to the object
       -simulation ID from the <tt class="docutils literal"><span class="pre">input/</span></tt>, <tt class="docutils literal"><span class="pre">output/</span></tt> and <tt class="docutils literal"><span class="pre">img_out/</span></tt> folders.</p>
       +simulation ID from the <code class="docutils literal"><span class="pre">input/</span></code>, <code class="docutils literal"><span class="pre">output/</span></code> and <code class="docutils literal"><span class="pre">img_out/</span></code> folders.</p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.consolidate">
       -<tt class="descname">consolidate</tt><big>(</big><em>normal_stress=10000.0</em><big>)</big><a class="headerlink" href="#sphere.sim.consolidate" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">consolidate</code><span class="sig-paren">(</span><em>normal_stress=10000.0</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.consolidate" title="Permalink to this definition">¶</a></dt>
        <dd><p>Setup consolidation experiment. Specify the upper wall normal stress in
        Pascal, default value is 10 kPa.</p>
        <table class="docutils field-list" frame="void" rules="none">
       t@@ -490,7 +528,7 @@ Pascal, default value is 10 kPa.</p>
        
        <dl class="method">
        <dt id="sphere.sim.contactModel">
       -<tt class="descname">contactModel</tt><big>(</big><em>contactmodel</em><big>)</big><a class="headerlink" href="#sphere.sim.contactModel" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">contactModel</code><span class="sig-paren">(</span><em>contactmodel</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.contactModel" title="Permalink to this definition">¶</a></dt>
        <dd><p>Define which contact model to use for the tangential component of
        particle-particle interactions. The elastic-viscous-frictional contact
        model (2) is considered to be the most realistic contact model, while
       t@@ -507,8 +545,67 @@ the viscous-frictional contact model is significantly faster.</p>
        </dd></dl>
        
        <dl class="method">
       +<dt id="sphere.sim.contactParticleArea">
       +<code class="descname">contactParticleArea</code><span class="sig-paren">(</span><em>i</em>, <em>j</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.contactParticleArea" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Finds the average area of an two particles in an inter-particle contact.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
       +<li><strong>i</strong> (<em>int or array of ints</em>) &#8211; Index of first particle</li>
       +<li><strong>j</strong> (<em>int or array of ints</em>) &#8211; Index of second particle</li>
       +<li><strong>d</strong> (<em>float or array of floats</em>) &#8211; Overlap distance</li>
       +</ul>
       +</td>
       +</tr>
       +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Contact area [m*m]</p>
       +</td>
       +</tr>
       +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">float or array of floats</p>
       +</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.contactSurfaceArea">
       +<code class="descname">contactSurfaceArea</code><span class="sig-paren">(</span><em>i</em>, <em>j</em>, <em>overlap</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.contactSurfaceArea" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Finds the contact surface area of an inter-particle contact.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
       +<li><strong>i</strong> (<em>int or array of ints</em>) &#8211; Index of first particle</li>
       +<li><strong>j</strong> (<em>int or array of ints</em>) &#8211; Index of second particle</li>
       +<li><strong>d</strong> (<em>float or array of floats</em>) &#8211; Overlap distance</li>
       +</ul>
       +</td>
       +</tr>
       +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Contact area [m*m]</p>
       +</td>
       +</tr>
       +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">float or array of floats</p>
       +</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.convergence">
       +<code class="descname">convergence</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.convergence" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Read the convergence evolution in the CFD solver. The values are stored
       +in <cite>self.conv</cite> with iteration number in the first column and iteration
       +count in the second column.</p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.plotConvergence" title="sphere.sim.plotConvergence"><code class="xref py py-func docutils literal"><span class="pre">plotConvergence()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
        <dt id="sphere.sim.createBondPair">
       -<tt class="descname">createBondPair</tt><big>(</big><em>i</em>, <em>j</em>, <em>spacing=-0.1</em><big>)</big><a class="headerlink" href="#sphere.sim.createBondPair" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">createBondPair</code><span class="sig-paren">(</span><em>i</em>, <em>j</em>, <em>spacing=-0.1</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.createBondPair" title="Permalink to this definition">¶</a></dt>
        <dd><p>Bond particles i and j. Particle j is moved adjacent to particle i,
        and oriented randomly.</p>
        <table class="docutils field-list" frame="void" rules="none">
       t@@ -530,15 +627,38 @@ overlap. The value is relative to the sum of the two radii.</li>
        
        <dl class="method">
        <dt id="sphere.sim.currentNormalStress">
       -<tt class="descname">currentNormalStress</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.currentNormalStress" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Calculates the current magnitude of the top wall normal stress.</p>
       +<code class="descname">currentNormalStress</code><span class="sig-paren">(</span><em>type='defined'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.currentNormalStress" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Calculates the current magnitude of the defined or effective top wall
       +normal stress.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
        <tbody valign="top">
       -<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The current top wall normal stress in Pascal</td>
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>type</strong> (<em>str</em>) &#8211; Find the &#8216;defined&#8217; (default) or &#8216;effective&#8217; normal stress</td>
        </tr>
       -<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">float</td>
       +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The current top wall normal stress in Pascal</td>
       +</tr>
       +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">float</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.currentTime">
       +<code class="descname">currentTime</code><span class="sig-paren">(</span><em>value=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.currentTime" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Get or set the current time. If called without arguments the current
       +time is returned. If a new time is passed in the &#8216;value&#8217; argument, the
       +time is written to the object.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value</strong> (<em>float</em>) &#8211; The new current time</td>
       +</tr>
       +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The current time</td>
       +</tr>
       +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">float</td>
        </tr>
        </tbody>
        </table>
       t@@ -546,7 +666,7 @@ overlap. The value is relative to the sum of the two radii.</li>
        
        <dl class="method">
        <dt id="sphere.sim.defaultParams">
       -<tt class="descname">defaultParams</tt><big>(</big><em>mu_s=0.4</em>, <em>mu_d=0.4</em>, <em>mu_r=0.0</em>, <em>rho=2600</em>, <em>k_n=1160000000.0</em>, <em>k_t=1160000000.0</em>, <em>k_r=0</em>, <em>gamma_n=0.0</em>, <em>gamma_t=0.0</em>, <em>gamma_r=0.0</em>, <em>gamma_wn=10000.0</em>, <em>gamma_wt=10000.0</em>, <em>capillaryCohesion=0</em><big>)</big><a class="headerlink" href="#sphere.sim.defaultParams" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">defaultParams</code><span class="sig-paren">(</span><em>mu_s=0.5</em>, <em>mu_d=0.5</em>, <em>mu_r=0.0</em>, <em>rho=2600</em>, <em>k_n=1160000000.0</em>, <em>k_t=1160000000.0</em>, <em>k_r=0</em>, <em>gamma_n=0.0</em>, <em>gamma_t=0.0</em>, <em>gamma_r=0.0</em>, <em>gamma_wn=10000.0</em>, <em>gamma_wt=10000.0</em>, <em>capillaryCohesion=0</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.defaultParams" title="Permalink to this definition">¶</a></dt>
        <dd><p>Initialize particle parameters to default values.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -562,7 +682,7 @@ overlap. The value is relative to the sum of the two radii.</li>
        not used</em></li>
        <li><strong>gamma_n</strong> (<em>float</em>) &#8211; Particle-particle contact normal viscosity [Ns/m]</li>
        <li><strong>gamma_t</strong> (<em>float</em>) &#8211; Particle-particle contact tangential viscosity [Ns/m]</li>
       -<li><strong>gamma_r</strong> (<em>float</em>) &#8211; Particle-particle contact rolling viscosity <em>Parameter 
       +<li><strong>gamma_r</strong> (<em>float</em>) &#8211; Particle-particle contact rolling viscosity <em>Parameter
        not used</em></li>
        <li><strong>gamma_wn</strong> (<em>float</em>) &#8211; Wall-particle contact normal viscosity [Ns/m]</li>
        <li><strong>gamma_wt</strong> (<em>float</em>) &#8211; Wall-particle contact tangential viscosity [Ns/m]</li>
       t@@ -577,7 +697,7 @@ interaction model (0 = no (default), 1 = yes)</li>
        
        <dl class="method">
        <dt id="sphere.sim.defineWorldBoundaries">
       -<tt class="descname">defineWorldBoundaries</tt><big>(</big><em>L, origo=[0.0, 0.0, 0.0], dx=-1</em><big>)</big><a class="headerlink" href="#sphere.sim.defineWorldBoundaries" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">defineWorldBoundaries</code><span class="sig-paren">(</span><em>L, origo=[0.0, 0.0, 0.0], dx=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.defineWorldBoundaries" title="Permalink to this definition">¶</a></dt>
        <dd><p>Set the boundaries of the world. Particles will only be able to interact
        within this domain. With dynamic walls, allow space for expansions.
        <em>Important</em>: The particle radii have to be set beforehand. The world
       t@@ -601,19 +721,19 @@ won&#8217;t work. Default = [0.0, 0.0, 0.0].</li>
        
        <dl class="method">
        <dt id="sphere.sim.deleteAllParticles">
       -<tt class="descname">deleteAllParticles</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.deleteAllParticles" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">deleteAllParticles</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.deleteAllParticles" title="Permalink to this definition">¶</a></dt>
        <dd><p>Deletes all particles in the simulation object.</p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.deleteParticle">
       -<tt class="descname">deleteParticle</tt><big>(</big><em>i</em><big>)</big><a class="headerlink" href="#sphere.sim.deleteParticle" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Delete particle with index <tt class="docutils literal"><span class="pre">i</span></tt>.</p>
       +<code class="descname">deleteParticle</code><span class="sig-paren">(</span><em>i</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.deleteParticle" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Delete particle(s) with index <code class="docutils literal"><span class="pre">i</span></code>.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
        <tbody valign="top">
       -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>i</strong> (<em>int</em>) &#8211; Particle index to delete</td>
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>i</strong> (<em>int, list or numpy.array</em>) &#8211; One or more particle indexes to delete</td>
        </tr>
        </tbody>
        </table>
       t@@ -621,15 +741,30 @@ won&#8217;t work. Default = [0.0, 0.0, 0.0].</li>
        
        <dl class="method">
        <dt id="sphere.sim.disableFluidPressureModulation">
       -<tt class="descname">disableFluidPressureModulation</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.disableFluidPressureModulation" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">disableFluidPressureModulation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.disableFluidPressureModulation" title="Permalink to this definition">¶</a></dt>
        <dd><p>Set the parameters for the sine wave modulating the fluid pressures
        at the top boundary to zero.</p>
       -<p>See also: <a class="reference internal" href="#sphere.sim.setFluidPressureModulation" title="sphere.sim.setFluidPressureModulation"><tt class="xref py py-func docutils literal"><span class="pre">setFluidPressureModulation()</span></tt></a></p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.setFluidPressureModulation" title="sphere.sim.setFluidPressureModulation"><code class="xref py py-func docutils literal"><span class="pre">setFluidPressureModulation()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.disableTopWallNormalStressModulation">
       +<code class="descname">disableTopWallNormalStressModulation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.disableTopWallNormalStressModulation" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the parameters for the sine wave modulating the normal stress
       +at the top dynamic wall to zero.</p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.setTopWallNormalStressModulation" title="sphere.sim.setTopWallNormalStressModulation"><code class="xref py py-func docutils literal"><span class="pre">setTopWallNormalStressModulation()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.dry">
       +<code class="descname">dry</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.dry" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the simulation to be dry (no fluids).</p>
       +<p>See also <a class="reference internal" href="#sphere.sim.wet" title="sphere.sim.wet"><code class="xref py py-func docutils literal"><span class="pre">wet()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.energy">
       -<tt class="descname">energy</tt><big>(</big><em>method</em><big>)</big><a class="headerlink" href="#sphere.sim.energy" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">energy</code><span class="sig-paren">(</span><em>method</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.energy" title="Permalink to this definition">¶</a></dt>
        <dd><p>Calculates the sum of the energy components of all particles.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -652,8 +787,150 @@ for the potential energy stored in bonds [J]</td>
        </dd></dl>
        
        <dl class="method">
       +<dt id="sphere.sim.findAllAverageParticlePairAreas">
       +<code class="descname">findAllAverageParticlePairAreas</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.findAllAverageParticlePairAreas" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Finds the average area of an inter-particle contact. This
       +function requires a prior call to <a class="reference internal" href="#sphere.sim.findOverlaps" title="sphere.sim.findOverlaps"><code class="xref py py-func docutils literal"><span class="pre">findOverlaps()</span></code></a> as it reads
       +from the <code class="docutils literal"><span class="pre">self.pairs</span></code> and <code class="docutils literal"><span class="pre">self.overlaps</span></code> arrays.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Array of contact surface areas</td>
       +</tr>
       +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">array of floats</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.findAllContactSurfaceAreas">
       +<code class="descname">findAllContactSurfaceAreas</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.findAllContactSurfaceAreas" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Finds the contact surface area of an inter-particle contact. This
       +function requires a prior call to <a class="reference internal" href="#sphere.sim.findOverlaps" title="sphere.sim.findOverlaps"><code class="xref py py-func docutils literal"><span class="pre">findOverlaps()</span></code></a> as it reads
       +from the <code class="docutils literal"><span class="pre">self.pairs</span></code> and <code class="docutils literal"><span class="pre">self.overlaps</span></code> arrays.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Array of contact surface areas</td>
       +</tr>
       +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">array of floats</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.findContactStresses">
       +<code class="descname">findContactStresses</code><span class="sig-paren">(</span><em>area='average'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.findContactStresses" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Finds all particle-particle uniaxial normal stresses (by first calling
       +<a class="reference internal" href="#sphere.sim.findNormalForces" title="sphere.sim.findNormalForces"><code class="xref py py-func docutils literal"><span class="pre">findNormalForces()</span></code></a>) and calculating the stress magnitudes by
       +dividing the normal force magnitude with the average particle area
       +(&#8216;average&#8217;) or by the contact surface area (&#8216;contact&#8217;).</p>
       +<p>The result is saved in <code class="docutils literal"><span class="pre">self.sigma_contacts</span></code>.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>area</strong> (<em>str</em>) &#8211; Area to use: &#8216;average&#8217; (default) or &#8216;contact&#8217;</td>
       +</tr>
       +</tbody>
       +</table>
       +<p>See also: <a class="reference internal" href="#sphere.sim.findNormalForces" title="sphere.sim.findNormalForces"><code class="xref py py-func docutils literal"><span class="pre">findNormalForces()</span></code></a> and <a class="reference internal" href="#sphere.sim.findOverlaps" title="sphere.sim.findOverlaps"><code class="xref py py-func docutils literal"><span class="pre">findOverlaps()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.findCoordinationNumber">
       +<code class="descname">findCoordinationNumber</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.findCoordinationNumber" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Finds the coordination number (the average number of contacts per
       +particle). Requires a previous call to <a class="reference internal" href="#sphere.sim.findOverlaps" title="sphere.sim.findOverlaps"><code class="xref py py-func docutils literal"><span class="pre">findOverlaps()</span></code></a>. Values
       +are stored in <code class="docutils literal"><span class="pre">self.coordinationnumber</span></code>.</p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.findHydraulicConductivities">
       +<code class="descname">findHydraulicConductivities</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.findHydraulicConductivities" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Calculates the hydrological conductivities from the Kozeny-Carman
       +relationship. These values are only relevant when the Darcy solver is
       +used (<cite>self.cfd_solver = 1</cite>). The permeability pre-factor <cite>self.k_c</cite>
       +and the assemblage porosities must be set beforehand. The former values
       +are set if a file from the <cite>output/</cite> folder is read using
       +<cite>self.readbin</cite>.</p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.findLoadedContacts">
       +<code class="descname">findLoadedContacts</code><span class="sig-paren">(</span><em>threshold</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.findLoadedContacts" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Finds the indices of contact pairs where the contact stress magnitude
       +exceeds or is equal to a specified threshold value. This function calls
       +<a class="reference internal" href="#sphere.sim.findContactStresses" title="sphere.sim.findContactStresses"><code class="xref py py-func docutils literal"><span class="pre">findContactStresses()</span></code></a>.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>threshold</strong> (<em>float</em>) &#8211; Threshold contact stress [Pa]</td>
       +</tr>
       +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Array of contact indices</td>
       +</tr>
       +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">array of ints</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.findMeanCoordinationNumber">
       +<code class="descname">findMeanCoordinationNumber</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.findMeanCoordinationNumber" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Returns the coordination number (the average number of contacts per
       +particle). Requires a previous call to <a class="reference internal" href="#sphere.sim.findOverlaps" title="sphere.sim.findOverlaps"><code class="xref py py-func docutils literal"><span class="pre">findOverlaps()</span></code></a></p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The mean particle coordination number</td>
       +</tr>
       +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">float</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.findNormalForces">
       +<code class="descname">findNormalForces</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.findNormalForces" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Finds all particle-particle overlaps (by first calling
       +<a class="reference internal" href="#sphere.sim.findOverlaps" title="sphere.sim.findOverlaps"><code class="xref py py-func docutils literal"><span class="pre">findOverlaps()</span></code></a>) and calculating the normal magnitude by
       +multiplying the overlaps with the elastic stiffness <code class="docutils literal"><span class="pre">self.k_n</span></code>.</p>
       +<p>The result is saved in <code class="docutils literal"><span class="pre">self.f_n_magn</span></code>.</p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.findOverlaps" title="sphere.sim.findOverlaps"><code class="xref py py-func docutils literal"><span class="pre">findOverlaps()</span></code></a> and <a class="reference internal" href="#sphere.sim.findContactStresses" title="sphere.sim.findContactStresses"><code class="xref py py-func docutils literal"><span class="pre">findContactStresses()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.findOverlaps">
       +<code class="descname">findOverlaps</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.findOverlaps" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Find all particle-particle overlaps by a n^2 contact search, which is
       +done in C++. The particle pair indexes and the distance of the overlaps
       +is saved in the object itself as the <code class="docutils literal"><span class="pre">.pairs</span></code> and <code class="docutils literal"><span class="pre">.overlaps</span></code>
       +members.</p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.findNormalForces" title="sphere.sim.findNormalForces"><code class="xref py py-func docutils literal"><span class="pre">findNormalForces()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.findPermeabilities">
       +<code class="descname">findPermeabilities</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.findPermeabilities" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Calculates the hydrological permeabilities from the Kozeny-Carman
       +relationship. These values are only relevant when the Darcy solver is
       +used (<cite>self.cfd_solver = 1</cite>). The permeability pre-factor <cite>self.k_c</cite>
       +and the assemblage porosities must be set beforehand. The former values
       +are set if a file from the <cite>output/</cite> folder is read using
       +<cite>self.readbin</cite>.</p>
       +</dd></dl>
       +
       +<dl class="method">
        <dt id="sphere.sim.forcechains">
       -<tt class="descname">forcechains</tt><big>(</big><em>lc=200.0</em>, <em>uc=650.0</em>, <em>outformat='png'</em>, <em>disp='2d'</em><big>)</big><a class="headerlink" href="#sphere.sim.forcechains" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">forcechains</code><span class="sig-paren">(</span><em>lc=200.0</em>, <em>uc=650.0</em>, <em>outformat='png'</em>, <em>disp='2d'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.forcechains" title="Permalink to this definition">¶</a></dt>
        <dd><p>Visualizes the force chains in the system from the magnitude of the
        normal contact forces, and produces an image of them. Warning: Will
        segfault if no contacts are found.</p>
       t@@ -678,7 +955,7 @@ visualized with this value</li>
        
        <dl class="method">
        <dt id="sphere.sim.forcechainsRose">
       -<tt class="descname">forcechainsRose</tt><big>(</big><em>lower_limit=0.25</em>, <em>graphics_format='pdf'</em><big>)</big><a class="headerlink" href="#sphere.sim.forcechainsRose" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">forcechainsRose</code><span class="sig-paren">(</span><em>lower_limit=0.25</em>, <em>graphics_format='pdf'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.forcechainsRose" title="Permalink to this definition">¶</a></dt>
        <dd><p>Visualize trend and plunge angles of the strongest force chains in a
        rose plot. The plots are saved in the current folder with the name
        &#8216;fc-&lt;simulation id&gt;-rose.pdf&#8217;.</p>
       t@@ -699,7 +976,7 @@ contact force magnitude, in ]0;1[</li>
        
        <dl class="method">
        <dt id="sphere.sim.frictionalEnergy">
       -<tt class="descname">frictionalEnergy</tt><big>(</big><em>idx</em><big>)</big><a class="headerlink" href="#sphere.sim.frictionalEnergy" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">frictionalEnergy</code><span class="sig-paren">(</span><em>idx</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.frictionalEnergy" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the frictional dissipated energy for a particle.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -717,7 +994,7 @@ contact force magnitude, in ]0;1[</li>
        
        <dl class="method">
        <dt id="sphere.sim.generateBimodalRadii">
       -<tt class="descname">generateBimodalRadii</tt><big>(</big><em>r_small=0.005</em>, <em>r_large=0.05</em>, <em>ratio=0.2</em>, <em>verbose=True</em><big>)</big><a class="headerlink" href="#sphere.sim.generateBimodalRadii" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">generateBimodalRadii</code><span class="sig-paren">(</span><em>r_small=0.005</em>, <em>r_large=0.05</em>, <em>ratio=0.2</em>, <em>verbose=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.generateBimodalRadii" title="Permalink to this definition">¶</a></dt>
        <dd><p>Draw random radii from two distinct sizes.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -733,12 +1010,12 @@ populations (large/small).</li>
        </tr>
        </tbody>
        </table>
       -<p>See also: <a class="reference internal" href="#sphere.sim.generateRadii" title="sphere.sim.generateRadii"><tt class="xref py py-func docutils literal"><span class="pre">generateRadii()</span></tt></a>.</p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.generateRadii" title="sphere.sim.generateRadii"><code class="xref py py-func docutils literal"><span class="pre">generateRadii()</span></code></a>.</p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.generateRadii">
       -<tt class="descname">generateRadii</tt><big>(</big><em>psd='logn'</em>, <em>radius_mean=0.00044</em>, <em>radius_variance=8.8e-09</em>, <em>histogram=True</em><big>)</big><a class="headerlink" href="#sphere.sim.generateRadii" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">generateRadii</code><span class="sig-paren">(</span><em>psd='logn'</em>, <em>mean=0.00044</em>, <em>variance=8.8e-09</em>, <em>histogram=False</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.generateRadii" title="Permalink to this definition">¶</a></dt>
        <dd><p>Draw random particle radii from a selected probability distribution.
        The larger the variance of radii is, the slower the computations will
        run. The reason is two-fold: The smallest particle dictates the time
       t@@ -752,24 +1029,98 @@ more particles, causing more contact checks.</p>
        <tbody valign="top">
        <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
        <li><strong>psd</strong> (<em>str</em>) &#8211; The particle side distribution. One possible value is
       -<tt class="docutils literal"><span class="pre">logn</span></tt>, which is a log-normal probability distribution, suitable
       +<code class="docutils literal"><span class="pre">logn</span></code>, which is a log-normal probability distribution, suitable
        for approximating well-sorted, coarse sediments. The other possible
       -value is <tt class="docutils literal"><span class="pre">uni</span></tt>, which is a uniform distribution from
       -<tt class="docutils literal"><span class="pre">radius_mean-radius_variance</span></tt> to <tt class="docutils literal"><span class="pre">radius_mean+radius_variance</span></tt>.</li>
       -<li><strong>radius_mean</strong> (<em>float</em>) &#8211; The mean radius [m] (default = 440e-6 m)</li>
       -<li><strong>radius_variance</strong> (<em>float</em>) &#8211; The variance in the probability distribution
       +value is <code class="docutils literal"><span class="pre">uni</span></code>, which is a uniform distribution from
       +<code class="docutils literal"><span class="pre">mean</span> <span class="pre">-</span> <span class="pre">variance</span></code> to <code class="docutils literal"><span class="pre">mean</span> <span class="pre">+</span> <span class="pre">variance</span></code>.</li>
       +<li><strong>mean</strong> (<em>float</em>) &#8211; The mean radius [m] (default = 440e-6 m)</li>
       +<li><strong>variance</strong> (<em>float</em>) &#8211; The variance in the probability distribution
        [m].</li>
        </ul>
        </td>
        </tr>
        </tbody>
        </table>
       -<p>See also: <a class="reference internal" href="#sphere.sim.generateBimodalRadii" title="sphere.sim.generateBimodalRadii"><tt class="xref py py-func docutils literal"><span class="pre">generateBimodalRadii()</span></tt></a>.</p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.generateBimodalRadii" title="sphere.sim.generateBimodalRadii"><code class="xref py py-func docutils literal"><span class="pre">generateBimodalRadii()</span></code></a>.</p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.hydraulicConductivity">
       +<code class="descname">hydraulicConductivity</code><span class="sig-paren">(</span><em>phi=0.35</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.hydraulicConductivity" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Determine the hydraulic conductivity (K) [m/s] from the permeability
       +prefactor and a chosen porosity.  This value is stored in <cite>self.K_c</cite>.
       +This function only works for the Darcy solver (<cite>self.cfd_solver == 1</cite>)</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>phi</strong> (<em>float</em>) &#8211; The porosity to use in the Kozeny-Carman relationship</td>
       +</tr>
       +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The hydraulic conductivity [m/s]</td>
       +</tr>
       +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">float</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.hydraulicDiffusivity">
       +<code class="descname">hydraulicDiffusivity</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.hydraulicDiffusivity" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Determine the hydraulic diffusivity (D) [m*m/s]. The result is stored in
       +<cite>self.D</cite>. This function only works for the Darcy solver
       +(<cite>self.cfd_solver[0] == 1</cite>)</p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.hydraulicPermeability">
       +<code class="descname">hydraulicPermeability</code><span class="sig-paren">(</span><em>phi_min=0.3</em>, <em>phi_max=0.99</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.hydraulicPermeability" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Determine the hydraulic permeability (k) [m*m] from the Kozeny-Carman
       +relationship, using the permeability prefactor (<cite>self.k_c</cite>), and the
       +range of valid porosities set in <cite>src/darcy.cuh</cite>, by default in the
       +range 0.1 to 0.9.</p>
       +<p>This function is only valid for the Darcy solver (<cite>self.cfd_solver ==
       +1</cite>).</p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.id">
       +<code class="descname">id</code><span class="sig-paren">(</span><em>sid=''</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.id" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Returns or sets the simulation id/name, which is used to identify
       +simulation files in the output folders.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>sid</strong> (<em>str</em>) &#8211; The desired simulation id. If left blank the current
       +simulation id will be returned.</td>
       +</tr>
       +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The current simulation id if no new value is set.</td>
       +</tr>
       +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.idAppend">
       +<code class="descname">idAppend</code><span class="sig-paren">(</span><em>string</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.idAppend" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Append a string to the simulation id/name, which is used to identify
       +simulation files in the output folders.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>string</strong> (<em>str</em>) &#8211; The string to append to the simulation id (<cite>self.sid</cite>).</td>
       +</tr>
       +</tbody>
       +</table>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.inertiaParameterPlanarShear">
       -<tt class="descname">inertiaParameterPlanarShear</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.inertiaParameterPlanarShear" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">inertiaParameterPlanarShear</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.inertiaParameterPlanarShear" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the value of the inertia parameter $I$ during planar shear
        proposed by GDR-MiDi 2004.</p>
        <table class="docutils field-list" frame="void" rules="none">
       t@@ -782,14 +1133,14 @@ proposed by GDR-MiDi 2004.</p>
        </tr>
        </tbody>
        </table>
       -<p>See also: <a class="reference internal" href="#sphere.sim.shearStrainRate" title="sphere.sim.shearStrainRate"><tt class="xref py py-func docutils literal"><span class="pre">shearStrainRate()</span></tt></a> and <a class="reference internal" href="#sphere.sim.shearVel" title="sphere.sim.shearVel"><tt class="xref py py-func docutils literal"><span class="pre">shearVel()</span></tt></a></p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.shearStrainRate" title="sphere.sim.shearStrainRate"><code class="xref py py-func docutils literal"><span class="pre">shearStrainRate()</span></code></a> and <a class="reference internal" href="#sphere.sim.shearVel" title="sphere.sim.shearVel"><code class="xref py py-func docutils literal"><span class="pre">shearVel()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.initFluid">
       -<tt class="descname">initFluid</tt><big>(</big><em>mu=0.00089</em>, <em>rho=1000.0</em>, <em>p=1.0</em>, <em>hydrostatic=True</em><big>)</big><a class="headerlink" href="#sphere.sim.initFluid" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">initFluid</code><span class="sig-paren">(</span><em>mu=0.00089</em>, <em>rho=1000.0</em>, <em>p=0.0</em>, <em>hydrostatic=False</em>, <em>cfd_solver=0</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.initFluid" title="Permalink to this definition">¶</a></dt>
        <dd><p>Initialize the fluid arrays and the fluid viscosity. The default value
       -of <tt class="docutils literal"><span class="pre">mu</span></tt> equals the dynamic viscosity of water at 25 degrees Celcius.
       +of <code class="docutils literal"><span class="pre">mu</span></code> equals the dynamic viscosity of water at 25 degrees Celcius.
        The value for water at 0 degrees Celcius is 17.87e-4 kg/(m*s).</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -803,8 +1154,10 @@ parameter <cite>hydrostatic</cite> is set to <cite>True</cite>, this value will 
        the fluid cells at the top</li>
        <li><strong>hydrostatic</strong> (<em>bool</em>) &#8211; Initialize the fluid pressures to the hydrostatic
        pressure distribution. A pressure gradient with depth is only
       -created if a gravitational acceleration along <img class="math" src="_images/math/b13f21416d84e13708696f34dea81026cda583c9.png" alt="z"/> previously
       +created if a gravitational acceleration along <img class="math" src="_images/math/84d7271dd9e78c1e05d6c3c6ecb60309ef7dfc73.png" alt="z"/> previously
        has been specified</li>
       +<li><strong>cfd_solver</strong> (<em>int</em>) &#8211; Solver to use for the computational fluid dynamics.
       +Accepted values: 0 (Navier Stokes, default) and 1 (Darcy).</li>
        </ul>
        </td>
        </tr>
       t@@ -814,7 +1167,7 @@ has been specified</li>
        
        <dl class="method">
        <dt id="sphere.sim.initGrid">
       -<tt class="descname">initGrid</tt><big>(</big><em>dx=-1</em><big>)</big><a class="headerlink" href="#sphere.sim.initGrid" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">initGrid</code><span class="sig-paren">(</span><em>dx=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.initGrid" title="Permalink to this definition">¶</a></dt>
        <dd><p>Initialize grid suitable for the particle positions set previously.
        The margin parameter adjusts the distance (in no. of max. radii)
        from the particle boundaries.
       t@@ -833,7 +1186,7 @@ width isn&#8217;t specified by <cite>dx</cite>.</p>
        
        <dl class="method">
        <dt id="sphere.sim.initGridAndWorldsize">
       -<tt class="descname">initGridAndWorldsize</tt><big>(</big><em>margin=2.0</em><big>)</big><a class="headerlink" href="#sphere.sim.initGridAndWorldsize" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">initGridAndWorldsize</code><span class="sig-paren">(</span><em>margin=2.0</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.initGridAndWorldsize" title="Permalink to this definition">¶</a></dt>
        <dd><p>Initialize grid suitable for the particle positions set previously.
        The margin parameter adjusts the distance (in no. of max. radii)
        from the particle boundaries. If the upper wall is dynamic, it is placed
       t@@ -850,9 +1203,9 @@ at the top boundary of the world.</p>
        
        <dl class="method">
        <dt id="sphere.sim.initGridPos">
       -<tt class="descname">initGridPos</tt><big>(</big><em>gridnum=array([12</em>, <em>12</em>, <em>36])</em><big>)</big><a class="headerlink" href="#sphere.sim.initGridPos" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">initGridPos</code><span class="sig-paren">(</span><em>gridnum=array([12</em>, <em>12</em>, <em>36])</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.initGridPos" title="Permalink to this definition">¶</a></dt>
        <dd><p>Initialize particle positions in loose, cubic configuration.
       -<tt class="docutils literal"><span class="pre">gridnum</span></tt> is the number of cells in the x, y and z directions.
       +<code class="docutils literal"><span class="pre">gridnum</span></code> is the number of cells in the x, y and z directions.
        <em>Important</em>: The particle radii and the boundary conditions (periodic or
        not) for the x and y boundaries have to be set beforehand.</p>
        <table class="docutils field-list" frame="void" rules="none">
       t@@ -867,9 +1220,9 @@ not) for the x and y boundaries have to be set beforehand.</p>
        
        <dl class="method">
        <dt id="sphere.sim.initRandomGridPos">
       -<tt class="descname">initRandomGridPos</tt><big>(</big><em>gridnum=array([12</em>, <em>12</em>, <em>32])</em><big>)</big><a class="headerlink" href="#sphere.sim.initRandomGridPos" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">initRandomGridPos</code><span class="sig-paren">(</span><em>gridnum=array([12</em>, <em>12</em>, <em>32])</em>, <em>padding=2.1</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.initRandomGridPos" title="Permalink to this definition">¶</a></dt>
        <dd><p>Initialize particle positions in loose, cubic configuration with some
       -variance. <tt class="docutils literal"><span class="pre">gridnum</span></tt> is the number of cells in the x, y and z
       +variance. <code class="docutils literal"><span class="pre">gridnum</span></code> is the number of cells in the x, y and z
        directions.  <em>Important</em>: The particle radii and the boundary conditions
        (periodic or not) for the x and y boundaries have to be set beforehand.
        The world size and grid height (in the z direction) is readjusted to fit
       t@@ -878,7 +1231,13 @@ the particle positions.</p>
        <col class="field-name" />
        <col class="field-body" />
        <tbody valign="top">
       -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>gridnum</strong> (<em>numpy.array</em>) &#8211; The number of particles in x, y and z directions</td>
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
       +<li><strong>gridnum</strong> (<em>numpy.array</em>) &#8211; The number of particles in x, y and z directions</li>
       +<li><strong>padding</strong> (<em>float</em>) &#8211; Increase distance between particles in x, y and z
       +directions with this multiplier. Large values create more random
       +packings.</li>
       +</ul>
       +</td>
        </tr>
        </tbody>
        </table>
       t@@ -886,7 +1245,7 @@ the particle positions.</p>
        
        <dl class="method">
        <dt id="sphere.sim.initRandomPos">
       -<tt class="descname">initRandomPos</tt><big>(</big><em>gridnum=array([12</em>, <em>12</em>, <em>36])</em><big>)</big><a class="headerlink" href="#sphere.sim.initRandomPos" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">initRandomPos</code><span class="sig-paren">(</span><em>gridnum=array([12</em>, <em>12</em>, <em>36])</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.initRandomPos" title="Permalink to this definition">¶</a></dt>
        <dd><p>Initialize particle positions in completely random configuration. Radii
        <em>must</em> be set beforehand. If the x and y boundaries are set as periodic,
        the particle centers will be placed all the way to the edge. On regular,
       t@@ -910,7 +1269,7 @@ make space for their radii within the bounding box.</p>
        
        <dl class="method">
        <dt id="sphere.sim.initTemporal">
       -<tt class="descname">initTemporal</tt><big>(</big><em>total</em>, <em>current=0.0</em>, <em>file_dt=0.05</em>, <em>step_count=0</em>, <em>dt=-1</em>, <em>epsilon=0.01</em><big>)</big><a class="headerlink" href="#sphere.sim.initTemporal" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">initTemporal</code><span class="sig-paren">(</span><em>total</em>, <em>current=0.0</em>, <em>file_dt=0.05</em>, <em>step_count=0</em>, <em>dt=-1</em>, <em>epsilon=0.01</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.initTemporal" title="Permalink to this definition">¶</a></dt>
        <dd><p>Set temporal parameters for the simulation. <em>Important</em>: Particle radii,
        physical parameters, and the optional fluid grid need to be set prior to
        these if the computational time step (dt) isn&#8217;t set explicitly. If the
       t@@ -931,7 +1290,7 @@ included.</p>
        </ul>
        </td>
        </tr>
       -<tr class="field-even field"><th class="field-name">Step_count :</th><td class="field-body"><p class="first last">The number of the first output file (default = 0)</p>
       +<tr class="field-even field"><th class="field-name">Step_count:</th><td class="field-body"><p class="first last">The number of the first output file (default = 0)</p>
        </td>
        </tr>
        </tbody>
       t@@ -940,7 +1299,7 @@ included.</p>
        
        <dl class="method">
        <dt id="sphere.sim.kineticEnergy">
       -<tt class="descname">kineticEnergy</tt><big>(</big><em>idx</em><big>)</big><a class="headerlink" href="#sphere.sim.kineticEnergy" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">kineticEnergy</code><span class="sig-paren">(</span><em>idx</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.kineticEnergy" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the (linear) kinetic energy for a particle.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -957,8 +1316,39 @@ included.</p>
        </dd></dl>
        
        <dl class="method">
       +<dt id="sphere.sim.largestFluidTimeStep">
       +<code class="descname">largestFluidTimeStep</code><span class="sig-paren">(</span><em>safety=0.5</em>, <em>v_max=-1.0</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.largestFluidTimeStep" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Finds and returns the largest time step in the fluid phase by von
       +Neumann and Courant-Friedrichs-Lewy analysis given the current
       +velocities. This ensures stability in the diffusive and advective parts
       +of the momentum equation.</p>
       +<p>The value of the time step decreases with increasing fluid viscosity
       +(<cite>self.mu</cite>), and increases with fluid cell size (<cite>self.L/self.num</cite>)</p>
       +<p>and fluid velocities (<cite>self.v_f</cite>)</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
       +<li><strong>safety</strong> (<em>float</em>) &#8211; Safety factor which is multiplied to the largest time
       +step.</li>
       +<li><strong>v_max</strong> (<em>float</em>) &#8211; The largest anticipated absolute fluid velocity [m/s]</li>
       +</ul>
       +</td>
       +</tr>
       +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The largest timestep stable for the current fluid state.</p>
       +</td>
       +</tr>
       +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">float</p>
       +</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
        <dt id="sphere.sim.largestMass">
       -<tt class="descname">largestMass</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.largestMass" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">largestMass</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.largestMass" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the mass of the heaviest particle.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -976,7 +1366,7 @@ included.</p>
        
        <dl class="method">
        <dt id="sphere.sim.mass">
       -<tt class="descname">mass</tt><big>(</big><em>idx</em><big>)</big><a class="headerlink" href="#sphere.sim.mass" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">mass</code><span class="sig-paren">(</span><em>idx</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.mass" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the mass of a particle.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -994,7 +1384,7 @@ included.</p>
        
        <dl class="method">
        <dt id="sphere.sim.momentOfInertia">
       -<tt class="descname">momentOfInertia</tt><big>(</big><em>idx</em><big>)</big><a class="headerlink" href="#sphere.sim.momentOfInertia" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">momentOfInertia</code><span class="sig-paren">(</span><em>idx</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.momentOfInertia" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the moment of inertia of a particle.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -1012,7 +1402,7 @@ included.</p>
        
        <dl class="method">
        <dt id="sphere.sim.momentum">
       -<tt class="descname">momentum</tt><big>(</big><em>idx</em><big>)</big><a class="headerlink" href="#sphere.sim.momentum" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">momentum</code><span class="sig-paren">(</span><em>idx</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.momentum" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the momentum (m*v) of a particle.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -1030,32 +1420,53 @@ included.</p>
        
        <dl class="method">
        <dt id="sphere.sim.normalBoundariesXY">
       -<tt class="descname">normalBoundariesXY</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.normalBoundariesXY" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">normalBoundariesXY</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.normalBoundariesXY" title="Permalink to this definition">¶</a></dt>
        <dd><p>Set the x and y boundary conditions to be static walls.</p>
       -<p>See also <a class="reference internal" href="#sphere.sim.periodicBoundariesXY" title="sphere.sim.periodicBoundariesXY"><tt class="xref py py-func docutils literal"><span class="pre">periodicBoundariesXY()</span></tt></a> and
       -<a class="reference internal" href="#sphere.sim.periodicBoundariesX" title="sphere.sim.periodicBoundariesX"><tt class="xref py py-func docutils literal"><span class="pre">periodicBoundariesX()</span></tt></a></p>
       +<p>See also <a class="reference internal" href="#sphere.sim.periodicBoundariesXY" title="sphere.sim.periodicBoundariesXY"><code class="xref py py-func docutils literal"><span class="pre">periodicBoundariesXY()</span></code></a> and
       +<a class="reference internal" href="#sphere.sim.periodicBoundariesX" title="sphere.sim.periodicBoundariesX"><code class="xref py py-func docutils literal"><span class="pre">periodicBoundariesX()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.periodicBoundariesX">
       -<tt class="descname">periodicBoundariesX</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.periodicBoundariesX" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">periodicBoundariesX</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.periodicBoundariesX" title="Permalink to this definition">¶</a></dt>
        <dd><p>Set the x boundary conditions to be periodic.</p>
       -<p>See also <a class="reference internal" href="#sphere.sim.normalBoundariesXY" title="sphere.sim.normalBoundariesXY"><tt class="xref py py-func docutils literal"><span class="pre">normalBoundariesXY()</span></tt></a> and
       -<a class="reference internal" href="#sphere.sim.periodicBoundariesXY" title="sphere.sim.periodicBoundariesXY"><tt class="xref py py-func docutils literal"><span class="pre">periodicBoundariesXY()</span></tt></a></p>
       +<p>See also <a class="reference internal" href="#sphere.sim.normalBoundariesXY" title="sphere.sim.normalBoundariesXY"><code class="xref py py-func docutils literal"><span class="pre">normalBoundariesXY()</span></code></a> and
       +<a class="reference internal" href="#sphere.sim.periodicBoundariesXY" title="sphere.sim.periodicBoundariesXY"><code class="xref py py-func docutils literal"><span class="pre">periodicBoundariesXY()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.periodicBoundariesXY">
       -<tt class="descname">periodicBoundariesXY</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.periodicBoundariesXY" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">periodicBoundariesXY</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.periodicBoundariesXY" title="Permalink to this definition">¶</a></dt>
        <dd><p>Set the x and y boundary conditions to be periodic.</p>
       -<p>See also <a class="reference internal" href="#sphere.sim.normalBoundariesXY" title="sphere.sim.normalBoundariesXY"><tt class="xref py py-func docutils literal"><span class="pre">normalBoundariesXY()</span></tt></a> and
       -<a class="reference internal" href="#sphere.sim.periodicBoundariesX" title="sphere.sim.periodicBoundariesX"><tt class="xref py py-func docutils literal"><span class="pre">periodicBoundariesX()</span></tt></a></p>
       +<p>See also <a class="reference internal" href="#sphere.sim.normalBoundariesXY" title="sphere.sim.normalBoundariesXY"><code class="xref py py-func docutils literal"><span class="pre">normalBoundariesXY()</span></code></a> and
       +<a class="reference internal" href="#sphere.sim.periodicBoundariesX" title="sphere.sim.periodicBoundariesX"><code class="xref py py-func docutils literal"><span class="pre">periodicBoundariesX()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.plotContacts">
       +<code class="descname">plotContacts</code><span class="sig-paren">(</span><em>graphics_format='png', figsize=[4, 4], title=None, lower_limit=0.0, upper_limit=1.0, alpha=1.0, return_data=False, outfolder='.', f_min=None, f_max=None, histogram=True, forcechains=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.plotContacts" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Plot current contact orientations on polar plot</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
       +<li><strong>lower_limit</strong> (<em>float</em>) &#8211; Do not visualize force chains below this relative
       +contact force magnitude, in ]0;1[</li>
       +<li><strong>upper_limit</strong> (<em>float</em>) &#8211; Visualize force chains above this relative
       +contact force magnitude but cap color bar range, in ]0;1[</li>
       +<li><strong>graphics_format</strong> (<em>str</em>) &#8211; Save the plot in this format</li>
       +</ul>
       +</td>
       +</tr>
       +</tbody>
       +</table>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.plotConvergence">
       -<tt class="descname">plotConvergence</tt><big>(</big><em>graphics_format='png'</em><big>)</big><a class="headerlink" href="#sphere.sim.plotConvergence" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Plot the convergence evolution in the CFD solver. The plot is saved 
       +<code class="descname">plotConvergence</code><span class="sig-paren">(</span><em>graphics_format='png'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.plotConvergence" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Plot the convergence evolution in the CFD solver. The plot is saved
        in the output folder with the file name
        &#8216;&lt;simulation id&gt;-conv.&lt;graphics_format&gt;&#8217;.</p>
        <table class="docutils field-list" frame="void" rules="none">
       t@@ -1066,11 +1477,12 @@ in the output folder with the file name
        </tr>
        </tbody>
        </table>
       +<p>See also: <a class="reference internal" href="#sphere.sim.convergence" title="sphere.sim.convergence"><code class="xref py py-func docutils literal"><span class="pre">convergence()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.plotFluidDiffAdvPresZ">
       -<tt class="descname">plotFluidDiffAdvPresZ</tt><big>(</big><em>graphics_format='png'</em><big>)</big><a class="headerlink" href="#sphere.sim.plotFluidDiffAdvPresZ" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">plotFluidDiffAdvPresZ</code><span class="sig-paren">(</span><em>graphics_format='png'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.plotFluidDiffAdvPresZ" title="Permalink to this definition">¶</a></dt>
        <dd><p>Compare contributions to the velocity from diffusion and advection,
        assuming the flow is 1D along the z-axis, phi = 1, and dphi = 0. This
        solution is analog to the predicted velocity and not constrained by the
       t@@ -1089,7 +1501,7 @@ viscosity&gt;Pa-s.&lt;graphics_format&gt;&#8217;.</p>
        
        <dl class="method">
        <dt id="sphere.sim.plotFluidPressuresY">
       -<tt class="descname">plotFluidPressuresY</tt><big>(</big><em>y=-1</em>, <em>graphics_format='png'</em><big>)</big><a class="headerlink" href="#sphere.sim.plotFluidPressuresY" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">plotFluidPressuresY</code><span class="sig-paren">(</span><em>y=-1</em>, <em>graphics_format='png'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.plotFluidPressuresY" title="Permalink to this definition">¶</a></dt>
        <dd><p>Plot fluid pressures in a plane normal to the second axis.
        The plot is saved in the current folder with the format
        &#8216;p_f-&lt;simulation id&gt;-y&lt;y value&gt;.&lt;graphics_format&gt;&#8217;.</p>
       t@@ -1106,12 +1518,12 @@ this value is -1, the center y position is used.</li>
        </tr>
        </tbody>
        </table>
       -<p>See also: <a class="reference internal" href="#sphere.sim.writeFluidVTK" title="sphere.sim.writeFluidVTK"><tt class="xref py py-func docutils literal"><span class="pre">writeFluidVTK()</span></tt></a> and <a class="reference internal" href="#sphere.sim.plotFluidPressuresZ" title="sphere.sim.plotFluidPressuresZ"><tt class="xref py py-func docutils literal"><span class="pre">plotFluidPressuresZ()</span></tt></a></p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.writeFluidVTK" title="sphere.sim.writeFluidVTK"><code class="xref py py-func docutils literal"><span class="pre">writeFluidVTK()</span></code></a> and <a class="reference internal" href="#sphere.sim.plotFluidPressuresZ" title="sphere.sim.plotFluidPressuresZ"><code class="xref py py-func docutils literal"><span class="pre">plotFluidPressuresZ()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.plotFluidPressuresZ">
       -<tt class="descname">plotFluidPressuresZ</tt><big>(</big><em>z=-1</em>, <em>graphics_format='png'</em><big>)</big><a class="headerlink" href="#sphere.sim.plotFluidPressuresZ" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">plotFluidPressuresZ</code><span class="sig-paren">(</span><em>z=-1</em>, <em>graphics_format='png'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.plotFluidPressuresZ" title="Permalink to this definition">¶</a></dt>
        <dd><p>Plot fluid pressures in a plane normal to the third axis.
        The plot is saved in the current folder with the format
        &#8216;p_f-&lt;simulation id&gt;-z&lt;z value&gt;.&lt;graphics_format&gt;&#8217;.</p>
       t@@ -1128,12 +1540,12 @@ this value is -1, the center z position is used.</li>
        </tr>
        </tbody>
        </table>
       -<p>See also: <a class="reference internal" href="#sphere.sim.writeFluidVTK" title="sphere.sim.writeFluidVTK"><tt class="xref py py-func docutils literal"><span class="pre">writeFluidVTK()</span></tt></a> and <a class="reference internal" href="#sphere.sim.plotFluidPressuresY" title="sphere.sim.plotFluidPressuresY"><tt class="xref py py-func docutils literal"><span class="pre">plotFluidPressuresY()</span></tt></a></p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.writeFluidVTK" title="sphere.sim.writeFluidVTK"><code class="xref py py-func docutils literal"><span class="pre">writeFluidVTK()</span></code></a> and <a class="reference internal" href="#sphere.sim.plotFluidPressuresY" title="sphere.sim.plotFluidPressuresY"><code class="xref py py-func docutils literal"><span class="pre">plotFluidPressuresY()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.plotFluidVelocitiesY">
       -<tt class="descname">plotFluidVelocitiesY</tt><big>(</big><em>y=-1</em>, <em>graphics_format='png'</em><big>)</big><a class="headerlink" href="#sphere.sim.plotFluidVelocitiesY" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">plotFluidVelocitiesY</code><span class="sig-paren">(</span><em>y=-1</em>, <em>graphics_format='png'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.plotFluidVelocitiesY" title="Permalink to this definition">¶</a></dt>
        <dd><p>Plot fluid velocities in a plane normal to the second axis.
        The plot is saved in the current folder with the format
        &#8216;v_f-&lt;simulation id&gt;-z&lt;z value&gt;.&lt;graphics_format&gt;&#8217;.</p>
       t@@ -1150,12 +1562,12 @@ this value is -1, the center y position is used.</li>
        </tr>
        </tbody>
        </table>
       -<p>See also: <a class="reference internal" href="#sphere.sim.writeFluidVTK" title="sphere.sim.writeFluidVTK"><tt class="xref py py-func docutils literal"><span class="pre">writeFluidVTK()</span></tt></a> and <a class="reference internal" href="#sphere.sim.plotFluidVelocitiesZ" title="sphere.sim.plotFluidVelocitiesZ"><tt class="xref py py-func docutils literal"><span class="pre">plotFluidVelocitiesZ()</span></tt></a></p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.writeFluidVTK" title="sphere.sim.writeFluidVTK"><code class="xref py py-func docutils literal"><span class="pre">writeFluidVTK()</span></code></a> and <a class="reference internal" href="#sphere.sim.plotFluidVelocitiesZ" title="sphere.sim.plotFluidVelocitiesZ"><code class="xref py py-func docutils literal"><span class="pre">plotFluidVelocitiesZ()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.plotFluidVelocitiesZ">
       -<tt class="descname">plotFluidVelocitiesZ</tt><big>(</big><em>z=-1</em>, <em>graphics_format='png'</em><big>)</big><a class="headerlink" href="#sphere.sim.plotFluidVelocitiesZ" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">plotFluidVelocitiesZ</code><span class="sig-paren">(</span><em>z=-1</em>, <em>graphics_format='png'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.plotFluidVelocitiesZ" title="Permalink to this definition">¶</a></dt>
        <dd><p>Plot fluid velocities in a plane normal to the third axis.
        The plot is saved in the current folder with the format
        &#8216;v_f-&lt;simulation id&gt;-z&lt;z value&gt;.&lt;graphics_format&gt;&#8217;.</p>
       t@@ -1172,12 +1584,12 @@ this value is -1, the center z position is used.</li>
        </tr>
        </tbody>
        </table>
       -<p>See also: <a class="reference internal" href="#sphere.sim.writeFluidVTK" title="sphere.sim.writeFluidVTK"><tt class="xref py py-func docutils literal"><span class="pre">writeFluidVTK()</span></tt></a> and <a class="reference internal" href="#sphere.sim.plotFluidVelocitiesY" title="sphere.sim.plotFluidVelocitiesY"><tt class="xref py py-func docutils literal"><span class="pre">plotFluidVelocitiesY()</span></tt></a></p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.writeFluidVTK" title="sphere.sim.writeFluidVTK"><code class="xref py py-func docutils literal"><span class="pre">writeFluidVTK()</span></code></a> and <a class="reference internal" href="#sphere.sim.plotFluidVelocitiesY" title="sphere.sim.plotFluidVelocitiesY"><code class="xref py py-func docutils literal"><span class="pre">plotFluidVelocitiesY()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.plotLoadCurve">
       -<tt class="descname">plotLoadCurve</tt><big>(</big><em>graphics_format='png'</em><big>)</big><a class="headerlink" href="#sphere.sim.plotLoadCurve" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">plotLoadCurve</code><span class="sig-paren">(</span><em>graphics_format='png'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.plotLoadCurve" title="Permalink to this definition">¶</a></dt>
        <dd><p>Plot the load curve (log time vs. upper wall movement).  The plot is
        saved in the current folder with the file name
        &#8216;&lt;simulation id&gt;-loadcurve.&lt;graphics_format&gt;&#8217;.
       t@@ -1197,7 +1609,7 @@ simulation (i.e. flat curve).</p>
        
        <dl class="method">
        <dt id="sphere.sim.plotPrescribedFluidPressures">
       -<tt class="descname">plotPrescribedFluidPressures</tt><big>(</big><em>graphics_format='png'</em><big>)</big><a class="headerlink" href="#sphere.sim.plotPrescribedFluidPressures" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">plotPrescribedFluidPressures</code><span class="sig-paren">(</span><em>graphics_format='png'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.plotPrescribedFluidPressures" title="Permalink to this definition">¶</a></dt>
        <dd><p>Plot the prescribed fluid pressures through time that may be
        modulated through the class parameters p_mod_A, p_mod_f, and p_mod_phi.
        The plot is saved in the output folder with the file name
       t@@ -1205,8 +1617,35 @@ The plot is saved in the output folder with the file name
        </dd></dl>
        
        <dl class="method">
       +<dt id="sphere.sim.plotSinFunction">
       +<code class="descname">plotSinFunction</code><span class="sig-paren">(</span><em>baseval</em>, <em>A</em>, <em>f</em>, <em>phi=0.0</em>, <em>xlabel='$t$ [s]'</em>, <em>ylabel='$y$'</em>, <em>plotstyle='.'</em>, <em>outformat='png'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.plotSinFunction" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Plot the values of a sinusoidal modulated base value. Saves the output
       +as a plot in the current folder.
       +The time values will range from <cite>self.time_current</cite> to
       +<cite>self.time_total</cite>.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
       +<li><strong>baseval</strong> (<em>float</em>) &#8211; The center value which the sinusoidal fluctuations are
       +modulating</li>
       +<li><strong>A</strong> (<em>float</em>) &#8211; The fluctuation amplitude</li>
       +<li><strong>phi</strong> (<em>float</em>) &#8211; The phase shift [s]</li>
       +<li><strong>xlabel</strong> (<em>str</em>) &#8211; The label for the x axis</li>
       +<li><strong>ylabel</strong> (<em>str</em>) &#8211; The label for the y axis</li>
       +<li><strong>plotstyle</strong> (<em>str</em>) &#8211; Matplotlib-string for specifying plotting style</li>
       +<li><strong>outformat</strong> (<em>str</em>) &#8211; File format of the output plot</li>
       +</ul>
       +</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
        <dt id="sphere.sim.porosities">
       -<tt class="descname">porosities</tt><big>(</big><em>graphics_format='pdf'</em>, <em>zslices=16</em><big>)</big><a class="headerlink" href="#sphere.sim.porosities" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">porosities</code><span class="sig-paren">(</span><em>graphics_format='pdf'</em>, <em>zslices=16</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.porosities" title="Permalink to this definition">¶</a></dt>
        <dd><p>Plot the averaged porosities with depth. The plot is saved in the format
        &#8216;&lt;simulation id&gt;-porosity.&lt;graphics_format&gt;&#8217;.</p>
        <table class="docutils field-list" frame="void" rules="none">
       t@@ -1226,10 +1665,10 @@ the porosity in</li>
        
        <dl class="method">
        <dt id="sphere.sim.porosity">
       -<tt class="descname">porosity</tt><big>(</big><em>slices=10</em>, <em>verbose=False</em><big>)</big><a class="headerlink" href="#sphere.sim.porosity" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">porosity</code><span class="sig-paren">(</span><em>slices=10</em>, <em>verbose=False</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.porosity" title="Permalink to this definition">¶</a></dt>
        <dd><p>Calculates the porosity as a function of depth, by averaging values in
        horizontal slabs. Returns porosity values and their corresponding depth.
       -The values are calculated using the external <tt class="docutils literal"><span class="pre">porosity</span></tt> program.</p>
       +The values are calculated using the external <code class="docutils literal"><span class="pre">porosity</span></code> program.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
       t@@ -1253,7 +1692,7 @@ disk</li>
        
        <dl class="method">
        <dt id="sphere.sim.randomBondPairs">
       -<tt class="descname">randomBondPairs</tt><big>(</big><em>ratio=0.3</em>, <em>spacing=-0.1</em><big>)</big><a class="headerlink" href="#sphere.sim.randomBondPairs" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">randomBondPairs</code><span class="sig-paren">(</span><em>ratio=0.3</em>, <em>spacing=-0.1</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.randomBondPairs" title="Permalink to this definition">¶</a></dt>
        <dd><p>Bond an amount of particles in two-particle clusters. The particles
        should be initialized beforehand.  Note: The actual number of bonds is
        likely to be somewhat smaller than specified, due to the random
       t@@ -1274,23 +1713,40 @@ particles, neg. values denote an overlap. Values in ]0.0,inf[.</li>
        </dd></dl>
        
        <dl class="method">
       +<dt id="sphere.sim.readTime">
       +<code class="descname">readTime</code><span class="sig-paren">(</span><em>time</em>, <em>verbose=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.readTime" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Read the output file most closely corresponding to the time given as an
       +argument.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>time</strong> (<em>float</em>) &#8211; The desired current time [s]</td>
       +</tr>
       +</tbody>
       +</table>
       +<p>See also <a class="reference internal" href="#sphere.sim.readbin" title="sphere.sim.readbin"><code class="xref py py-func docutils literal"><span class="pre">readbin()</span></code></a>, <a class="reference internal" href="#sphere.sim.readfirst" title="sphere.sim.readfirst"><code class="xref py py-func docutils literal"><span class="pre">readfirst()</span></code></a>, <a class="reference internal" href="#sphere.sim.readsecond" title="sphere.sim.readsecond"><code class="xref py py-func docutils literal"><span class="pre">readsecond()</span></code></a>, and
       +<a class="reference internal" href="#sphere.sim.readstep" title="sphere.sim.readstep"><code class="xref py py-func docutils literal"><span class="pre">readstep()</span></code></a>.</p>
       +</dd></dl>
       +
       +<dl class="method">
        <dt id="sphere.sim.readbin">
       -<tt class="descname">readbin</tt><big>(</big><em>targetbin</em>, <em>verbose=True</em>, <em>bonds=True</em>, <em>devsmod=True</em>, <em>esysparticle=False</em><big>)</big><a class="headerlink" href="#sphere.sim.readbin" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Reads a target <tt class="docutils literal"><span class="pre">sphere</span></tt> binary file.</p>
       -<p>See also <a class="reference internal" href="#sphere.sim.writebin" title="sphere.sim.writebin"><tt class="xref py py-func docutils literal"><span class="pre">writebin()</span></tt></a>, <a class="reference internal" href="#sphere.sim.readfirst" title="sphere.sim.readfirst"><tt class="xref py py-func docutils literal"><span class="pre">readfirst()</span></tt></a>, <a class="reference internal" href="#sphere.sim.readlast" title="sphere.sim.readlast"><tt class="xref py py-func docutils literal"><span class="pre">readlast()</span></tt></a>,
       -<a class="reference internal" href="#sphere.sim.readsecond" title="sphere.sim.readsecond"><tt class="xref py py-func docutils literal"><span class="pre">readsecond()</span></tt></a>, and <a class="reference internal" href="#sphere.sim.readstep" title="sphere.sim.readstep"><tt class="xref py py-func docutils literal"><span class="pre">readstep()</span></tt></a>.</p>
       +<code class="descname">readbin</code><span class="sig-paren">(</span><em>targetbin</em>, <em>verbose=True</em>, <em>bonds=True</em>, <em>sigma0mod=True</em>, <em>esysparticle=False</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.readbin" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Reads a target <code class="docutils literal"><span class="pre">sphere</span></code> binary file.</p>
       +<p>See also <a class="reference internal" href="#sphere.sim.writebin" title="sphere.sim.writebin"><code class="xref py py-func docutils literal"><span class="pre">writebin()</span></code></a>, <a class="reference internal" href="#sphere.sim.readfirst" title="sphere.sim.readfirst"><code class="xref py py-func docutils literal"><span class="pre">readfirst()</span></code></a>, <a class="reference internal" href="#sphere.sim.readlast" title="sphere.sim.readlast"><code class="xref py py-func docutils literal"><span class="pre">readlast()</span></code></a>,
       +<a class="reference internal" href="#sphere.sim.readsecond" title="sphere.sim.readsecond"><code class="xref py py-func docutils literal"><span class="pre">readsecond()</span></code></a>, and <a class="reference internal" href="#sphere.sim.readstep" title="sphere.sim.readstep"><code class="xref py py-func docutils literal"><span class="pre">readstep()</span></code></a>.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
        <tbody valign="top">
        <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
       -<li><strong>targetbin</strong> (<em>str</em>) &#8211; The path to the binary <tt class="docutils literal"><span class="pre">sphere</span></tt> file</li>
       +<li><strong>targetbin</strong> (<em>str</em>) &#8211; The path to the binary <code class="docutils literal"><span class="pre">sphere</span></code> file</li>
        <li><strong>verbose</strong> (<em>bool</em>) &#8211; Show diagnostic information (default = True)</li>
        <li><strong>bonds</strong> (<em>bool</em>) &#8211; The input file contains bond information (default = True).
       -This parameter should be true for all recent <tt class="docutils literal"><span class="pre">sphere</span></tt> versions.</li>
       -<li><strong>devsmod</strong> (<em>bool</em>) &#8211; The input file contains information about modulating
       +This parameter should be true for all recent <code class="docutils literal"><span class="pre">sphere</span></code> versions.</li>
       +<li><strong>sigma0mod</strong> (<em>bool</em>) &#8211; The input file contains information about modulating
        stresses at the top wall (default = True). This parameter should be
       -true for all recent <tt class="docutils literal"><span class="pre">sphere</span></tt> versions.</li>
       +true for all recent <code class="docutils literal"><span class="pre">sphere</span></code> versions.</li>
        <li><strong>esysparticle</strong> (<em>bool</em>) &#8211; Stop reading the file after reading the kinematics,
        which is useful for reading output files from other DEM programs.
        (default = False)</li>
       t@@ -1303,9 +1759,9 @@ which is useful for reading output files from other DEM programs.
        
        <dl class="method">
        <dt id="sphere.sim.readfirst">
       -<tt class="descname">readfirst</tt><big>(</big><em>verbose=True</em><big>)</big><a class="headerlink" href="#sphere.sim.readfirst" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Read the first output file from the <tt class="docutils literal"><span class="pre">../output/</span></tt> folder, corresponding
       -to the object simulation id (<tt class="docutils literal"><span class="pre">self.sid</span></tt>).</p>
       +<code class="descname">readfirst</code><span class="sig-paren">(</span><em>verbose=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.readfirst" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Read the first output file from the <code class="docutils literal"><span class="pre">../output/</span></code> folder, corresponding
       +to the object simulation id (<code class="docutils literal"><span class="pre">self.sid</span></code>).</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
       t@@ -1314,15 +1770,15 @@ to the object simulation id (<tt class="docutils literal"><span class="pre">self
        </tr>
        </tbody>
        </table>
       -<p>See also <a class="reference internal" href="#sphere.sim.readbin" title="sphere.sim.readbin"><tt class="xref py py-func docutils literal"><span class="pre">readbin()</span></tt></a>, <a class="reference internal" href="#sphere.sim.readlast" title="sphere.sim.readlast"><tt class="xref py py-func docutils literal"><span class="pre">readlast()</span></tt></a>, <a class="reference internal" href="#sphere.sim.readsecond" title="sphere.sim.readsecond"><tt class="xref py py-func docutils literal"><span class="pre">readsecond()</span></tt></a>, and
       -<a class="reference internal" href="#sphere.sim.readstep" title="sphere.sim.readstep"><tt class="xref py py-func docutils literal"><span class="pre">readstep()</span></tt></a>.</p>
       +<p>See also <a class="reference internal" href="#sphere.sim.readbin" title="sphere.sim.readbin"><code class="xref py py-func docutils literal"><span class="pre">readbin()</span></code></a>, <a class="reference internal" href="#sphere.sim.readlast" title="sphere.sim.readlast"><code class="xref py py-func docutils literal"><span class="pre">readlast()</span></code></a>, <a class="reference internal" href="#sphere.sim.readsecond" title="sphere.sim.readsecond"><code class="xref py py-func docutils literal"><span class="pre">readsecond()</span></code></a>, and
       +<a class="reference internal" href="#sphere.sim.readstep" title="sphere.sim.readstep"><code class="xref py py-func docutils literal"><span class="pre">readstep()</span></code></a>.</p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.readlast">
       -<tt class="descname">readlast</tt><big>(</big><em>verbose=True</em><big>)</big><a class="headerlink" href="#sphere.sim.readlast" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Read the last output file from the <tt class="docutils literal"><span class="pre">../output/</span></tt> folder, corresponding
       -to the object simulation id (<tt class="docutils literal"><span class="pre">self.sid</span></tt>).</p>
       +<code class="descname">readlast</code><span class="sig-paren">(</span><em>verbose=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.readlast" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Read the last output file from the <code class="docutils literal"><span class="pre">../output/</span></code> folder, corresponding
       +to the object simulation id (<code class="docutils literal"><span class="pre">self.sid</span></code>).</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
       t@@ -1331,15 +1787,15 @@ to the object simulation id (<tt class="docutils literal"><span class="pre">self
        </tr>
        </tbody>
        </table>
       -<p>See also <a class="reference internal" href="#sphere.sim.readbin" title="sphere.sim.readbin"><tt class="xref py py-func docutils literal"><span class="pre">readbin()</span></tt></a>, <a class="reference internal" href="#sphere.sim.readfirst" title="sphere.sim.readfirst"><tt class="xref py py-func docutils literal"><span class="pre">readfirst()</span></tt></a>, <a class="reference internal" href="#sphere.sim.readsecond" title="sphere.sim.readsecond"><tt class="xref py py-func docutils literal"><span class="pre">readsecond()</span></tt></a>, and
       -<a class="reference internal" href="#sphere.sim.readstep" title="sphere.sim.readstep"><tt class="xref py py-func docutils literal"><span class="pre">readstep()</span></tt></a>.</p>
       +<p>See also <a class="reference internal" href="#sphere.sim.readbin" title="sphere.sim.readbin"><code class="xref py py-func docutils literal"><span class="pre">readbin()</span></code></a>, <a class="reference internal" href="#sphere.sim.readfirst" title="sphere.sim.readfirst"><code class="xref py py-func docutils literal"><span class="pre">readfirst()</span></code></a>, <a class="reference internal" href="#sphere.sim.readsecond" title="sphere.sim.readsecond"><code class="xref py py-func docutils literal"><span class="pre">readsecond()</span></code></a>, and
       +<a class="reference internal" href="#sphere.sim.readstep" title="sphere.sim.readstep"><code class="xref py py-func docutils literal"><span class="pre">readstep()</span></code></a>.</p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.readsecond">
       -<tt class="descname">readsecond</tt><big>(</big><em>verbose=True</em><big>)</big><a class="headerlink" href="#sphere.sim.readsecond" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Read the second output file from the <tt class="docutils literal"><span class="pre">../output/</span></tt> folder,
       -corresponding to the object simulation id (<tt class="docutils literal"><span class="pre">self.sid</span></tt>).</p>
       +<code class="descname">readsecond</code><span class="sig-paren">(</span><em>verbose=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.readsecond" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Read the second output file from the <code class="docutils literal"><span class="pre">../output/</span></code> folder,
       +corresponding to the object simulation id (<code class="docutils literal"><span class="pre">self.sid</span></code>).</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
       t@@ -1348,15 +1804,15 @@ corresponding to the object simulation id (<tt class="docutils literal"><span cl
        </tr>
        </tbody>
        </table>
       -<p>See also <a class="reference internal" href="#sphere.sim.readbin" title="sphere.sim.readbin"><tt class="xref py py-func docutils literal"><span class="pre">readbin()</span></tt></a>, <a class="reference internal" href="#sphere.sim.readfirst" title="sphere.sim.readfirst"><tt class="xref py py-func docutils literal"><span class="pre">readfirst()</span></tt></a>, <a class="reference internal" href="#sphere.sim.readlast" title="sphere.sim.readlast"><tt class="xref py py-func docutils literal"><span class="pre">readlast()</span></tt></a>,
       -and <a class="reference internal" href="#sphere.sim.readstep" title="sphere.sim.readstep"><tt class="xref py py-func docutils literal"><span class="pre">readstep()</span></tt></a>.</p>
       +<p>See also <a class="reference internal" href="#sphere.sim.readbin" title="sphere.sim.readbin"><code class="xref py py-func docutils literal"><span class="pre">readbin()</span></code></a>, <a class="reference internal" href="#sphere.sim.readfirst" title="sphere.sim.readfirst"><code class="xref py py-func docutils literal"><span class="pre">readfirst()</span></code></a>, <a class="reference internal" href="#sphere.sim.readlast" title="sphere.sim.readlast"><code class="xref py py-func docutils literal"><span class="pre">readlast()</span></code></a>,
       +and <a class="reference internal" href="#sphere.sim.readstep" title="sphere.sim.readstep"><code class="xref py py-func docutils literal"><span class="pre">readstep()</span></code></a>.</p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.readstep">
       -<tt class="descname">readstep</tt><big>(</big><em>step</em>, <em>verbose=True</em><big>)</big><a class="headerlink" href="#sphere.sim.readstep" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Read a output file from the <tt class="docutils literal"><span class="pre">../output/</span></tt> folder, corresponding
       -to the object simulation id (<tt class="docutils literal"><span class="pre">self.sid</span></tt>).</p>
       +<code class="descname">readstep</code><span class="sig-paren">(</span><em>step</em>, <em>verbose=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.readstep" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Read a output file from the <code class="docutils literal"><span class="pre">../output/</span></code> folder, corresponding
       +to the object simulation id (<code class="docutils literal"><span class="pre">self.sid</span></code>).</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
       t@@ -1369,15 +1825,15 @@ to the object simulation id (<tt class="docutils literal"><span class="pre">self
        </tr>
        </tbody>
        </table>
       -<p>See also <a class="reference internal" href="#sphere.sim.readbin" title="sphere.sim.readbin"><tt class="xref py py-func docutils literal"><span class="pre">readbin()</span></tt></a>, <a class="reference internal" href="#sphere.sim.readfirst" title="sphere.sim.readfirst"><tt class="xref py py-func docutils literal"><span class="pre">readfirst()</span></tt></a>, <a class="reference internal" href="#sphere.sim.readlast" title="sphere.sim.readlast"><tt class="xref py py-func docutils literal"><span class="pre">readlast()</span></tt></a>,
       -and <a class="reference internal" href="#sphere.sim.readsecond" title="sphere.sim.readsecond"><tt class="xref py py-func docutils literal"><span class="pre">readsecond()</span></tt></a>.</p>
       +<p>See also <a class="reference internal" href="#sphere.sim.readbin" title="sphere.sim.readbin"><code class="xref py py-func docutils literal"><span class="pre">readbin()</span></code></a>, <a class="reference internal" href="#sphere.sim.readfirst" title="sphere.sim.readfirst"><code class="xref py py-func docutils literal"><span class="pre">readfirst()</span></code></a>, <a class="reference internal" href="#sphere.sim.readlast" title="sphere.sim.readlast"><code class="xref py py-func docutils literal"><span class="pre">readlast()</span></code></a>,
       +and <a class="reference internal" href="#sphere.sim.readsecond" title="sphere.sim.readsecond"><code class="xref py py-func docutils literal"><span class="pre">readsecond()</span></code></a>.</p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.render">
       -<tt class="descname">render</tt><big>(</big><em>method='pres'</em>, <em>max_val=1000.0</em>, <em>lower_cutoff=0.0</em>, <em>graphics_format='png'</em>, <em>verbose=True</em><big>)</big><a class="headerlink" href="#sphere.sim.render" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">render</code><span class="sig-paren">(</span><em>method='pres'</em>, <em>max_val=1000.0</em>, <em>lower_cutoff=0.0</em>, <em>graphics_format='png'</em>, <em>verbose=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.render" title="Permalink to this definition">¶</a></dt>
        <dd><p>Using the built-in ray tracer, render all output files that belong to
       -the simulation, determined by the simulation id (<tt class="docutils literal"><span class="pre">sid</span></tt>).</p>
       +the simulation, determined by the simulation id (<code class="docutils literal"><span class="pre">sid</span></code>).</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
       t@@ -1391,7 +1847,7 @@ total displacement along the x-axis, &#8216;angpos&#8217;: color by angular
        position.</li>
        <li><strong>max_val</strong> (<em>float</em>) &#8211; The maximum value of the color bar</li>
        <li><strong>lower_cutoff</strong> (<em>float</em>) &#8211; Do not render particles with a value below this
       -value, of the field selected by <tt class="docutils literal"><span class="pre">method</span></tt></li>
       +value, of the field selected by <code class="docutils literal"><span class="pre">method</span></code></li>
        <li><strong>graphics_format</strong> (<em>str</em>) &#8211; Convert the PPM images generated by the ray
        tracer to this image format using Imagemagick</li>
        <li><strong>verbose</strong> (<em>bool</em>) &#8211; Show verbose information during ray tracing</li>
       t@@ -1404,7 +1860,7 @@ tracer to this image format using Imagemagick</li>
        
        <dl class="method">
        <dt id="sphere.sim.rotationalEnergy">
       -<tt class="descname">rotationalEnergy</tt><big>(</big><em>idx</em><big>)</big><a class="headerlink" href="#sphere.sim.rotationalEnergy" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">rotationalEnergy</code><span class="sig-paren">(</span><em>idx</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.rotationalEnergy" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the rotational energy for a particle.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -1422,26 +1878,26 @@ tracer to this image format using Imagemagick</li>
        
        <dl class="method">
        <dt id="sphere.sim.run">
       -<tt class="descname">run</tt><big>(</big><em>verbose=True</em>, <em>hideinputfile=False</em>, <em>dry=False</em>, <em>valgrind=False</em>, <em>cudamemcheck=False</em>, <em>device=-1</em><big>)</big><a class="headerlink" href="#sphere.sim.run" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Start <tt class="docutils literal"><span class="pre">sphere</span></tt> calculations on the <tt class="docutils literal"><span class="pre">sim</span></tt> object</p>
       +<code class="descname">run</code><span class="sig-paren">(</span><em>verbose=True</em>, <em>hideinputfile=False</em>, <em>dry=False</em>, <em>valgrind=False</em>, <em>cudamemcheck=False</em>, <em>device=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.run" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Start <code class="docutils literal"><span class="pre">sphere</span></code> calculations on the <code class="docutils literal"><span class="pre">sim</span></code> object</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
        <tbody valign="top">
        <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
       -<li><strong>verbose</strong> (<em>bool</em>) &#8211; Show <tt class="docutils literal"><span class="pre">sphere</span></tt> output</li>
       -<li><strong>hideinputfile</strong> (<em>bool</em>) &#8211; Hide the file name of the <tt class="docutils literal"><span class="pre">sphere</span></tt> input file</li>
       +<li><strong>verbose</strong> (<em>bool</em>) &#8211; Show <code class="docutils literal"><span class="pre">sphere</span></code> output</li>
       +<li><strong>hideinputfile</strong> (<em>bool</em>) &#8211; Hide the file name of the <code class="docutils literal"><span class="pre">sphere</span></code> input file</li>
        <li><strong>dry</strong> (<em>bool</em>) &#8211; Perform a dry run. Important parameter values are shown by
       -the <tt class="docutils literal"><span class="pre">sphere</span></tt> program, and it exits afterwards.</li>
       -<li><strong>valgrind</strong> (<em>bool</em>) &#8211; Run the program with <tt class="docutils literal"><span class="pre">valgrind</span></tt> in order to check
       +the <code class="docutils literal"><span class="pre">sphere</span></code> program, and it exits afterwards.</li>
       +<li><strong>valgrind</strong> (<em>bool</em>) &#8211; Run the program with <code class="docutils literal"><span class="pre">valgrind</span></code> in order to check
        memory leaks in the host code. This causes a significant increase in
        computational time.</li>
       -<li><strong>cudamemcheck</strong> (<em>bool</em>) &#8211; Run the program with <tt class="docutils literal"><span class="pre">cudamemcheck</span></tt> in order to
       +<li><strong>cudamemcheck</strong> (<em>bool</em>) &#8211; Run the program with <code class="docutils literal"><span class="pre">cudamemcheck</span></code> in order to
        check for device memory leaks and errors. This causes a significant
        increase in computational time.</li>
        <li><strong>device</strong> (<em>int</em>) &#8211; Specify the GPU device to execute the program on.
        If not specified, sphere will use the device with the most CUDA cores.
       -To see a list of devices, run <tt class="docutils literal"><span class="pre">nvidia-smi</span></tt> in the system shell.</li>
       +To see a list of devices, run <code class="docutils literal"><span class="pre">nvidia-smi</span></code> in the system shell.</li>
        </ul>
        </td>
        </tr>
       t@@ -1450,25 +1906,40 @@ To see a list of devices, run <tt class="docutils literal"><span class="pre">nvi
        </dd></dl>
        
        <dl class="method">
       -<dt id="sphere.sim.setBeta">
       -<tt class="descname">setBeta</tt><big>(</big><em>beta</em><big>)</big><a class="headerlink" href="#sphere.sim.setBeta" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Beta is a fluid solver parameter, used in velocity prediction and
       -pressure iteration 1.0: Use old pressures for fluid velocity prediction
       +<dt id="sphere.sim.scaleSize">
       +<code class="descname">scaleSize</code><span class="sig-paren">(</span><em>factor</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.scaleSize" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Scale the positions, linear velocities, forces, torques and radii of all
       +particles and mobile walls.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>factor</strong> (<em>float</em>) &#8211; Spatial scaling factor ]0;inf[</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setBeta">
       +<code class="descname">setBeta</code><span class="sig-paren">(</span><em>beta</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setBeta" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Beta is a fluid solver parameter, used in velocity prediction and
       +pressure iteration 1.0: Use old pressures for fluid velocity prediction
        (see Langtangen et al. 2002) 0.0: Do not use old pressures for fluid
        velocity prediction (Chorin&#8217;s original projection method, see Chorin
        (1968) and &#8220;Projection method (fluid dynamics)&#8221; page on Wikipedia.  The
        best results precision and performance-wise are obtained by using a beta
        of 0 and a low tolerance criteria value.</p>
        <p>The default and recommended value is 0.0.</p>
       -<p>Other solver parameter setting functions: <a class="reference internal" href="#sphere.sim.setGamma" title="sphere.sim.setGamma"><tt class="xref py py-func docutils literal"><span class="pre">setGamma()</span></tt></a>,
       -<a class="reference internal" href="#sphere.sim.setTheta" title="sphere.sim.setTheta"><tt class="xref py py-func docutils literal"><span class="pre">setTheta()</span></tt></a>, <a class="reference internal" href="#sphere.sim.setTolerance" title="sphere.sim.setTolerance"><tt class="xref py py-func docutils literal"><span class="pre">setTolerance()</span></tt></a>,
       -<a class="reference internal" href="#sphere.sim.setDEMstepsPerCFDstep" title="sphere.sim.setDEMstepsPerCFDstep"><tt class="xref py py-func docutils literal"><span class="pre">setDEMstepsPerCFDstep()</span></tt></a> and
       -<a class="reference internal" href="#sphere.sim.setMaxIterations" title="sphere.sim.setMaxIterations"><tt class="xref py py-func docutils literal"><span class="pre">setMaxIterations()</span></tt></a></p>
       +<p>Other solver parameter setting functions: <a class="reference internal" href="#sphere.sim.setGamma" title="sphere.sim.setGamma"><code class="xref py py-func docutils literal"><span class="pre">setGamma()</span></code></a>,
       +<a class="reference internal" href="#sphere.sim.setTheta" title="sphere.sim.setTheta"><code class="xref py py-func docutils literal"><span class="pre">setTheta()</span></code></a>, <a class="reference internal" href="#sphere.sim.setTolerance" title="sphere.sim.setTolerance"><code class="xref py py-func docutils literal"><span class="pre">setTolerance()</span></code></a>,
       +<a class="reference internal" href="#sphere.sim.setDEMstepsPerCFDstep" title="sphere.sim.setDEMstepsPerCFDstep"><code class="xref py py-func docutils literal"><span class="pre">setDEMstepsPerCFDstep()</span></code></a> and
       +<a class="reference internal" href="#sphere.sim.setMaxIterations" title="sphere.sim.setMaxIterations"><code class="xref py py-func docutils literal"><span class="pre">setMaxIterations()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.setDEMstepsPerCFDstep">
       -<tt class="descname">setDEMstepsPerCFDstep</tt><big>(</big><em>ndem</em><big>)</big><a class="headerlink" href="#sphere.sim.setDEMstepsPerCFDstep" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">setDEMstepsPerCFDstep</code><span class="sig-paren">(</span><em>ndem</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setDEMstepsPerCFDstep" title="Permalink to this definition">¶</a></dt>
        <dd><p>A fluid solver parameter, the value of the maxiter parameter denotes the
        number of DEM time steps to be performed per CFD time step.</p>
        <p>The default value is 1.</p>
       t@@ -1480,14 +1951,14 @@ number of DEM time steps to be performed per CFD time step.</p>
        </tr>
        </tbody>
        </table>
       -<p>Other solver parameter setting functions: <a class="reference internal" href="#sphere.sim.setGamma" title="sphere.sim.setGamma"><tt class="xref py py-func docutils literal"><span class="pre">setGamma()</span></tt></a>,
       -<a class="reference internal" href="#sphere.sim.setTheta" title="sphere.sim.setTheta"><tt class="xref py py-func docutils literal"><span class="pre">setTheta()</span></tt></a>, <a class="reference internal" href="#sphere.sim.setBeta" title="sphere.sim.setBeta"><tt class="xref py py-func docutils literal"><span class="pre">setBeta()</span></tt></a>, <a class="reference internal" href="#sphere.sim.setTolerance" title="sphere.sim.setTolerance"><tt class="xref py py-func docutils literal"><span class="pre">setTolerance()</span></tt></a> and
       -<a class="reference internal" href="#sphere.sim.setMaxIterations" title="sphere.sim.setMaxIterations"><tt class="xref py py-func docutils literal"><span class="pre">setMaxIterations()</span></tt></a>.</p>
       +<p>Other solver parameter setting functions: <a class="reference internal" href="#sphere.sim.setGamma" title="sphere.sim.setGamma"><code class="xref py py-func docutils literal"><span class="pre">setGamma()</span></code></a>,
       +<a class="reference internal" href="#sphere.sim.setTheta" title="sphere.sim.setTheta"><code class="xref py py-func docutils literal"><span class="pre">setTheta()</span></code></a>, <a class="reference internal" href="#sphere.sim.setBeta" title="sphere.sim.setBeta"><code class="xref py py-func docutils literal"><span class="pre">setBeta()</span></code></a>, <a class="reference internal" href="#sphere.sim.setTolerance" title="sphere.sim.setTolerance"><code class="xref py py-func docutils literal"><span class="pre">setTolerance()</span></code></a> and
       +<a class="reference internal" href="#sphere.sim.setMaxIterations" title="sphere.sim.setMaxIterations"><code class="xref py py-func docutils literal"><span class="pre">setMaxIterations()</span></code></a>.</p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.setDampingNormal">
       -<tt class="descname">setDampingNormal</tt><big>(</big><em>gamma</em><big>)</big><a class="headerlink" href="#sphere.sim.setDampingNormal" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">setDampingNormal</code><span class="sig-paren">(</span><em>gamma</em>, <em>over_damping=False</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setDampingNormal" title="Permalink to this definition">¶</a></dt>
        <dd><p>Set the dampening coefficient (gamma) in the normal direction of the
        particle-particle contact model. The function will print the fraction
        between the chosen damping and the critical damping value.</p>
       t@@ -1495,16 +1966,20 @@ between the chosen damping and the critical damping value.</p>
        <col class="field-name" />
        <col class="field-body" />
        <tbody valign="top">
       -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>gamma</strong> (<em>float</em>) &#8211; The viscous damping constant [N/(m/s)]</td>
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
       +<li><strong>gamma</strong> (<em>float</em>) &#8211; The viscous damping constant [N/(m/s)]</li>
       +<li><strong>over_damping</strong> (<em>boolean</em>) &#8211; Accept overdampening</li>
       +</ul>
       +</td>
        </tr>
        </tbody>
        </table>
       -<p>See also: <tt class="xref py py-func docutils literal"><span class="pre">setDampingTangential(gamma)()</span></tt></p>
       +<p>See also: <code class="xref py py-func docutils literal"><span class="pre">setDampingTangential(gamma)()</span></code></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.setDampingTangential">
       -<tt class="descname">setDampingTangential</tt><big>(</big><em>gamma</em><big>)</big><a class="headerlink" href="#sphere.sim.setDampingTangential" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">setDampingTangential</code><span class="sig-paren">(</span><em>gamma</em>, <em>over_damping=False</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setDampingTangential" title="Permalink to this definition">¶</a></dt>
        <dd><p>Set the dampening coefficient (gamma) in the tangential direction of the
        particle-particle contact model. The function will print the fraction
        between the chosen damping and the critical damping value.</p>
       t@@ -1512,43 +1987,122 @@ between the chosen damping and the critical damping value.</p>
        <col class="field-name" />
        <col class="field-body" />
        <tbody valign="top">
       -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>gamma</strong> (<em>float</em>) &#8211; The viscous damping constant [N/(m/s)]</td>
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
       +<li><strong>gamma</strong> (<em>float</em>) &#8211; The viscous damping constant [N/(m/s)]</li>
       +<li><strong>over_damping</strong> (<em>boolean</em>) &#8211; Accept overdampening</li>
       +</ul>
       +</td>
       +</tr>
       +</tbody>
       +</table>
       +<p>See also: <code class="xref py py-func docutils literal"><span class="pre">setDampingNormal(gamma)()</span></code></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setDynamicFriction">
       +<code class="descname">setDynamicFriction</code><span class="sig-paren">(</span><em>mu_d</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setDynamicFriction" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the dynamic friction coefficient for particle-particle interactions
       +(<cite>self.mu_d</cite>). This value describes the resistance to a shearing motion
       +while it is happening (contact tangential velocity larger than 0).
       +Strain softening can be introduced by having a smaller dynamic
       +frictional coefficient than the static fricion coefficient. Usually this
       +value is identical to the static friction coefficient.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>mu_d</strong> (<em>float</em>) &#8211; Value of the dynamic friction coefficient, in [0;inf[.
       +Usually between 0 and 1.</td>
       +</tr>
       +</tbody>
       +</table>
       +<p>See also: <code class="xref py py-func docutils literal"><span class="pre">setStaticFriction(mu_s)()</span></code></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setFluidBottomFixedFlux">
       +<code class="descname">setFluidBottomFixedFlux</code><span class="sig-paren">(</span><em>specific_flux</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidBottomFixedFlux" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Define a constant fluid flux normal to the boundary.</p>
       +<p>The default behavior for the boundary is fixed value (Dirichlet), see
       +<a class="reference internal" href="#sphere.sim.setFluidBottomFixedPressure" title="sphere.sim.setFluidBottomFixedPressure"><code class="xref py py-func docutils literal"><span class="pre">setFluidBottomFixedPressure()</span></code></a>.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>specific_flux</strong> &#8211; Specific flux values across boundary (positive
       +values upwards), [m/s]</td>
        </tr>
        </tbody>
        </table>
       -<p>See also: <tt class="xref py py-func docutils literal"><span class="pre">setDampingNormal(gamma)()</span></tt></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.setFluidBottomFixedPressure">
       -<tt class="descname">setFluidBottomFixedPressure</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.setFluidBottomFixedPressure" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">setFluidBottomFixedPressure</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidBottomFixedPressure" title="Permalink to this definition">¶</a></dt>
        <dd><p>Set the lower boundary of the fluid domain to follow the fixed pressure
        value (Dirichlet) boundary condition.</p>
        <p>This is the default behavior for the boundary. See also
       -<a class="reference internal" href="#sphere.sim.setFluidBottomNoFlow" title="sphere.sim.setFluidBottomNoFlow"><tt class="xref py py-func docutils literal"><span class="pre">setFluidBottomNoFlow()</span></tt></a></p>
       +<a class="reference internal" href="#sphere.sim.setFluidBottomNoFlow" title="sphere.sim.setFluidBottomNoFlow"><code class="xref py py-func docutils literal"><span class="pre">setFluidBottomNoFlow()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.setFluidBottomNoFlow">
       -<tt class="descname">setFluidBottomNoFlow</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.setFluidBottomNoFlow" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">setFluidBottomNoFlow</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidBottomNoFlow" title="Permalink to this definition">¶</a></dt>
        <dd><p>Set the lower boundary of the fluid domain to follow the no-flow
        (Neumann) boundary condition with free slip parallel to the boundary.</p>
        <p>The default behavior for the boundary is fixed value (Dirichlet), see
       -<a class="reference internal" href="#sphere.sim.setFluidBottomFixedPressure" title="sphere.sim.setFluidBottomFixedPressure"><tt class="xref py py-func docutils literal"><span class="pre">setFluidBottomFixedPressure()</span></tt></a>.</p>
       +<a class="reference internal" href="#sphere.sim.setFluidBottomFixedPressure" title="sphere.sim.setFluidBottomFixedPressure"><code class="xref py py-func docutils literal"><span class="pre">setFluidBottomFixedPressure()</span></code></a>.</p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.setFluidBottomNoFlowNoSlip">
       -<tt class="descname">setFluidBottomNoFlowNoSlip</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.setFluidBottomNoFlowNoSlip" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">setFluidBottomNoFlowNoSlip</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidBottomNoFlowNoSlip" title="Permalink to this definition">¶</a></dt>
        <dd><p>Set the lower boundary of the fluid domain to follow the no-flow
        (Neumann) boundary condition with no slip parallel to the boundary.</p>
        <p>The default behavior for the boundary is fixed value (Dirichlet), see
       -<a class="reference internal" href="#sphere.sim.setFluidBottomFixedPressure" title="sphere.sim.setFluidBottomFixedPressure"><tt class="xref py py-func docutils literal"><span class="pre">setFluidBottomFixedPressure()</span></tt></a>.</p>
       +<a class="reference internal" href="#sphere.sim.setFluidBottomFixedPressure" title="sphere.sim.setFluidBottomFixedPressure"><code class="xref py py-func docutils literal"><span class="pre">setFluidBottomFixedPressure()</span></code></a>.</p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setFluidCompressibility">
       +<code class="descname">setFluidCompressibility</code><span class="sig-paren">(</span><em>beta_f</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidCompressibility" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the fluid adiabatic compressibility [1/Pa]. This value is equal to
       +<cite>1/K</cite> where <cite>K</cite> is the bulk modulus [Pa]. The value for water is 5.1e-10
       +for water at 0 degrees Celcius. This parameter is used for the Darcy
       +solver exclusively.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>beta_f</strong> (<em>float</em>) &#8211; The fluid compressibility [1/Pa]</td>
       +</tr>
       +</tbody>
       +</table>
       +<p>See also: <a class="reference internal" href="#sphere.sim.setFluidDensity" title="sphere.sim.setFluidDensity"><code class="xref py py-func docutils literal"><span class="pre">setFluidDensity()</span></code></a> and <a class="reference internal" href="#sphere.sim.setFluidViscosity" title="sphere.sim.setFluidViscosity"><code class="xref py py-func docutils literal"><span class="pre">setFluidViscosity()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setFluidDensity">
       +<code class="descname">setFluidDensity</code><span class="sig-paren">(</span><em>rho_f</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidDensity" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the fluid density [kg/(m*m*m)]. The value for water is 1000. This
       +parameter is used for the Navier-Stokes fluid solver exclusively.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>rho_f</strong> (<em>float</em>) &#8211; The fluid density [kg/(m*m*m)]</td>
       +</tr>
       +</tbody>
       +</table>
       +<dl class="docutils">
       +<dt>See also: <a class="reference internal" href="#sphere.sim.setFluidViscosity" title="sphere.sim.setFluidViscosity"><code class="xref py py-func docutils literal"><span class="pre">setFluidViscosity()</span></code></a> and</dt>
       +<dd><a class="reference internal" href="#sphere.sim.setFluidCompressibility" title="sphere.sim.setFluidCompressibility"><code class="xref py py-func docutils literal"><span class="pre">setFluidCompressibility()</span></code></a></dd>
       +</dl>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.setFluidPressureModulation">
       -<tt class="descname">setFluidPressureModulation</tt><big>(</big><em>A</em>, <em>f</em>, <em>phi=0.0</em><big>)</big><a class="headerlink" href="#sphere.sim.setFluidPressureModulation" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">setFluidPressureModulation</code><span class="sig-paren">(</span><em>A</em>, <em>f</em>, <em>phi=0.0</em>, <em>plot=False</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidPressureModulation" title="Permalink to this definition">¶</a></dt>
        <dd><p>Set the parameters for the sine wave modulating the fluid pressures
        at the top boundary. Note that a cos-wave is obtained with phi=pi/2.</p>
        <table class="docutils field-list" frame="void" rules="none">
       t@@ -1558,45 +2112,146 @@ at the top boundary. Note that a cos-wave is obtained with phi=pi/2.</p>
        <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
        <li><strong>A</strong> (<em>float</em>) &#8211; Fluctuation amplitude [Pa]</li>
        <li><strong>f</strong> (<em>float</em>) &#8211; Fluctuation frequency [Hz]</li>
       -<li><strong>phi</strong> (<em>float</em>) &#8211; Fluctuation phase shift (default=0.0)</li>
       +<li><strong>phi</strong> (<em>float</em>) &#8211; Fluctuation phase shift (default=0.0) [rad]</li>
       +<li><strong>plot</strong> (<em>bool</em>) &#8211; Show a plot of the resulting modulation</li>
        </ul>
        </td>
        </tr>
        </tbody>
        </table>
       -<p>See also: <a class="reference internal" href="#sphere.sim.disableFluidPressureModulation" title="sphere.sim.disableFluidPressureModulation"><tt class="xref py py-func docutils literal"><span class="pre">disableFluidPressureModulation()</span></tt></a></p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.setTopWallNormalStressModulation" title="sphere.sim.setTopWallNormalStressModulation"><code class="xref py py-func docutils literal"><span class="pre">setTopWallNormalStressModulation()</span></code></a> and
       +<a class="reference internal" href="#sphere.sim.disableFluidPressureModulation" title="sphere.sim.disableFluidPressureModulation"><code class="xref py py-func docutils literal"><span class="pre">disableFluidPressureModulation()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setFluidTopFixedFlux">
       +<code class="descname">setFluidTopFixedFlux</code><span class="sig-paren">(</span><em>specific_flux</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidTopFixedFlux" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Define a constant fluid flux normal to the boundary.</p>
       +<p>The default behavior for the boundary is fixed value (Dirichlet), see
       +<a class="reference internal" href="#sphere.sim.setFluidBottomFixedPressure" title="sphere.sim.setFluidBottomFixedPressure"><code class="xref py py-func docutils literal"><span class="pre">setFluidBottomFixedPressure()</span></code></a>.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>specific_flux</strong> &#8211; Specific flux values across boundary (positive
       +values upwards), [m/s]</td>
       +</tr>
       +</tbody>
       +</table>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.setFluidTopFixedPressure">
       -<tt class="descname">setFluidTopFixedPressure</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.setFluidTopFixedPressure" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">setFluidTopFixedPressure</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidTopFixedPressure" title="Permalink to this definition">¶</a></dt>
        <dd><p>Set the upper boundary of the fluid domain to follow the fixed pressure
        value (Dirichlet) boundary condition.</p>
        <p>This is the default behavior for the boundary. See also
       -<a class="reference internal" href="#sphere.sim.setFluidTopNoFlow" title="sphere.sim.setFluidTopNoFlow"><tt class="xref py py-func docutils literal"><span class="pre">setFluidTopNoFlow()</span></tt></a></p>
       +<a class="reference internal" href="#sphere.sim.setFluidTopNoFlow" title="sphere.sim.setFluidTopNoFlow"><code class="xref py py-func docutils literal"><span class="pre">setFluidTopNoFlow()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.setFluidTopNoFlow">
       -<tt class="descname">setFluidTopNoFlow</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.setFluidTopNoFlow" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">setFluidTopNoFlow</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidTopNoFlow" title="Permalink to this definition">¶</a></dt>
        <dd><p>Set the upper boundary of the fluid domain to follow the no-flow
        (Neumann) boundary condition with free slip parallel to the boundary.</p>
        <p>The default behavior for the boundary is fixed value (Dirichlet), see
       -<a class="reference internal" href="#sphere.sim.setFluidTopFixedPressure" title="sphere.sim.setFluidTopFixedPressure"><tt class="xref py py-func docutils literal"><span class="pre">setFluidTopFixedPressure()</span></tt></a>.</p>
       +<a class="reference internal" href="#sphere.sim.setFluidTopFixedPressure" title="sphere.sim.setFluidTopFixedPressure"><code class="xref py py-func docutils literal"><span class="pre">setFluidTopFixedPressure()</span></code></a>.</p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.setFluidTopNoFlowNoSlip">
       -<tt class="descname">setFluidTopNoFlowNoSlip</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.setFluidTopNoFlowNoSlip" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">setFluidTopNoFlowNoSlip</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidTopNoFlowNoSlip" title="Permalink to this definition">¶</a></dt>
        <dd><p>Set the upper boundary of the fluid domain to follow the no-flow
        (Neumann) boundary condition with no slip parallel to the boundary.</p>
        <p>The default behavior for the boundary is fixed value (Dirichlet), see
       -<a class="reference internal" href="#sphere.sim.setFluidTopFixedPressure" title="sphere.sim.setFluidTopFixedPressure"><tt class="xref py py-func docutils literal"><span class="pre">setFluidTopFixedPressure()</span></tt></a>.</p>
       +<a class="reference internal" href="#sphere.sim.setFluidTopFixedPressure" title="sphere.sim.setFluidTopFixedPressure"><code class="xref py py-func docutils literal"><span class="pre">setFluidTopFixedPressure()</span></code></a>.</p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setFluidViscosity">
       +<code class="descname">setFluidViscosity</code><span class="sig-paren">(</span><em>mu</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidViscosity" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the fluid dynamic viscosity [Pa*s]. The value for water is
       +1.797e-3 at 0 degrees Celcius. This parameter is used for both the Darcy
       +and Navier-Stokes fluid solver.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>mu</strong> (<em>float</em>) &#8211; The fluid dynamic viscosity [Pa*s]</td>
       +</tr>
       +</tbody>
       +</table>
       +<dl class="docutils">
       +<dt>See also: <a class="reference internal" href="#sphere.sim.setFluidDensity" title="sphere.sim.setFluidDensity"><code class="xref py py-func docutils literal"><span class="pre">setFluidDensity()</span></code></a> and</dt>
       +<dd><a class="reference internal" href="#sphere.sim.setFluidCompressibility" title="sphere.sim.setFluidCompressibility"><code class="xref py py-func docutils literal"><span class="pre">setFluidCompressibility()</span></code></a></dd>
       +</dl>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setFluidXFixedPressure">
       +<code class="descname">setFluidXFixedPressure</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidXFixedPressure" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the X boundaries of the fluid domain to follow the fixed pressure
       +value (Dirichlet) boundary condition.</p>
       +<p>This is not the default behavior for the boundary. See also
       +<a class="reference internal" href="#sphere.sim.setFluidXFixedPressure" title="sphere.sim.setFluidXFixedPressure"><code class="xref py py-func docutils literal"><span class="pre">setFluidXFixedPressure()</span></code></a>,
       +<a class="reference internal" href="#sphere.sim.setFluidXNoFlow" title="sphere.sim.setFluidXNoFlow"><code class="xref py py-func docutils literal"><span class="pre">setFluidXNoFlow()</span></code></a>, and
       +<a class="reference internal" href="#sphere.sim.setFluidXPeriodic" title="sphere.sim.setFluidXPeriodic"><code class="xref py py-func docutils literal"><span class="pre">setFluidXPeriodic()</span></code></a> (default)</p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setFluidXNoFlow">
       +<code class="descname">setFluidXNoFlow</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidXNoFlow" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the X boundaries of the fluid domain to follow the no-flow
       +(Neumann) boundary condition.</p>
       +<p>This is not the default behavior for the boundary. See also
       +<a class="reference internal" href="#sphere.sim.setFluidXFixedPressure" title="sphere.sim.setFluidXFixedPressure"><code class="xref py py-func docutils literal"><span class="pre">setFluidXFixedPressure()</span></code></a>,
       +<a class="reference internal" href="#sphere.sim.setFluidXNoFlow" title="sphere.sim.setFluidXNoFlow"><code class="xref py py-func docutils literal"><span class="pre">setFluidXNoFlow()</span></code></a>, and
       +<a class="reference internal" href="#sphere.sim.setFluidXPeriodic" title="sphere.sim.setFluidXPeriodic"><code class="xref py py-func docutils literal"><span class="pre">setFluidXPeriodic()</span></code></a> (default)</p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setFluidXPeriodic">
       +<code class="descname">setFluidXPeriodic</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidXPeriodic" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the X boundaries of the fluid domain to follow the periodic
       +(cyclic) boundary condition.</p>
       +<p>This is the default behavior for the boundary. See also
       +<a class="reference internal" href="#sphere.sim.setFluidXFixedPressure" title="sphere.sim.setFluidXFixedPressure"><code class="xref py py-func docutils literal"><span class="pre">setFluidXFixedPressure()</span></code></a> and
       +<a class="reference internal" href="#sphere.sim.setFluidXNoFlow" title="sphere.sim.setFluidXNoFlow"><code class="xref py py-func docutils literal"><span class="pre">setFluidXNoFlow()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setFluidYFixedPressure">
       +<code class="descname">setFluidYFixedPressure</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidYFixedPressure" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the Y boundaries of the fluid domain to follow the fixed pressure
       +value (Dirichlet) boundary condition.</p>
       +<p>This is not the default behavior for the boundary. See also
       +<a class="reference internal" href="#sphere.sim.setFluidYNoFlow" title="sphere.sim.setFluidYNoFlow"><code class="xref py py-func docutils literal"><span class="pre">setFluidYNoFlow()</span></code></a> and
       +<a class="reference internal" href="#sphere.sim.setFluidYPeriodic" title="sphere.sim.setFluidYPeriodic"><code class="xref py py-func docutils literal"><span class="pre">setFluidYPeriodic()</span></code></a> (default)</p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setFluidYNoFlow">
       +<code class="descname">setFluidYNoFlow</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidYNoFlow" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the Y boundaries of the fluid domain to follow the no-flow
       +(Neumann) boundary condition.</p>
       +<p>This is not the default behavior for the boundary. See also
       +<a class="reference internal" href="#sphere.sim.setFluidYFixedPressure" title="sphere.sim.setFluidYFixedPressure"><code class="xref py py-func docutils literal"><span class="pre">setFluidYFixedPressure()</span></code></a> and
       +<a class="reference internal" href="#sphere.sim.setFluidYPeriodic" title="sphere.sim.setFluidYPeriodic"><code class="xref py py-func docutils literal"><span class="pre">setFluidYPeriodic()</span></code></a> (default)</p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setFluidYPeriodic">
       +<code class="descname">setFluidYPeriodic</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setFluidYPeriodic" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the Y boundaries of the fluid domain to follow the periodic
       +(cyclic) boundary condition.</p>
       +<p>This is the default behavior for the boundary. See also
       +<a class="reference internal" href="#sphere.sim.setFluidYFixedPressure" title="sphere.sim.setFluidYFixedPressure"><code class="xref py py-func docutils literal"><span class="pre">setFluidYFixedPressure()</span></code></a> and
       +<a class="reference internal" href="#sphere.sim.setFluidYNoFlow" title="sphere.sim.setFluidYNoFlow"><code class="xref py py-func docutils literal"><span class="pre">setFluidYNoFlow()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.setGamma">
       -<tt class="descname">setGamma</tt><big>(</big><em>gamma</em><big>)</big><a class="headerlink" href="#sphere.sim.setGamma" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">setGamma</code><span class="sig-paren">(</span><em>gamma</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setGamma" title="Permalink to this definition">¶</a></dt>
        <dd><p>Gamma is a fluid solver parameter, used for smoothing the pressure
        values. The epsilon (pressure) values are smoothed by including the
        average epsilon value of the six closest (face) neighbor cells. This
       t@@ -1611,14 +2266,14 @@ more averaging is introduced. A value of 0.0 disables all averaging.</p>
        </tr>
        </tbody>
        </table>
       -<p>Other solver parameter setting functions: <a class="reference internal" href="#sphere.sim.setTheta" title="sphere.sim.setTheta"><tt class="xref py py-func docutils literal"><span class="pre">setTheta()</span></tt></a>,
       -<a class="reference internal" href="#sphere.sim.setBeta" title="sphere.sim.setBeta"><tt class="xref py py-func docutils literal"><span class="pre">setBeta()</span></tt></a>, <a class="reference internal" href="#sphere.sim.setTolerance" title="sphere.sim.setTolerance"><tt class="xref py py-func docutils literal"><span class="pre">setTolerance()</span></tt></a>,
       -<a class="reference internal" href="#sphere.sim.setDEMstepsPerCFDstep" title="sphere.sim.setDEMstepsPerCFDstep"><tt class="xref py py-func docutils literal"><span class="pre">setDEMstepsPerCFDstep()</span></tt></a> and <a class="reference internal" href="#sphere.sim.setMaxIterations" title="sphere.sim.setMaxIterations"><tt class="xref py py-func docutils literal"><span class="pre">setMaxIterations()</span></tt></a></p>
       +<p>Other solver parameter setting functions: <a class="reference internal" href="#sphere.sim.setTheta" title="sphere.sim.setTheta"><code class="xref py py-func docutils literal"><span class="pre">setTheta()</span></code></a>,
       +<a class="reference internal" href="#sphere.sim.setBeta" title="sphere.sim.setBeta"><code class="xref py py-func docutils literal"><span class="pre">setBeta()</span></code></a>, <a class="reference internal" href="#sphere.sim.setTolerance" title="sphere.sim.setTolerance"><code class="xref py py-func docutils literal"><span class="pre">setTolerance()</span></code></a>,
       +<a class="reference internal" href="#sphere.sim.setDEMstepsPerCFDstep" title="sphere.sim.setDEMstepsPerCFDstep"><code class="xref py py-func docutils literal"><span class="pre">setDEMstepsPerCFDstep()</span></code></a> and <a class="reference internal" href="#sphere.sim.setMaxIterations" title="sphere.sim.setMaxIterations"><code class="xref py py-func docutils literal"><span class="pre">setMaxIterations()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.setMaxIterations">
       -<tt class="descname">setMaxIterations</tt><big>(</big><em>maxiter</em><big>)</big><a class="headerlink" href="#sphere.sim.setMaxIterations" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">setMaxIterations</code><span class="sig-paren">(</span><em>maxiter</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setMaxIterations" title="Permalink to this definition">¶</a></dt>
        <dd><p>A fluid solver parameter, the value of the maxiter parameter denotes the
        maximal allowed number of fluid solver iterations before ending the
        fluid solver loop prematurely. The residual values are at that point not
       t@@ -1634,14 +2289,101 @@ solver</td>
        </tr>
        </tbody>
        </table>
       -<p>Other solver parameter setting functions: <a class="reference internal" href="#sphere.sim.setGamma" title="sphere.sim.setGamma"><tt class="xref py py-func docutils literal"><span class="pre">setGamma()</span></tt></a>,
       -<a class="reference internal" href="#sphere.sim.setTheta" title="sphere.sim.setTheta"><tt class="xref py py-func docutils literal"><span class="pre">setTheta()</span></tt></a>, <a class="reference internal" href="#sphere.sim.setBeta" title="sphere.sim.setBeta"><tt class="xref py py-func docutils literal"><span class="pre">setBeta()</span></tt></a>, <a class="reference internal" href="#sphere.sim.setDEMstepsPerCFDstep" title="sphere.sim.setDEMstepsPerCFDstep"><tt class="xref py py-func docutils literal"><span class="pre">setDEMstepsPerCFDstep()</span></tt></a>
       -and <a class="reference internal" href="#sphere.sim.setTolerance" title="sphere.sim.setTolerance"><tt class="xref py py-func docutils literal"><span class="pre">setTolerance()</span></tt></a></p>
       +<p>Other solver parameter setting functions: <a class="reference internal" href="#sphere.sim.setGamma" title="sphere.sim.setGamma"><code class="xref py py-func docutils literal"><span class="pre">setGamma()</span></code></a>,
       +<a class="reference internal" href="#sphere.sim.setTheta" title="sphere.sim.setTheta"><code class="xref py py-func docutils literal"><span class="pre">setTheta()</span></code></a>, <a class="reference internal" href="#sphere.sim.setBeta" title="sphere.sim.setBeta"><code class="xref py py-func docutils literal"><span class="pre">setBeta()</span></code></a>, <a class="reference internal" href="#sphere.sim.setDEMstepsPerCFDstep" title="sphere.sim.setDEMstepsPerCFDstep"><code class="xref py py-func docutils literal"><span class="pre">setDEMstepsPerCFDstep()</span></code></a>
       +and <a class="reference internal" href="#sphere.sim.setTolerance" title="sphere.sim.setTolerance"><code class="xref py py-func docutils literal"><span class="pre">setTolerance()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setPermeabilityGrainSize">
       +<code class="descname">setPermeabilityGrainSize</code><span class="sig-paren">(</span><em>verbose=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setPermeabilityGrainSize" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the permeability prefactor based on the mean grain size (Damsgaard
       +et al., 2015, eq. 10).</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>verbose</strong> (<em>bool</em>) &#8211; Print information about the realistic permeabilities
       +hydraulic conductivities to expect with the chosen permeability
       +prefactor.</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setPermeabilityPrefactor">
       +<code class="descname">setPermeabilityPrefactor</code><span class="sig-paren">(</span><em>k_c</em>, <em>verbose=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setPermeabilityPrefactor" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the permeability prefactor from Goren et al 2011, eq. 24. The
       +function will print the limits of permeabilities to be simulated. This
       +parameter is only used in the Darcy solver.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
       +<li><strong>k_c</strong> (<em>float</em>) &#8211; Permeability prefactor value [m*m]</li>
       +<li><strong>verbose</strong> (<em>bool</em>) &#8211; Print information about the realistic permeabilities and
       +hydraulic conductivities to expect with the chosen permeability
       +prefactor.</li>
       +</ul>
       +</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setStaticFriction">
       +<code class="descname">setStaticFriction</code><span class="sig-paren">(</span><em>mu_s</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setStaticFriction" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the static friction coefficient for particle-particle interactions
       +(<cite>self.mu_s</cite>). This value describes the resistance to a shearing motion
       +while it is not happenind (contact tangential velocity zero).</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>mu_s</strong> (<em>float</em>) &#8211; Value of the static friction coefficient, in [0;inf[.
       +Usually between 0 and 1.</td>
       +</tr>
       +</tbody>
       +</table>
       +<p>See also: <code class="xref py py-func docutils literal"><span class="pre">setDynamicFriction(mu_d)()</span></code></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setStiffnessNormal">
       +<code class="descname">setStiffnessNormal</code><span class="sig-paren">(</span><em>k_n</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setStiffnessNormal" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the elastic stiffness (<cite>k_n</cite>) in the normal direction of the
       +contact.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>k_n</strong> (<em>float</em>) &#8211; The elastic stiffness coefficient [N/m]</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setStiffnessTangential">
       +<code class="descname">setStiffnessTangential</code><span class="sig-paren">(</span><em>k_t</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setStiffnessTangential" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the elastic stiffness (<cite>k_t</cite>) in the tangential direction of the
       +contact.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>k_t</strong> (<em>float</em>) &#8211; The elastic stiffness coefficient [N/m]</td>
       +</tr>
       +</tbody>
       +</table>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.setTheta">
       -<tt class="descname">setTheta</tt><big>(</big><em>theta</em><big>)</big><a class="headerlink" href="#sphere.sim.setTheta" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">setTheta</code><span class="sig-paren">(</span><em>theta</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setTheta" title="Permalink to this definition">¶</a></dt>
        <dd><p>Theta is a fluid solver under-relaxation parameter, used in solution of
        Poisson equation. The value should be within the range ]0.0;1.0]. At a
        value of 1.0, the new estimate of epsilon values is used exclusively. At
       t@@ -1657,18 +2399,18 @@ instabilities may be avoided with lower values.</p>
        </tr>
        </tbody>
        </table>
       -<p>Other solver parameter setting functions: <a class="reference internal" href="#sphere.sim.setGamma" title="sphere.sim.setGamma"><tt class="xref py py-func docutils literal"><span class="pre">setGamma()</span></tt></a>,
       -<a class="reference internal" href="#sphere.sim.setBeta" title="sphere.sim.setBeta"><tt class="xref py py-func docutils literal"><span class="pre">setBeta()</span></tt></a>, <a class="reference internal" href="#sphere.sim.setTolerance" title="sphere.sim.setTolerance"><tt class="xref py py-func docutils literal"><span class="pre">setTolerance()</span></tt></a>,
       -<a class="reference internal" href="#sphere.sim.setDEMstepsPerCFDstep" title="sphere.sim.setDEMstepsPerCFDstep"><tt class="xref py py-func docutils literal"><span class="pre">setDEMstepsPerCFDstep()</span></tt></a> and <a class="reference internal" href="#sphere.sim.setMaxIterations" title="sphere.sim.setMaxIterations"><tt class="xref py py-func docutils literal"><span class="pre">setMaxIterations()</span></tt></a></p>
       +<p>Other solver parameter setting functions: <a class="reference internal" href="#sphere.sim.setGamma" title="sphere.sim.setGamma"><code class="xref py py-func docutils literal"><span class="pre">setGamma()</span></code></a>,
       +<a class="reference internal" href="#sphere.sim.setBeta" title="sphere.sim.setBeta"><code class="xref py py-func docutils literal"><span class="pre">setBeta()</span></code></a>, <a class="reference internal" href="#sphere.sim.setTolerance" title="sphere.sim.setTolerance"><code class="xref py py-func docutils literal"><span class="pre">setTolerance()</span></code></a>,
       +<a class="reference internal" href="#sphere.sim.setDEMstepsPerCFDstep" title="sphere.sim.setDEMstepsPerCFDstep"><code class="xref py py-func docutils literal"><span class="pre">setDEMstepsPerCFDstep()</span></code></a> and <a class="reference internal" href="#sphere.sim.setMaxIterations" title="sphere.sim.setMaxIterations"><code class="xref py py-func docutils literal"><span class="pre">setMaxIterations()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.setTolerance">
       -<tt class="descname">setTolerance</tt><big>(</big><em>tolerance</em><big>)</big><a class="headerlink" href="#sphere.sim.setTolerance" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">setTolerance</code><span class="sig-paren">(</span><em>tolerance</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setTolerance" title="Permalink to this definition">¶</a></dt>
        <dd><p>A fluid solver parameter, the value of the tolerance parameter denotes
        the required value of the maximum normalized residual for the fluid
        solver.</p>
       -<p>The default and recommended value is 1.0e-8.</p>
       +<p>The default and recommended value is 1.0e-3.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
       t@@ -1678,31 +2420,97 @@ residual</td>
        </tr>
        </tbody>
        </table>
       -<p>Other solver parameter setting functions: <a class="reference internal" href="#sphere.sim.setGamma" title="sphere.sim.setGamma"><tt class="xref py py-func docutils literal"><span class="pre">setGamma()</span></tt></a>,
       -<a class="reference internal" href="#sphere.sim.setTheta" title="sphere.sim.setTheta"><tt class="xref py py-func docutils literal"><span class="pre">setTheta()</span></tt></a>, <a class="reference internal" href="#sphere.sim.setBeta" title="sphere.sim.setBeta"><tt class="xref py py-func docutils literal"><span class="pre">setBeta()</span></tt></a>, <a class="reference internal" href="#sphere.sim.setDEMstepsPerCFDstep" title="sphere.sim.setDEMstepsPerCFDstep"><tt class="xref py py-func docutils literal"><span class="pre">setDEMstepsPerCFDstep()</span></tt></a> and
       -<a class="reference internal" href="#sphere.sim.setMaxIterations" title="sphere.sim.setMaxIterations"><tt class="xref py py-func docutils literal"><span class="pre">setMaxIterations()</span></tt></a></p>
       +<p>Other solver parameter setting functions: <a class="reference internal" href="#sphere.sim.setGamma" title="sphere.sim.setGamma"><code class="xref py py-func docutils literal"><span class="pre">setGamma()</span></code></a>,
       +<a class="reference internal" href="#sphere.sim.setTheta" title="sphere.sim.setTheta"><code class="xref py py-func docutils literal"><span class="pre">setTheta()</span></code></a>, <a class="reference internal" href="#sphere.sim.setBeta" title="sphere.sim.setBeta"><code class="xref py py-func docutils literal"><span class="pre">setBeta()</span></code></a>, <a class="reference internal" href="#sphere.sim.setDEMstepsPerCFDstep" title="sphere.sim.setDEMstepsPerCFDstep"><code class="xref py py-func docutils literal"><span class="pre">setDEMstepsPerCFDstep()</span></code></a> and
       +<a class="reference internal" href="#sphere.sim.setMaxIterations" title="sphere.sim.setMaxIterations"><code class="xref py py-func docutils literal"><span class="pre">setMaxIterations()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setTopWallNormalStressModulation">
       +<code class="descname">setTopWallNormalStressModulation</code><span class="sig-paren">(</span><em>A</em>, <em>f</em>, <em>plot=False</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setTopWallNormalStressModulation" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the parameters for the sine wave modulating the normal stress
       +at the top wall. Note that a cos-wave is obtained with phi=pi/2.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
       +<li><strong>A</strong> (<em>float</em>) &#8211; Fluctuation amplitude [Pa]</li>
       +<li><strong>f</strong> (<em>float</em>) &#8211; Fluctuation frequency [Hz]</li>
       +<li><strong>plot</strong> (<em>bool</em>) &#8211; Show a plot of the resulting modulation</li>
       +</ul>
       +</td>
       +</tr>
       +</tbody>
       +</table>
       +<p>See also: <a class="reference internal" href="#sphere.sim.setFluidPressureModulation" title="sphere.sim.setFluidPressureModulation"><code class="xref py py-func docutils literal"><span class="pre">setFluidPressureModulation()</span></code></a> and
       +<a class="reference internal" href="#sphere.sim.disableTopWallNormalStressModulation" title="sphere.sim.disableTopWallNormalStressModulation"><code class="xref py py-func docutils literal"><span class="pre">disableTopWallNormalStressModulation()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.setYoungsModulus">
       +<code class="descname">setYoungsModulus</code><span class="sig-paren">(</span><em>E</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.setYoungsModulus" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the elastic Young&#8217;s modulus (<cite>E</cite>) for the contact model.  This
       +parameter is used over normal stiffness (<cite>k_n</cite>) and tangential
       +stiffness (<cite>k_t</cite>) when its value is greater than zero. Using this
       +parameter produces size-invariant behavior.</p>
       +<p>Example values are ~70e9 Pa for quartz,
       +<a class="reference external" href="http://www.engineeringtoolbox.com/young-modulus-d_417.html">http://www.engineeringtoolbox.com/young-modulus-d_417.html</a></p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>E</strong> (<em>float</em>) &#8211; The elastic modulus [Pa]</td>
       +</tr>
       +</tbody>
       +</table>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.shear">
       -<tt class="descname">shear</tt><big>(</big><em>shear_strain_rate=1.0</em><big>)</big><a class="headerlink" href="#sphere.sim.shear" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Setup shear experiment. The shear strain rate is the shear velocity
       -divided by the initial height per second. The shear movement is along
       -the positive x axis. The function zeroes the tangential wall viscosity
       -(gamma_wt) and the wall friction coefficients (mu_ws, mu_wn).</p>
       +<code class="descname">shear</code><span class="sig-paren">(</span><em>shear_strain_rate=1.0</em>, <em>shear_stress=False</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.shear" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Setup shear experiment either by a constant shear rate or a constant
       +shear stress.  The shear strain rate is the shear velocity divided by
       +the initial height per second. The shear movement is along the positive
       +x axis. The function zeroes the tangential wall viscosity (gamma_wt) and
       +the wall friction coefficients (mu_ws, mu_wn).</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
       +<li><strong>shear_strain_rate</strong> (<em>float</em>) &#8211; The shear strain rate [-] to use if
       +shear_stress isn&#8217;t False.</li>
       +<li><strong>shear_stress</strong> (<em>float or bool</em>) &#8211; The shear stress value to use [Pa].</li>
       +</ul>
       +</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.shearDisplacement">
       +<code class="descname">shearDisplacement</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.shearDisplacement" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Calculates and returns the current shear displacement. The displacement
       +is found by determining the total x-axis displacement of the upper,
       +fixed particles.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
        <tbody valign="top">
       -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>shear_strain_rate</strong> (<em>float</em>) &#8211; The shear strain rate to use.</td>
       +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The total shear displacement [m]</td>
       +</tr>
       +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">float</td>
        </tr>
        </tbody>
        </table>
       +<p>See also: <a class="reference internal" href="#sphere.sim.shearStrain" title="sphere.sim.shearStrain"><code class="xref py py-func docutils literal"><span class="pre">shearStrain()</span></code></a> and <a class="reference internal" href="#sphere.sim.shearVelocity" title="sphere.sim.shearVelocity"><code class="xref py py-func docutils literal"><span class="pre">shearVelocity()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.shearStrain">
       -<tt class="descname">shearStrain</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.shearStrain" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">shearStrain</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.shearStrain" title="Permalink to this definition">¶</a></dt>
        <dd><p>Calculates and returns the current shear strain (gamma) value of the
        experiment. The shear strain is found by determining the total x-axis
        displacement of the upper, fixed particles.</p>
       t@@ -1716,48 +2524,73 @@ displacement of the upper, fixed particles.</p>
        </tr>
        </tbody>
        </table>
       -<p>See also: <a class="reference internal" href="#sphere.sim.shearStrainRate" title="sphere.sim.shearStrainRate"><tt class="xref py py-func docutils literal"><span class="pre">shearStrainRate()</span></tt></a> and <a class="reference internal" href="#sphere.sim.shearVel" title="sphere.sim.shearVel"><tt class="xref py py-func docutils literal"><span class="pre">shearVel()</span></tt></a></p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.shearStrainRate" title="sphere.sim.shearStrainRate"><code class="xref py py-func docutils literal"><span class="pre">shearStrainRate()</span></code></a> and <a class="reference internal" href="#sphere.sim.shearVel" title="sphere.sim.shearVel"><code class="xref py py-func docutils literal"><span class="pre">shearVel()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.shearStrainRate">
       -<tt class="descname">shearStrainRate</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.shearStrainRate" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">shearStrainRate</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.shearStrainRate" title="Permalink to this definition">¶</a></dt>
        <dd><p>Calculates the shear strain rate (dot(gamma)) value of the experiment.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
        <tbody valign="top">
       -<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The value of $I$</td>
       +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The value of dot(gamma)</td>
        </tr>
        <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">float</td>
        </tr>
        </tbody>
        </table>
       -<p>See also: <a class="reference internal" href="#sphere.sim.shearStrain" title="sphere.sim.shearStrain"><tt class="xref py py-func docutils literal"><span class="pre">shearStrain()</span></tt></a> and <a class="reference internal" href="#sphere.sim.shearVel" title="sphere.sim.shearVel"><tt class="xref py py-func docutils literal"><span class="pre">shearVel()</span></tt></a></p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.shearStrain" title="sphere.sim.shearStrain"><code class="xref py py-func docutils literal"><span class="pre">shearStrain()</span></code></a> and <a class="reference internal" href="#sphere.sim.shearVel" title="sphere.sim.shearVel"><code class="xref py py-func docutils literal"><span class="pre">shearVel()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.shearStress">
       +<code class="descname">shearStress</code><span class="sig-paren">(</span><em>type='effective'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.shearStress" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Calculates the sum of shear stress values measured on any moving
       +particles with a finite and fixed velocity.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>type</strong> (<em>str</em>) &#8211; Find the &#8216;defined&#8217; or &#8216;effective&#8217; (default) shear stress</td>
       +</tr>
       +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The shear stress in Pa</td>
       +</tr>
       +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">numpy.array</td>
       +</tr>
       +</tbody>
       +</table>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.shearVel">
       -<tt class="descname">shearVel</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.shearVel" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Calculates and returns the shear velocity (gamma_dot) of the
       -experiment. The shear velocity is the x-axis velocity value of the
       -upper particles.</p>
       +<code class="descname">shearVel</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.shearVel" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Alias of <a class="reference internal" href="#sphere.sim.shearVelocity" title="sphere.sim.shearVelocity"><code class="xref py py-func docutils literal"><span class="pre">shearVelocity()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.shearVelocity">
       +<code class="descname">shearVelocity</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.shearVelocity" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Calculates and returns the current shear velocity. The displacement
       +is found by determining the total x-axis velocity of the upper,
       +fixed particles.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
        <tbody valign="top">
       -<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The shear velocity applied by the upper, fixed particles [m/s]</td>
       +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The shear velocity [m/s]</td>
        </tr>
        <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">float</td>
        </tr>
        </tbody>
        </table>
       -<p>See also: <a class="reference internal" href="#sphere.sim.shearStrainRate" title="sphere.sim.shearStrainRate"><tt class="xref py py-func docutils literal"><span class="pre">shearStrainRate()</span></tt></a> and <a class="reference internal" href="#sphere.sim.shearStrain" title="sphere.sim.shearStrain"><tt class="xref py py-func docutils literal"><span class="pre">shearStrain()</span></tt></a></p>
       +<p>See also: <a class="reference internal" href="#sphere.sim.shearStrainRate" title="sphere.sim.shearStrainRate"><code class="xref py py-func docutils literal"><span class="pre">shearStrainRate()</span></code></a> and <a class="reference internal" href="#sphere.sim.shearDisplacement" title="sphere.sim.shearDisplacement"><code class="xref py py-func docutils literal"><span class="pre">shearDisplacement()</span></code></a></p>
        </dd></dl>
        
        <dl class="method">
        <dt id="sphere.sim.sheardisp">
       -<tt class="descname">sheardisp</tt><big>(</big><em>graphics_format='pdf'</em>, <em>zslices=32</em><big>)</big><a class="headerlink" href="#sphere.sim.sheardisp" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">sheardisp</code><span class="sig-paren">(</span><em>graphics_format='pdf'</em>, <em>zslices=32</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.sheardisp" title="Permalink to this definition">¶</a></dt>
        <dd><p>Plot the particle x-axis displacement against the original vertical
        particle position. The plot is saved in the current directory with the
        file name &#8216;&lt;simulation id&gt;-sheardisp.&lt;graphics_format&gt;&#8217;.</p>
       t@@ -1772,8 +2605,28 @@ file name &#8216;&lt;simulation id&gt;-sheardisp.&lt;graphics_format&gt;&#8217;.
        </dd></dl>
        
        <dl class="method">
       +<dt id="sphere.sim.show">
       +<code class="descname">show</code><span class="sig-paren">(</span><em>coloring=array([]</em>, <em>dtype=float64)</em>, <em>resolution=6</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.show" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Show a rendering of all particles in a window.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
       +<li><strong>coloring</strong> (<em>numpy.array</em>) &#8211; Color the particles from red to white to blue according
       +to the values in this array.</li>
       +<li><strong>resolution</strong> (<em>int</em>) &#8211; The resolution of the rendered spheres. Larger values
       +increase the performance requirements.</li>
       +</ul>
       +</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
        <dt id="sphere.sim.smallestMass">
       -<tt class="descname">smallestMass</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.smallestMass" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">smallestMass</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.smallestMass" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the mass of the leightest particle.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -1790,10 +2643,17 @@ file name &#8216;&lt;simulation id&gt;-sheardisp.&lt;graphics_format&gt;&#8217;.
        </dd></dl>
        
        <dl class="method">
       +<dt id="sphere.sim.staticGrid">
       +<code class="descname">staticGrid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.staticGrid" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the height of the fluid grid to be constant as set in <cite>self.L[2]</cite>.</p>
       +<p>See also <a class="reference internal" href="#sphere.sim.adaptiveGrid" title="sphere.sim.adaptiveGrid"><code class="xref py py-func docutils literal"><span class="pre">adaptiveGrid()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
        <dt id="sphere.sim.status">
       -<tt class="descname">status</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.status" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">status</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.status" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the current simulation status by using the simulation id
       -(<tt class="docutils literal"><span class="pre">sid</span></tt>) as an identifier.</p>
       +(<code class="docutils literal"><span class="pre">sid</span></code>) as an identifier.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
       t@@ -1807,8 +2667,26 @@ file name &#8216;&lt;simulation id&gt;-sheardisp.&lt;graphics_format&gt;&#8217;.
        </dd></dl>
        
        <dl class="method">
       +<dt id="sphere.sim.surfaceArea">
       +<code class="descname">surfaceArea</code><span class="sig-paren">(</span><em>idx</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.surfaceArea" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Returns the surface area of a particle.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>idx</strong> (<em>int</em>) &#8211; Particle index</td>
       +</tr>
       +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The surface area of the particle [m^2]</td>
       +</tr>
       +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">float</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
        <dt id="sphere.sim.thinsection_x1x3">
       -<tt class="descname">thinsection_x1x3</tt><big>(</big><em>x2='center'</em>, <em>graphics_format='png'</em>, <em>cbmax=None</em>, <em>arrowscale=0.01</em>, <em>velarrowscale=1.0</em>, <em>slipscale=1.0</em>, <em>verbose=False</em><big>)</big><a class="headerlink" href="#sphere.sim.thinsection_x1x3" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">thinsection_x1x3</code><span class="sig-paren">(</span><em>x2='center'</em>, <em>graphics_format='png'</em>, <em>cbmax=None</em>, <em>arrowscale=0.01</em>, <em>velarrowscale=1.0</em>, <em>slipscale=1.0</em>, <em>verbose=False</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.thinsection_x1x3" title="Permalink to this definition">¶</a></dt>
        <dd><p>Produce a 2D image of particles on a x1,x3 plane, intersecting the
        second axis at x2. Output is saved as &#8216;&lt;sid&gt;-ts-x1x3.txt&#8217; in the
        current folder.</p>
       t@@ -1842,7 +2720,7 @@ gnuplot&gt; plot &#8216;&lt;sid&gt;-ts-x1x3.txt&#8217; with circles palette fs  
        
        <dl class="method">
        <dt id="sphere.sim.torqueScript">
       -<tt class="descname">torqueScript</tt><big>(</big><em>email='adc&#64;geo.au.dk'</em>, <em>email_alerts='ae'</em>, <em>walltime='24:00:00'</em>, <em>queue='qfermi'</em>, <em>cudapath='/com/cuda/4.0.17/cuda'</em>, <em>spheredir='/home/adc/code/sphere'</em>, <em>use_workdir=False</em>, <em>workdir='/scratch'</em><big>)</big><a class="headerlink" href="#sphere.sim.torqueScript" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">torqueScript</code><span class="sig-paren">(</span><em>email='adc&#64;geo.au.dk'</em>, <em>email_alerts='ae'</em>, <em>walltime='24:00:00'</em>, <em>queue='qfermi'</em>, <em>cudapath='/com/cuda/4.0.17/cuda'</em>, <em>spheredir='/home/adc/code/sphere'</em>, <em>use_workdir=False</em>, <em>workdir='/scratch'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.torqueScript" title="Permalink to this definition">¶</a></dt>
        <dd><p>Creates a job script for the Torque queue manager for the simulation
        object.</p>
        <table class="docutils field-list" frame="void" rules="none">
       t@@ -1876,8 +2754,37 @@ folder</li>
        </dd></dl>
        
        <dl class="method">
       +<dt id="sphere.sim.torqueScriptPenguin">
       +<code class="descname">torqueScriptPenguin</code><span class="sig-paren">(</span><em>email='adc&#64;geo.au.dk'</em>, <em>email_alerts='ae'</em>, <em>walltime='1920:00:00'</em>, <em>queue='H30G'</em>, <em>spheredir='/home/adc/code/sphere'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.torqueScriptPenguin" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Creates a job script for the Torque queue manager for the simulation
       +object.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
       +<li><strong>email</strong> (<em>str</em>) &#8211; The e-mail address that Torque messages should be sent to</li>
       +<li><strong>email_alerts</strong> (<em>str</em>) &#8211; The type of Torque messages to send to the e-mail
       +address. The character &#8216;b&#8217; causes a mail to be sent when the
       +execution begins. The character &#8216;e&#8217; causes a mail to be sent when
       +the execution ends normally. The character &#8216;a&#8217; causes a mail to be
       +sent if the execution ends abnormally. The characters can be written
       +in any order.</li>
       +<li><strong>walltime</strong> (<em>str</em>) &#8211; The maximal allowed time for the job, in the format
       +&#8216;HH:MM:SS&#8217;.</li>
       +<li><strong>queue</strong> (<em>str</em>) &#8211; The Torque queue to schedule the job for</li>
       +<li><strong>spheredir</strong> (<em>str</em>) &#8211; The path to the root directory of sphere on the
       +cluster</li>
       +</ul>
       +</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
        <dt id="sphere.sim.totalFrictionalEnergy">
       -<tt class="descname">totalFrictionalEnergy</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.totalFrictionalEnergy" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">totalFrictionalEnergy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.totalFrictionalEnergy" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the total frictional dissipated energy for all particles.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -1893,7 +2800,7 @@ folder</li>
        
        <dl class="method">
        <dt id="sphere.sim.totalKineticEnergy">
       -<tt class="descname">totalKineticEnergy</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.totalKineticEnergy" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">totalKineticEnergy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.totalKineticEnergy" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the total linear kinetic energy for all particles.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -1906,8 +2813,22 @@ folder</li>
        </dd></dl>
        
        <dl class="method">
       +<dt id="sphere.sim.totalMass">
       +<code class="descname">totalMass</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.totalMass" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Returns the total mass of all particles.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The total mass  in [kg]</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
        <dt id="sphere.sim.totalMomentum">
       -<tt class="descname">totalMomentum</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.totalMomentum" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">totalMomentum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.totalMomentum" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the sum of particle momentums.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -1923,7 +2844,7 @@ folder</li>
        
        <dl class="method">
        <dt id="sphere.sim.totalRotationalEnergy">
       -<tt class="descname">totalRotationalEnergy</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.totalRotationalEnergy" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">totalRotationalEnergy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.totalRotationalEnergy" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the total rotational kinetic energy for all particles.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -1937,7 +2858,7 @@ folder</li>
        
        <dl class="method">
        <dt id="sphere.sim.totalViscousEnergy">
       -<tt class="descname">totalViscousEnergy</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.totalViscousEnergy" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">totalViscousEnergy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.totalViscousEnergy" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the total viscous dissipated energy for all particles.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -1953,7 +2874,7 @@ folder</li>
        
        <dl class="method">
        <dt id="sphere.sim.triaxial">
       -<tt class="descname">triaxial</tt><big>(</big><em>wvel=-0.001</em>, <em>normal_stress=10000.0</em><big>)</big><a class="headerlink" href="#sphere.sim.triaxial" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">triaxial</code><span class="sig-paren">(</span><em>wvel=-0.001</em>, <em>normal_stress=10000.0</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.triaxial" title="Permalink to this definition">¶</a></dt>
        <dd><p>Setup triaxial experiment. The upper wall is moved at a fixed velocity
        in m/s, default values is -0.001 m/s (i.e. downwards). The side walls
        are exerting a defined normal stress.</p>
       t@@ -1974,7 +2895,7 @@ moves downwards.</li>
        
        <dl class="method">
        <dt id="sphere.sim.uniaxialStrainRate">
       -<tt class="descname">uniaxialStrainRate</tt><big>(</big><em>wvel=-0.001</em><big>)</big><a class="headerlink" href="#sphere.sim.uniaxialStrainRate" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">uniaxialStrainRate</code><span class="sig-paren">(</span><em>wvel=-0.001</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.uniaxialStrainRate" title="Permalink to this definition">¶</a></dt>
        <dd><p>Setup consolidation experiment. Specify the upper wall velocity in m/s,
        default value is -0.001 m/s (i.e. downwards).</p>
        <table class="docutils field-list" frame="void" rules="none">
       t@@ -1990,9 +2911,9 @@ moves downwards.</td>
        
        <dl class="method">
        <dt id="sphere.sim.video">
       -<tt class="descname">video</tt><big>(</big><em>out_folder='./'</em>, <em>video_format='mp4'</em>, <em>graphics_folder='../img_out/'</em>, <em>graphics_format='png'</em>, <em>fps=25</em>, <em>qscale=1</em>, <em>bitrate=1800</em>, <em>verbose=False</em><big>)</big><a class="headerlink" href="#sphere.sim.video" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">video</code><span class="sig-paren">(</span><em>out_folder='./'</em>, <em>video_format='mp4'</em>, <em>graphics_folder='../img_out/'</em>, <em>graphics_format='png'</em>, <em>fps=25</em>, <em>qscale=1</em>, <em>bitrate=1800</em>, <em>verbose=False</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.video" title="Permalink to this definition">¶</a></dt>
        <dd><p>Uses ffmpeg to combine images to animation. All images should be
       -rendered beforehand using <a class="reference internal" href="#sphere.render" title="sphere.render"><tt class="xref py py-func docutils literal"><span class="pre">render()</span></tt></a>.</p>
       +rendered beforehand using <a class="reference internal" href="#sphere.render" title="sphere.render"><code class="xref py py-func docutils literal"><span class="pre">render()</span></code></a>.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
       t@@ -2015,7 +2936,7 @@ rendered beforehand using <a class="reference internal" href="#sphere.render" ti
        
        <dl class="method">
        <dt id="sphere.sim.viscousEnergy">
       -<tt class="descname">viscousEnergy</tt><big>(</big><em>idx</em><big>)</big><a class="headerlink" href="#sphere.sim.viscousEnergy" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">viscousEnergy</code><span class="sig-paren">(</span><em>idx</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.viscousEnergy" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the viscous dissipated energy for a particle.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -2033,7 +2954,7 @@ rendered beforehand using <a class="reference internal" href="#sphere.render" ti
        
        <dl class="method">
        <dt id="sphere.sim.visualize">
       -<tt class="descname">visualize</tt><big>(</big><em>method='energy'</em>, <em>savefig=True</em>, <em>outformat='png'</em><big>)</big><a class="headerlink" href="#sphere.sim.visualize" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">visualize</code><span class="sig-paren">(</span><em>method='energy'</em>, <em>savefig=True</em>, <em>outformat='png'</em>, <em>figsize=False</em>, <em>pickle=False</em>, <em>xlim=False</em>, <em>firststep=0</em>, <em>f_min=None</em>, <em>f_max=None</em>, <em>cmap=None</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.visualize" title="Permalink to this definition">¶</a></dt>
        <dd><p>Visualize output from the simulation, where the temporal progress is
        of interest. The output will be saved in the current folder with a name
        combining the simulation id of the simulation, and the visualization
       t@@ -2044,10 +2965,20 @@ method.</p>
        <tbody valign="top">
        <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
        <li><strong>method</strong> (<em>str</em>) &#8211; The type of plot to render. Possible values are &#8216;energy&#8217;,
       -&#8216;walls&#8217;, &#8216;triaxial&#8217; and &#8216;shear&#8217;</li>
       +&#8216;walls&#8217;, &#8216;triaxial&#8217;, &#8216;inertia&#8217;, &#8216;mean-fluid-pressure&#8217;,
       +&#8216;fluid-pressure&#8217;, &#8216;shear&#8217;, &#8216;shear-displacement&#8217;, &#8216;porosity&#8217;,
       +&#8216;rate-dependence&#8217;, &#8216;contacts&#8217;</li>
        <li><strong>savefig</strong> (<em>bool</em>) &#8211; Save the image instead of showing it on screen</li>
        <li><strong>outformat</strong> &#8211; The output format of the plot data. This can be an
        image format, or in text (&#8216;txt&#8217;).</li>
       +<li><strong>figsize</strong> (<em>array</em>) &#8211; Specify output figure size in inches</li>
       +<li><strong>pickle</strong> (<em>bool</em>) &#8211; Save all figure content as a Python pickle file. It can
       +be opened later using <cite>fig = pickle.load(open(&#8216;file.pickle&#8217;,&#8217;rb&#8217;))</cite>.</li>
       +<li><strong>xlim</strong> (<em>array</em>) &#8211; Set custom limits to the x axis. If not specified, the x
       +range will correspond to the entire data interval.</li>
       +<li><strong>firststep</strong> (<em>int</em>) &#8211; The first output file step to read (default: 0)</li>
       +<li><strong>cmap</strong> (<em>matplotlib.colors.LinearSegmentedColormap</em>) &#8211; Choose custom color map, e.g.
       +<cite>cmap=matplotlib.cm.get_cmap(&#8216;afmhot&#8217;)</cite></li>
        </ul>
        </td>
        </tr>
       t@@ -2057,7 +2988,7 @@ image format, or in text (&#8216;txt&#8217;).</li>
        
        <dl class="method">
        <dt id="sphere.sim.voidRatio">
       -<tt class="descname">voidRatio</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.voidRatio" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">voidRatio</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.voidRatio" title="Permalink to this definition">¶</a></dt>
        <dd><p>Calculates the current void ratio</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -2073,7 +3004,7 @@ image format, or in text (&#8216;txt&#8217;).</li>
        
        <dl class="method">
        <dt id="sphere.sim.volume">
       -<tt class="descname">volume</tt><big>(</big><em>idx</em><big>)</big><a class="headerlink" href="#sphere.sim.volume" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">volume</code><span class="sig-paren">(</span><em>idx</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.volume" title="Permalink to this definition">¶</a></dt>
        <dd><p>Returns the volume of a particle.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -2090,10 +3021,33 @@ image format, or in text (&#8216;txt&#8217;).</li>
        </dd></dl>
        
        <dl class="method">
       +<dt id="sphere.sim.wall0iz">
       +<code class="descname">wall0iz</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.wall0iz" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Returns the cell index of wall 0 along z.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">z cell index</td>
       +</tr>
       +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">int</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.wet">
       +<code class="descname">wet</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.wet" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Set the simulation to be wet (total fluid saturation).</p>
       +<p>See also <a class="reference internal" href="#sphere.sim.dry" title="sphere.sim.dry"><code class="xref py py-func docutils literal"><span class="pre">dry()</span></code></a></p>
       +</dd></dl>
       +
       +<dl class="method">
        <dt id="sphere.sim.writeFluidVTK">
       -<tt class="descname">writeFluidVTK</tt><big>(</big><em>folder='../output/'</em>, <em>cell_centered=True</em>, <em>verbose=True</em><big>)</big><a class="headerlink" href="#sphere.sim.writeFluidVTK" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Writes a VTK file for the fluid grid to the <tt class="docutils literal"><span class="pre">../output/</span></tt> folder by
       -default. The file name will be in the format <tt class="docutils literal"><span class="pre">fluid-&lt;self.sid&gt;.vti</span></tt>.
       +<code class="descname">writeFluidVTK</code><span class="sig-paren">(</span><em>folder='../output/'</em>, <em>cell_centered=True</em>, <em>verbose=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.writeFluidVTK" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Writes a VTK file for the fluid grid to the <code class="docutils literal"><span class="pre">../output/</span></code> folder by
       +default. The file name will be in the format <code class="docutils literal"><span class="pre">fluid-&lt;self.sid&gt;.vti</span></code>.
        The vti files can be used for visualizing the fluid in ParaView.</p>
        <p>The scalars (pressure, porosity, porosity change) and the velocity
        vectors are either placed in a grid where the grid corners correspond to
       t@@ -2125,7 +3079,7 @@ order to visualize fluid vector fields, the cell-centered mesh is
        selected in the &#8220;Pipeline Browser&#8221;, and is filtered using &#8220;Filters&#8221; -&gt;
        &#8220;Alphabetical&#8221; -&gt; &#8220;Cell Data to Point Data&#8221;.</p>
        <p>If several data files are generated for the same simulation (e.g. using
       -the <a class="reference internal" href="#sphere.sim.writeVTKall" title="sphere.sim.writeVTKall"><tt class="xref py py-func docutils literal"><span class="pre">writeVTKall()</span></tt></a> function), it is able to step the
       +the <a class="reference internal" href="#sphere.sim.writeVTKall" title="sphere.sim.writeVTKall"><code class="xref py py-func docutils literal"><span class="pre">writeVTKall()</span></code></a> function), it is able to step the
        visualization through time by using the ParaView controls.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -2146,9 +3100,9 @@ cell corners (False), (default = True)</li>
        
        <dl class="method">
        <dt id="sphere.sim.writeVTK">
       -<tt class="descname">writeVTK</tt><big>(</big><em>folder='../output/'</em>, <em>verbose=True</em><big>)</big><a class="headerlink" href="#sphere.sim.writeVTK" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Writes a VTK file with particle information to the <tt class="docutils literal"><span class="pre">../output/</span></tt> folder
       -by default. The file name will be in the format <tt class="docutils literal"><span class="pre">&lt;self.sid&gt;.vtu</span></tt>.
       +<code class="descname">writeVTK</code><span class="sig-paren">(</span><em>folder='../output/'</em>, <em>verbose=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.writeVTK" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Writes a VTK file with particle information to the <code class="docutils literal"><span class="pre">../output/</span></code> folder
       +by default. The file name will be in the format <code class="docutils literal"><span class="pre">&lt;self.sid&gt;.vtu</span></code>.
        The vtu files can be used to visualize the particles in ParaView.</p>
        <p>After opening the vtu files, the particle fields will show up in the
        &#8220;Properties&#8221; list. Press &#8220;Apply&#8221; to import all fields into the ParaView
       t@@ -2165,7 +3119,7 @@ resolution&#8221;) to increase the quality and the computational requirements
        of the rendering. All adjustments by default require the &#8220;Apply&#8221; button
        to be pressed before regenerating the view.</p>
        <p>If several vtu files are generated for the same simulation (e.g. using
       -the <a class="reference internal" href="#sphere.sim.writeVTKall" title="sphere.sim.writeVTKall"><tt class="xref py py-func docutils literal"><span class="pre">writeVTKall()</span></tt></a> function), it is able to step the
       +the <a class="reference internal" href="#sphere.sim.writeVTKall" title="sphere.sim.writeVTKall"><code class="xref py py-func docutils literal"><span class="pre">writeVTKall()</span></code></a> function), it is able to step the
        visualization through time by using the ParaView controls.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
       t@@ -2184,11 +3138,11 @@ visualization through time by using the ParaView controls.</p>
        
        <dl class="method">
        <dt id="sphere.sim.writeVTKall">
       -<tt class="descname">writeVTKall</tt><big>(</big><em>cell_centered=True</em>, <em>verbose=True</em><big>)</big><a class="headerlink" href="#sphere.sim.writeVTKall" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">writeVTKall</code><span class="sig-paren">(</span><em>cell_centered=True</em>, <em>verbose=True</em>, <em>forces=False</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.writeVTKall" title="Permalink to this definition">¶</a></dt>
        <dd><p>Writes a VTK file for each simulation output file with particle
       -information and the fluid grid to the <tt class="docutils literal"><span class="pre">../output/</span></tt> folder by default.
       -The file name will be in the format <tt class="docutils literal"><span class="pre">&lt;self.sid&gt;.vtu</span></tt> and
       -<tt class="docutils literal"><span class="pre">fluid-&lt;self.sid&gt;.vti</span></tt>. The vtu files can be used to visualize the
       +information and the fluid grid to the <code class="docutils literal"><span class="pre">../output/</span></code> folder by default.
       +The file name will be in the format <code class="docutils literal"><span class="pre">&lt;self.sid&gt;.vtu</span></code> and
       +<code class="docutils literal"><span class="pre">fluid-&lt;self.sid&gt;.vti</span></code>. The vtu files can be used to visualize the
        particles, and the vti files for visualizing the fluid in ParaView.</p>
        <p>After opening the vtu files, the particle fields will show up in the
        &#8220;Properties&#8221; list. Press &#8220;Apply&#8221; to import all fields into the ParaView
       t@@ -2222,13 +3176,43 @@ that &#8220;Arrow&#8221; is selected as the &#8220;Glyph type&#8221;, and &#8220
        big as the number of fluid cells in the grid. Press &#8220;Apply&#8221; to visualize
        the arrows.</p>
        <p>If several data files are generated for the same simulation (e.g. using
       -the <a class="reference internal" href="#sphere.sim.writeVTKall" title="sphere.sim.writeVTKall"><tt class="xref py py-func docutils literal"><span class="pre">writeVTKall()</span></tt></a> function), it is able to step the
       +the <a class="reference internal" href="#sphere.sim.writeVTKall" title="sphere.sim.writeVTKall"><code class="xref py py-func docutils literal"><span class="pre">writeVTKall()</span></code></a> function), it is able to step the
        visualization through time by using the ParaView controls.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
        <tbody valign="top">
       -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>verbose</strong> (<em>bool</em>) &#8211; Show diagnostic information (default = True)</td>
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
       +<li><strong>verbose</strong> (<em>bool</em>) &#8211; Show diagnostic information (default = True)</li>
       +<li><strong>cell_centered</strong> (<em>bool</em>) &#8211; Write fluid values to cell centered positions
       +(default = true)</li>
       +<li><strong>forces</strong> (<em>bool</em>) &#8211; Write contact force files (slow) (default = False)</li>
       +</ul>
       +</td>
       +</tr>
       +</tbody>
       +</table>
       +</dd></dl>
       +
       +<dl class="method">
       +<dt id="sphere.sim.writeVTKforces">
       +<code class="descname">writeVTKforces</code><span class="sig-paren">(</span><em>folder='../output/'</em>, <em>verbose=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.writeVTKforces" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Writes a VTK file with particle-interaction information to the
       +<code class="docutils literal"><span class="pre">../output/</span></code> folder by default. The file name will be in the format
       +<code class="docutils literal"><span class="pre">&lt;self.sid&gt;.vtp</span></code>.  The vtp files can be used to visualize the
       +particle interactions in ParaView.  First use the &#8220;Cell Data to Point
       +Data&#8221; filter, and afterwards show the contact network with the &#8220;Tube&#8221;
       +filter.</p>
       +<table class="docutils field-list" frame="void" rules="none">
       +<col class="field-name" />
       +<col class="field-body" />
       +<tbody valign="top">
       +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
       +<li><strong>folder</strong> (<em>str</em>) &#8211; The folder where to place the output file (default
       +(default = &#8216;../output/&#8217;)</li>
       +<li><strong>verbose</strong> (<em>bool</em>) &#8211; Show diagnostic information (default = True)</li>
       +</ul>
       +</td>
        </tr>
        </tbody>
        </table>
       t@@ -2236,10 +3220,10 @@ visualization through time by using the ParaView controls.</p>
        
        <dl class="method">
        <dt id="sphere.sim.writebin">
       -<tt class="descname">writebin</tt><big>(</big><em>folder='../input/'</em>, <em>verbose=True</em><big>)</big><a class="headerlink" href="#sphere.sim.writebin" title="Permalink to this definition">¶</a></dt>
       -<dd><p>Writes a <tt class="docutils literal"><span class="pre">sphere</span></tt> binary file to the <tt class="docutils literal"><span class="pre">../input/</span></tt> folder by default.
       -The file name will be in the format <tt class="docutils literal"><span class="pre">&lt;self.sid&gt;.bin</span></tt>.</p>
       -<p>See also <a class="reference internal" href="#sphere.sim.readbin" title="sphere.sim.readbin"><tt class="xref py py-func docutils literal"><span class="pre">readbin()</span></tt></a>.</p>
       +<code class="descname">writebin</code><span class="sig-paren">(</span><em>folder='../input/'</em>, <em>verbose=True</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.writebin" title="Permalink to this definition">¶</a></dt>
       +<dd><p>Writes a <code class="docutils literal"><span class="pre">sphere</span></code> binary file to the <code class="docutils literal"><span class="pre">../input/</span></code> folder by default.
       +The file name will be in the format <code class="docutils literal"><span class="pre">&lt;self.sid&gt;.bin</span></code>.</p>
       +<p>See also <a class="reference internal" href="#sphere.sim.readbin" title="sphere.sim.readbin"><code class="xref py py-func docutils literal"><span class="pre">readbin()</span></code></a>.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
       t@@ -2256,7 +3240,7 @@ The file name will be in the format <tt class="docutils literal"><span class="pr
        
        <dl class="method">
        <dt id="sphere.sim.zeroKinematics">
       -<tt class="descname">zeroKinematics</tt><big>(</big><big>)</big><a class="headerlink" href="#sphere.sim.zeroKinematics" title="Permalink to this definition">¶</a></dt>
       +<code class="descname">zeroKinematics</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sphere.sim.zeroKinematics" title="Permalink to this definition">¶</a></dt>
        <dd><p>Zero all kinematic parameters of the particles. This function is useful
        when output from one simulation is reused in another simulation.</p>
        </dd></dl>
       t@@ -2265,7 +3249,7 @@ when output from one simulation is reused in another simulation.</p>
        
        <dl class="function">
        <dt id="sphere.status">
       -<tt class="descclassname">sphere.</tt><tt class="descname">status</tt><big>(</big><em>project</em><big>)</big><a class="headerlink" href="#sphere.status" title="Permalink to this definition">¶</a></dt>
       +<code class="descclassname">sphere.</code><code class="descname">status</code><span class="sig-paren">(</span><em>project</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.status" title="Permalink to this definition">¶</a></dt>
        <dd><p>Check the status.dat file for the target project, and return the last output
        file number.</p>
        <table class="docutils field-list" frame="void" rules="none">
       t@@ -2284,7 +3268,7 @@ file number.</p>
        
        <dl class="function">
        <dt id="sphere.thinsectionVideo">
       -<tt class="descclassname">sphere.</tt><tt class="descname">thinsectionVideo</tt><big>(</big><em>project</em>, <em>out_folder='./'</em>, <em>video_format='mp4'</em>, <em>fps=25</em>, <em>qscale=1</em>, <em>bitrate=1800</em>, <em>verbose=False</em><big>)</big><a class="headerlink" href="#sphere.thinsectionVideo" title="Permalink to this definition">¶</a></dt>
       +<code class="descclassname">sphere.</code><code class="descname">thinsectionVideo</code><span class="sig-paren">(</span><em>project</em>, <em>out_folder='./'</em>, <em>video_format='mp4'</em>, <em>fps=25</em>, <em>qscale=1</em>, <em>bitrate=1800</em>, <em>verbose=False</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.thinsectionVideo" title="Permalink to this definition">¶</a></dt>
        <dd><p>Uses ffmpeg to combine thin section images to an animation. This function
        will implicity render the thin section images beforehand.</p>
        <table class="docutils field-list" frame="void" rules="none">
       t@@ -2308,7 +3292,7 @@ will implicity render the thin section images beforehand.</p>
        
        <dl class="function">
        <dt id="sphere.torqueScriptParallel3">
       -<tt class="descclassname">sphere.</tt><tt class="descname">torqueScriptParallel3</tt><big>(</big><em>obj1</em>, <em>obj2</em>, <em>obj3</em>, <em>email='adc&#64;geo.au.dk'</em>, <em>email_alerts='ae'</em>, <em>walltime='24:00:00'</em>, <em>queue='qfermi'</em>, <em>cudapath='/com/cuda/4.0.17/cuda'</em>, <em>spheredir='/home/adc/code/sphere'</em>, <em>use_workdir=False</em>, <em>workdir='/scratch'</em><big>)</big><a class="headerlink" href="#sphere.torqueScriptParallel3" title="Permalink to this definition">¶</a></dt>
       +<code class="descclassname">sphere.</code><code class="descname">torqueScriptParallel3</code><span class="sig-paren">(</span><em>obj1</em>, <em>obj2</em>, <em>obj3</em>, <em>email='adc&#64;geo.au.dk'</em>, <em>email_alerts='ae'</em>, <em>walltime='24:00:00'</em>, <em>queue='qfermi'</em>, <em>cudapath='/com/cuda/4.0.17/cuda'</em>, <em>spheredir='/home/adc/code/sphere'</em>, <em>use_workdir=False</em>, <em>workdir='/scratch'</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.torqueScriptParallel3" title="Permalink to this definition">¶</a></dt>
        <dd><p>Create job script for the Torque queue manager for three binaries,
        executed in parallel, ideally on three GPUs.</p>
        <table class="docutils field-list" frame="void" rules="none">
       t@@ -2342,14 +3326,14 @@ in any order.</li>
        </tr>
        </tbody>
        </table>
       -<p>See also <tt class="xref py py-func docutils literal"><span class="pre">torqueScript()</span></tt></p>
       +<p>See also <code class="xref py py-func docutils literal"><span class="pre">torqueScript()</span></code></p>
        </dd></dl>
        
        <dl class="function">
        <dt id="sphere.video">
       -<tt class="descclassname">sphere.</tt><tt class="descname">video</tt><big>(</big><em>project</em>, <em>out_folder='./'</em>, <em>video_format='mp4'</em>, <em>graphics_folder='../img_out/'</em>, <em>graphics_format='png'</em>, <em>fps=25</em>, <em>qscale=1</em>, <em>bitrate=1800</em>, <em>verbose=False</em><big>)</big><a class="headerlink" href="#sphere.video" title="Permalink to this definition">¶</a></dt>
       +<code class="descclassname">sphere.</code><code class="descname">video</code><span class="sig-paren">(</span><em>project</em>, <em>out_folder='./'</em>, <em>video_format='mp4'</em>, <em>graphics_folder='../img_out/'</em>, <em>graphics_format='png'</em>, <em>fps=25</em>, <em>qscale=1</em>, <em>bitrate=1800</em>, <em>verbose=False</em><span class="sig-paren">)</span><a class="headerlink" href="#sphere.video" title="Permalink to this definition">¶</a></dt>
        <dd><p>Uses ffmpeg to combine images to animation. All images should be
       -rendered beforehand using <a class="reference internal" href="#sphere.render" title="sphere.render"><tt class="xref py py-func docutils literal"><span class="pre">render()</span></tt></a>.</p>
       +rendered beforehand using <a class="reference internal" href="#sphere.render" title="sphere.render"><code class="xref py py-func docutils literal"><span class="pre">render()</span></code></a>.</p>
        <table class="docutils field-list" frame="void" rules="none">
        <col class="field-name" />
        <col class="field-body" />
       t@@ -2378,13 +3362,13 @@ rendered beforehand using <a class="reference internal" href="#sphere.render" ti
                  </div>
                </div>
              </div>
       -      <div class="sphinxsidebar">
       +      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
                <div class="sphinxsidebarwrapper">
          <h3><a href="index.html">Table Of Contents</a></h3>
          <ul>
        <li><a class="reference internal" href="#">Python API</a><ul>
        <li><a class="reference internal" href="#sample-usage">Sample usage</a></li>
       -<li><a class="reference internal" href="#module-sphere">The <tt class="docutils literal"><span class="pre">sphere</span></tt> module</a></li>
       +<li><a class="reference internal" href="#module-sphere">The <code class="docutils literal"><span class="pre">sphere</span></code> module</a></li>
        </ul>
        </li>
        </ul>
       t@@ -2392,29 +3376,28 @@ rendered beforehand using <a class="reference internal" href="#sphere.render" ti
          <h4>Previous topic</h4>
          <p class="topless"><a href="cfd.html"
                                title="previous chapter">Fluid simulation and particle-fluid interaction</a></p>
       -  <h3>This Page</h3>
       -  <ul class="this-page-menu">
       -    <li><a href="_sources/python_api.txt"
       -           rel="nofollow">Show Source</a></li>
       -  </ul>
       -<div id="searchbox" style="display: none">
       +  <div role="note" aria-label="source link">
       +    <h3>This Page</h3>
       +    <ul class="this-page-menu">
       +      <li><a href="_sources/python_api.txt"
       +            rel="nofollow">Show Source</a></li>
       +    </ul>
       +   </div>
       +<div id="searchbox" style="display: none" role="search">
          <h3>Quick search</h3>
            <form class="search" action="search.html" method="get">
       -      <input type="text" name="q" />
       -      <input type="submit" value="Go" />
       +      <div><input type="text" name="q" /></div>
       +      <div><input type="submit" value="Go" /></div>
              <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 module, class or function name.
       -    </p>
        </div>
        <script type="text/javascript">$('#searchbox').show(0);</script>
                </div>
              </div>
              <div class="clearer"></div>
            </div>
       -    <div class="related">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -2426,12 +3409,12 @@ rendered beforehand using <a class="reference internal" href="#sphere.render" ti
                <li class="right" >
                  <a href="cfd.html" title="Fluid simulation and particle-fluid interaction"
                     >previous</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>
       -    <div class="footer">
       -        &copy; Copyright 2014, Anders Damsgaard.
       -      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
       +    <div class="footer" role="contentinfo">
       +        &#169; Copyright 2014, Anders Damsgaard.
       +      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
            </div>
          </body>
        </html>
        \ No newline at end of file
 (DIR) diff --git a/doc/html/search.html b/doc/html/search.html
       t@@ -1,5 +1,3 @@
       -
       -
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
       t@@ -8,15 +6,14 @@
          <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            
       -    <title>Search &mdash; sphere 1.00-alpha documentation</title>
       +    <title>Search &#8212; sphere 1.00-alpha documentation</title>
            
       -    <link rel="stylesheet" href="_static/default.css" type="text/css" />
       +    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
            <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       -    <link rel="stylesheet" href="_static/breathe.css" type="text/css" />
            
            <script type="text/javascript">
              var DOCUMENTATION_OPTIONS = {
       -        URL_ROOT:    '',
       +        URL_ROOT:    './',
                VERSION:     '1.00-alpha',
                COLLAPSE_INDEX: false,
                FILE_SUFFIX: '.html',
       t@@ -27,6 +24,8 @@
            <script type="text/javascript" src="_static/underscore.js"></script>
            <script type="text/javascript" src="_static/doctools.js"></script>
            <script type="text/javascript" src="_static/searchtools.js"></script>
       +    <link rel="index" title="Index" href="genindex.html" />
       +    <link rel="search" title="Search" href="#" />
            <link rel="top" title="sphere 1.00-alpha documentation" href="index.html" />
          <script type="text/javascript">
            jQuery(function() { Search.loadIndex("searchindex.js"); });
       t@@ -36,8 +35,8 @@
           
        
          </head>
       -  <body>
       -    <div class="related">
       +  <body role="document">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -46,14 +45,14 @@
                <li class="right" >
                  <a href="py-modindex.html" title="Python Module Index"
                     >modules</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>  
        
            <div class="document">
              <div class="documentwrapper">
                <div class="bodywrapper">
       -          <div class="body">
       +          <div class="body" role="main">
                    
          <h1 id="search-documentation">Search</h1>
          <div id="fallback" class="admonition warning">
       t@@ -82,13 +81,13 @@
                  </div>
                </div>
              </div>
       -      <div class="sphinxsidebar">
       +      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
                <div class="sphinxsidebarwrapper">
                </div>
              </div>
              <div class="clearer"></div>
            </div>
       -    <div class="related">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -97,12 +96,12 @@
                <li class="right" >
                  <a href="py-modindex.html" title="Python Module Index"
                     >modules</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>
       -    <div class="footer">
       -        &copy; Copyright 2014, Anders Damsgaard.
       -      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
       +    <div class="footer" role="contentinfo">
       +        &#169; Copyright 2014, Anders Damsgaard.
       +      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
            </div>
          </body>
        </html>
        \ No newline at end of file
 (DIR) diff --git a/doc/html/searchindex.js b/doc/html/searchindex.js
       t@@ -1 +1 @@
       -Search.setIndex({objects:{"":{sphere:[5,0,1,""]},sphere:{status:[5,1,1,""],convert:[5,1,1,""],run:[5,1,1,""],render:[5,1,1,""],thinsectionVideo:[5,1,1,""],torqueScriptParallel3:[5,1,1,""],V_sphere:[5,1,1,""],cleanup:[5,1,1,""],video:[5,1,1,""],sim:[5,3,1,""]},"sphere.sim":{setFluidTopFixedPressure:[5,2,1,""],totalFrictionalEnergy:[5,2,1,""],setTheta:[5,2,1,""],setTolerance:[5,2,1,""],generateBimodalRadii:[5,2,1,""],defaultParams:[5,2,1,""],initRandomGridPos:[5,2,1,""],porosity:[5,2,1,""],periodicBoundariesXY:[5,2,1,""],momentum:[5,2,1,""],thinsection_x1x3:[5,2,1,""],largestMass:[5,2,1,""],readbin:[5,2,1,""],writeFluidVTK:[5,2,1,""],kineticEnergy:[5,2,1,""],defineWorldBoundaries:[5,2,1,""],uniaxialStrainRate:[5,2,1,""],inertiaParameterPlanarShear:[5,2,1,""],readlast:[5,2,1,""],bond:[5,2,1,""],consolidate:[5,2,1,""],shearStrainRate:[5,2,1,""],setDampingNormal:[5,2,1,""],energy:[5,2,1,""],disableFluidPressureModulation:[5,2,1,""],video:[5,2,1,""],initRandomPos:[5,2,1,""],writeVTKall:[5,2,1,""],frictionalEnergy:[5,2,1,""],shearStrain:[5,2,1,""],zeroKinematics:[5,2,1,""],visualize:[5,2,1,""],randomBondPairs:[5,2,1,""],setBeta:[5,2,1,""],setDEMstepsPerCFDstep:[5,2,1,""],run:[5,2,1,""],deleteParticle:[5,2,1,""],setGamma:[5,2,1,""],plotFluidVelocitiesZ:[5,2,1,""],plotFluidVelocitiesY:[5,2,1,""],forcechainsRose:[5,2,1,""],adjustUpperWall:[5,2,1,""],setFluidTopNoFlow:[5,2,1,""],viscousEnergy:[5,2,1,""],readsecond:[5,2,1,""],plotPrescribedFluidPressures:[5,2,1,""],forcechains:[5,2,1,""],render:[5,2,1,""],triaxial:[5,2,1,""],rotationalEnergy:[5,2,1,""],initGrid:[5,2,1,""],readfirst:[5,2,1,""],periodicBoundariesX:[5,2,1,""],sheardisp:[5,2,1,""],totalRotationalEnergy:[5,2,1,""],adjustWall:[5,2,1,""],setFluidTopNoFlowNoSlip:[5,2,1,""],setFluidPressureModulation:[5,2,1,""],setDampingTangential:[5,2,1,""],initFluid:[5,2,1,""],volume:[5,2,1,""],normalBoundariesXY:[5,2,1,""],bulkPorosity:[5,2,1,""],setFluidBottomNoFlow:[5,2,1,""],createBondPair:[5,2,1,""],torqueScript:[5,2,1,""],generateRadii:[5,2,1,""],writebin:[5,2,1,""],plotLoadCurve:[5,2,1,""],deleteAllParticles:[5,2,1,""],shear:[5,2,1,""],initTemporal:[5,2,1,""],setMaxIterations:[5,2,1,""],initGridAndWorldsize:[5,2,1,""],totalMomentum:[5,2,1,""],shearVel:[5,2,1,""],porosities:[5,2,1,""],readstep:[5,2,1,""],acceleration:[5,2,1,""],plotFluidDiffAdvPresZ:[5,2,1,""],smallestMass:[5,2,1,""],checkerboardColors:[5,2,1,""],writeVTK:[5,2,1,""],bondsRose:[5,2,1,""],cleanup:[5,2,1,""],addParticle:[5,2,1,""],setFluidBottomFixedPressure:[5,2,1,""],currentNormalStress:[5,2,1,""],plotConvergence:[5,2,1,""],status:[5,2,1,""],voidRatio:[5,2,1,""],momentOfInertia:[5,2,1,""],totalViscousEnergy:[5,2,1,""],setFluidBottomNoFlowNoSlip:[5,2,1,""],totalKineticEnergy:[5,2,1,""],initGridPos:[5,2,1,""],plotFluidPressuresY:[5,2,1,""],plotFluidPressuresZ:[5,2,1,""],mass:[5,2,1,""],contactModel:[5,2,1,""]}},terms:{orthogon:5,prefix:3,whose:[],s_law:[],"const":3,under:[1,0,5],everi:2,"void":[3,5],readbin:[3,5],mp4:5,vector:[3,2,4,5],bulkporos:5,setfluidtopnoflownoslip:5,p_f:5,seper:3,direct:[4,5],second:[3,2,4,5],even:[3,4],supervis:0,hide:5,neg:[2,4,5],lundbek:0,"new":[2,4,5],symmetr:2,topolog:3,behavior:[1,4,5],here:2,path:[1,5],interpret:1,dry:[3,5],initgridandworlds:5,precis:[3,5],linearli:[2,5],releas:1,instabl:5,total:[3,2,4,5],univ:[],unit:1,plot:5,describ:[2,4],initfluid:5,call:[3,5],recommend:5,type:[1,3,4,5],relax:5,successful:1,relat:3,warn:5,exce:[2,5],loss:[4,5],must:5,setup:[1,5],work:[1,0,5],setfluidtopnoflow:5,coalesc:3,root:[1,3,5],unnam:5,kinet:[4,5],give:3,img_width:3,indic:0,want:2,readstep:5,keep:[1,2],unsign:3,setdemstepspercfdstep:5,end:[3,2,5],mu_w:5,travel:3,mu_r:5,how:[3,5],env:5,place:[1,3,5],mu_d:5,updat:[1,0,2,3],after:[1,3,2,5],befor:[3,5],wrong:[],mesh:5,law:[3,2,4],parallel:[1,2,5],averag:[2,5],third:[0,2,5],interpol:5,maintain:1,environ:1,incorpor:2,enter:2,exclus:[3,5],order:[1,3,2,4,5],oper:[1,0,2,3],over:4,visc_n_rat:5,pascal:5,flexibl:[1,2],totalviscousenergi:5,img:[],fix:5,welcome_:[],fig:3,hidden:[],shear:[2,5],them:5,anim:5,thei:[3,2],choic:[],include_cod:[],arrow:5,each:[3,2,4,5],angvel:[3,5],side:[2,5],mean:[1,2,5],pdflatex:1,logn:5,euler_method:[],network:4,gradient:[2,5],content:0,rewrit:2,smi:5,gov:[],linear:[2,4,5],slipscal:5,situat:2,free:[1,2,5],standard:5,configuraion:3,angl:5,filter:5,isn:[2,5],rang:[2,5],render:[1,3,5],restrict:1,hook:[],instruct:1,thick:5,sort_by_kei:3,advect:[2,5],top:[2,5],evolut:[3,5],addparticl:5,tool:1,bondsros:5,max_val:5,somewhat:[4,5],conserv:[2,5],target:[3,5],provid:1,zero:[3,2,4,5],project:[0,2,5],matter:4,rad:5,setfluidpressuremodul:5,xdisp:[3,5],ram:3,rai:[1,5],raw:4,seed:4,increment:4,ldot:3,latter:4,blue:5,though:[3,4],object:[1,5],regular:5,phase:[2,5],prematur:5,don:3,doc:1,flow:[1,0,2,5],vector_norm:[],sum:[2,4,5],dot:[4,5],radix:3,opposit:2,random:[3,5],radiu:[2,4,5],radii:5,pkg:1,involv:3,consolid:5,layout:3,menu:5,explain:[3,0],configur:[1,3,5],settheta:5,folder:[1,3,5],loopstart:3,stop:5,fluid:[0,2,4,5],net:3,bar:5,cuda_sdk_root_dir:1,"public":[1,3],mu_:5,datatyp:3,result:[1,3,2,4,5],elasto:5,deleteallparticl:5,fail:[],best:[1,5],plotloadcurv:5,tensor:2,wikipedia:5,figur:3,simplest:4,angpo:[3,5],approach:2,attribut:2,extend:[],cfdem:[],toler:[2,5],subfold:3,howev:[3,4],kineticenergi:5,against:5,uni:5,browser:5,com:[1,3,5],pre:[3,5],height:5,guid:[3,0],assum:[2,5],gamma_n:5,numpi:[1,5],three:[1,3,2,4,5],been:[4,5],spherebin:5,interest:[0,5],gamma_t:5,gamma_r:5,suppress:3,search:[3,0,4],emploi:3,ident:2,cudamemcheck:5,plotconverg:5,gnu:[1,3],properti:[1,2,5],setfluidtopfixedpressur:5,aim:[1,0],euclidean:[],calcul:[3,2,4,5],seven:2,conv:5,tabl:0,toolkit:1,shami:2,sever:[3,5],perform:[1,3,5],make:[1,3,5],transpar:5,complex:[],split:[0,2],dimensionless:2,complet:5,hang:5,hand:[3,2,4],kin:5,"0e3f":3,thu:3,contact:[3,0,2,4,5],thi:[0,1,2,3,4,5],left:5,identifi:[3,4,5],savefig:5,newton:[3,2,4],yet:4,previous:[2,5],expos:1,character:[2,4],save:5,applic:[3,5],dissip:[4,5],mennu:5,background:[3,2],maxval:3,specif:[1,3],initcuda:3,www:[],right:[2,5],old:[2,5],deal:2,interv:[3,5],maxim:[2,5],intern:[1,3],maxit:5,raytrac:[3,5],txt:[1,5],bottom:2,ev_dot:5,adjustwal:5,condit:[1,0,2,5],core:5,bold:4,torquescriptparallel3:5,post:[4,5],zerokinemat:5,simul:[0,1,2,3,4,5],coars:5,produc:5,step_count:5,"float":[3,5],bound:5,ppm:5,readfirst:5,wrap:3,often:3,git:1,wai:[1,3,5],gridnum:5,frictionalenergi:5,support:1,interiaparameterplanarshear:[],avail:1,width:[2,5],fraction:[2,5],analysi:[1,5],medium:2,form:[3,2,4],forc:[3,2,4,5],epsilon:5,setbeta:5,berg:4,"true":5,azi:5,bugfix:1,maximum:5,url:3,inaccur:4,fermi:1,fundament:4,plotfluiddiffadvpresz:5,featur:4,"abstract":[],diagnost:[3,5],exist:3,ship:1,check:[1,3,5],when:[4,5],test:1,totalkineticenergi:5,roll:5,node:[2,5],intend:5,intent:3,consid:[2,5],stoke:[0,2],spherealgo:3,longer:4,bullet:[],chrono:[],geometr:4,time:[1,3,2,4,5],backward:2,mathrm:3,checkerboardcolor:5,concept:2,sandia:[],global:3,plotprescribedfluidpressur:5,signific:5,z_slice:3,computation:4,rot:5,row:[],depend:[1,3,2],graph:3,vec:[],text:5,vel:[3,5],sourc:[1,3],string:3,solver:[2,5],iter:[2,5],mu_wn:5,item:3,sine:5,targetbin:5,calcparticlecellid:3,upper:5,slower:5,trend:5,sign:2,corner:5,appear:5,uniform:5,current:[3,2,5],boost:3,deriv:[0,2,4],gener:[1,4,5],coeffici:[2,4,5],water:5,explicitli:5,address:5,along:[4,5],sphere_:3,toolbar:5,box:5,shift:5,avconv:1,queue:5,poisson:[2,5],modul:[1,0,5],gamma_dot:5,volumetr:[2,5],instal:[1,0],memorytyp:3,ayi:5,memori:[3,5],univers:0,live:1,criteria:[2,5],scope:3,reorder:3,writevtkal:5,finit:2,damsgaard:[1,0,4],visual:[1,3,5],appendix:3,rigid:[],templat:[],setdampingnorm:5,graphic:1,can:[1,3,2,4,5],capillarycohes:5,transferconstmem:3,purpos:[1,5],obj1:5,stream:3,predict:[2,5],chip:3,critic:5,unfortun:1,alwai:3,differenti:2,write:[3,5],criterion:4,minpo:3,map:[],contact_mechan:[],arrowscal:5,max:5,clone:1,mac:1,devsmod:5,date:1,data:[1,3,5],stress:[2,5],liquid:4,repuls:[],explicit:2,inform:[1,3,5],setgamma:5,combin:5,block:3,superscript:[],findoverlap:3,dynam:[0,1,2,3,4,5],entiti:4,vti:5,vtk:[1,5],platform:1,window:5,vtu:5,mail:5,main:[1,3,5],non:[1,3,4,5],initi:[1,3,5],half:2,now:[3,4],introduct:[1,0,4],term:2,workload:3,plung:5,realist:[4,5],separ:4,initgridpo:5,compil:[1,3],domain:5,replac:1,individu:[3,2],continu:[3,2],significantli:5,createbondpair:5,shown:5,space:[2,5],lagrangian:2,profil:3,correct:[2,4],theori:0,org:[],"___":1,torqu:[3,4,5],prescrib:[2,5],frequenc:5,graphics_fold:5,pageref:3,synchron:3,motion:[3,4],initrandompo:5,neglect:2,first:[2,5],origin:[2,4,5],arrai:[3,5],open:[3,5],angular:5,size:5,given:2,z_adjust:5,conservation_of_energi:[],circl:5,viscousenergi:5,copi:1,specifi:[1,5],video_format:5,than:[2,5],png:5,wide:4,posit:[2,4,5],wvel:5,seri:3,cell_cent:5,ani:5,slam:5,slab:5,engin:[],hydrostat:5,bulletphys:[],note:[1,3,2,4,5],ideal:5,checkerboard:5,take:[1,2],begin:[3,5],sure:[1,5],trace:5,normal:[3,2,4,5],multipli:5,beta:5,writensarrai:3,pair:[2,4,5],later:2,lower_cutoff:[3,5],typeset:1,runtim:1,readjust:5,axi:5,cmakelist:1,totalfrictionalenergi:5,viscou:[2,4,5],viscos:[2,4,5],show:[3,5],friction:[4,5],dphi:5,help:[1,3],onli:[2,4,5],slow:3,ratio:[2,5],written:[1,3,5],analyz:5,"440e":5,offici:0,get:[1,3],kinemat:5,cannot:[1,3,2],settoler:5,theta:5,geo:[0,5],requir:[1,0,5,3],v_f:5,yield:3,across:2,where:[1,3,2,4,5],wiki:[],kernel:3,momentofinertia:5,infinit:5,uniaxialstrainr:5,label:3,between:[2,5],"import":[3,2,5],disablefluidpressuremodul:5,assumpt:2,screen:5,fit:5,reorderarrai:3,quiet:3,nearbi:2,leightest:5,mani:[],laplac:2,acceler:[2,4,5],color:[3,5],pot:5,period:[2,5],ultim:1,breath:1,checkval:3,thousand:[],resolut:5,ndvector:[],former:4,"case":[1,3,2],invok:[1,3,5],margin:5,planar:5,stdout:3,soil:4,equal:[3,2,5],cluster:5,img_height:3,egholm:0,subglaci:1,develop:[1,0],author:0,alphabet:5,bowl:5,same:5,binari:[1,3,5],html:1,lammp:[],document:[1,0,5,3],closest:5,kelvin:4,driver:1,driven:4,capabl:1,foat:5,improv:3,extern:5,model:[3,0,2,4,5],dimension:[1,3,2,4],gdr:5,execut:[1,3,5],excel:1,remov:5,touch:[],speed:3,rose:5,except:3,param:5,blog:4,rescal:5,momentum:[2,5],real:4,read:[1,3,5],psd:5,grid:[3,2,4,5],voigt:4,world:5,findcuda:1,cdot:3,either:[3,2,4,5],initgrid:5,output:[1,3,5],downward:5,inter:[4,5],manag:5,fulfil:5,qfermi:5,hydraul:5,slice:5,cudapath:5,definit:3,evolv:[],exit:[3,2,5],readlast:5,refer:3,inspect:1,starttim:3,fulli:2,src:[1,3],central:2,greatli:3,gplv3:1,degre:[3,5],cuda:[1,3,2,5],neighbor:[3,2,5],act:5,industri:4,bond:5,routin:1,effici:4,paraview:5,your:1,log:5,area:[],aren:2,start:[1,3,5],interfac:[4,5],low:5,gravit:[2,5],generateradii:5,newtonian:2,regard:4,diffus:5,satur:2,faster:5,notat:4,coulomb:4,possibl:[3,5],"default":[3,4,5],k_r:5,k_t:5,k_n:5,taylor:3,creat:[1,5],checkvalu:3,setdampingtangenti:5,"27s_laws_of_mot":[],rearrang:4,denot:[2,4,5],collid:5,googl:3,orient:[4,5],field:5,defaultparam:5,cleanup:5,collis:[3,5],spatial:[3,2,5],magnutud:[],you:1,architectur:[1,3],sequenc:3,symbol:[1,4],xysum:[],directori:[1,5],descript:3,lmgc:[],mass:[3,2,4,5],potenti:5,cpp:3,delta_n_ij:3,cpu:[3,2],disp:5,represent:5,all:[0,1,2,3,4,5],scalar:[3,2,5],disc:[],abil:2,cundal:4,follow:[1,3,2,4,5],disk:5,chain:5,opensourcedem:[],totalmomentum:5,program:[3,5],introduc:[2,5],sound:3,fals:5,capillari:5,verb:3,mechan:4,veri:4,dampen:5,list:[1,3,5],inittempor:[3,5],sand:4,adjust:[2,5],small:[3,4,5],dimens:5,shearrat:5,tex:1,rate:[2,5],pressur:[2,5],pass:[3,4],excit:[],section:[3,2,4,5],abl:5,delet:5,version:[1,3,2,5],intersect:[2,5],method:[0,1,2,3,4,5],movement:[3,5],hasn:4,full:[1,3,5],hash:3,visc_n:5,variat:2,modifi:[1,2],valu:[1,3,2,4,5],gidaspow:2,prior:5,amount:5,magnitud:[2,5],diamet:[2,5],via:3,depart:0,filenam:[3,5],select:5,qscale:5,distinct:5,liber:3,two:[2,4,5],formul:[2,4],more:[1,3,4,5],flat:5,desir:[4,5],setmaxiter:5,dictat:5,none:5,strain:[2,5],outlin:2,x1x3:5,histori:3,periodicboundariesx:5,remain:2,paragraph:3,dem:[1,3,4,5],gpu_gener:1,thinsectionvideo:5,loopend:3,sphere:[0,1,2,3,4,5],attain:2,hookean:4,divid:5,rather:3,anoth:5,divis:4,simpl:5,regener:5,gase:4,thrustfootnot:3,plane:[4,5],chronoengin:[],varianc:5,stabil:[3,5],lmgc90:[],github:1,img_out:5,caus:5,spheric:2,nvidia:[1,3,5],fluidflow:3,checkbox:5,rotat:[3,4,5],soon:1,through:[1,3,2,4,5],nobord:5,paramet:[3,2,4,5],geoscienc:0,segfault:5,jacobi:[2,5],"return":[3,5],food:4,complain:1,piotrowski:0,found:[1,3,2,4,5],rheologi:2,procedur:[1,0,2],energi:[4,5],todo:3,event:3,cubic:[2,4,5],loadcurv:5,molecular_dynam:[],print:[3,5],subsubsect:3,occurr:4,dvipng:1,focallength:3,reason:[2,5],base:[3,2,5],visco:[4,5],put:[2,5],maxpo:3,thread:3,launch:3,veloc:[2,4,5],aarhu:0,assign:5,dont:3,exchang:2,number:[1,3,2,5],randombondpair:5,done:[3,5],differ:[3,2,5],script:5,sheardisp:5,least:5,gpu:[1,3,2,5],molecular:4,idelsohn:2,store:[3,2,4,5],printnsarrai:3,option:[1,3,2,5],relationship:[3,2],part:[0,2],consult:3,std:3,scheme:4,contrari:4,ffmpeg:[1,5],fold:5,deviator:2,horizont:[2,5],reus:5,str:5,arrang:1,randomli:5,comput:[1,3,2,4,5],exert:5,p_mod_a:5,heaviest:5,beforehand:5,p_mod_f:5,deleteparticl:5,built:[1,5],voidratio:5,also:[3,4,5],build:[1,0],upper_cutoff:3,pipelin:5,ergun:2,distribut:[1,5],previou:[3,2],reach:[3,4],mixtur:2,most:[3,5],plan:1,rho:5,adjustupperwal:5,abnorm:5,reportvalu:3,session:5,find:[2,5],access:3,solut:[0,2,5],factor:5,writebin:[3,5],unus:3,programoutput:1,v_sphere:5,p_mod_phi:5,continuum:2,graphics_format:5,common:[1,3,2,4,5],origo:5,rotationalenergi:5,arr:3,set:[1,3,2,4,5],decompos:[2,4],see:[1,3,4,5],float4:3,close:[],analog:5,float3:3,someth:[],won:5,experi:[3,4,5],altern:[1,5],imagemagick:[1,5],numer:[1,0,2,4,3],induc:2,isol:2,matplotlib:1,solv:2,inertia:5,popul:5,both:[3,4,5],last:5,alon:[3,2],tempor:[3,0,4,5],inertiaparameterplanarshear:5,pdf:[1,5],load:5,point:[3,2,4,5],schedul:5,residu:[2,5],linux:1,cudamemset:3,becom:2,damp:[4,5],devic:[1,3,5],due:[1,2,4,5],empti:3,modern:[],imag:5,coordin:5,understand:[1,4],func:[],tangenti:[4,5],look:1,solid:[2,4,5],durat:4,"while":[1,3,2,5],abov:[1,2,4,5],error:[3,5],loos:5,loop:[3,5],pack:[],subsect:3,rightarrow:[],out_fold:5,belong:5,fixvel:5,shorter:5,latexpdf:1,higher:5,shearstrain:5,moment:5,temporari:5,user:1,typic:[1,5],recent:5,lower:[3,5],task:[],darcyflow:[],"87e":5,velarrowscal:5,propos:5,shape:2,contactmodel:5,langtangen:[2,5],"0e9":3,restructuredtext:1,theoret:[3,2],input:[1,3,5],subsequ:[1,5],triaxial:5,euler:[2,4],cuh:3,bin:[3,5],format:[1,3,5],big:5,delta_n:[],characterist:3,zslice:5,semi:2,resolv:[3,4],collect:1,popular:[],encount:3,neumann:[2,5],simplifi:2,spring:4,some:[1,4,5],back:5,emph:3,strongest:5,sampl:[1,0,5],scale:[2,5],per:[3,5],mathemat:4,larg:5,shearvel:5,run:[1,3,5],perpendicular:2,step:[3,2,4,5],ndem:5,idx:5,reappear:2,materi:[1,2,4,5],incompress:2,readsecond:5,gamma:5,cutoff:[3,5],file1:3,within:[2,5],diff_adv:5,ensur:3,dev_:3,span:5,errno:[],question:[],fast:[3,2],custom:2,adjac:5,includ:[1,3,2,4,5],contactsearch:3,bondpot:5,translat:5,newer:1,delta:3,line:1,sdk:3,info:[],zhu:2,consist:4,normalboundariesxi:5,assemblag:1,"0xffffffff":3,highlight:4,similar:1,curv:5,constant:[3,2,5],doesn:5,repres:2,"char":3,threedim:3,helper_math:1,cmake:1,gnuplot:5,draw:5,normal_stress:5,drag:2,amplitud:5,dram:3,setfluidbottomnoflow:5,algorithm:[3,5],depth:5,epslatex:5,celciu:5,code:[1,3,2,5],partial:2,edg:5,scratch:5,radius_mean:5,plotfluidvelocitiesi:5,send:5,granular:[1,3,2,4],plotfluidvelocitiesz:5,aris:[],gravel:4,sent:5,datafil:3,thinsection_x1x3:5,wave:[3,5],volum:[2,5],relev:0,walltim:5,stiff:[3,5],button:5,montp2:[],smaller:5,natur:4,cfd:5,gamma_wt:5,gamma_wn:5,video:5,click:5,append:3,compat:3,index:[0,4,5],compar:5,resembl:4,cell:[3,2,5],experiment:2,len:2,bodi:[2,4],lower_limit:5,setfluidbottomfixedpressur:5,vertic:5,sinc:[3,2],convert:[3,5],larger:[2,5],converg:5,cbmax:5,chang:[1,3,2,5],apx:3,torquescript:5,outformat:5,appli:[3,2,5],approxim:[2,5],apt:1,api:[1,0,5,3],from:[1,3,2,4,5],commun:2,doubl:3,isotrop:2,implic:5,few:[],asteroid:4,usr:5,reynold:2,sort:[3,5],discrete_element_method:[],zhegal:2,use_workdir:5,annot:5,thin:5,control:[1,3,5],process:[1,0,5,3],sudo:1,high:[],slip:[2,5],writefluidvtk:5,generatebimodalradii:5,gcc:[1,3],palett:5,six:[2,5],subdirectori:1,instead:[1,3,5],sim:[3,5],frac:[],surfac:5,esysparticl:5,physic:[1,3,5],alloc:[3,5],essenti:1,bind:1,counter:3,correspond:[2,5],element:[1,0,4],issu:1,allow:[2,5],move:5,sourcecodevari:3,libav:1,r_larg:5,chosen:5,shearstrainr:5,restrain:5,therefor:4,greater:[1,2],python:[1,0,5,3],sid:5,yade:[],dat:[3,5],mention:[1,2],front:5,subsubsec:3,spheredir:5,edit:5,kpa:5,mode:[3,5],tracer:[1,5],chorin:[2,5],"static":[4,5],subsec:3,fluctuat:5,variabl:[1,3],matrix:5,hideinputfil:5,texliv:1,suitabl:5,rel:[3,2,4,5],inaccess:3,ref:3,red:5,forcechainsros:5,simulation_id:3,christensen:1,thrust:3,afterward:5,dirichlet:[2,5],midi:5,could:2,timer:3,david:0,length:[3,4,5],enforc:2,navier:[0,2],geometri:[],retain:1,softwar:[1,0,3],qualiti:5,scene:1,mai:5,transfertoconstantmemori:3,"1e4":5,stencil:2,strict:1,unknown:2,licens:1,system:[1,3,2,5],messag:[3,5],initrandomgridpo:5,termin:3,"final":5,defineworldboundari:5,shell:[1,3,5],methodolog:2,exactli:[],bitrat:5,bed:1,charact:5,writeppm:3,kepler:1,have:[1,3,4,5],cohes:5,need:[2,5],diverg:2,discret:[1,0,2,4],which:[1,3,2,5],graviti:[],singl:[3,5],radius_vari:5,unless:3,"class":[3,5],homogen:4,placement:3,strack:4,dens:3,face:[2,5],determin:[2,4,5],constrain:[2,5],email_alert:5,mainloop:3,verbos:[3,5],xyzsum:5,empir:2,desc:3,trivial:2,locat:[1,3],launchpad:[],should:[1,3,5],jan:0,smallest:[3,5],local:1,meant:1,obj3:5,obj2:5,contribut:[3,2,5],pull:1,writevtk:5,autom:[1,3],increas:5,enabl:[1,5],denmark:0,inputbin:3,file_dt:5,grai:5,integr:[3,0,2,4],contain:[2,5],currentnormalstress:5,sediment:5,view:5,legaci:5,frame:5,elast:[3,4,5],powder:4,sphinxcontrib:1,particl:[0,1,2,3,4,5],statu:[3,5],casagrand:5,correctli:1,boundari:[0,2,5],state:4,progress:[0,5],email:5,verifi:1,kei:3,job:5,entir:[4,5],addit:[1,2],doxygen:1,largestmass:5,valgrind:5,etc:[1,3],equat:[3,0,2,4,5],wall:[3,5],walk:1,ipython:1,es_dot:5,respect:1,mailto:0,quit:3,cauchi:2,compon:[1,3,2,4,5],treat:[],r_small:5,bulk:[2,5],present:2,totalrotationalenergi:5,align:[],defin:[3,2,4,5],limach:2,file:[1,3,5],texttt:3,archiv:1,setfluidbottomnoflownoslip:5,welcom:0,parti:0,handl:[1,3],largest:5,inc:1,phi:5,workdir:5,http:[3,0],again:1,expans:[3,5],periodicboundariesxi:5,eulerian:2,expand:[3,2],smallestmass:5,off:3,center:[2,5],well:[1,2,5],exampl:[1,3,5],command:1,choos:5,usual:[],plotfluidpressuresi:5,distanc:[2,5],wall_mass_factor:5,less:2,marginpar:3,obtain:[1,0,2,5],plotfluidpressuresz:5,simultan:[],makefil:[1,3],wen:2,add:[1,5],adc:[0,5],densiti:[2,5],press:5,name:5,insert:3,resid:3,like:5,lost:[4,5],poros:[3,0,2,5],necessari:3,porou:2,output0:3,soft:1,page:[3,0,5],integratewal:3,liggght:[],interact:[0,1,2,3,4,5],self:5,smoothli:5,home:5,librari:5,glyph:5,nvcc:[1,3],summat:3,leak:5,avoid:[4,5],overlap:[4,5],estim:[0,2,5],leav:2,esi:[],usag:[3,0,5],host:[3,5],file_io:3,about:[1,3,5],actual:5,freedom:3,ander:[1,0],devc_:3,discard:3,disabl:5,own:[],automat:3,shear_strain_r:5,laplacian:2,forcechain:[3,5],val:3,transfer:3,"function":[1,3,2,5],histogram:5,suppli:3,wise:5,displac:[4,5],smooth:5,displai:[4,5],troubl:1,below:[3,5],limit:[2,4,5],otherwis:[4,5],problem:3,evalu:2,"int":[3,5],dure:[2,5],implement:[0,2,4],pip:1,inf:5,probabl:5,detail:[3,4],other:[1,2,4,5],bool:5,futur:2,repeat:2,prealloc:5,zhou:2,gpumain:3,debian:1,stai:5,ghost:2,sphinx:1,scientif:[]},objtypes:{"0":"py:module","1":"py:function","2":"py:method","3":"py:class"},titles:["The sphere documentation","Introduction","Fluid simulation and particle-fluid interaction","sphere internals","Discrete element method","Python API"],objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","method","Python method"],"3":["py","class","Python class"]},filenames:["index","introduction","cfd","sphere_internals","dem","python_api"]})
       -\ No newline at end of file
       +Search.setIndex({envversion:49,filenames:["cfd","dem","index","introduction","python_api","sphere_internals"],objects:{"":{DEM:[5,0,1,"_CPPv23DEM"],sphere:[4,1,0,"-"]},"sphere.sim":{ReynoldsNumber:[4,4,1,""],acceleration:[4,4,1,""],adaptiveGrid:[4,4,1,""],addParticle:[4,4,1,""],adjustUpperWall:[4,4,1,""],adjustWall:[4,4,1,""],bond:[4,4,1,""],bondsRose:[4,4,1,""],bulkPorosity:[4,4,1,""],cellSize:[4,4,1,""],checkerboardColors:[4,4,1,""],cleanup:[4,4,1,""],consolidate:[4,4,1,""],contactModel:[4,4,1,""],contactParticleArea:[4,4,1,""],contactSurfaceArea:[4,4,1,""],convergence:[4,4,1,""],createBondPair:[4,4,1,""],currentNormalStress:[4,4,1,""],currentTime:[4,4,1,""],defaultParams:[4,4,1,""],defineWorldBoundaries:[4,4,1,""],deleteAllParticles:[4,4,1,""],deleteParticle:[4,4,1,""],disableFluidPressureModulation:[4,4,1,""],disableTopWallNormalStressModulation:[4,4,1,""],dry:[4,4,1,""],energy:[4,4,1,""],findAllAverageParticlePairAreas:[4,4,1,""],findAllContactSurfaceAreas:[4,4,1,""],findContactStresses:[4,4,1,""],findCoordinationNumber:[4,4,1,""],findHydraulicConductivities:[4,4,1,""],findLoadedContacts:[4,4,1,""],findMeanCoordinationNumber:[4,4,1,""],findNormalForces:[4,4,1,""],findOverlaps:[4,4,1,""],findPermeabilities:[4,4,1,""],forcechains:[4,4,1,""],forcechainsRose:[4,4,1,""],frictionalEnergy:[4,4,1,""],generateBimodalRadii:[4,4,1,""],generateRadii:[4,4,1,""],hydraulicConductivity:[4,4,1,""],hydraulicDiffusivity:[4,4,1,""],hydraulicPermeability:[4,4,1,""],id:[4,4,1,""],idAppend:[4,4,1,""],inertiaParameterPlanarShear:[4,4,1,""],initFluid:[4,4,1,""],initGrid:[4,4,1,""],initGridAndWorldsize:[4,4,1,""],initGridPos:[4,4,1,""],initRandomGridPos:[4,4,1,""],initRandomPos:[4,4,1,""],initTemporal:[4,4,1,""],kineticEnergy:[4,4,1,""],largestFluidTimeStep:[4,4,1,""],largestMass:[4,4,1,""],mass:[4,4,1,""],momentOfInertia:[4,4,1,""],momentum:[4,4,1,""],normalBoundariesXY:[4,4,1,""],periodicBoundariesX:[4,4,1,""],periodicBoundariesXY:[4,4,1,""],plotContacts:[4,4,1,""],plotConvergence:[4,4,1,""],plotFluidDiffAdvPresZ:[4,4,1,""],plotFluidPressuresY:[4,4,1,""],plotFluidPressuresZ:[4,4,1,""],plotFluidVelocitiesY:[4,4,1,""],plotFluidVelocitiesZ:[4,4,1,""],plotLoadCurve:[4,4,1,""],plotPrescribedFluidPressures:[4,4,1,""],plotSinFunction:[4,4,1,""],porosities:[4,4,1,""],porosity:[4,4,1,""],randomBondPairs:[4,4,1,""],readTime:[4,4,1,""],readbin:[4,4,1,""],readfirst:[4,4,1,""],readlast:[4,4,1,""],readsecond:[4,4,1,""],readstep:[4,4,1,""],render:[4,4,1,""],rotationalEnergy:[4,4,1,""],run:[4,4,1,""],scaleSize:[4,4,1,""],setBeta:[4,4,1,""],setDEMstepsPerCFDstep:[4,4,1,""],setDampingNormal:[4,4,1,""],setDampingTangential:[4,4,1,""],setDynamicFriction:[4,4,1,""],setFluidBottomFixedFlux:[4,4,1,""],setFluidBottomFixedPressure:[4,4,1,""],setFluidBottomNoFlow:[4,4,1,""],setFluidBottomNoFlowNoSlip:[4,4,1,""],setFluidCompressibility:[4,4,1,""],setFluidDensity:[4,4,1,""],setFluidPressureModulation:[4,4,1,""],setFluidTopFixedFlux:[4,4,1,""],setFluidTopFixedPressure:[4,4,1,""],setFluidTopNoFlow:[4,4,1,""],setFluidTopNoFlowNoSlip:[4,4,1,""],setFluidViscosity:[4,4,1,""],setFluidXFixedPressure:[4,4,1,""],setFluidXNoFlow:[4,4,1,""],setFluidXPeriodic:[4,4,1,""],setFluidYFixedPressure:[4,4,1,""],setFluidYNoFlow:[4,4,1,""],setFluidYPeriodic:[4,4,1,""],setGamma:[4,4,1,""],setMaxIterations:[4,4,1,""],setPermeabilityGrainSize:[4,4,1,""],setPermeabilityPrefactor:[4,4,1,""],setStaticFriction:[4,4,1,""],setStiffnessNormal:[4,4,1,""],setStiffnessTangential:[4,4,1,""],setTheta:[4,4,1,""],setTolerance:[4,4,1,""],setTopWallNormalStressModulation:[4,4,1,""],setYoungsModulus:[4,4,1,""],shear:[4,4,1,""],shearDisplacement:[4,4,1,""],shearStrain:[4,4,1,""],shearStrainRate:[4,4,1,""],shearStress:[4,4,1,""],shearVel:[4,4,1,""],shearVelocity:[4,4,1,""],sheardisp:[4,4,1,""],show:[4,4,1,""],smallestMass:[4,4,1,""],staticGrid:[4,4,1,""],status:[4,4,1,""],surfaceArea:[4,4,1,""],thinsection_x1x3:[4,4,1,""],torqueScript:[4,4,1,""],torqueScriptPenguin:[4,4,1,""],totalFrictionalEnergy:[4,4,1,""],totalKineticEnergy:[4,4,1,""],totalMass:[4,4,1,""],totalMomentum:[4,4,1,""],totalRotationalEnergy:[4,4,1,""],totalViscousEnergy:[4,4,1,""],triaxial:[4,4,1,""],uniaxialStrainRate:[4,4,1,""],video:[4,4,1,""],viscousEnergy:[4,4,1,""],visualize:[4,4,1,""],voidRatio:[4,4,1,""],volume:[4,4,1,""],wall0iz:[4,4,1,""],wet:[4,4,1,""],writeFluidVTK:[4,4,1,""],writeVTK:[4,4,1,""],writeVTKall:[4,4,1,""],writeVTKforces:[4,4,1,""],writebin:[4,4,1,""],zeroKinematics:[4,4,1,""]},sphere:{V_sphere:[4,2,1,""],cleanup:[4,2,1,""],convert:[4,2,1,""],render:[4,2,1,""],run:[4,2,1,""],sim:[4,3,1,""],status:[4,2,1,""],thinsectionVideo:[4,2,1,""],torqueScriptParallel3:[4,2,1,""],video:[4,2,1,""]}},objnames:{"0":["cpp","class","C++ class"],"1":["py","module","Python module"],"2":["py","function","Python function"],"3":["py","class","Python class"],"4":["py","method","Python method"]},objtypes:{"0":"cpp:class","1":"py:module","2":"py:function","3":"py:class","4":"py:method"},terms:{"0xffffffff":5,"1e4":4,"440e":4,"70e9":4,"797e":4,"87e":4,"boolean":4,"case":[0,3,5],"class":[4,5],"default":[1,4,5],"export":3,"final":4,"float":[4,5],"function":[0,3,4,5],"import":[0,4,5],"int":4,"new":[0,1,4],"public":3,"return":[4,5],"static":[1,4],"true":4,"try":3,"void":4,"while":[0,3,4,5],___:3,aarhu:2,abil:0,abl:4,abnorm:4,about:[3,4,5],abov:[0,1,3,4],absolut:4,acceler:[0,1,4],accept:4,access:5,accord:4,across:[0,4],act:4,actual:4,adamsgaard:2,adaptivegrid:4,adc:[3,4],add:[3,4],addit:[0,3],addparticl:4,address:4,adiabat:4,adjac:4,adjust:[0,4],adjustupperwal:4,adjustwal:4,advect:[0,4],afmhot:4,after:[0,3,4,5],afterward:4,again:3,against:4,aim:[2,3],algorithm:4,alia:4,all:[0,1,2,3,4,5],alloc:[4,5],allocat:5,allow:[0,4],alon:[0,5],along:[1,4],alpha:4,alphabet:4,also:[1,4,5],altern:[3,4],alwai:5,amount:4,amplitud:4,analog:4,analysi:[3,4],analysis:4,analyz:4,ander:[2,3],angl:4,angpo:[4,5],angular:4,angvel:[4,5],ani:4,anim:4,annot:4,anoth:4,anticip:4,api:3,appear:4,append:[4,5],appendix:5,appli:[0,4,5],applic:[4,5],apply:4,approach:0,approxim:[0,4],apt:3,apx:5,architectur:[3,5],archiv:3,area:4,aren:0,argument:4,arrai:[4,5],arrang:3,arrow:4,arrowscal:4,assemblag:[3,4],assign:4,assum:[0,4],assumpt:0,asteroid:1,attain:0,attribut:0,author:2,autom:[3,5],automat:[4,5],avail:3,avconv:3,averag:[0,4],avoid:[1,4],axi:4,ayi:4,azi:4,back:4,background:[0,5],backward:0,bar:4,base:[0,4,5],basev:4,becom:0,bed:3,been:[1,4],befor:[4,5],beforehand:4,begin:[4,5],behavior:[1,3,4],belong:4,below:[4,5],berg:1,best:[3,4],beta:4,beta_f:4,between:[0,4,5],big:4,bin:[4,5],binari:[3,4,5],bind:3,bitrat:4,blank:4,block:5,blog:1,blue:4,bodi:[0,1],bold:1,bond:4,bondpot:4,bondsros:4,bool:4,boost:5,both:[1,4,5],bottom:0,bound:4,bowl:4,box:4,breath:3,browser:4,bugfix:3,build:[],built:[3,4],bulk:[0,4],bulkporos:4,button:4,calcparticlecellid:5,calcul:[0,1,4,5],call:[4,5],can:[0,1,3,4,5],cannot:[0,3,5],cap:4,capabl:3,capillari:4,capillarycohes:4,carman:4,carri:3,casagrand:4,cauchi:0,caus:4,cbmax:4,cdot:5,celciu:4,cell:[0,4,5],cell_cent:4,cellsiz:4,center:[0,4],central:0,cfd:4,cfd_solver:4,chain:4,chang:[0,3,4,5],charact:4,character:[0,1],characterist:5,check:[3,4,5],checkbox:4,checkerboard:4,checkerboardcolor:4,chip:5,choos:4,chorin:[0,4],chosen:4,circl:4,clang:3,cleanup:4,click:4,clone:3,close:4,closest:4,cluster:4,cmake:3,cmakelist:3,cmap:4,coalesc:5,coars:4,code:[0,3,4,5],coeffici:[0,1,4],cohes:4,collect:3,collid:4,collis:[4,5],color:[4,5],column:4,com:[3,4,5],combin:4,command:3,common:[0,1,3,4,5],commun:0,compar:4,compat:[3,5],compil:[3,5],complain:3,complet:4,compon:[0,1,3,4,5],compress:4,comput:[0,1,3,4,5],computation:1,concept:0,conduct:4,configur:[3,4,5],configuraion:5,conserv:[0,4],consid:[0,4],consist:1,consolid:4,constant:[0,4,5],constrain:[0,4],consult:5,contact:0,contactmodel:4,contactparticlearea:4,contactsearch:5,contactsurfacearea:4,contain:[0,4],continu:[0,5],continuum:0,contrari:1,contribut:[0,4,5],control:[3,4,5],conv:4,converg:4,convert:[4,5],coordin:4,coordinationnumb:4,copi:3,core:4,corner:4,correct:[0,1],correctli:3,correspond:[0,4],could:0,coulomb:1,count:4,counter:5,courant:4,cpp:5,cpu:[0,5],creat:[3,4],createbondpair:4,criteria:[0,4],criterion:1,critic:4,cube:4,cubic:[0,1,4],cuda:[0,3,4,5],cuda_sdk_root_dir:3,cudamemcheck:4,cudamemset:5,cudapath:4,cuh:[4,5],cundal:1,current:[0,4,5],currentnormalstress:4,currenttim:4,curv:4,custom:[0,4],cutoff:[4,5],cxx:3,cyclic:4,d_417:4,damp:[1,4],dampen:4,damsgaard:[1,2,3,4],darci:4,dat:[4,5],data:[3,4,5],datafil:5,datatyp:5,date:3,david:2,deal:0,debian:3,decompos:[0,1],decreas:4,defaultparam:4,defin:[0,1,4,5],defineworldboundari:4,definit:5,degre:[4,5],delet:4,deleteallparticl:4,deleteparticl:4,delta:5,dem:[1,3,4,5],denmark:2,denot:[0,1,4],dens:5,densiti:[0,4],depart:2,depend:[0,3,4,5],depth:4,describ:[0,1,4],descript:5,desir:[1,4],detail:[1,5],determin:[0,1,4],dev_:5,devc_:5,develop:[2,3],deviator:0,devic:[3,4,5],diagnost:4,diamet:[0,4],dictat:4,diff_adv:4,differ:[0,4,5],differenti:0,diffus:4,dimens:4,dimension:[0,1,3,5],dimensionless:0,direct:[1,4],directori:[3,4],dirichlet:[0,4],disabl:4,disablefluidpressuremodul:4,disabletopwallnormalstressmodul:4,discard:5,disclaim:3,discret:0,disk:4,disp:4,displac:[1,4],displai:[1,4],dissip:[1,4],distanc:[0,4],distinct:4,distribut:[3,4],diverg:0,divid:4,divis:1,doc:3,doe:3,doesn:4,domain:4,don:5,done:[4,5],dont:5,dot:[1,4],doubl:5,downward:4,doxygen:3,dphi:4,drag:0,dram:5,draw:4,driven:1,driver:3,dry:[4,5],dtype:4,due:[0,1,3,4],durat:1,dure:[0,4],dvipng:3,each:[0,1,4,5],edg:4,edge:4,edit:4,effect:4,effici:1,egholm:2,either:[0,1,4,5],elast:[1,4,5],elasto:4,email:4,email_alert:4,emph:5,empir:0,emploi:5,empti:5,enabl:[3,4],encount:[3,5],end:[0,4,5],energi:[1,4],enforc:0,engineeringtoolbox:4,ensur:[4,5],enter:0,entir:[1,4],entiti:1,env:4,environ:3,epsilon:4,epslatex:4,equal:[0,4,5],ergun:0,error:[4,5],es_dot:4,essenti:3,estimat:4,esysparticl:4,etc:[3,5],euler:[0,1],eulerian:0,ev_dot:4,evalu:0,even:[1,5],event:5,everi:0,evolut:[4,5],exampl:[3,4,5],exce:[0,4],excel:3,except:5,exchang:0,exclus:4,execut:[3,4,5],exert:4,exist:5,exit:[0,4,5],expand:[0,5],expans:[4,5],expect:4,experi:[1,4,5],experiment:0,explain:[2,5],explicit:0,explicitli:4,expos:3,extern:4,f_max:4,f_min:4,f_n_magn:4,face:[0,4],factor:4,fail:3,fals:4,fast:[0,5],faster:4,featur:1,fermi:3,ffmpeg:[3,4],field:4,fig:[4,5],figsiz:4,figur:[4,5],file1:5,file:[3,4,5],file_dt:4,file_io:5,filenam:4,filter:4,find:[0,4],findallaverageparticlepairarea:4,findallcontactsurfacearea:4,findcontactstress:4,findcoordinationnumb:4,findcuda:3,findhydraulicconduct:4,findloadedcontact:4,findmeancoordinationnumb:4,findnormalforc:4,findoverlap:4,findperm:4,finit:[0,4],first:[0,4],firststep:4,fit:4,fix:4,fixvel:4,flat:4,flexibl:[0,3],float3:5,float4:5,float64:4,flow:0,fluctuat:4,flux:4,foat:4,fold:4,folder:[3,4,5],follow:[0,1,3,4,5],food:1,forc:[0,1,4,5],forcechain:4,forcechainsros:4,form:[0,1,5],format:[3,4],former:[1,4],formul:[0,1],found:[0,1,3,4,5],fraction:[0,4],frame:4,free:[0,3,4],freedom:5,frequenc:4,fricion:4,friction:[1,4],frictionalenergi:4,friedrich:4,from:[0,1,3,4,5],front:4,fulfil:4,full:[3,4,5],fulli:0,fundament:1,futur:0,gamma:4,gamma_n:4,gamma_r:4,gamma_t:4,gamma_wn:4,gamma_wt:4,gase:1,gcc:[3,5],gdr:4,gener:[1,3,4],generatebimodalradii:4,generateradii:4,geo:[2,4],geometr:1,geoscienc:2,get:[3,4,5],get_cmap:4,ghost:0,gidaspow:0,git:3,github:3,give:5,given:[0,4],global:5,glyph:4,gnu:[3,5],gnuplot:4,googl:5,goren:4,gplv3:3,gpu:[0,3,4,5],gpu_generation:3,gpumain:5,gradient:[0,4],grai:4,grain:4,granular:[0,1,3,4,5],graph:5,graphic:3,graphics_fold:4,graphics_format:4,gravel:1,gravit:[0,4],greater:[0,3,4],greatli:5,grid:[0,1,4,5],gridnum:4,guid:[2,5],h30g:4,half:0,hand:[0,1,5],handl:[3,5],hang:4,happen:4,happenind:4,hash:5,hasn:1,have:[1,3,4,5],heaviest:4,height:4,help:[3,5],helper_math:3,here:0,hide:4,hideinputfil:4,higher:4,highlight:1,histogram:4,histori:5,home:4,homogen:1,hookean:1,horizont:[0,4],host:[4,5],how:[4,5],howev:[1,5],html:[3,4],http:[2,3,4,5],hydraul:4,hydraulicconduct:4,hydraulicdiffus:4,hydraulicperm:4,hydrolog:4,hydrostat:4,idappend:4,ideal:4,idelsohn:0,ident:[0,4],identifi:[1,4,5],idx:4,imag:[4,5],imagemagick:[3,4],img_out:4,implic:4,important:4,improv:5,inaccess:5,inaccur:1,inc:3,inch:4,includ:[0,1,3,4,5],include:4,incompress:0,incorpor:0,increas:4,increment:1,index:[1,2,4],indic:4,individu:[0,5],induc:0,industri:1,inertia:4,inertiaparameterplanarshear:4,inf:4,infinit:4,inform:[3,4,5],initfluid:4,initgrid:4,initgridandworlds:4,initgridpo:4,initi:[3,4],initial:[4,5],initrandomgridpo:4,initrandompo:4,inittempor:[4,5],input:[3,4,5],insert:5,inspection:3,instabl:4,instal:[2,3],installat:[],instead:[3,4,5],integr:0,integratewal:5,intend:4,intent:5,inter:[1,4],interest:[2,4],interfac:[1,4],intern:3,interpol:4,interpret:3,intersect:[0,4],interv:[4,5],introduc:[0,4],introduct:1,invari:4,invok:[4,5],involv:5,ipython:3,isn:[0,4],isol:0,isotrop:0,issue:3,item:5,iter:[0,4],itself:4,jacobi:[0,4],jan:2,job:4,k_c:4,k_n:4,k_r:4,k_t:4,keep:[0,3],kei:5,kelvin:1,kepler:3,kernel:5,kin:4,kinemat:4,kinet:[1,4],kineticenergi:4,kozeni:4,kpa:4,label:[4,5],lagrangian:0,langtangen:[0,4],laplac:0,laplacian:0,larg:4,larger:[0,4],largest:4,largestfluidtimestep:4,largestmass:4,last:4,later:[0,4],latexpdf:3,latter:1,launch:5,law:[0,1,5],layout:5,ldot:5,leak:4,least:4,leav:0,left:4,legaci:4,leightest:4,len:0,length:[1,4,5],less:0,lewi:4,libav:3,liber:5,librari:4,licens:3,like:4,limach:0,limit:[0,1,4],linear:[0,1,4],linearli:[0,4],linearsegmentedcolormap:4,linux:3,liquid:1,list:[3,4,5],live:3,load:4,loadcurv:4,local:3,locat:[3,5],log:4,logn:4,longer:1,look:3,loop:[4,5],loopend:5,loopstart:5,loos:4,loss:[1,4],lost:[1,4],low:4,lower:[4,5],lower_cutoff:4,lower_limit:4,lundbek:2,mac:3,magnitud:[0,4],mai:4,mail:4,mailto:2,main:[3,4,5],mainloop:5,maintain:3,make:[3,4,5],makefil:[3,5],manag:4,map:4,margin:4,marginpar:5,mass:[0,1,4,5],materi:[0,1,3,4],mathemat:1,mathrm:5,matplotlib:[3,4],matrix:4,matter:1,max:4,max_val:4,maxim:[0,4],maximum:4,maxit:4,maxval:5,mean:[0,3,4],meant:3,measur:4,mechan:1,medium:0,member:4,memori:[4,5],memorytyp:5,mennu:4,mention:[0,3],menu:4,mesh:4,messag:[4,5],method:0,methodolog:0,midi:4,mixtur:0,mobil:4,mode:[4,5],model:[0,1,2,4,5],modifi:[0,3],modul:3,modulu:4,molecular:1,moment:4,momentofinertia:4,momentum:[0,4],more:[1,3,4,5],most:[4,5],motion:[1,4,5],move:4,movement:[4,5],mp4:4,mu_:4,mu_d:4,mu_r:4,mu_w:4,mu_wn:4,multipli:4,must:4,name:4,natur:1,ndem:4,nearbi:0,necessari:5,need:[0,4],neg:[0,1,4],neglect:0,neighbor:[0,4,5],net:5,network:[1,4],neumann:[0,4],newer:3,newton:[0,1,5],newtonian:0,nobord:4,node:[0,4],non:[1,3,4,5],none:4,normal:[0,1,4,5],normal_stress:4,normalboundariesxy:4,notat:1,note:[0,1,3,4,5],now:[1,5],num:4,number:[0,3,4,5],numpi:[3,4],nvcc:[3,5],nvidia:[3,4,5],obj1:4,obj2:4,obj3:4,object:[3,4],obtain:0,occurr:1,off:5,offici:2,often:5,old:[0,4],one:4,onli:[0,1,4],open:[4,5],opposit:0,option:[3,4,5],optional:[0,3,5],order:[0,1,3,4,5],orient:[1,4],origin:[0,1,4],origo:4,orthogon:4,other:[0,1,3,4],otherwis:[1,4],out_fold:4,outfold:4,outformat:4,outlin:0,output0:5,output:[3,4,5],over:[1,4],over_damp:4,overdampen:4,overlap:[1,4],p_f:4,p_mod_a:4,p_mod_f:4,p_mod_phi:4,pack:4,pad:4,page:[2,4,5],pageref:5,pair:[0,1,4],palett:4,paragraph:5,parallel:[0,3,4],param:4,paramet:[0,1,4,5],paraview:4,part:[0,2,4],parti:2,partial:0,pascal:4,pass:[1,4,5],path:[3,4],pdf:[3,4],pdflatex:3,per:[4,5],perform:[3,4,5],period:[0,4],periodicboundariesx:4,periodicboundariesxy:4,permeabl:4,perpendicular:0,phase:[0,4],phi:4,phi_max:4,phi_min:4,physic:[3,4,5],pickl:4,piotrowski:2,pip:3,pipelin:4,pkg:3,place:[3,4,5],placement:5,plan:3,planar:4,plane:[1,4],platform:3,plot:4,plotcontact:4,plotconverg:4,plotfluiddiffadvpresz:4,plotfluidpressuresy:4,plotfluidpressuresz:4,plotfluidvelocitiesy:4,plotfluidvelocitiesz:4,plotloadcurv:4,plotprescribedfluidpressur:4,plotsinfunct:4,plotstyl:4,plung:4,png:4,point:[0,1,4,5],poisson:[0,4],polar:4,popul:4,porou:0,posit:[0,1,4],possibl:[4,5],post:[1,4],pot:4,potenti:4,powder:1,ppm:4,pre:[4,5],prealloc:4,precis:[4,5],predict:[0,4],prefactor:4,prefix:5,prematur:4,prescrib:[0,4],present:0,press:4,pressur:[0,4],previou:[0,4,5],previous:[0,4],print:[4,5],prior:4,probabl:4,problem:[3,5],process:[2,3,4,5],produc:4,profil:5,program:[4,5],programoutput:3,progress:[2,4],project:[0,2,4],properti:[0,3,4],propos:4,provid:3,psd:4,pull:3,purpos:[3,4],put:[0,4],python:3,qfermi:4,qscale:4,qualiti:4,quartz:4,queue:4,quiet:5,quit:5,r_larg:4,r_small:4,rad:4,radii:4,radiu:[0,1,4],radix:5,rai:[3,4],ram:5,random:[4,5],randombondpair:4,randomli:4,rang:[0,4],rate:[0,4],rather:5,ratio:[0,4],raw:1,raytrac:[4,5],reach:[1,5],read:[3,4,5],readbin:4,readfirst:4,readjust:4,readlast:4,readsecond:4,readstep:4,readtim:4,real:1,realist:[1,4],reappear:0,rearrang:1,reason:[0,4],recent:4,recommend:4,red:4,ref:5,regard:1,regener:4,regular:4,rel:[0,1,4,5],relat:[3,5],relationship:[0,4,5],relax:4,releas:3,relev:[2,4],remain:0,remov:4,render:[3,4,5],reorder:5,reorderarrai:5,repeat:0,replac:3,repres:0,represent:4,requir:[],rescal:4,resembl:1,resid:5,residu:[0,4],resist:4,resolut:4,resolv:[1,5],respect:3,restrain:4,restrict:3,restructuredtext:3,result:[0,1,3,4,5],results:4,retain:3,return_data:4,reus:4,rewrit:0,reynold:[0,4],reynoldsnumb:4,rheologi:0,rho:4,rho_f:4,right:[0,4],roll:4,root:[3,4,5],rose:4,rot:4,rotat:[1,4,5],rotationalenergi:4,routin:3,run:[3,4,5],running:4,runtim:3,safeti:4,same:4,sampl:3,sand:1,satur:[0,4],save:4,savefig:4,scalar:[0,4,5],scale:[0,4],scales:4,scene:3,schedul:4,scheme:1,scope:5,scratch:4,screen:4,script:4,sdk:5,second:[0,1,4,5],section:[0,1,4,5],sediment:4,see:[1,3,4,5],seed:1,segfault:4,select:4,self:4,semi:0,send:4,sent:4,separ:1,seper:5,sequenc:5,seri:5,session:4,set:[0,1,3,4,5],setbeta:4,setdampingnorm:4,setdampingtangenti:4,setdemstepspercfdstep:4,setdynamicfrict:4,setfluidbottomfixedflux:4,setfluidbottomfixedpressur:4,setfluidbottomnoflow:4,setfluidbottomnoflownoslip:4,setfluidcompress:4,setfluiddens:4,setfluidpressuremodul:4,setfluidtopfixedflux:4,setfluidtopfixedpressur:4,setfluidtopnoflow:4,setfluidtopnoflownoslip:4,setfluidviscos:4,setfluidxfixedpressur:4,setfluidxnoflow:4,setfluidxperiod:4,setfluidyfixedpressur:4,setfluidynoflow:4,setfluidyperiod:4,setgamma:4,setmaxiter:4,setpermeabilitygrains:4,setpermeabilityprefactor:4,setstaticfrict:4,setstiffnessnorm:4,setstiffnesstangenti:4,settheta:4,settoler:4,settopwallnormalstressmodul:4,setup:[3,4],setyoungsmodulu:4,seven:0,sever:[4,5],shami:0,shape:0,shear:[0,4],shear_strain_r:4,shear_stress:4,sheardisp:4,sheardisplac:4,shearrat:4,shearstrain:4,shearstrainr:4,shearstress:4,shearvel:4,shearveloc:4,shell:[3,4,5],shift:4,ship:3,shorter:4,should:[3,4,5],show:[4,5],shown:4,sid:4,side:[0,4],sigma0mod:4,sigma_contact:4,sign:0,signific:4,significantli:4,sim:[4,5],similar:3,simpl:4,simplest:1,simplifi:0,simulation:4,simulation_id:5,sinc:[0,5],sine:4,singl:[4,5],sinusoid:4,situat:0,six:[0,4],size:4,slab:4,slam:4,slice:4,slip:[0,4],slipscal:4,slow:[4,5],slower:4,small:[1,4,5],smaller:4,smallest:[4,5],smallestmass:4,smi:4,smooth:4,smoothli:4,soft:3,soften:4,softwar:[2,3,5],soil:1,solid:[0,1,4],solv:0,solver:[0,3,4],some:[1,3,4],somewhat:[1,4],soon:3,sort:[4,5],sort_by_kei:5,sound:5,sourc:[3,5],sourcecodevari:5,space:[0,4],span:4,spatial:[0,4,5],specif:[3,4,5],specifi:[3,4,5],specific_flux:4,speed:5,sphere:[0,1],sphere_:5,spherealgo:5,spherebin:4,spheredir:4,spheric:0,sphinx:3,sphinxcontrib:3,spring:1,src:[3,4,5],stabil:[4,5],stabl:4,stai:4,standard:4,start:[3,4,5],state:[1,4],staticgrid:4,statu:[4,5],stdout:5,stencil:0,step:[0,1,4,5],step_count:4,stiff:[4,5],stop:4,store:[0,1,4,5],str:4,strack:1,strain:[0,4],stress:[0,4],strict:3,string:4,strongest:4,style:4,subdirectori:3,subfold:5,subglaci:3,subsec:5,subsect:5,subsequ:[3,4],subsubsec:5,subsubsect:5,success:3,successful:3,sudo:3,suitabl:4,sum:[0,1,4],summat:5,supervis:2,suppli:5,support:3,suppress:5,sure:[3,4],surfac:4,surfacearea:4,symbol:[1,3],symmetr:0,synchron:5,system:[0,3,4,5],take:[0,3],tangenti:[1,4],target:4,targetbin:4,taylor:5,temporari:4,tensor:0,term:0,termin:5,test:3,tex:3,texliv:3,text:4,texttt:5,than:[0,4],thei:[0,5],them:4,theoret:[0,5],theori:2,therefor:1,theta:4,thi:[0,1,2,3,4,5],thick:4,thin:4,thinsection_x1x3:4,thinsectionvideo:4,third:[0,2,4],though:[1,5],thread:5,three:[0,1,3,4,5],threshold:4,through:[0,1,3,4,5],thrust:5,thrustfootnot:5,thu:5,time:[0,1,3,4,5],time_curr:4,time_tot:4,timer:5,timestep:4,titl:4,todo:5,toler:[0,4],tool:3,toolbar:4,toolkit:3,top:[0,4],topolog:5,torqu:[1,4,5],torquescript:4,torquescriptparallel3:4,torquescriptpenguin:4,total:[0,1,4,5],totalfrictionalenergi:4,totalkineticenergi:4,totalmass:4,totalmomentum:4,totalrotationalenergi:4,totalviscousenergi:4,trace:4,tracer:[3,4],transfer:5,transfertoconstantmemori:5,translat:4,transpar:4,travel:5,trend:4,triaxial:4,trim:4,trivial:0,troubl:3,tube:4,two:[0,1,4],txt:[3,4],type:[1,3,4,5],typeset:3,typic:[3,4],ultim:3,under:[2,3,4],understand:[1,3],unfortun:3,uni:4,uniaxi:4,uniaxialstrainr:4,uniform:4,unit:3,univers:2,unknown:0,unless:5,unnam:4,unus:5,updat:[0,3,5],update:[],upper:4,upper_limit:4,upward:4,url:5,usag:[],usage:5,use:4,use_workdir:4,user:3,using:[0,4],usr:4,usualli:4,v_f:4,v_max:4,v_sphere:4,val:5,valgrind:4,valid:4,valu:[0,1,3,4,5],variabl:[3,5],varianc:4,variat:0,vector:[0,1,4,5],vel:[4,5],velarrowscal:4,veloc:[0,1,4],verb:5,verbos:4,veri:1,verifi:3,version:[0,3,4,5],vertic:4,via:5,video:4,video_format:4,view:4,visc_n:4,visc_n_rat:4,visco:[1,4],viscos:[0,1,4],viscou:[0,1,4],viscousenergi:4,visual:[3,4,5],voidratio:4,voigt:1,volum:[0,4],volumetr:[0,4],von:4,vti:4,vtk:[3,4],vtp:4,vtu:4,w_x:4,wai:[3,4,5],walk:3,wall0iz:4,wall:[4,5],wall_mass_factor:4,walltim:4,want:0,warn:4,water:4,wave:[4,5],welcom:2,well:[0,3,4],wen:0,wet:4,when:[1,4],where:[0,1,3,4,5],which:[0,3,4,5],white:4,wide:1,width:[0,4],wikipedia:4,window:4,wise:4,within:[0,4],without:4,won:4,work:[],workdir:4,workload:5,world:4,wrap:5,write:[4,5],writebin:4,writefluidvtk:4,writevtk:4,writevtkal:4,writevtkforc:4,written:[3,4,5],wvel:4,www:4,x1x3:4,xdisp:[4,5],xlabel:4,xlim:4,xyzsum:4,yet:1,yield:5,ylabel:4,you:3,young:4,your:3,z_adjust:4,zero:[0,1,4,5],zerokinemat:4,zhegal:0,zhou:0,zhu:0,zslice:4},titles:["Fluid simulation and particle-fluid interaction","Discrete element method","The sphere documentation","Introduction and Installation","Python API","sphere internals"],titleterms:{algorithm:5,api:4,boundari:0,build:3,condit:0,contact:1,content:2,deriv:0,discret:1,document:2,dynam:0,element:1,equat:0,estim:0,flow:3,fluid:0,implement:0,indice:2,installat:3,integr:1,interact:[0,1],intern:5,introduct:3,method:1,modul:4,navier:0,numer:[0,5],obtain:3,oper:0,particl:0,poros:0,procedur:0,python:4,refer:5,requir:3,sampl:4,search:1,simul:0,solut:0,sphere:[2,3,4,5],split:0,stoke:0,tabl:2,tempor:1,update:3,usag:4,work:3}})
       +\ No newline at end of file
 (DIR) diff --git a/doc/html/sphere_internals.html b/doc/html/sphere_internals.html
       t@@ -1,5 +1,3 @@
       -
       -
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
       t@@ -8,15 +6,14 @@
          <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            
       -    <title>sphere internals &mdash; sphere 1.00-alpha documentation</title>
       +    <title>sphere internals &#8212; sphere 1.00-alpha documentation</title>
            
       -    <link rel="stylesheet" href="_static/default.css" type="text/css" />
       +    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
            <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       -    <link rel="stylesheet" href="_static/breathe.css" type="text/css" />
            
            <script type="text/javascript">
              var DOCUMENTATION_OPTIONS = {
       -        URL_ROOT:    '',
       +        URL_ROOT:    './',
                VERSION:     '1.00-alpha',
                COLLAPSE_INDEX: false,
                FILE_SUFFIX: '.html',
       t@@ -26,10 +23,13 @@
            <script type="text/javascript" src="_static/jquery.js"></script>
            <script type="text/javascript" src="_static/underscore.js"></script>
            <script type="text/javascript" src="_static/doctools.js"></script>
       -    <link rel="top" title="sphere 1.00-alpha documentation" href="index.html" /> 
       +    <link rel="index" title="Index" href="genindex.html" />
       +    <link rel="search" title="Search" href="search.html" />
       +    <link rel="top" title="sphere 1.00-alpha documentation" href="index.html" />
       +    <link rel="prev" title="Python API" href="python_api.html" /> 
          </head>
       -  <body>
       -    <div class="related">
       +  <body role="document">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -38,27 +38,33 @@
                <li class="right" >
                  <a href="py-modindex.html" title="Python Module Index"
                     >modules</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="right" >
       +          <a href="python_api.html" title="Python API"
       +             accesskey="P">previous</a> |</li>
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>  
        
            <div class="document">
              <div class="documentwrapper">
                <div class="bodywrapper">
       -          <div class="body">
       +          <div class="body" role="main">
                    
          <div class="section" id="sphere-internals">
        <h1>sphere internals<a class="headerlink" href="#sphere-internals" title="Permalink to this headline">¶</a></h1>
        <p>The <em>sphere</em> executable has the following options:</p>
       -<div class="highlight-text"><div class="highlight"><pre>$ ../../sphere --help
       +<div class="highlight-text"><div class="highlight"><pre><span></span>$ ../../sphere --help
        ../../sphere: particle dynamics simulator
        Usage: ../../sphere [OPTION[S]]... [FILE1 ...]
        Options:
        -h, --help                print help
        -V, --version                print version information and exit
        -q, --quiet                suppress status messages to stdout
       +-d &lt;device&gt;                execute on device with specified id
        -n, --dry                show key experiment parameters and quit
       --r, --render                render input files instead of simulating temporal evolution
       +-f, --fluid                simulate fluid between particles
       +-r, --render                render input files to images instead of
       +                            simulating the temporal evolution
        -dc, --dont-check        don&#39;t check values before running
        
        Raytracer (-r) specific options:
       t@@ -68,9 +74,10 @@ Raytracer (-r) specific options:
                normal, pres, vel, angvel, xdisp, angpos
                &#39;normal&#39; is the default mode
                if -l is appended, don&#39;t render particles with value below
       +-c, --contacts                Print a list of particle-particle contacts
        </pre></div>
        </div>
       -<p>The most common way to invoke <em>sphere</em> is however via the Python API (e.g. <a class="reference internal" href="python_api.html#sphere.run" title="sphere.run"><tt class="xref py py-func docutils literal"><span class="pre">sphere.run()</span></tt></a>, <a class="reference internal" href="python_api.html#sphere.render" title="sphere.render"><tt class="xref py py-func docutils literal"><span class="pre">sphere.render()</span></tt></a>, etc.).</p>
       +<p>The most common way to invoke <em>sphere</em> is however via the Python API (e.g. <a class="reference internal" href="python_api.html#sphere.run" title="sphere.run"><code class="xref py py-func docutils literal"><span class="pre">sphere.run()</span></code></a>, <a class="reference internal" href="python_api.html#sphere.render" title="sphere.render"><code class="xref py py-func docutils literal"><span class="pre">sphere.render()</span></code></a>, etc.).</p>
        <p>subsection{The <em>sphere</em> algorithm}
        label{subsec:spherealgo}
        The <em>sphere</em>-binary is launched from the system terminal by passing the simulation ID as an input parameter; texttt{./sphere_&lt;architecture&gt; &lt;simulation_ID&gt;}. The sequence of events in the program is the following:
       t@@ -210,9 +217,9 @@ item Update of verb&#8221;&lt;simulation_ID&gt;.status#..bin&#8221; (texttt{devi
        </ol>
        <p>The length of the computational time steps (texttt{time.dt}) is calculated via equation ref{eq:dt}, where length of the time intervals is defined by:</p>
        <div class="math">
       -<p><img src="_images/math/a32f407296c4d7fd42fe568d2ad7e8fa81f2df27.png" alt="\Delta t = 0.075 \min \left( m/\max(k_n,k_t) \right)"/></p>
       -</div><p>where <img class="math" src="_images/math/f5047d1e0cbb50ec208923a22cd517c55100fa7b.png" alt="m"/> is the particle mass, and <img class="math" src="_images/math/8c325612684d41304b9751c175df7bcc0f61f64f.png" alt="k"/> are the elastic stiffnesses.
       -The time step is set by this relationship in <tt class="xref py py-func docutils literal"><span class="pre">initTemporal()</span></tt>.
       +<p><img src="_images/math/6af8f3510a4e3f1aea74c1b180c9d93ef248128c.png" alt="\Delta t = 0.075 \min \left( m/\max(k_n,k_t) \right)"/></p>
       +</div><p>where <img class="math" src="_images/math/c4bb40dd65eae6c11b325989b14e0b8d35e4e3ef.png" alt="m"/> is the particle mass, and <img class="math" src="_images/math/e9203da50e1059455123460d4e716c9c7f440cc3.png" alt="k"/> are the elastic stiffnesses.
       +The time step is set by this relationship in <code class="xref py py-func docutils literal"><span class="pre">initTemporal()</span></code>.
        This equation ensures that the elastic wave (traveling at the speed of sound) is resolved a number of times while traveling through the smallest particle.</p>
        <p>subsubsection{Host and device memory types}
        label{subsubsec:memorytypes}
       t@@ -220,9 +227,9 @@ A full, listed description of the <em>sphere</em> source code variables can be f
        <p>The floating point precision operating internally in <em>sphere</em> is defined in texttt{datatypes.h}, and can be either single (texttt{float}), or double (texttt{double}). Depending on the GPU, the calculations are performed about double as fast in single precision, in relation to double precision. In dense granular configuraions, the double precision however results in greatly improved numerical stability, and is thus set as the default floating point precision. The floating point precision is stored as the type definitions texttt{Float}, texttt{Float3} and texttt{Float4}. The floating point values in the in- and output datafiles are emph{always} written in double precision, and, if necessary, automatically converted by <em>sphere</em>.</p>
        <p>Three-dimensional variables (e.g. spatial vectors in <cite>E^3</cite>) are in global memory stored as texttt{Float4} arrays, since these read and writes can be coalesced, while e.g. texttt{float3}&#8217;s cannot. This alone yields a <cite>sim`20</cite>times` performance boost, even though it involves 25% more (unused) data.</p>
        <p>paragraph{Host memory} is the main random-access computer memory (RAM), i.e. read and write memory accessible by CPU processes, but inaccessible by CUDA kernels executed on the device.</p>
       -<p>paragraph{Device memory} is the main, global device memory. It resides off-chip on the GPU, often in the form of 1&#8211;6 GB DRAM. The read/write access from the CUDA kernels is relatively slow. The arrays residing in (global) device memory are prefixed by <tt class="docutils literal"><span class="pre">dev_</span></tt> in the source code.</p>
       +<p>paragraph{Device memory} is the main, global device memory. It resides off-chip on the GPU, often in the form of 1&#8211;6 GB DRAM. The read/write access from the CUDA kernels is relatively slow. The arrays residing in (global) device memory are prefixed by <code class="docutils literal"><span class="pre">dev_</span></code> in the source code.</p>
        <p>marginpar{Todo: Expand section on device memory types}</p>
       -<p>paragraph{Constant memory} values cannot be changed after they are set, and are used for scalars or small vectors. Values are set in the <tt class="docutils literal"><span class="pre">transferToConstantMemory(...)}</span></tt> function, called in the beginning of texttt{gpuMain(ldots)} in texttt{device.cu}. Constant memory variables have a global scope, and are prefixed by <tt class="docutils literal"><span class="pre">devC_</span></tt> in the source code.</p>
       +<p>paragraph{Constant memory} values cannot be changed after they are set, and are used for scalars or small vectors. Values are set in the <code class="docutils literal"><span class="pre">transferToConstantMemory(...)}</span></code> function, called in the beginning of texttt{gpuMain(ldots)} in texttt{device.cu}. Constant memory variables have a global scope, and are prefixed by <code class="docutils literal"><span class="pre">devC_</span></code> in the source code.</p>
        <p>%subsection{The main loop}
        %label{subsec:mainloop}
        %The <em>sphere</em> software calculates particle movement and rotation based on the forces applied to it, by application of Newton&#8217;s law of motion (Newton&#8217;s second law with constant particle mass: <cite>F_{mathrm{net}} = m&nbsp;cdot a_{mathrm{cm}}</cite>). This is done in a series of algorithmic steps, see list on page pageref{loopstart}. The steps are explained in the following sections with reference to the <em>sphere</em>-source file; texttt{sphere.cu}. The intent with this document is emph{not} to give a full theoretical background of the methods, but rather how the software performs the calculations.</p>
       t@@ -232,187 +239,15 @@ subsubsection{Particles and computational time}</p>
        <p>subsection{Compilation}
        label{subsec:compilation}
        An important note is that the texttt{C} examples of the NVIDIA CUDA SDK should be compiled before <em>sphere</em>. Consult the <cite>Getting started guide</cite>, supplied by Nvidia for details on this step.</p>
       -<p><em>sphere</em> is supplied with several Makefiles, which automate the compilation process. To compile all components, open a shell, go to the texttt{src/} subfolder and type texttt{make}. The GNU Make will return the parameters passed to the individual CUDA and GNU compilers (texttt{nvcc} and texttt{gcc}). The resulting binary file (texttt{sphere}) is placed in the <em>sphere</em> root folder. <tt class="docutils literal"><span class="pre">src/Makefile</span></tt> will also compile the raytracer.</p>
       +<p><em>sphere</em> is supplied with several Makefiles, which automate the compilation process. To compile all components, open a shell, go to the texttt{src/} subfolder and type texttt{make}. The GNU Make will return the parameters passed to the individual CUDA and GNU compilers (texttt{nvcc} and texttt{gcc}). The resulting binary file (texttt{sphere}) is placed in the <em>sphere</em> root folder. <code class="docutils literal"><span class="pre">src/Makefile</span></code> will also compile the raytracer.</p>
        </div>
        <div class="section" id="c-reference">
        <h2>C++ reference<a class="headerlink" href="#c-reference" title="Permalink to this headline">¶</a></h2>
       -<div class="line-block">
       -<div class="line" id=""><span id="project0classDEM"></span><em>class</em> <strong>DEM</strong></div>
       -</div>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -<em>Public Functions</em><blockquote>
       -<div><p id=""><span id="project0classDEM_1a991dd9d5ffe9935e1105d3c024a06a8c"></span><div class="line-block">
       -<div class="line"> <strong>DEM</strong>(std::string inputbin, const int verbosity = 1, const int checkVals = 1, const int dry = 0, const int initCuda = 1, const int transferConstMem = 1, const int fluidFlow = 0, const int exclusive = 0)</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1aa3066aa501f982c2df51f58fb5a91148"></span><div class="line-block">
       -<div class="line"> <strong>~DEM</strong>(void)</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1ac32ef9094b25ee9c35e30f4488491fe2"></span><div class="line-block">
       -<div class="line">void <strong>readbin</strong>(const char * target)</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1a242634f10a9bc1f19e4eb46b7168f288"></span><div class="line-block">
       -<div class="line">void <strong>writebin</strong>(const char * target)</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1a2fabfdb491bd95fc41b78b14d7098b76"></span><div class="line-block">
       -<div class="line">void <strong>diagnostics</strong>()</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1ac8ee9469bd6efd769a87e9537be1ad9c"></span><div class="line-block">
       -<div class="line">void <strong>checkValues</strong>()</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1a3f6f5bdff5193be0deeff3599559e33a"></span><div class="line-block">
       -<div class="line">void <strong>reportValues</strong>()</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1a4d8d968838244cd44b0961bdc621f874"></span><div class="line-block">
       -<div class="line">void <strong>startTime</strong>()</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1ab28a7813c5848d3b27e6f1ed5196d649"></span><div class="line-block">
       -<div class="line">void <strong>render</strong>(const int method = 1, const float maxval = 1.0e3f, const float lower_cutoff = 0.0f, const float focalLength = 1.0f, const unsigned int img_width = 800, const unsigned int img_height = 800)</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1a5abc32b3691e7336e80cfab162d0a237"></span><div class="line-block">
       -<div class="line">void <strong>writePPM</strong>(const char * target)</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1ad4e191a3aa8491ae04f1897ff1f24bde"></span><div class="line-block">
       -<div class="line">void <strong>porosity</strong>(const int z_slices = 10)</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1a5e3a8e75216d4014819019b365b718cb"></span><div class="line-block">
       -<div class="line">Float3 <strong>minPos</strong>()</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1a55e5de749a916600bb4e0680ecafcd0f"></span><div class="line-block">
       -<div class="line">Float3 <strong>maxPos</strong>()</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1a9fa9b39cf7f038cc961337f9d4e162e5"></span><div class="line-block">
       -<div class="line">void <strong>findOverlaps</strong>(std::vector&lt; std::vector&lt; unsigned int &gt; &gt; &amp; ij, std::vector&lt; Float &gt; &amp; delta_n_ij)</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1ad94250277dec22f68e096bbf149ff0a8"></span><div class="line-block">
       -<div class="line">void <strong>forcechains</strong>(const std::string format = &#8220;interactive&#8221;, const int threedim = 1, const double lower_cutoff = 0.0, const double upper_cutoff = 1.0e9)</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1a4f398ac462ce442eff0b649286c03bcb"></span><div class="line-block">
       -<div class="line">void <strong>printNSarray</strong>(FILE * stream, Float * arr)</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1a5495c54f09b7a9d157352daf7de77500"></span><div class="line-block">
       -<div class="line">void <strong>printNSarray</strong>(FILE * stream, Float * arr, std::string desc)</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1ae7b0770eb976dbc262e76f414444f78d"></span><div class="line-block">
       -<div class="line">void <strong>printNSarray</strong>(FILE * stream, Float3 * arr)</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1add65316e75fc181c73ab636dff42187a"></span><div class="line-block">
       -<div class="line">void <strong>printNSarray</strong>(FILE * stream, Float3 * arr, std::string desc)</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1a777844d118f6d317b17466ec0760bbff"></span><div class="line-block">
       -<div class="line">void <strong>writeNSarray</strong>(Float * array, const char * filename)</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -<p id=""><span id="project0classDEM_1a9eb88295a2de9273d24605e960e1b6f0"></span><div class="line-block">
       -<div class="line">void <strong>writeNSarray</strong>(Float3 * array, const char * filename)</div>
       -</div>
       -</p>
       -<blockquote>
       -<div><p></p>
       -<p></p>
       -</div></blockquote>
       -</div></blockquote>
       -</div></blockquote>
       +<dl class="class">
       +<dt id="_CPPv23DEM">
       +<span id="DEM"></span><span class="target" id="classDEM"></span><em class="property">class </em><code class="descclassname"></code><code class="descname">DEM</code><a class="headerlink" href="#_CPPv23DEM" title="Permalink to this definition">¶</a></dt>
       +<dd></dd></dl>
       +
        </div>
        </div>
        
       t@@ -420,7 +255,7 @@ An important note is that the texttt{C} examples of the NVIDIA CUDA SDK should b
                  </div>
                </div>
              </div>
       -      <div class="sphinxsidebar">
       +      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
                <div class="sphinxsidebarwrapper">
          <h3><a href="index.html">Table Of Contents</a></h3>
          <ul>
       t@@ -431,29 +266,31 @@ An important note is that the texttt{C} examples of the NVIDIA CUDA SDK should b
        </li>
        </ul>
        
       -  <h3>This Page</h3>
       -  <ul class="this-page-menu">
       -    <li><a href="_sources/sphere_internals.txt"
       -           rel="nofollow">Show Source</a></li>
       -  </ul>
       -<div id="searchbox" style="display: none">
       +  <h4>Previous topic</h4>
       +  <p class="topless"><a href="python_api.html"
       +                        title="previous chapter">Python API</a></p>
       +  <div role="note" aria-label="source link">
       +    <h3>This Page</h3>
       +    <ul class="this-page-menu">
       +      <li><a href="_sources/sphere_internals.txt"
       +            rel="nofollow">Show Source</a></li>
       +    </ul>
       +   </div>
       +<div id="searchbox" style="display: none" role="search">
          <h3>Quick search</h3>
            <form class="search" action="search.html" method="get">
       -      <input type="text" name="q" />
       -      <input type="submit" value="Go" />
       +      <div><input type="text" name="q" /></div>
       +      <div><input type="submit" value="Go" /></div>
              <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 module, class or function name.
       -    </p>
        </div>
        <script type="text/javascript">$('#searchbox').show(0);</script>
                </div>
              </div>
              <div class="clearer"></div>
            </div>
       -    <div class="related">
       +    <div class="related" role="navigation" aria-label="related navigation">
              <h3>Navigation</h3>
              <ul>
                <li class="right" style="margin-right: 10px">
       t@@ -462,12 +299,15 @@ An important note is that the texttt{C} examples of the NVIDIA CUDA SDK should b
                <li class="right" >
                  <a href="py-modindex.html" title="Python Module Index"
                     >modules</a> |</li>
       -        <li><a href="index.html">sphere 1.00-alpha documentation</a> &raquo;</li> 
       +        <li class="right" >
       +          <a href="python_api.html" title="Python API"
       +             >previous</a> |</li>
       +        <li class="nav-item nav-item-0"><a href="index.html">sphere 1.00-alpha documentation</a> &#187;</li> 
              </ul>
            </div>
       -    <div class="footer">
       -        &copy; Copyright 2014, Anders Damsgaard.
       -      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
       +    <div class="footer" role="contentinfo">
       +        &#169; Copyright 2014, Anders Damsgaard.
       +      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
            </div>
          </body>
        </html>
        \ No newline at end of file
 (DIR) diff --git a/doc/pdf/sphere.pdf b/doc/pdf/sphere.pdf
       Binary files differ.
 (DIR) diff --git a/doc/sphinx/index.rst b/doc/sphinx/index.rst
       t@@ -14,7 +14,7 @@ supervision of David Lundbek Egholm and Jan A. Piotrowski, all of the Department
        of Geoscience, Aarhus University, Denmark. The author welcomes interested third
        party developers. This document is a work in progress.
        
       -Contact: Anders Damsgaard, `<http://cs.au.dk/~adc>`_,
       +Contact: Anders Damsgaard, `<https://adamsgaard.dk>`_,
        `<anders.damsgaard@geo.au.dk>`_
        
        
       t@@ -27,7 +27,7 @@ Contents
           dem
           cfd
           python_api
       -   .. sphere_internals
       +   sphere_internals
        
        
        
 (DIR) diff --git a/doc/sphinx/introduction.rst b/doc/sphinx/introduction.rst
       t@@ -1,5 +1,5 @@
       -Introduction
       -============
       +Introduction and Installation
       +=============================
        
        The ``sphere``-software is used for three-dimensional discrete element method 
        (DEM) particle simulations. The source code is written in C++, CUDA C and
       t@@ -37,11 +37,11 @@ The build requirements are:
          * `CMake <http://www.cmake.org>`_, version 2.8 or newer
          * The `GNU Compiler Collection <http://gcc.gnu.org/>`_ (GCC)
          * The `Nvidia CUDA toolkit <https://developer.nvidia.com/cuda-downloads>`_,
       -    version 5.0 or newer
       +    version 8.0 or newer
        
        In Debian GNU/Linux, these dependencies can be installed by running::
        
       - $ sudo apt-get install build-essential cmake nvidia-cuda-toolkit
       + $ sudo apt-get install build-essential cmake nvidia-cuda-toolkit clang-3.8
        
        Unfortunately, the Nvidia Toolkit is shipped under a non-free license. In order
        to install it in Debian GNU/Linux, add ``non-free`` archives to your
       t@@ -50,7 +50,7 @@ to install it in Debian GNU/Linux, add ``non-free`` archives to your
        The runtime requirements are:
        
          * A `CUDA-enabled GPU <http://www.nvidia.com/object/cuda_gpus.html>`_ with
       -    compute capability 1.1 or greater.
       +    compute capability 2.0 or greater.
          * A Nvidia CUDA-enabled GPU and device driver
        
        Optional tools, required for simulation setup and data processing:
       t@@ -113,11 +113,6 @@ Building ``sphere``
        ``sphere`` is built using ``cmake``, the platform-specific C/C++ compilers,
        and ``nvcc`` from the Nvidia CUDA toolkit.
        
       -If you plan to run ``sphere`` on a Kepler GPU, execute the following commands
       -from the root directory::
       -
       - $ cmake . && make
       -
        If you instead plan to execute it on a Fermi GPU, change ``set(GPU_GENERATION
        1)`` to ``set(GPU_GENERATION 0`` in ``CMakeLists.txt``.
        
       t@@ -132,19 +127,27 @@ sample subdirectory ``common/inc/helper_math.h`` into the sphere ``src/``
        directory, and run ``cmake`` and ``make`` again. Due to license restrictions,
        sphere cannot be distributed with this file.
        
       +If you plan to run ``sphere`` on a Kepler GPU, execute the following commands
       +from the root directory::
       +
       + $ cmake . && make
       +
       +NOTE: If your system does not have a GCC compiler (e.g. GCC-5 for CUDA 8) 
       +compatible with the installed CUDA version, try using ``clang-3.8`` instead::
       +
       + $ export CC=$(which clang-3.8) && export CXX=$(which clang++-3.8) && cmake . && make
       +
        After a successfull installation, the ``sphere`` executable will be located
        in the root folder. To make sure that all components are working correctly,
        execute::
        
         $ make test
        
       -All instructions required for building ``sphere`` are provided in a number of
       -``Makefile``'s. To generate the main ``sphere`` command-line executable, go to
       -the root directory, and invoke CMake and GNU Make::
       -
       - $ cmake . && make
       +Disclaimer: On some systems the Navier-Stokes related tests will fail.  If you 
       +do encounter these problems, but do not plan on using the Navier Stokes solver 
       +for fluid dynamics, carry on.
        
       -If successfull, the Makefiles will create the required data folders, object
       +If successful the Makefiles will create the required data folders, object
        files, as well as the ``sphere`` executable in the root folder. Issue the
        following commands to check the executable::