[% IF use_frames %]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>[% title_prefix %][% title %]</title>
    [% PROCESS _common_js.tt %]
    [% UNLESS all_in_one_css %]
    <link href="[% url_prefix %]thruk/themes/[% theme %]/stylesheets/common.css" type="text/css" rel="stylesheet" />
    [% END %]
    <link href="[% url_prefix %]thruk/themes/[% theme %]/stylesheets/thruk_global.css" type="text/css" rel="stylesheet" />
    <link href="[% url_prefix %]thruk/themes/[% theme %]/stylesheets/[% theme %].css" type="text/css" rel="stylesheet" />
    <link rel="shortcut icon" href="[% url_prefix %]thruk/themes/[% theme %]/images/favicon.ico" type="image/ico" />
    <style type="text/css">
    <!--
    HTML {
        overflow: inherit;
        overflow-y: auto;
    }
    -->
    </style>
    [% PROCESS extra_headers.tt %]
  </head>
  <body class='navbar' onload="preloadImages();">
[% END %]
<div class="tree">
<script type="text/javascript" language="JavaScript1.2">
<!--
//******************************************************************************
// ------ DTree Tree-menu Data --------------------------------------------
//******************************************************************************

[% icon_open    = '' %]
[% icon         = '' %]

[% BLOCK set_icons %]
  [% icon = url_prefix _ 'thruk/themes/Nuvola/side/icons/info.gif' %]
  [% IF section.name == 'Current Status' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/icons/monitoring.gif' %]
  [% ELSIF section.name == 'Reports' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/icons/reporting.gif' %]
  [% ELSIF section.name == 'System' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/icons/configuration.gif' %]
  [% ELSIF section.name == 'Bookmarks' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/icons/info.gif' %]
  [% END %]

  [% IF l.name == 'Map' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/icons/map.gif' %]
  [% ELSIF l.name == 'Comments' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/icons/notes.gif' %]
  [% ELSIF l.name == 'Downtime' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/icons/downtime.gif' %]
  [% ELSIF l.name == 'Problems' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/icons/error.gif' %]
  [% ELSIF l.name == 'Notifications' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/icons/notifications.gif' %]
  [% ELSIF l.name == 'Event Log' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/icons/notes.gif' %]
  [% ELSIF l.name == 'Process Info' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/icons/processes.gif' %]
  [% ELSIF l.name == 'Performance Info' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/icons/performance.gif' %]
  [% ELSIF l.name == 'Scheduling Queue' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/icons/queue.gif' %]
  [% END %]

  [% IF l.exists('icon') %]
      [% icon = l.icon %]
  [% END %]

  [% IF l.links && l.links.size > 0 %]
    [% icon      = url_prefix _ 'thruk/themes/Nuvola/side/icons/folder.gif' %]
    [% icon_open = url_prefix _ 'thruk/themes/Nuvola/side/icons/folder_open.gif' %]
  [% END %]


[% END %]


[% FOREACH section = navigation +%]
[%+ menu_name = section.name _ '_menu' | lower | remove('\s+') %]
[%+ menu_name %] = new dTree('[% menu_name %]');

[% IF section.icon %]
  [% icon = url_prefix _ section.icon %]
[% ELSE %]
  [% IF section.name == 'General' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/home.gif' %]
  [% ELSIF section.name == 'Current Status' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/monitoring.gif' %]
  [% ELSIF section.name == 'Reports' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/reporting.gif' %]
  [% ELSIF section.name == 'System' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/configuration.gif' %]
  [% ELSIF section.name == 'Bookmarks' %]
    [% icon = url_prefix _ 'thruk/themes/Nuvola/side/home.gif' %]
  [% END %]
[% END %]

[%+ menu_name %].header('&nbsp;&nbsp;<a thref="#">[% section.name %]<\/a>','[% icon %]',32,'[% url_prefix %]thruk/themes/Nuvola/side/title.gif','#AFB1C3',true)
[%+ menu_name %].add(0,-1);
  [%+ index = 0 %]
  [% FOREACH link = section.links +%]
      [% index = index + 1 %]
      [% IF link.href %]
        [% PROCESS set_icons l=link %]
        [%+ menu_name %].add([% index %],0,'[% link.name %]','[% link.href %]','','[% link.target %]', '[% icon %]', '[% icon_open %]');
        [%+ parent_index = index %]
        [% FOREACH sublink = link.links +%]
          [% PROCESS set_icons l=sublink %]
          [% index = index + 1 %]
          [%+ menu_name %].add([% index %],[% parent_index %],'[% sublink.name %]','[% sublink.href %]','','[% sublink.target %]','[% icon %]');
        [% END %]
      [% ELSIF link.search +%]
        [%+ menu_name %].add([% index %],0,"<nobr><form style='padding: 0px; margin:0px; display:inline;' method='get' action='[% url_prefix %]thruk/cgi-bin/status.cgi' target='[% link.target %]'>[% IF use_new_search%]<input type='hidden' name='hidesearch' value='2' /><input type='hidden' name='s0_op' value='~' /><input type='hidden' name='s0_type' value='search' /><input type='text' name='s0_value' id='NavBarSearchItem' size=10 style='font-size:10'>[% ELSE %]<input type='hidden' name='navbarsearch' value='1'><input type='text' name='host' id='NavBarSearchItem' size=10 style='font-size:10'>[% END %]<\/form><\/nobr>",'','','','[% url_prefix %]thruk/themes/Nuvola/side/icons/search.gif');
      [% END %]
  [% END %]
document.write([% menu_name %]);
[% END %]

-->
</script>
</div>
[% PROCESS _ajax_search.tt %]
[% IF use_frames %]
  </body>
</html>
[% END %]
