<script type="text/javascript" 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" %>

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

<table width="100%" border="1" cellpadding="0" cellspacing="0" class="moduleShell" role="presentation">
<html:form action="/personMergeWorklistSearch" method="post">
  <%@ include file="/admin/csrfgentoken.jsp" %>
<script type="text/javascript">
// Perform all page initialization
function onLoadInit()
{
    if (personMergeWorklistSearchActionForm.extscHiddenId.value == 'true')
    {
        // Expand the extra search criteria section
        expandOrCollapse(extScBlockId, personMergeWorklistSearchActionForm.extscImage, personMergeWorklistSearchActionForm.extscHiddenId);
    }
    else
    {
        // Update the additional search criteria helper text
        updateAdditionalCriteriaText(additionalFields, extScBlockId, personMergeWorklistSearchActionForm.additionalText, '<c:out value="${additionalTextMessage}"/>')
    }
}
</script>

 <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="25" height="17"/></td>
        <td nowrap style="padding-left: 7"><bean-el:message key="label.person.personMergeSearch"/></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>
            <c:set var="ssnText"><bean-el:message key="label.person.ssn"/></c:set>
            <td width="45%" class="moduleLabel"><fw:label property="ssn" forId="ssnId"><bean-el:message key="label.person.ssn"/>:</fw:label></td>
            <td width="55%" class="moduleValue"><html-el:text title="${ssnText}" property="ssn" styleId="ssnId" styleClass="initfocus" size="20" maxlength="11"  onkeypress="return validateSSN(event)" onblur="formatSSN(event)"/></td>
        </tr>
        <tr>
            <c:set var="vpidText"><bean-el:message key="label.vpid"/></c:set>
            <td class="moduleLabel"><fw:label property="vpid" forId="vpidId"><bean-el:message key="label.vpid"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${vpidText}" property="vpid" styleId="vpidId" size="20" maxlength="29" /></td>
        </tr>
        <tr>
            <c:set var="lastnameText"><bean-el:message key="label.person.lastName"/></c:set>
            <td class="moduleLabel"><fw:label property="familyName" forId="familyNameId"><bean-el:message key="label.person.lastName"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${lastnameText}" property="familyName" styleId="familyNameId" size="20" maxlength="35" /></td>
        </tr>
        <tr>
            <c:set var="firstnameText"><bean-el:message key="label.person.firstName"/></c:set>
            <td class="moduleLabel"><fw:label property="givenName" forId="givenNameId"><bean-el:message key="label.person.firstName"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${firstnameText}" property="givenName" styleId="givenNameId" size="20" maxlength="25" /></td>
        </tr>
        <tr>
            <c:set var="dateOfBirthText"><bean-el:message key="label.person.dob"/></c:set>
            <td class="moduleLabel"><fw:label property="dateOfBirth" forId="dateOfBirthId"><bean-el:message key="label.person.dob"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${dateOfBirthText} ${mmddyyyyText}" property="dateOfBirth" styleId="dateOfBirthId" size="20" maxlength="10" />&nbsp;<bean-el:message key="label.dateFormatmmddyyyy"/></td>
        </tr>

        <%-- Expand/Collapse Section Link --%>
        <tr>
          <td class="moduleLabel">
            <fw:link href="."  onclick="expandOrCollapse(extScBlockId, extscImage, extscHiddenId); updateAdditionalCriteriaText(additionalFields, extScBlockId, additionalText, '${additionalTextMessage}'); return false">
              <html-el:img alt="${expandableSectionCollapsed}" align="center" border="0" styleId="extscImage" src="../images/redArrowRight.gif" /><fw:label property="additionalText" forId="additionalText"><bean-el:message key="label.person.additionalSearchCriteria"/></fw:label>
            </fw:link>&nbsp;
            <html-el:hidden styleId="extscHiddenId" name="personMergeWorklistSearchActionForm" property="extscHiddenId"></html-el:hidden>
          </td>
          <td class="moduleValue"><input id="additionalText" style="display:none; border-width:0; background-color: Transparent" readonly size="30"></td>
        </tr>

        <%-- Extended Search Criteria --%>
        <tr>
          <tr id="extScBlockId" style="display:none">
          <td colspan="2">
            <%-- The display:none style has to be set here to have a value available when the onLoad method is called --%>
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="moduleShellTableBody" role="presentation">
              <tr>
                <c:set var="militaryServiceNumberText"><bean-el:message key="label.person.militaryServiceNumber"/></c:set>
                <td width="45%" class="moduleLabel"><fw:label property="militaryServiceNumber" forId="militaryServiceNumberId"><bean-el:message key="label.person.militaryServiceNumber"/>:</fw:label></td>
                <td width="55%" class="moduleValue"><html-el:text title="${militaryServiceNumberText}" property="militaryServiceNumber" styleId="militaryServiceNumberId" size="20" maxlength="20" /></td>
              </tr>
              <tr>
                <c:set var="claimFolderNumberText"><bean-el:message key="label.person.claimFolderNumber"/></c:set>
                <td class="moduleLabel"><fw:label property="claimFolderNumber" forId="claimFolderNumberId"><bean-el:message key="label.person.claimFolderNumber"/>:</fw:label></td>
                <td class="moduleValue"><html-el:text title="${claimFolderNumberText}" property="claimFolderNumber" styleId="claimFolderNumberId" size="20" maxlength="9" /></td>
              </tr>
              <tr>
                <c:set var="middlenameText"><bean-el:message key="label.person.middleName"/></c:set>
                <td class="moduleLabel"><fw:label property="middleName" forId="middleNameId"><bean-el:message key="label.person.middleName"/>:</fw:label></td>
                <td class="moduleValue"><html-el:text title="${middlenameText}" property="middleName" styleId="middleNameId" size="20" maxlength="25" /></td>
              </tr>
              <tr>
                 <td class="moduleLabel"><bean-el:message key="label.person.birthSex"/>:</td>
                 <td class="moduleValue">
                     <c:set var="genderText"><bean-el:message key="label.person.gender"/></c:set>
                     <c:set var="maleText"><bean-el:message key="label.male"/></c:set>
                     <c:set var="femaleText"><bean-el:message key="label.female"/></c:set>
                     <c:set var="allText"><bean-el:message key="label.all"/></c:set>
                     <html-el:radio title="${genderText} (${maleText})" styleId="gender_M" property="gender" value="M" />
                     	<fw:label property="middleName" forId="gender_M"><bean-el:message key="label.male"/></fw:label>
                     <html-el:radio title="${genderText} (${femaleText})" styleId="gender_F" property="gender" value="F"  />
                     	<fw:label property="middleName" forId="gender_F"><bean-el:message key="label.female"/></fw:label>
                     <html-el:radio title="${genderText} (${allText})" styleId="gender_A" property="gender" value=""  />
                     	<fw:label property="middleName" forId="gender_A"><bean-el:message key="label.all"/></fw:label>
                 </td>
              </tr>
            </table>
          </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"><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="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.cancel"/></html-el:submit></td>
                <td><img alt="" src="../images/buttonEndRight.gif"/></td>
                <td width="45%"><img alt="" src="../images/spacer.gif"/></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
     </td>
    </tr>
   </table>
  </td>
 </tr>

<script type="text/javascript">
// Additional Search Criteria Fields
var additionalFields = new Array(4);
additionalFields[0] = personMergeWorklistSearchActionForm.militaryServiceNumber;
additionalFields[1] = personMergeWorklistSearchActionForm.claimFolderNumber;
additionalFields[2] = personMergeWorklistSearchActionForm.middleName;
additionalFields[3] = personMergeWorklistSearchActionForm.genderAll;
</script>

</html:form>
</table>
