
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="4" bgcolor="{$cell_color}">
        <tr>
          <td class="default_white">
            <b>{$app_setup.tool_caption|default:$application_title}</b> (<a title="{t}logout from{/t} {$app_setup.tool_caption|default:$application_title}" target="_top" href="{$rel_url}logout.php" class="white_link">{t}Logout{/t}</a>)
          </td>
          <td align="right" class="default_white">
            {if $current_role > $roles.developer}
            <a target="_top" title="{t}manage the application settings, users, projects, etc{/t}" href="{$rel_url}manage/projects.php" class="white_link">{t}Administration{/t}</a>&nbsp;|
            {/if}
            {if $current_role >= $roles.reporter}
            <a target="_top" title="{t}create a new issue{/t}" href="{$rel_url}new.php" class="white_link">{t}Create Issue{/t}</a>&nbsp;|
            {/if}
            <a target="_top" title="{t}list the issues stored in the system{/t}" href="{$rel_url}list.php" class="white_link">{t}List Issues{/t}</a>&nbsp;|
            {if $current_role != $roles.customer}
            <a target="_top" title="{t}get access to advanced search parameters{/t}" href="{$rel_url}adv_search.php" class="white_link">{t}Advanced Search{/t}</a>&nbsp;|
            {/if}
            {if $app_setup.support_email == 'enabled' and $current_role > $roles.customer}
            <a target="_top" title="{t}list available emails{/t}" href="{$rel_url}emails.php" class="white_link">{t}Associate Emails{/t}</a>&nbsp;|
            {/if}
            {if $current_role > $roles.customer}
            <a target="_top" title="{t}list all issues assigned to you{/t}" href="{$rel_url}list.php?view=my_assignments" class="white_link">{t}My Assignments{/t}</a>&nbsp;|
            {/if}
            <a target="_top" title="{t}general statistics{/t}" href="{$rel_url}main.php" class="white_link">{t}Stats{/t}</a>&nbsp;|
            {if $current_role > $roles.customer}
            <a target="_top" title="{t}reporting system{/t}" href="{$rel_url}reports/index.php" class="white_link">{t}Reports{/t}</a>&nbsp;|
            {/if}
            <a target="_top" title="{t}internal faq{/t}" href="{$rel_url}faq.php" class="white_link">{t}Internal FAQ{/t}</a>&nbsp;|
            <a title="{t}help documentation{/t}" href="javascript:void(null);" onClick="javascript:openHelp('{$rel_url}', 'main');" class="help">{t}Help{/t}</a>&nbsp;
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="4" bgcolor="{$cell_color}">
        <tr>
          {if $current_role == $roles.customer}
          <td nowrap width="50%" bgcolor="{$light_color}" class="default">
            <b>{t}Project{/t}: {$current_project_name|escape:"html"}</b>
          </td>
          {else}
          {literal}
          <script language="JavaScript">
          <!--
          function setCurrentProject()
          {
              var features = 'width=420,height=200,top=30,left=30,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,status=no';
              var projWin = window.open('', '_active_project', features);
              projWin.focus();
              return true;
          }
          function validateIssueID(f)
          {
              f.id.value = f.id.value.replace(/[^\d]/g, '');
              if (isNumberOnly(f.id.value)) {
                  return true;
              } else {
                  selectField(f, 'id');
                  alert('{/literal}{t escape=js}Please enter a valid issue ID.{/t}{literal}');
                  return false;
              }
          }
          function changeClockStatus()
          {
          {/literal}
              var features = 'width=420,height=200,top=30,left=30,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,status=no';
              var clockWin = window.open('{$rel_url}clock_status.php', '_clock_status', features);
              clockWin.focus();
          {literal}
          }
          //-->
          </script>
          {/literal}
          <form onSubmit="javascript:return setCurrentProject();" target="_active_project" method="post" action="{$rel_url}switch.php{if $is_frame == "yes"}?is_frame=yes{/if}">
          <td nowrap width="50%" bgcolor="{$light_color}">
            <select name="current_project" class="shortcut">
              {html_options options=$active_projects selected=$current_project}
            </select>
            <input type="submit" class="shortcut" value="{t}Switch{/t}">
          </td>
          </form>
          {/if}
          <td width="50%" nowrap bgcolor="{$light_color}" class="default">
            <b>{$current_role_name}: {$current_full_name}{if $current_role > $roles.standard_user} [{t}CLOCKED{/t} {if $is_current_user_clocked_in}{t}IN{/t}{else}{t}OUT{/t}{/if}]{/if}</b>
            (<a target="_top" title="{t}modify your account details and preferences{/t}" href="{$rel_url}preferences.php" class="link">{t}Preferences{/t}</a>{if $current_role > $roles.standard_user}
            <a target="_top" title="{t}change your account clocked-in status{/t}" href="javascript:void(null);" onClick="javascript:changeClockStatus();" class="link">{t}Clock{/t} {if $is_current_user_clocked_in}{t}Out{/t}{else}{t}In{/t}{/if}</a>{/if})
          </td>
          <form target="_top" method="get" action="{$rel_url}list.php">
          <td width="5%" nowrap bgcolor="{$light_color}">
            {if $current_role != $roles.customer}
            <label for="search" accesskey="3"></label>
            <input type="text" id="search" name="keywords" value="{t}keywords{/t}" size="15"
              onBlur="javascript:if (this.value == '') this.value = 'keywords';" onFocus="javascript:if (this.value == 'keywords') this.value='';" class="shortcut">
            <input type="submit" value="{t}Search{/t}" class="shortcut">
            {/if}
          </td>
          </form>
          <form onSubmit="javascript:return validateIssueID(this);" target="_top" method="get" action="{$rel_url}view.php">
          <td width="2%" nowrap bgcolor="{$light_color}" align="right">
            <label for="shortcut" accesskey="4"></label>
            <input type="text" id="shortcut" name="id" value="id #"
              onBlur="javascript:if (this.value == '') this.value = 'id #';" onFocus="javascript:if (this.value == 'id #') this.value='';" size="5" class="shortcut">
            {include file="error_icon.tpl.html" field="id"}
            <input type="submit" value="{t}Go{/t}" class="shortcut">
          </td>
          </form>
        </tr>
      </table>
    </td>
  </tr>
</table>

{if $show_line != "no"}
<hr size="1" noshade color="{$cell_color}">
{/if}
