<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="/tags/esr-core" prefix="esrcore" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tags/fw" prefix="fw" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>

<%@ page import='gov.va.med.esr.ui.common.util.JspUtils' %>
<%@ page import='gov.va.med.esr.common.model.lookup.VAFacility' %>
<%@ taglib uri="/tags/authz" prefix="auth" %>
<%@ page import='gov.va.med.esr.common.model.lookup.Capability' %>
<%@ page import='gov.va.med.esr.common.model.lookup.PHDocumentType' %>

<c:set var="expandableSectionCollapsed" scope="page"><bean-el:message key="label.expandableSectionCollapsed"/></c:set>

  <!-- VOA Attachments  -->
           <c:choose>
          <c:when test="${eligibilityForm.veteranIndicator == 'y'}">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="moduleShellTableBody" role="presentation">
            <tr>
                <td width="8%"> </td>
                <td width="84%">
                    <table width="100%" border="1" bordercolor="C64044" cellspacing="0" cellpadding="0" class="moduleShellTableBody" role="presentation">
                        <tr>
                            <td>
                               <table width="100%" border="0" cellspacing="0" cellpadding="0" class="moduleShellTableBody" role="presentation">
                                <tr>
                                    <td width="44%" class="moduleLabel">
                                       <fw:link href="." onclick="expandOrCollapse(voaBlock, voaImage, voaHiddenId); return false">
                                            <html-el:img alt="${expandableSectionCollapsed}" align="center" border="0" styleId="voaImage" src="../images/redArrowRight.gif" /><bean-el:message key="label.voaFileAttachment" />                                   
                                       </fw:link>&nbsp;
                                       <html-el:hidden name="eligibilityForm" styleId="voaHiddenId" property="voaHiddenId"/>
                                   </td>
                                   <td width="56%">&nbsp;  </td>
                               </tr>
                               <tr>
                                <td colspan="2"> 
                                    <div id=voaBlock class="expandCollapseBody">
                                    <c:set var="voaFileAttachment"><bean-el:message key="label.voaFileAttachment"/></c:set>
                                    <html-el:hidden name="eligibilityForm" property="activeVOARowID"/>
                                    <table width="100%" border="0"  cellspacing="0" cellpadding="0" class="moduleShellTableBody">
                                        <caption>VOA File Attachment</caption>
                                        <tr>
                                            <th scope = "col" width="18%">FileName </th>
                                            <th scope = "col" width="8%"> FileType </th>
                                            <th scope = "col" width="10%"> DocType </th>
                                            <th scope = "col" width="18%"> Updated </th>
                                            <th scope = "col" width="15%"> By </th>
                                        </tr>
                                        <logic:notEmpty name="eligibilityForm" property="voaAttachments">
                                            <logic:iterate id="voaAttachment"  name="eligibilityForm" property="voaAttachments" indexId="indexId">
                                            <c:set var="status" value="${indexId}" />
                                            <tr>
                                                <td width="18%" title="<c:out value="${voaAttachment.voaAttachmentFileName} ${status}"/>" class="moduleValue" nowrap>
                                                    <fw:link target="_blank" action="/gotoEligibilityEdit.do?methodName=openDocument&amp;documentName=${voaAttachment.voaAttachmentFileName}" >    
                                                        <c:out value="${voaAttachment.voaAttachmentFileName}" />
                                                    </fw:link>
                                                </td>
                                                <td width="8%" title="<c:out value="${voaAttachment.voaAttachmentFileType} ${status}"/>" class="moduleValue" nowrap>
                                                    <c:out value="${voaAttachment.voaAttachmentFileType}" />
                                                </td>
                                                <td width="10%" title="<c:out value="${voaAttachment.voaAttachmentDocType} ${status}"/>" class="moduleValue" nowrap>
                                                    <c:out value="${voaAttachment.voaAttachmentDocType}" />
                                                </td>

                                                <td width="18%" title="<c:out value="${voaAttachment.voaAttachmentUpdated} ${status}"/>" class="moduleValue" nowrap>
                                                    <c:out value="${voaAttachment.voaAttachmentUpdated}" />
                                                </td>
                                                <td width="15%" title="<c:out value="${voaAttachment.voaAttachmentUpdatedBy} ${status}"/>" class="moduleValue" nowrap>
                                                    <c:out value="${voaAttachment.voaAttachmentUpdatedBy}" />
                                                </td>
                                            </tr>
                                            </logic:iterate>
                                        </logic:notEmpty>
                                        <logic:empty name="eligibilityForm" property="voaAttachments">
                                            <tr>
                                                <td width="18%" class="moduleValue">No documents on file</td>
                                                <td width="8%"  class="moduleValue"></td>
                                                <td width="10%" class="moduleValue"></td>
                                                <td width="18%" class="moduleValue"></td>
                                                <td width="15%" class="moduleValue"></td>
                                           </tr>
                                        </logic:empty>
                                    </table>
                                </div>
                                </td>
                                </tr>
                                                <!-- Update Button >
                                                <tr  align="center">
                                                    <td> <br /></td>
                                                </tr>
                                                <tr  align="center">
                                                    <td   colspan="7">
                                                    <table width="30%" border="0" cellspacing="0" cellpadding="0" role="presentation">
                                                        <tr>
                                                            <td><img alt=""  src="../images/buttonEndLeft.gif"/></td>
                                                            <td>
                                                            <html-el:submit property="methodName" style="width:95; vertical-align: top;" styleClass="buttonText">
                                                            <bean-el:message key="button.UPDATE_Attributes"/>
                                                            </html-el:submit></td>
                                                            <td><img alt=""  src="../images/buttonEndRight.gif" ></td>
                                                            <td width="100%"><img alt=""  src="../images/spacer.gif" width="1" height="1"/></td>
                                                        </tr>
                                                 </table>
                                            </td>
                                            <tr>-->
                                <!-- Update Button -->
                              </table>
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="8%"> </td>
            </tr>
            </table>
    </c:when>
          <c:otherwise>
          <html-el:hidden name="eligibilityForm"  styleId="voaHiddenId" property="voaHiddenId" value="false"></html-el:hidden>
          </c:otherwise>
    </c:choose>