<% @tabs = {  definition: 'Definition', examples: 'Examples', usage: 'Usage', settings: 'Settings' } if @tabs == 'module' %>

<div class="<% if @tabs?: %>tab <% end %>segment">
  <div class="container">
    <div class="introduction">

      <h1 class="ui dividing header">
        <%=@document.title %>
        <% if @document.status?: %><span class="ui label"><%= @document.status %></span><% end %>
      </h1>

      <p><%=@document.description %></p>
      <% if @document.type is 'UI Element' or @document.type is 'UI View' or @document.type is 'UI Collection': %>
      <div class="ui basic labeled icon toggle overview button">
        Definition Mode
        <i class="book icon"></i>
      </div>
      <% end %>
      <% if @document.type is 'UI Module': %>
      <a href="/module.html" class="ui basic labeled icon button">
        Learn about Modules
        <i class="help icon"></i>
      </a>
      <% end %>
    </div>
    <div class="advertisement">
      <% unless 'development' in @getEnvironments(): %>
      <div id="carbonads-container"><div class="carbonad"><div id="azcarbon"></div><script type="text/javascript">var z = document.createElement("script"); z.type = "text/javascript"; z.async = true; z.src = "http://engine.carbonads.com/z/51619/azcarbon_2_1_0_HORIZ"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(z, s);</script></div></div>
      <% end %>
    </div>
    <% if @tabs?: %>
    <% index = 0 %>
    <% tabCount = 0 %>
    <% numbers = ['zero', 'one', 'two', 'three', 'four', 'five', 'six'] %>
    <% colors = ['red', 'teal', 'blue', 'purple', 'black', 'orange'] %>
      <% for id, name of @tabs: %>
        <% tabCount++ %>
      <% end %>
      <div class="<%= numbers[tabCount] %> item tabular ui menu">
        <% for id, name of @tabs: %>
          <a class="<%= if index == 0 then 'active ' %>item" data-tab="<%= id %>"><%= name %></a>
          <% index++ %>
        <% end %>
      </div>
      <% index = 0 %>
      <div class="fluid vertical ui menu">
        <% for id, name of @tabs: %>
          <a class="<%= if index == 0 then 'active ' %>item" data-tab="<%= id %>"><%= name %></a>
          <% index++ %>
        <% end %>
      </div>
    <% end %>
  </div>
</div>