<script language="JavaScript" src="../scripts/ESR-Script.js"></script>
<%@ taglib uri="/tags/fw" prefix="fw" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import='gov.va.med.fw.service.pagination.SearchQueryInfo' %>

<c:set var="countryEditable" scope="page" value="true"/>
<c:set var="nullCountryAllowed" scope="page" value="true"/>
<c:set var="zipCodeLookup" scope="page" value="true"/>
<c:set var="updateContacts" scope="page"><bean-el:message key="button.search"/></c:set>
<c:set var="actionSearch"><%= SearchQueryInfo.ACTION_SEARCH %></c:set>
<c:set var="mmddyyyyText" scope="page"><bean-el:message key="label.mmddyyyy"/></c:set>

<script>
// Perform all page initialization
function onLoadInit()
{
    updateCountryFields();
}
</script>

<table width="100%" border="1" cellpadding="0" cellspacing="0" class="moduleShell" role="presentation">
<html-el:form action="/undeliverableMailSearch" method="post">
  <%@ include file="/admin/csrfgentoken.jsp" %>
 <tr>
  <td>
   <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTable" role="presentation">
    <tr>
     <td>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableHead" role="presentation">
       <tr>
        <td class="moduleBlueBox"><img alt=""  src="../images/spacer.gif" width="28" height="23"/></td>
        <td nowrap style="padding-left: 7"><bean-el:message key="label.comms.undeliverableMailSearch"/></td>
        <td width="100%"><img alt=""  src="../images/spacer.gif"></td>
       </tr>
      </table>
     </td>
    </tr>

    <tr>
     <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="moduleShellTableBody" role="presentation">

        <%-- Primary search Criteria --%>
        <tr>
            <td colspan="2">&nbsp;</td>
        </tr>
        <tr>
            <td width="45%" class="moduleLabel"><fw:label property="ssn" forId="txtSSN"><bean-el:message key="label.comms.ssn"/>:</fw:label></td>
            <c:set var="ssnText"><bean-el:message key="label.comms.ssn"/></c:set>
            <td width="55%" class="moduleValue"><html-el:text title="${ssnText}" property="SSN" styleClass="moduleEdit initfocus" styleId="txtSSN" size="20" maxlength="11" onkeypress="return validateSSN(event)" onblur="formatSSN(event)"/></td>
        </tr>
        <tr>
            <td width="45%" class="moduleLabel"><fw:label property="barcode" forId="txtBarcode"><bean-el:message key="label.comms.barcode"/>:</fw:label></td>
            <c:set var="barcodeText"><bean-el:message key="label.comms.barcode"/></c:set>
            <td width="55%" class="moduleValue"><html-el:text title="${barcodeText}" property="barcode" styleClass="moduleEdit" styleId="txtBarcode" size="20" maxlength="25"/></td>
        </tr>
        <tr>
            <td class="moduleLabel"><fw:label property="familyName" forId="txtFamilyName"><bean-el:message key="label.comms.lastName"/>:</fw:label></td>
            <c:set var="lastNameText"><bean-el:message key="label.comms.lastName"/></c:set>
            <td class="moduleValue"><html-el:text title="${lastNameText}" property="familyName" styleClass="moduleEdit" styleId="txtFamilyName" size="20" maxlength="40"/></td>
        </tr>
        <tr>
            <td class="moduleLabel"><fw:label property="givenName" forId="txtGivenName"><bean-el:message key="label.comms.firstName"/>:</fw:label></td>
            <c:set var="firstNameText"><bean-el:message key="label.comms.firstName"/></c:set>
            <td class="moduleValue"><html-el:text title="${firstNameText}" property="givenName" styleClass="moduleEdit" styleId="txtGivenName" size="20" maxlength="30"/></td>
        </tr>
        <tr>
            <td class="moduleLabel"><fw:label property="middleName" forId="txtMiddleName"><bean-el:message key="label.comms.middleName"/>:</fw:label></td>
            <c:set var="middleNameText"><bean-el:message key="label.comms.middleName"/></c:set>
            <td class="moduleValue"><html-el:text title="${middleNameText}" property="middleName" styleClass="moduleEdit" styleId="txtMiddleName" size="20" maxlength="30"/></td>
        </tr>
        <tr>
            <td colspan="2">
                <%@ include file="/tiles/common/addressForm.jsp" %>
            </td>
        </tr>
        <tr>
          <td class="moduleLabel"><fw:label property="formNumber" forId="txtFormNumber"><bean-el:message key="label.comms.formNumber"/>:</fw:label></td>
          <td class="moduleValue">
            <c:set var="formNumberText"><bean-el:message key="label.comms.formNumber"/></c:set>
            <html-el:select title="${formNumberText}" styleClass="moduleEdit" styleId="txtFormNumber" property="formNumber" >
              <html-el:option value=""><bean-el:message key="label.select" /></html-el:option>
              <esrcore:options collection="gov.va.med.esr.common.model.lookup.ComLetterTemplateType" property="code" labelProperty="code"/>
            </html-el:select>
          </td>
        </tr>
        <tr>
            <td class="moduleLabel"><fw:label property="caseNumber" forId="txtCaseNumber"><bean-el:message key="label.comms.caseNumber"/>:</fw:label></td>
            <c:set var="caseNumberText"><bean-el:message key="label.comms.caseNumber"/></c:set>
            <td class="moduleValue"><html-el:text title="${caseNumberText}" property="caseNumber" styleClass="moduleEdit" styleId="txtCaseNumber" size="20" maxlength="30"/></td>
        </tr>
        <tr>
            <td class="moduleLabel"><fw:label property="dateMailed" forId="txtDateMailed"><bean-el:message key="label.comms.dateMailed"/>:</fw:label></td>
            <c:set var="dateMailedText"><bean-el:message key="label.comms.dateMailed"/>&nbsp;<c:out value="${mmddyyyyText}" /></c:set>
            <td class="moduleValue"><html-el:text title="${dateMailedText}" property="dateMailed" styleClass="moduleEdit" styleId="txtDateMailed" size="20" maxlength="10"/>&nbsp;<bean-el:message key="label.mmddyyyy"/></td>
        </tr>

        <%-- Button Row --%>
        <tr>
          <td colspan="2" height="50">
            <table width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation">
              <tr>
                <td width="45%"><img alt=""  src="../images/spacer.gif"/></td>
                <td><img alt=""  src="../images/buttonEndLeft.gif"/></td>
                <td><html-el:submit property="methodName" style="width:50; vertical-align: top;" styleClass="buttonText" onclick="javascript: setFormValue(this.form, 'callerKey', '${actionSearch}');"><bean-el:message key="button.search"/></html-el:submit></td>
                <td><img alt=""  src="../images/buttonEndRight.gif"/></td>
                <td width="1%"><img alt=""  src="../images/spacer.gif"/></td>
                <td><img alt=""  src="../images/buttonEndLeft.gif"/></td>
                <td><html-el:submit property="methodName" style="width:50; vertical-align: top;" styleClass="buttonText"><bean-el:message key="button.clear"/></html-el:submit></td>
                <td><img alt=""  src="../images/buttonEndRight.gif"/></td>
                <td width="45%"><img alt=""  src="../images/spacer.gif"/></td>
              </tr>
              <input type="hidden" name="callerKey" value="">
            </table>
          </td>
        </tr>
      </table>
     </td>
    </tr>
   </table>
  </td>
 </tr>

</html-el:form>
</table>
