
<%@ 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" %>
<%@ taglib uri="/tags/esr-core" prefix="esrcore" %>

<%--
<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>
--%>
<%-- add a person flag --%>
<%
//boolean isAddAPersonButton = request.getAttribute("addAPersonButton") != null ?
//		((Boolean) request.getAttribute("addAPersonButton")).booleanValue() : false;
%>


    
<c:set var="isAddAPersonButton" value="false"></c:set>
<c:if test="${searchActionForm.addButtonDisabled == 'false'}">
    <c:set var="isAddAPersonButton" value="true"></c:set>
</c:if>

<c:set var="requiredText"><bean-el:message key="label.required"/></c:set>

<table width="100%" border="1" cellpadding="0" cellspacing="0" class="moduleShell" role="presentation">
<html:form action="/searchNew" method="post">
  <%@ include file="/admin/csrfgentoken.jsp" %>

<script type="text/javascript">
// Perform all page initialization
function onLoadInit()
{
	updateCountryFields();
	addEvent(document.forms[0], 'submit', disableAdd);
}
</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.personsearch"/></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">
              <%@ include file="/tiles/common/instructionalText.jsp" %>
            </td>
        </tr>
        <tr>
            <c:set var="ssnText"><bean-el:message key="label.ssn"/></c:set>
            <td width="45%" class="moduleLabel"><fw:label required="true" property="addAPersonSsn" forId="txtAddAPersonSsn"><bean-el:message key="label.ssn"/>:</fw:label></td>
            <td width="55%" class="moduleValue"><html-el:text title="${requiredText}, ${ssnText}" property="addAPersonSsn" styleId="txtAddAPersonSsn" styleClass="initfocus" size="20" maxlength="11" tabindex="1" onkeypress="return validateSSN(event)" onblur="formatSSN(event)" disabled= "${isAddAPersonButton}"/></td>
        </tr>
        <tr>
            <c:set var="lastnameText"><bean-el:message key="label.lastname"/></c:set>
            <td class="moduleLabel"><fw:label required="true" property="familyName" forId="txtFamilyName"><bean-el:message key="label.lastname"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${requiredText}, ${lastnameText}" property="familyName" styleId="txtFamilyName" size="20" onblur="toUpperCase(this)" maxlength="35" tabindex="2" disabled= "${isAddAPersonButton}"/></td>
        </tr>
        <tr>
            <c:set var="firstnameText"><bean-el:message key="label.firstname"/></c:set>
            <td class="moduleLabel"><fw:label property="givenName" forId="txtGivenName"><bean-el:message key="label.firstname"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${firstnameText}" property="givenName" styleId="txtGivenName" size="20" onblur="toUpperCase(this)" maxlength="25" tabindex="3" disabled= "${isAddAPersonButton}"/></td>
        </tr>
        <tr>
            <c:set var="middlenameText"><bean-el:message key="label.middlename"/></c:set>
            <td class="moduleLabel"><fw:label property="middleName" forId="txtMiddleName"><bean-el:message key="label.middlename"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${middlenameText}" property="middleName" styleId="txtMiddleName" size="20" onblur="toUpperCase(this)" maxlength="25" tabindex="4" disabled= "${isAddAPersonButton}"/></td>
        </tr>
          <%-- Per BA, other name is removed
        <tr>
            <c:set var="otherNamesText"><bean-el:message key="label.otherNames"/></c:set>
            <td class="moduleLabel"><fw:label property="otherNames"><bean-el:message key="label.otherNames"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${otherNamesText}" property="otherNames" size="20" maxlength="25" tabindex="5"/></td>
        </tr>
        --%>
        <tr>
            <c:set var="dateOfBirthText"><bean-el:message key="label.dateOfBirth"/></c:set>
            <td class="moduleLabel"><fw:label required="true" property="dateOfBirth" forId="txtDateOfBirth"><bean-el:message key="label.dateOfBirth"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${requiredText}, ${dateOfBirthText} ${mmddyyyyText}" property="dateOfBirth" styleId="txtDateOfBirth" size="20" maxlength="25" tabindex="6" disabled= "${isAddAPersonButton}"/>&nbsp;<bean-el:message key="label.dateFormatmmddyyyy"/></td>
        </tr>
        <%-- Per BRD, MBI, mother maiden name, preferred facility are removed
        <tr>
            <c:set var="multipleBirthText"><bean-el:message key="label.multipleBirth"/></c:set>
            <td class="moduleLabel"><fw:label property="multipleBirth"><bean-el:message key="label.multipleBirth"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${multipleBirthText}" property="multipleBirth" size="20" maxlength="25" tabindex="7"/></td>
        </tr>
        <tr>
            <c:set var="mothersMaidenNameText"><bean-el:message key="label.mothersMaidenName"/></c:set>
            <td class="moduleLabel"><fw:label property="mothersMaidenName"><bean-el:message key="label.mothersMaidenName"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${mothersMaidenNameText}" property="mothersMaidenName" size="20" maxlength="25" tabindex="8"/></td>
        </tr>
		<tr>
		  <td class="moduleLabel"><fw:label required="true" property="preferredFacility"><bean-el:message key="label.preferredFacility"/>:</fw:label></td>
		  <td class="moduleValue">
		    <c:set var="preferredFacilityText"><bean-el:message key="label.preferredFacility"/></c:set>
		    <html-el:select title="${preferredFacilityText}" styleClass="moduleEdit" property="preferredFacility">
		      <html-el:option value="">
		        <bean-el:message key="label.select"/>
		      </html-el:option>
		      <esrcore:options collection="gov.va.med.esr.ui.common.beans.PreferredFacility" property="code" labelProperty="siteNumberAndName"/>
		    </html-el:select>
		  </td>
		</tr>
		--%>
        <tr>
           <td class="moduleLabel"><bean-el:message key="label.required.prefix" />&nbsp;<bean-el:message key="label.birthSex"/>:</td>
           <td class="moduleValue">
               <c:set var="genderText"><bean-el:message key="label.birthSex"/></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="${requiredText}, ${genderText} (${maleText})" styleId="txtGenderM" property="gender" value="M" tabindex="10" disabled= "${isAddAPersonButton}"/><fw:label property="gender" forId="txtGenderM"><bean-el:message key="label.male"/></fw:label>
               <html-el:radio title="${requiredText}, ${genderText} (${femaleText})" styleId="txtGenderF" property="gender" value="F" tabindex="11" disabled= "${isAddAPersonButton}"/><fw:label property="gender" forId="txtGenderF"><bean-el:message key="label.female"/></fw:label>
               <html-el:radio title="${requiredText}, ${genderText} (${allText})" styleId="txtGenderA" property="gender" value="" tabindex="12" disabled= "${isAddAPersonButton}"/><fw:label property="gender" forId="txtGenderA"><bean-el:message key="label.all"/></fw:label>
           </td>
         </tr>

         <tr>
          <td colspan="2" style="padding-top: 10px">
              <%@ include file="addressFormAddPerson.jsp" %>
           </td>
         </tr>
        <%-- Per BRD, place of birth city/state are removed
        <tr>
            <c:set var="placeOfBirthCityText"><bean-el:message key="label.placeOfBirthCity"/></c:set>
            <td class="moduleLabel"><fw:label property="placeOfBirthCity"><bean-el:message key="label.placeOfBirthCity"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${placeOfBirthCityText}" property="placeOfBirthCity" size="20" maxlength="25" tabindex="13"/></td>
        </tr>
        <tr>
            <c:set var="placeOfBirthStateText"><bean-el:message key="label.placeOfBirthCity"/></c:set>
            <td class="moduleLabel"><fw:label property="placeOfBirthState"><bean-el:message key="label.placeOfBirthState"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${placeOfBirthStateText}" property="placeOfBirthState" size="20" maxlength="25" tabindex="14"/></td>
        </tr>
        --%>
        <%--
        <tr>
            <c:set var="addressText"><bean-el:message key="label.address"/></c:set>
            <td class="moduleLabel"><fw:label property="address"><bean-el:message key="label.address"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${addressText}" property="address" size="40" maxlength="35" tabindex="15"/></td>
        </tr>
        <tr>
            <c:set var="cityText"><bean-el:message key="label.city"/></c:set>
            <td class="moduleLabel"><fw:label property="city"><bean-el:message key="label.city"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${cityText}" property="city" size="40" maxlength="15" tabindex="16"/></td>
        </tr>
        <tr>
            <c:set var="stateText"><bean-el:message key="label.state"/></c:set>
            <td class="moduleLabel"><fw:label property="state"><bean-el:message key="label.state"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${stateText}" property="state" size="40" maxlength="40" tabindex="17"/></td>
        </tr>
        <tr>
            <c:set var="zipCodeText"><bean-el:message key="label.zipCode"/></c:set>
            <td class="moduleLabel"><fw:label property="zipCode"><bean-el:message key="label.zipCode"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${zipCodeText}" property="zipCode" tabindex="18"/></td>
        </tr>
        <tr>
            <c:set var="postalCodeText"><bean-el:message key="label.postalCode"/></c:set>
            <td class="moduleLabel"><fw:label property="postalCode"><bean-el:message key="label.postalCode"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${postalCodeText}" property="postalCode" tabindex="19"/></td>
        </tr>
        <tr>
            <c:set var="countryText"><bean-el:message key="label.country"/></c:set>
            <td class="moduleLabel"><fw:label property="country"><bean-el:message key="label.country"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${countryText}" property="country" tabindex="20"/></td>
        </tr>  %>
        <%-- Per BRD, province is removed
        <tr>
            <c:set var="provinceText"><bean-el:message key="label.province"/></c:set>
            <td class="moduleLabel"><fw:label property="province"><bean-el:message key="label.province"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${provinceText}" property="province" tabindex="21"/></td>
        </tr>
        --%>
        <tr>
            <c:set var="homePhoneNumberText"><bean-el:message key="label.homePhoneNumber"/></c:set>
            <td class="moduleLabel"><fw:label property="homePhoneNumber" forId="txtHomePhoneNumber"><bean-el:message key="label.homePhoneNumber"/>:</fw:label></td>
            <td class="moduleValue"><html-el:text title="${homePhoneNumberText}" property="homePhoneNumber" styleId="txtHomePhoneNumber" tabindex="35" disabled= "${isAddAPersonButton}"/></td>
        </tr>

        <%-- Expand/Collapse Section Link --%>

        <%-- 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">

            </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;" tabindex="41" styleClass="buttonText"><bean-el:message key="button.searchAddAPerson"/></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;" tabindex="42" 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;" tabindex="43" styleClass="buttonText"><bean-el:message key="button.cancel"/></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 styleId="addPersonBtn" property="methodName" style="width:50; vertical-align: top;" tabindex="44" styleClass="buttonText" disabled="${not isAddAPersonButton}" ><bean-el:message key="button.add"/></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] = searchActionForm.militaryServiceNumber;
additionalFields[1] = searchActionForm.claimFolderNumber;
additionalFields[2] = searchActionForm.middleName;
additionalFields[3] = searchActionForm.genderAll;
</script>

</html:form>
</table>
