<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tags/esr-core" prefix="esrcore" %>
<%@ page import="org.apache.struts.Globals" %>
<%@ page import="org.apache.struts.action.ActionMessages" %>

<!-- Import the tile parameters to the pageScopr -->
<tiles:importAttribute name="bundle" ignore="true" scope="request" />
<tiles:importAttribute name="title"  ignore="false" scope="request" />
<tiles:importAttribute name="helpIdName" ignore="true" scope="request" />
<tiles:importAttribute name="helpIdName_AddAPerson" ignore="true" scope="request" />
<tiles:importAttribute name="breadCrumb" ignore="true" />
<tiles:importAttribute name="breadCrumbAAP" ignore="true" />
<tiles:importAttribute name="enableMessages" ignore="false" scope="request" />
<tiles:importAttribute name="pageName" ignore="false" scope="request" />
<tiles:importAttribute name="tabName" ignore="false" scope="request"/>
<tiles:importAttribute name="subTabName" ignore="false" scope="request"/>
<tiles:importAttribute name="onLoadMethodName" ignore="true" scope="request"/>

<c:set var="addAPersonHelpContext" value="false"/>

<!-- If resource bundle name is provided get the message from that resource bundle -->
<c:if test="${not empty bundle}">
  <c:set var="pageTitle"><bean-el:message bundle="${bundle}" key="${title}" /></c:set>
</c:if>

<!-- If resource bundle name is not provided get the message from the default resource bundle -->
<c:if test="${empty bundle}" >
  <c:set var="pageTitle"><bean-el:message key="${title}" /></c:set>
</c:if>

<!-- check to see if it is "add a person" to populate the help Id Name -->
<c:if test="${AppData.SelectedPerson != null && AppData.addAPerson != null && AppData.addAPerson == true}">
        <c:set var="addAPersonHelpContext" value="true"/>
</c:if>


<c:set var="screenHelp" scope="page"><bean-el:message key="header.screenHelp" /></c:set>
<c:set var="contextPath" scope="page"><%=request.getContextPath()%></c:set>

<head>
  <title><c:out value="${pageTitle}" /></title>
  <meta http-equiv="x-ua-compatible" content="IE=5">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta http-equiv="pragma" content="no-cache">
  <meta http-equiv="cache-control" content="no-cache">
  <meta http-equiv="expires" content="0">

<!--   <link href="../stylesheets/ESR_structure.css" rel="stylesheet" type="text/css"> -->

  <!-- ULTIMATE DROP DOWN MENU Version 4.5 by Brothercake -->
  <!-- http://www.udm4.com/ -->
  <script type="text/javascript" src="../scripts/udm-custom.js"></script>
  <script type="text/javascript" src="../scripts/udm-control.js"></script>
  <script type="text/javascript" src="../scripts/udm-style.js"></script>
  <noscript>Java Script Disabled on your browser. Please Enable it. </noscript>
</head>

<!-- <script language="JavaScript" src="../scripts/ESR-Script.js"></script>
<script language="JavaScript" src="../scripts/RoboHelp_CSH.js"></script> -->
<!-- <script language="JavaScript" src="scripts/RoboHelp_CSH.js"></script> -->

<%@ include file="commonHeaderIncludes.jsp" %>

<body bgcolor="#E8EDF7" onLoad="<c:out value="${onLoadMethodName}"/>">
<span style='display:none' id='serverSessionTimeout'><%=sessionTimeout%></span>
<% String breadCrumb = (String)pageContext.getAttribute("breadCrumb"); %>
<% String breadCrumbAAP = (String)pageContext.getAttribute("breadCrumbAAP"); %>
<table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation">
  <tiles:insert attribute="header" />
  <tr>
    <td colspan="4" valign="top" class="conWellBkg" align="center">
      <table class="contentPanel" width="98%" border="0" cellspacing="0" cellpadding="0" role="presentation">
        <c:if test="${(not empty breadCrumb) or (not empty helpIdName)}">
        <tr>
          <td class="conSubPanelBread" align="left">
            <c:if test="${not empty breadCrumb}">
            <c:choose>
            	<c:when test="${(not empty breadCrumbAAP) && (addAPersonHelpContext == true)}">
          			<esrcore:breadCrumb crumbs="<%=breadCrumbAAP%>"/>
				</c:when>
				<c:otherwise>
					<esrcore:breadCrumb crumbs="<%=breadCrumb%>"/>
	     		</c:otherwise>
			</c:choose>
            </c:if>
          </td>
          <c:if test="${(not empty helpIdName)}">
                <c:choose>
				<c:when test='${not empty helpIdName_AddAPerson && (addAPersonHelpContext == true)}'>
          			<td nowrap class="conSubPanelBread" align="right" style="padding-left: 0; padding-right: 10; text-align: right">
              		<a id="es-tabs-help"  class= " helpFocus" href="javascript:ESR_ShowHelp(<bean-el:message key="${helpIdName_AddAPerson}"/>)"><html-el:img alt="${screenHelp}" border="0" src="${contextPath}/images/esr_help_small.gif"/></a>
           			</td>
				</c:when>
				<c:otherwise>
					<td nowrap class="conSubPanelBread" align="right" style="padding-left: 0; padding-right: 10; text-align: right">
              		<a id="es-tabs-help"  class= " helpFocus" href="javascript:ESR_ShowHelp(<bean-el:message key="${helpIdName}"/>)"><html-el:img alt="${screenHelp}" border="0" src="${contextPath}/images/esr_help_small.gif"/></a>
            		</td>
	     		</c:otherwise>
				</c:choose>
          </c:if>
        </tr>
        </c:if>

        <tr>
          <td colspan="2" width="100%" class="conPanelBody">
            <tiles:importAttribute name="veteranHeader" ignore="false" scope="request"/>

            <c:if test="${not empty veteranHeader}">
            <tiles:insert attribute="veteranHeader" />
            </c:if>

            <table width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation">
              <tr>
                <td style="padding: 10">
                  <table width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation">
                    <tr>
                      <td>
                        <tiles:insert attribute="mainMenu" />
                      </td>
                    </tr>
                  </table>

                  <table width="100%" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; padding: 0 10 0 10" border="0" cellpadding="0" cellspacing="0" role="presentation">
                    <tiles:importAttribute name="subMenu" ignore="false" scope="request"/>

                    <c:choose>
                    <c:when test="${not empty subMenu}">
                    <%-- Sub-tabs --%>
                    <tr>
                      <td style="padding: 10">
                        <table width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation">
                          <tr>
                            <td>
                              <tiles:insert attribute="subMenu" />
                            </td>
                          </tr>
                        </table>

                        <table width="100%" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; padding: 0 10 0 10" border="0" cellpadding="0" cellspacing="0" role="presentation">
                          <tr height="10"><td></td></tr> <!-- row spacing -->

                          <tr>
                            <td align="left" valign="top">
                              <%@ include file="/tiles/common/asyncMessage.jsp" %>
                            </td>
                          </tr>

                          <c:if test="${(empty enableMessages) or enableMessages == 'true'}">
                          <tr>
                            <td align="left" valign="top">
                              <%@ include file="/tiles/common/errorMessage.jsp" %>
                            </td>
                          </tr>

                          <tr>
                            <td align="left" valign="top">
                              <%@ include file="/tiles/common/informationMessage.jsp" %>
                            </td>
                          </tr>
                          </c:if>

                          <tr>
                            <td>
                              <a name="ContentArea" id = "ContentArea"/>
                              <tiles:insert attribute="content" />
                            </td>
                          </tr>

                          <tr height="10"><td></td></tr> <!-- row spacing -->
                        </table>
                      </td>
                    </tr>

                    </c:when>
                    <c:otherwise>
                    <%-- No sub-tabs --%>
                    <tr height="10"><td></td></tr> <!-- row spacing -->
                    <tr>
                      <td align="left" valign="top">
                        <%@ include file="/tiles/common/asyncMessage.jsp" %>
                      </td>
                    </tr>

                    <c:if test="${(empty enableMessages) or enableMessages == 'true'}">
                    <tr>
                      <td align="left" valign="top">
                        <%@ include file="/tiles/common/errorMessage.jsp" %>
                      </td>
                    </tr>

                    <tr>
                      <td align="left" valign="top">
                        <%@ include file="/tiles/common/informationMessage.jsp" %>
                      </td>
                    </tr>
                    </c:if>

                    <tr>
                      <td>
                        <a name="ContentArea" id = "ContentArea"/>
                        <tiles:insert attribute="content" />
                      </td>
                    </tr>

                    <tr height="10"><td></td></tr> <!-- row spacing -->
                    </c:otherwise>
                    </c:choose>

                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <tiles:insert attribute="footer" />
  </tr>
</table>
<%@ include file="/tiles/common/modalDialog.jsp" %>
<script type="text/javascript" language="javascript">
	pageSetup();
	getAsyncMessages();
</script>

</body>
