<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>{{ meta['title'] if meta and meta['title'] else title }} - Deis Documentation</title>
    <meta name="description" content="{{ meta['description'] if meta }}">
    <meta name="keywords" content="{{ meta['keywords'] if meta }}" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="{{ pathto('_static/css/bootstrap.css', 1) }}" type="text/css">
    <link rel="stylesheet" href="{{ pathto('_static/css/bootstrap-responsive.css', 1) }}" type="text/css">
    <link rel="stylesheet" href="{{ pathto('_static/css/main.css', 1) }}" type="text/css">
    <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css">
    <link rel="shortcut icon" href="{{ pathto('_static/favicon.ico', 1) }}">
    <script
    <script src="{{ pathto('_static/js/modernizr-2.6.2-respond-1.1.0.min.js', 1) }}"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.1.min.js"><\/script>')</script>
    <meta name='robots' content='noindex,nofollow' />
  {%- if pagename == 'index' %}
  <link rel="canonical" href="http://deis.io/docs/latest/">
  {% else %}
  <link rel="canonical" href="http://deis.io/docs/latest/{{ pagename }}/">
  {% endif %}
  {% block extrahead %}{% endblock %}
</head>
<body style="zoom: 1;">
    <!--[if lt IE 7]>
        <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
    <![endif]-->

    <a class="fork" href="http://github.com/opdemand/deis"><img src="{{ pathto('_static/img/fork.png', 1) }}" alt="GitHub Fork Button"></a>
    <div class="container">
        <div class="row">
            <div class="span3 hoop menu">
                <div class="nav-border top-spacing">
                    <ul class="nav nav-list menu">
                        <li><a href="/"><img class="logo" src="{{ pathto('_static/img/menu-logo.png', 1) }}" alt="deis logo"></a></li>
                        <li class="divider"></li>
                        <li class="navitem"><a href="http://deis.io/overview/">Overview</a></li>
                        <li class="divider"></li>
                        <li class="navitem"><a href="http://deis.io/get-deis/">Get Deis</a></li>
                        <li class="divider"></li>
                        <li class="navitem"><a href="http://deis.io/get-involved/">Get Involved</a></li>
                        <li class="divider"></li>
                        <li class="navitem selected green"><a href="/">Documentation</a></li>
                        <li class="divider"></li>
                        <li class="navitem"><a href="http://deis.io/blog/">Blog</a></li>
                        <li class="divider"></li>
                        <div style="clear:both;"></div>
                    </ul>

                    <div class="social-menu">
                        <a href="https://twitter.com/opendeis" target="_blank"><span class="twitter"></span></a>
                        <a href="http://freenode.net" target="_blank"><span class="irc"></span></a>
                        <a href="https://github.com/opdemand/deis" target="_blank"><span class="github"></span></a>
                        <a href="http://stackoverflow.com/" target="_blank"><span class="stack"></span></a>
                    </div>

                    <div class="byline-menu">
                        <a href="" ><span class="cloud-logo"></span></a>
                        <p>Deis is a project by<br>OpDemand</p>
                    </div>
                </div>
            </div>

            <div class="span6 hoop contents">
              <div class="doc-content">{% block body %}{% endblock %}</div>
            </div>


            <div class="span2 offset1 docs-sidebar hoop">
              {{ toctree(collapse=False, maxdepth=3) }}
            </div>

        </div> <!-- .row -->
      </div> <!-- .main_section container-->

  <footer>
  </footer>
  <script type="text/javascript">
    var DOCUMENTATION_OPTIONS = {
      URL_ROOT:    '{{ url_root }}',
      VERSION:     '{{ release|e }}',
      COLLAPSE_INDEX: false,
      FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
      HAS_SOURCE:  {{ has_source|lower }}
    };
    // hacky workaround for doctools.js breakage
    $.browser = {};
  </script>
  <script type="text/javascript" src="{{ pathto('_static/underscore.js', 1) }}" type="text/css"></script>
  <script type="text/javascript" src="{{ pathto('_static/doctools.js', 1) }}" type="text/css"></script>
  <script type="text/javascript" src="{{ pathto('_static/searchtools.js', 1) }}" type="text/css"></script>

  <script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-42867143-1', 'deis.io');
  ga('send', 'pageview');

  </script>

  <script>
  $(document).ready(function() {
    var maxHeight = -1;

    //find the tallest column
    $('.hoop').each(function() {
      if (maxHeight < $(this).height()) {
        maxHeight = $(this).height();
        tallest = $(this);
      }
    });

    //Find the margin of the tallest item. If none, set to 0
    var tallestMargin = parseInt(tallest.css('margin-top'));
    if(tallestMargin < 1 || isNaN(tallestMargin)) {tallestMargin = 0;}

    //Set the height of each of the columns
    $('.hoop').each(function() {
      if(maxHeight < 923) {
        maxHeight = 923;
        $(this).height(maxHeight + tallestMargin);
      } else {
        $(this).height(maxHeight + tallestMargin);
      }
    });

    //Remove margin from height on Docs Sidebar
    $('.docs-sidebar').height(maxHeight - 145);

    //remove the margin from the tallest column if it exists
    //tallest.height(maxHeight - tallestMargin);
    
    //Set the margin above the social buttons in the left-hand menu
    if (maxHeight > 800) {
      newMargin = maxHeight - 451 - 133 - 30 + tallestMargin;
      $('.social-menu').css({'margin-top': newMargin})
    } else {
      $('.social-menu').css({'margin-top': 309})
    }

    //Remove <ul> from Releases
    $('.toctree-l1 > a').each(function(){
      if($(this).html() == "Releases") {
        console.log($(this).html());
      }
    });

    //Check URL
    var path = window.location.href;
    var pathName = path.split('/');
    var num = pathName.length - 3;
    var gettingstarted, terms, client, server, contributing;

    switch(pathName[num]) {
      case 'gettingstarted':
        //case at Getting Started
        $('.toctree-l1 > a').each(function(){
          if($(this).html() == "Getting Started") {
            $(this).parent().attr('state', 'open');
            $(this).attr('state', 'open');
          }
        });
        break;
      case 'terms':
        //case at Terms
        $('.toctree-l1 > a').each(function(){
          if($(this).html() == "Terms") {
            $(this).parent().attr('state', 'open');
            $(this).attr('state', 'open');
          }
        });
        break;
      case 'client':
        //case at Client Reference
        $('.toctree-l1 > a').each(function(){
          if($(this).html() == "Client Reference") {
            $(this).parent().attr('state', 'open');
            $(this).attr('state', 'open');
          }
        });
        break;
      case 'server':
        //case at Server Reference
        $('.toctree-l1 > a').each(function(){
          if($(this).html() == "Server Reference") {
            $(this).parent().attr('state', 'open');
            $(this).attr('state', 'open');
          }
        });
        break;
      case 'contributing':
        //case at Contributing
        $('.toctree-l1 > a').each(function(){
          if($(this).html() == "Contributing") {
            $(this).parent().attr('state', 'open');
            $(this).attr('state', 'open');
          }
        });
        break;
      case 'releases':
        //code this out when releases gets filled out
        break;
      default:

    }
    
    //Doc Sidebar: Create accordion
    var allPanels = $('.toctree-l1 > ul');
    allPanels.hide();

    $('.toctree-l1 > a').each(function(){
       if($(this).parent().attr('state') == 'open') {
         $(this).attr('state', 'open');
         $(this).next().show();
        }
    });

    $('.toctree-l1 > a:first-child').click(function() {
      if($(this).siblings().size() > 0 && $(this).attr('state') != 'open') {
        allPanels.slideUp();
        $(this).next().slideDown();
        $('.toctree-l1 > a').attr('state', 'closed');
        $(this).attr('state', 'open');
        return false;
      }
      if ($(this).attr('state') == 'open') {
        return false;
      }
    });
  });
  </script>
  

    </body>
</html>
