<form class="search" method="get" action="/<%= base_path(router.search_prefix) %>">
  Search: <input name="q" type="search" placeholder="Search" id="search_box" size="30" value="<%= h @query %>" />
</form>
<script type="text/javascript" charset="utf-8">
  $(function() {
    $('#search_box').autocomplete($('#search_box').parent().attr('action'), {
      width: document.body.className == 'frames' ? 250 : 340,
      formatItem: function(item) {
        var values = item[0].split(",");
        return values[0] + (values[1] == '' ? "" : " <small>(" + values[1] + ")</small>");
      }
    }).result(function(event, item) {
      var values = item[0].split(",")
      $('#search_box').val(values[1]);
      location.href = values[3];
      return false;
    });
  });
</script>
<style>
  .frames form.search { position: absolute; right: 14px; top: -6px; padding-top: 10px; }
  .frames #menu .noframes { float: none; }
  .frames #menu { float: left; }
  .frames #content h1 { margin-top: 15px; }
</style>

<div id="menu">
  <% unless @single_library %>
    <a href="/<%= router.docs_prefix %>" target="_top">Libraries</a> &raquo;
    <span class="title"><%= @library.name %> <% if @library.version %><small>(<%= @library.version %>)</small><% end %></span>
  <% end %>
  <% if object.is_a?(CodeObjects::Base) && @file.nil? %>
    <% unless @single_library %>&raquo;<% end %>
    <a href="<%= url_for_index %>"><% if object.root? || object.type == :method %>Index<% else %>Index (<%= object.name.to_s[0] %>)<% end %></a> &raquo;
    <%= @breadcrumb.map {|obj| "<span class='title'>" + linkify(obj, obj.name) + "</span>" }.join(" &raquo; ") %>
    <%= @breadcrumb.size > 0 ? " &raquo; " : "" %>
    <span class='title'><%= object.root? ? "Top Level Namespace" : object.name(true) %></span>
  <% else %>
    <% if (@breadcrumb_title || object != '_index.html') && !@single_library %>&raquo; <% end %>
    <% if object != '_index.html' %><a href="<%= url_for_index %>">Index</a> &raquo; <% end %>
    <span class='title'><%= @breadcrumb_title %></span>
  <% end %>

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

