<script type="text/javascript" src="{$pathHeaderJs}"></script>
<div id="headershow" class="header"><a href="#" onclick="headerToggle(true)"><img src="{$pathTemplateImages}default.header_show.png" alt="Show header menu" /></a></div>
<div id="header" class="header">
<ul class="head">
  <li><a href="#" onclick="headerToggle(true)"><img src="{$pathTemplateImages}default.header_hide.png" alt="Hide header menu" /></a></li>
    <li class="logo"><a href="http://www.nagvis.org/"><img src="{$pathImages}/internal/logo_96x25.png" alt="NagVis" /></a></li>
    <li onmouseover="!sidebarOpen() ? ddMenu('views',1) : void(0)" onmouseout="ddMenuHide(['views'])" class="dropdown">
        <span id="views-ddheader" onclick="toggleSidebar(true);ddMenuHide(['views'])">{$langOpen} <img src="{$pathTemplateImages}default.header_down.png" alt="&#8711;" /></span>
        {template headMaps maps pathBase type indent=1}
        {foreach $maps map}
            <li class="lvl{$indent}">
            {if $map.configError == true}<a class="error" href="#">{$map.mapAlias}</a>
            {else}<a href="{$pathBase}/frontend/nagvis-js/index.php?mod={$type}&amp;act=view&amp;show={$map.mapName}">{$map.mapAlias}</a> {/if}
            </li>
            {if $map.childs}
                {headMaps $map.childs $pathBase $type $indent+1}
            {/if}
        {/foreach}
        {/template}
        <ul id="views-ddcontent">
            {if $permittedOverview}
              <li><a href="{$pathBase}/frontend/nagvis-js/index.php">{$langOverview}</a></li>
            {/if}
            {if count($maps) > 0}
              <li class="spacer"><hr /></li>
              {headMaps $maps $pathBase "Map"}
            {/if}
            <li class="spacer underline"></li>
        </ul>
    </li>
    {if ($mod == 'Map' && ($permittedEdit == true && $act != 'edit' || $permittedView == true && $act != 'view')) || $bRotation == true || $permittedSearch}
    <li onmouseover="ddMenu('action',1)" onmouseout="ddMenuHide(['action'])" class="dropdown">
        <span id="action-ddheader">{$langActions} <img src="{$pathTemplateImages}default.header_down.png" alt="&#8711;" /></span>
        <ul id="action-ddcontent">
            {if $mod == 'Map' && $permittedSearch}
            <li><a href="javascript:void(0)" onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=Search&amp;act=view', '{$langSearch}')">{$langSearch}</a></li>
            {/if}
            {if $mod == 'Map' && $permittedEdit == true}
            <li><a href="#" onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=Map&amp;act=addModify&amp;show={$currentMap}&amp;object_id=0&mode=view_params'+getViewParams(null, true), '{$langModifyParams}');" class="underline">{$langModifyParams}</a></li>
            {/if}
            {if $bRotation == true}
            <li id="rotationStart" style="display:none"><a href="#" onclick="switchRotation()">{$langRotationStart}</a></li>
            <li id="rotationStop" style="display:inline"><a href="#" onclick="switchRotation()">{$langRotationStop}</a></li>
            {/if}
            {if $mod == 'Map' && $usesSources && $permittedEdit == true}
            <li><a href="#" onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=Map&amp;act=toStaticMap&amp;show=dialog', '{$langToStaticMap}')">{$langToStaticMap}</a></li>
            {/if}
            <li class="spacer underline"></li>
        </ul>
    </li>
    {/if}
    {if $mod == 'Map' && $permittedEdit == true}
    <li onmouseover="ddMenu('map',1)" onmouseout="ddMenuHide(['map'])" class="dropdown">
        <span id="map-ddheader">{$langMapEdit} <img src="{$pathTemplateImages}default.header_down.png" alt="&#8711;" /></span>
        <ul id="map-ddcontent">
            <li><a href="#" onclick="toggleAllMapObjectsLock();ddMenuHide(['map'])">{$langLockUnlockAll}</a></li>
            <li class="spacer"><hr /></li>
            <li><a href="#" onclick="gridToggle();ddMenuHide(['map'])">{$langToggleGrid}</a></li>
            <li class="spacer"><hr /></li>
            <li onmouseover="ddMenu('map-addicon',1,1)" onmouseout="ddMenuHide(['map-addicon'])" class="dropdown subdropdown">
                <a class="submenu-link" id="map-addicon-ddheader" href="#">{$langMapAddIcon}</a>
                <ul id="map-addicon-ddcontent">
                	<li><a class="topline topline" href="#" onclick="addObject(event, 'host', 'icon', 1, 'add');ddMenuHide(['map-addicon','map']);">{$langHost}</a></li>
                	<li><a class="topline" href="#" onclick="addObject(event, 'service', 'icon', 1, 'add');ddMenuHide(['map-addicon','map']);">{$langService}</a></li>
                	<li><a class="topline" href="#" onclick="addObject(event, 'hostgroup', 'icon', 1, 'add');ddMenuHide(['map-addicon','map']);">{$langHostgroup}</a></li>
                	<li><a class="topline" href="#" onclick="addObject(event, 'servicegroup', 'icon', 1, 'add');ddMenuHide(['map-addicon','map']);">{$langServicegroup}</a></li>
                	<li><a class="topline underline" href="#" onclick="addObject(event, 'map', 'icon', 1, 'add');ddMenuHide(['map-addicon','map']);">{$langMap}</a></li>
                </ul>
            </li>
            <li onmouseover="ddMenu('map-addline',1,1)" onmouseout="ddMenuHide(['map-addline'])" class="dropdown subdropdown">
                <a class="submenu-link" id="map-addline-ddheader" href="#">{$langMapAddLine}</a>
                <ul id="map-addline-ddcontent">
                	<li><a class="topline topline" href="#" onclick="addObject(event, 'host', 'line', 2, 'add');ddMenuHide(['map-addline','map']);">{$langHost}</a></li>
                	<li><a class="topline" href="#" onclick="addObject(event, 'service', 'line', 2, 'add');ddMenuHide(['map-addline','map']);">{$langService}</a></li>
                	<li><a class="topline" href="#" onclick="addObject(event, 'hostgroup', 'line', 2, 'add');ddMenuHide(['map-addline','map']);">{$langHostgroup}</a></li>
                	<li><a class="topline" href="#" onclick="addObject(event, 'servicegroup', 'line', 2, 'add');ddMenuHide(['map-addline','map']);">{$langServicegroup}</a></li>
                	<li><a class="topline underline" href="#" onclick="addObject(event, 'map', 'line', 2, 'add');ddMenuHide(['map-addline','map']);">{$langMap}</a></li>
                </ul>
            </li>
            <li onmouseover="ddMenu('map-addspecial',1,1)" onmouseout="ddMenuHide(['map-addspecial'])" class="dropdown subdropdown">
                <a class="submenu-link" id="map-addspecial-ddheader" href="#">{$langMapAddSpecial}</a>
                <ul id="map-addspecial-ddcontent">
                	<li><a class="topline topline" href="#" onclick="addObject(event, 'shape', '', 1, 'add');ddMenuHide(['map-addspecial','map']);">{$langShape}</a></li>
                	<li><a class="topline" href="#" onclick="addObject(event, 'textbox', '', 2, 'add');ddMenuHide(['map-addspecial','map']);">{$langTextbox}</a></li>
                	<li><a class="topline" href="#" onclick="addObject(event, 'line', 'line', 2, 'add');ddMenuHide(['map-addspecial','map']);">{$langStateless} {$langLine}</a></li>
                	<li><a class="topline underline" href="javascript:void(0)" onclick="addObject(event, 'container', '', 2, 'add');ddMenuHide(['map-addspecial','map']);">{$langContainer}</a></li>
                </ul>
            </li>
            <li class="spacer"><hr /></li>
            <li><a href="#" onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=Map&amp;act=manageTmpl&amp;show={$currentMap}', '{$langMapManageTmpl}', 300)">{$langMapManageTmpl}</a></li>
            <li><a href="#" onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=Map&amp;act=addModify&amp;show={$currentMap}&amp;object_id=0', '{$langMapOptions}');" class="underline">{$langMapOptions}</a></li>
        </ul>
    </li>
    {/if}
    {if $permittedEditMainCfg || $permittedManageBackgrounds || $permittedManageMaps || $permittedManageShapes}
    <li onmouseover="ddMenu('wui',1)" onmouseout="ddMenuHide(['wui'])" class="dropdown">
        <span id="wui-ddheader">{$langOptions} <img src="{$pathTemplateImages}default.header_down.png" alt="&#8711;" /></span>
        <ul id="wui-ddcontent">
            {if $permittedEditMainCfg}<li><a href="#" onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=MainCfg&amp;act=edit', '{$langEditMainCfg}', 970)">{$langEditMainCfg}</a></li>
            <li class="spacer"><hr /></li>
            <li><a href="#" onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=MainCfg&amp;act=manageBackends', '{$langMgmtBackends}');">{$langMgmtBackends}</a></li>{/if}
            {if $permittedManageBackgrounds}<li><a href="#" onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=ManageBackgrounds&amp;act=view', '{$langMgmtBackgrounds}');">{$langMgmtBackgrounds}</a></li>{/if}
            {if $permittedManageMaps}<li><a href="#" onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=Map&amp;act=manage', '{$langMgmtMaps}');">{$langMgmtMaps}</a></li>{/if}
            {if $permittedManageShapes}<li><a class="underline" href="#" onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=ManageShapes&amp;act=view', '{$langMgmtShapes}');">{$langMgmtShapes}</a></li>{/if}
        </ul>
    </li>
    {/if}
</ul>
<ul class="head right">
    <li><div id="refreshCounterHead"></div></li>
    <li id="editIndicator" style="display:none">
        <span>Edit Mode!</span>
    </li>
    <li onmouseover="ddMenu('user',1)" onmouseout="ddMenuHide(['user'])" class="dropdown">
        <span id="user-ddheader">{$langUser}<img src="{$pathTemplateImages}default.header_down.png" alt="&#8711;" /></span>
        <ul id="user-ddcontent">
        	<li><a href="#">{$langLoggedIn}: {$currentUser}</a></li>
        	{if $supportedChangePassword && $permittedChangePassword}<li><a href="#" onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=ChangePassword&amp;act=view', '{$langChangePassword}');">{$langChangePassword}</a></li>{/if}
        	{if $permittedUserMgmt}<li><a href="#" onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=UserMgmt&amp;act=view', '{$langUserMgmt}');">{$langUserMgmt}</a></li>{/if}
        	{if $permittedRoleMgmt}<li><a href="#" onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=RoleMgmt&amp;act=view', '{$langManageRoles}', 500);">{$langManageRoles}</a></li>{/if}
            {if $permittedLogout}<li><a href="#" onclick="getSyncRequest('{$pathBase}/server/core/ajax_handler.php?mod=Auth&amp;act=logout');return false;">{$langLogout}</a></li>{/if}
            <li class="spacer underline"></li>
        </ul>
    </li>
    <li onmouseover="ddMenu('language',1)" onmouseout="ddMenuHide(['language'])" class="dropdown">
        <span id="language-ddheader">{$langChooseLanguage} <img src="{$pathTemplateImages}default.header_down.png" alt="&#8711;" /></span>
        <ul id="language-ddcontent">
            {foreach $langs lang}<li><a href="{str_replace('&', '&amp;', $currentUri)}{if strpos($currentUri,'?') !== false}&amp;{else}?{/if}lang={$lang.language}">{$lang.langLanguageLocated}</a></li>{/foreach}
          	<li class="spacer underline"></li>
        </ul>
    </li>
    <li onmouseover="ddMenu('support',1)" onmouseout="ddMenuHide(['support'])" class="dropdown">
        <span id="support-ddheader">{$langNeedHelp} <img src="{$pathTemplateImages}default.header_down.png" alt="&#8711;" /></span>
        <ul id="support-ddcontent">
            <li><a href="{$pathBase}/docs/{$docLanguage}/index.html">{$langOnlineDoc}</a></li>
            <li><a href="http://www.monitoring-portal.org/wbb/index.php?page=Board&amp;boardID=42">{$langForum}</a></li>
            <li><a href="{$pathBase}/frontend/nagvis-js/index.php?mod=Info" class="underline">{$langSupportInfo}</a></li>
        </ul>
    </li>
    <li style="width:120px"></li>
</ul>
</div>

{template sideMaps maps pathBase type indent=1}
{foreach $maps map}
    {if $map.configError == true}<li class="lvl{$indent}"><a class="error">{$map.mapAlias}</a></li>
    {else}<li class="lvl{$indent}"><a href="{$pathBase}/frontend/nagvis-js/index.php?mod={$type}&amp;act=view&amp;show={$map.mapName}">{$map.mapAlias}</a></li>{/if}
    {if $map.childs}
        {sideMaps $map.childs $pathBase $type $indent+1}
    {/if}
{/foreach}
{/template}
<div id="sidebar">
<ul>
    {if $permittedOverview}<li class="spacerbottom"><a href="{$pathBase}/frontend/nagvis-js/index.php">{$langOverview}</a></li>{/if}
    <li class="closed"><a class="title" href="#" onclick="sidebarToggleSubtree(this)">{$langMaps}</a>
        <ul style="display:none;">{sideMaps $maps $pathBase "Map"}</ul>
    </li>
    {if count($rotations) > 0}
    <li class="closed spacertop"><a class="title" href="#" onclick="sidebarToggleSubtree(this)">{$langRotations}</a>
        <ul style="display:none;">
        {foreach $rotations rotation}
            <li class=lvl1><a href="{$pathBase}/frontend/nagvis-js/index.php?mod=Rotation&act=view&show={$rotation}">{$rotation}</a></li>
        {/foreach}
        </ul>
    </li>
    {/if}
</ul>
</div>
<div id="headerspacer"></div>
<script type="text/javascript">addDOMLoadEvent(function()\{sidebarDraw(); headerDraw();});</script>
