<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tags/authz" prefix="auth" %>
<%@ page import='gov.va.med.esr.common.model.lookup.Capability' %>

<%-- Default to no permissions --%>
<c:set var="tabBatch" value="true"/>
<c:set var="tabPerson" value="true"/>

<%-- Alt Text --%>
<c:set var="irsBatchText" scope="page"><bean-el:message key="label.irsBatch"/>&nbsp;<bean-el:message key="label.tab"/></c:set>
<c:set var="irsPersonText" scope="page"><bean-el:message key="label.irsPerson"/>&nbsp;<bean-el:message key="label.tab"/></c:set>
<c:set var="selectedTabText" scope="page"><bean-el:message key="label.selectedTab"/>,&nbsp;</c:set>

<%-- Re-enable permissions if the user has them --%>
<auth:authorize ifAnyGranted="<%=Capability.ADMINISTRATOR.getCode()%>">
  <c:set var="tabBatch" value ="true"/>
</auth:authorize>
<auth:authorize ifAnyGranted="<%=Capability.ADMINISTRATOR.getCode()%>">
  <c:set var="tabPerson" value ="true"/>
</auth:authorize>

<%-- Set color and images for each tab based on it being selected or not. --%>
<c:choose>
<c:when test="${subTabName == 'irsRejectBatch'}">
  <c:set var="irsBatchImage" scope="page">on</c:set>
  <c:set var="irsBatchTextText" scope="page" value="${selectedTabText}${irsBatchText}"/>
</c:when>
<c:otherwise>
  <c:set var="irsBatchImage" scope="page">off</c:set>
</c:otherwise>
</c:choose>

<c:choose>
<c:when test="${subTabName == 'irsRejectPerson'}">
  <c:set var="irsPersonImage" scope="page">on</c:set>
  <c:set var="irsPersonText" scope="page" value="${selectedTabText}${irsPersonText}"/>
</c:when>
<c:otherwise>
  <c:set var="irsPersonImage" scope="page">off</c:set>
</c:otherwise>
</c:choose>

<table cellSpacing="0" cellPadding="0" border="0">
  <tr valign="bottom">
	<c:if test="${tabPerson == true}"><td><html-el:link styleId="es-tabs-admin-irs-person" styleClass="tabLink" forward="irsRejectPerson.display"><html-el:img alt="${irsPersonText}" src="/esr/images/tabs_rejectperson_${irsPersonImage}.gif" border="0"/></html-el:link></td></c:if>
    <c:if test="${tabBatch == true}"><td><html-el:link styleId="es-tabs-admin-irs-batch" styleClass="tabLink" forward="irsRejectBatch.display"><html-el:img alt="${irsBatchText}" src="/esr/images/tabs_rejectbatch_${irsBatchImage}.gif" border="0"/></html-el:link></td></c:if>

    <td width="100%" style="border-bottom: 1px solid #000000;"><img alt=""  src="../images/spacer.gif" height="1" width="100%"/></td>
  </tr>
</table>
