<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/enrgise-html.tld" prefix="enrgise" %>

<html:html>
<html:base />
<head>
  <TITLE><bean:message  key="hrm.title" /></TITLE>
  <jsp:include page="GenIncludes.jsp" flush="true" />
  <meta http-equiv=pragma content=no-cache>
</head>


<BODY scroll="auto" onkeydown="hotKeys(event);";>

<html:form name="HrmPersonalDtlsForm" action="HrmPersonalDtlsLngBaseAction" type="wenrgise.hrms.webtier.form.HrmEmpPersDtlForm">
<bean:define id="ParentForm" name="HrmPersonalDtlsForm" toScope="request" />
<jsp:include page="GenIconMenu.jsp" flush="true" />


<!--Top Most Blue Bar-->
<TABLE cellSpacing=0 bgColor=#bdd0ef>
    <tr>
        <TD  colSpan=12 class=mainHeader height=10><bean:message key="hrm.HrmEmpPersonalDetails.mainHeader" /></TD>
    </TR>
</TABLE>
<!--//  Display Errors -->
<enrgise:errors/>
<logic:messagesPresent message="true">
<Table>
    <html:messages id="message" message="true">
    <TR><TD>
      <bean:write name="message"/>
    </TD></TR>
    </html:messages>      
</Table>
</logic:messagesPresent>
<!--//  Display Errors --> 

<TABLE cellSpacing=0 cellPadding=0 border=0 >
    <TR>
        <TD>
        
        <TABLE cellSpacing=0 cellPadding=0 >
        <!--Application Header Starts -->
              <TR>
                    <TD class=subHeader colspan=6><bean:message key="hrm.HrmEmpPersonalDetails.subHeader1" /></TD>
              </TR>
              <TR>
                    <TD colspan=6 bgColor=#4682b4><enrgise:img name="HrmPersonalDtlsForm" property="photo" height="1" src="../includes/images/photo.gif" width="1" border="0" /></TD>
              </TR>
              <tr>
                  <td class="labelText"><bean:message key="hrm.HrmEmpPersonalDetails.employeeNo" /></td>
                  <td><html:text  property="employeeNo" alt="N" titleKey="hrm.HrmEmpPersonalDetails.employeeNo" maxlength="10" size="23" styleClass="required" onchange="doChangeHeader();" readonly="true" /><enrgise:img height="16" align="center" src="../includes/images/lov.jpg" name="HrmPersonalDtlsForm"  property="butEmployeeNo" onclick="return ShowEmployeeNo()" /></td>              
                  <td class="labelText"><bean:message key="hrm.HrmEmpPersonalDetails.draftFlag" /></td>
                  <td><enrgise:checkbox property="draftFlag"  name="HrmPersonalDtlsForm"  styleClass="optional" disabledClass="locked" /></td>
                  
              </tr>
             <tr>
                  <td class="labelText"></td>
                  <td></td>
                  <td class="labelText"></td>
                  <td></td>
                  <td colspan=2> </td>
              </tr>
              <tr>
                  <td class="labelText"><bean:message key="hrm.HrmEmpPersonalDetails.employeeName" /></td>
                  <td colspan="3"><enrgise:text  property="firstName" alt="ALPHA" titleKey="hrm.HrmEmpPersonalDetails.firstName" maxlength="100" size="37" styleClass="required" disabledClass="required" onchange="doChangeHeader();" onkeypress="isName(event)"  /><enrgise:text  property="middleName" alt="ALPHA" titleKey="hrm.HrmEmpPersonalDetails.middleName" maxlength="100" size="37" styleClass="optional" disabledClass="optional" onchange="doChangeHeader();" onkeypress="isName(event)" />
                  <enrgise:text  property="lastName" alt="ALPHA" titleKey="hrm.HrmEmpPersonalDetails.lastName" maxlength="100" size="37" styleClass="required" disabledClass="required" onchange="doChangeHeader();"  onkeypress="isName(event)"  /></td> 
                  <td> </td>                
              </tr>
              <tr height="30">
                    <td colspan="6"></td>
             </tr>
         </table>
      
  
      <table cellspacing=0 cellpadding=0 border=0>
      <!-- Detail Information Row starts -->
      <TR>
       <TD colspan=6>
        <!-- Personal Details Table Starts -->
         <TABLE cellSpacing=0 cellPadding=0 >
           <tr>
                <enrgise:tab name="HrmEmpPersDtlsForm" property="tabPersDtls" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" rows="2" onclick= "doGetTab('HrmEmpPersDtls','HrmEmpPersLngGetTabAction.do')" ><bean:message key="hrm.HrmEmpPersonalDetails.personalDetails" /></enrgise:tab>
                <enrgise:tab name="HrmEmpPersDtlsForm" property="tabAddDtls" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" rows="2" onclick= "doGetTab('HrmEmpPersAddDtls','HrmEmpPersLngGetTabAction.do')"  ><bean:message key="hrm.HrmEmpPersonalDetails.address" /></enrgise:tab>
                <enrgise:tab name="HrmEmpPersDtlsForm" property="tabJoiningInfo" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" rows="2" onclick= "doGetTab('HrmEmpPersJoinInf','HrmEmpPersLngGetTabAction.do')"><bean:message key="hrm.HrmEmpPersonalDetails.joiningInfo" /></enrgise:tab>
                <enrgise:tab name="HrmEmpPersDtlsForm" property="tabEmpHist" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" rows="2" onclick= "doGetTab('HrmEmpPersEmpHst','HrmEmpPersLngGetTabAction.do')"><bean:message key="hrm.HrmEmpPersonalDetails.employeeHistory" /></enrgise:tab>
                <enrgise:tab name="HrmEmpPersDtlsForm" property="tabPriorExp" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" rows="2" onclick= "doGetTab('HrmEmpPersPriorExp','HrmEmpPersLngGetTabAction.do')"><bean:message key="hrm.HrmEmpPersonalDetails.priorExperience" /></enrgise:tab>
                <enrgise:tab name="HrmEmpPersDtlsForm" property="tabEduDtls" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" rows="2" onclick= "doGetTab('HrmEmpPersEduDtls','HrmEmpPersLngGetTabAction.do')"><bean:message key="hrm.HrmEmpPersonalDetails.educationDetails" /></enrgise:tab>
                <enrgise:tab name="HrmEmpPersDtlsForm" property="tabPFDtls" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif"      rows="2" onclick= "doGetTab('HrmEmpPersPFDtls','HrmEmpPersLngGetTabAction.do')"  ><bean:message key="hrm.HrmEmpPersonalDetails.pFDetails" /></enrgise:tab>
                <enrgise:tab name="HrmEmpPersDtlsForm" property="tabTrngDtls" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" rows="2" onclick= "doGetTab('HrmEmpPersTrngDtls','HrmEmpPersLngGetTabAction.do')" ><bean:message key="hrm.HrmEmpPersonalDetails.trainingDetails" /></enrgise:tab>
                <enrgise:tab name="HrmEmpPersDtlsForm" property="tabAwardDtls" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" rows="2" onclick= "doGetTab('HrmEmpPersAward','HrmEmpPersLngGetTabAction.do')"  ><bean:message key="hrm.HrmEmpPersonalDetails.awardDtls" /></enrgise:tab>
                <enrgise:tab name="HrmEmpPersDtlsForm" property="tabInsDtls" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" rows="2" onclick= "doGetTab('HrmEmpPersIns','HrmEmpPersLngGetTabAction.do')"  ><bean:message key="hrm.HrmEmpPersonalDetails.insDtls" /></enrgise:tab>
                <enrgise:tab name="HrmEmpPersDtlsForm" property="tabHealth" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" rows="2" onclick= "doGetTab('HrmEmpPersHealth','HrmEmpPersLngGetTabAction.do')"  ><bean:message key="hrm.HrmEmpPersonalDetails.health" /></enrgise:tab>
                <enrgise:tab name="HrmEmpPersDtlsForm" property="tabLng" styleClass="actTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" rows="2" ><bean:message key="hrm.HrmEmpPersonalDetails.languageDtls" /></enrgise:tab>
                <enrgise:tab name="HrmEmpPersDtlsForm" property="tabRef" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" rows="2" onclick= "doGetTab('HrmEmpPersRef','HrmEmpPersLngGetTabAction.do')"  ><bean:message key="hrm.HrmEmpPersonalDetails.refDtls" /></enrgise:tab>
                
                
                <td width="45%"> </td>
             
     
          </tr>                  
          <TR >
         
 <!-- Detail table Container starts -->
              <TD colspan=37>
                <TABLE cellSpacing=0 cellPadding=0 border=0>
                  <TBODY>
                   <TR>
                     <TD >
                       <DIV id=divDtlTable style="height:270px" >
  			<!-- Detail table starts -->
                        <TABLE cellSpacing=0 cellPadding=0>
                         <TBODY>
                          <tr>
                            <TD class=tableHeader width="1%"><html:checkbox property="selectAll" onclick="toggleCheckBox('checked')" /></TD>
                              <TD class=tableHeader ><bean:message key="hrm.HrmEmpPersonalDetailsLng.lngName" /></td>
                              <TD class=tableHeader ><bean:message  key="hrm.HrmEmpPersonalDetailsLng.lngSpeak" /></td>
                              <TD class=tableHeader ><bean:message  key="hrm.HrmEmpPersonalDetailsLng.lngRead" /></td>
                              <TD class=tableHeader ><bean:message  key="hrm.HrmEmpPersonalDetailsLng.lngWrite" /></td>
                         </tr>
                          <logic:iterate id="HrmPersLngDtls" name="HrmPersonalDtlsForm" property="arrEmpPersDtlLng" type="wenrgise.hrms.bean.HrmEmpPersLngDtlBean" indexId="idx" >
                              <logic:notEqual name="HrmPersLngDtls" property="status" value="D" >
                             <tr class='<bean:write name="HrmPersonalDtlsForm" property="listRowClass"/>'  >
                                <td >
                                <html:hidden property="status"  name="HrmPersLngDtls" />
                                <html:hidden property="detailId"  name="HrmPersLngDtls"  />
                                <html:checkbox property="checked"  name="HrmPersonalDtlsForm" alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);" />
                                <html:hidden property="itemChecked" name="HrmPersLngDtls" />
                                </td>
                                <!--<td class="labelText"><bean:message key="hrm.HrmEmpPersonalDetailsLng.lngName" /></td> -->
                                <td><html:text  property="lngName" alt="A" name="HrmPersLngDtls"   titleKey="hrm.HrmEmpPersonalDetailsLng.lngName" size="80" styleClass="required" onchange="doChangeDetail(0)" readonly="true" /><enrgise:img height="16" align="center" src="../includes/images/lov.jpg" name="HrmPersonalDtlsForm" property="butLngName" onclick="return ShowMotherTongue(0)" /></td>
                                <!--<td class="labelText"><bean:message key="hrm.HrmEmpPersonalDetailsLng.lngSpeak" /></td> -->
                                <td><enrgise:checkbox  property="lngSpeak" alt="A" formName="HrmPersonalDtlsForm" name="HrmPersLngDtls"  titleKey="hrm.HrmEmpPersonalDetailsLng.lngSpeak" styleClass="optional" disabledClass="locked" onclick="doCheckInitialise(this,0);" onchange="doChangeDetail(0)"/><html:hidden property="lngSpeak" name="HrmPersLngDtls" /></td>
                                <!--<td class="labelText"><bean:message key="hrm.HrmEmpPersonalDetailsLng.lngRead" /></td> -->
                                <td><enrgise:checkbox  property="lngRead" alt="A" formName="HrmPersonalDtlsForm" name="HrmPersLngDtls"  titleKey="hrm.HrmEmpPersonalDetailsLng.lngRead" styleClass="optional" disabledClass="locked" onclick="doCheckInitialise(this,0);" onchange="doChangeDetail(0)"/><html:hidden property="lngRead" name="HrmPersLngDtls" /></td>
                                <!-- <td class="labelText"><bean:message key="hrm.HrmEmpPersonalDetailsLng.lngWrite" /></td> -->
                                <td><enrgise:checkbox  property="lngWrite" alt="A" formName="HrmPersonalDtlsForm" name="HrmPersLngDtls"  titleKey="hrm.HrmEmpPersonalDetailsLng.lngWrite" styleClass="optional" disabledClass="locked" onclick="doCheckInitialise(this,0);" onchange="doChangeDetail(0)"/><html:hidden property="lngWrite" name="HrmPersLngDtls" /></td>
                                  
                            </tr>
                            </logic:notEqual>
                             <logic:equal name="HrmPersLngDtls" property="status" value="D"  >
                              <tr class='<bean:write name="HrmPersonalDtlsForm" property="listRowClass"/>'  >
                                <td >
                                <html:hidden property="status"  name="HrmPersLngDtls" />
                                <html:hidden property="detailId"  name="HrmPersLngDtls"  />
                                <html:checkbox property="checked"  name="HrmPersonalDtlsForm"  value="check" disabled="true" alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);" />
                                <html:hidden property="itemChecked" name="HrmPersLngDtls" />
                                </td>
                                  <!--<td class="labelText"><bean:message key="hrm.HrmEmpPersonalDetailsLng.lngName" /></td> -->
                                <td><html:text  property="lngName" alt="A" name="HrmPersLngDtls"   titleKey="hrm.HrmEmpPersonalDetailsLng.lngName" size="40" styleClass="required" onchange="doChangeDetail(0)" readonly="true" /><enrgise:img height="16" align="center" src="../includes/images/lov.jpg" name="HrmPersonalDtlsForm" property="butLngName" onclick="return ShowMotherTongue(0)" /></td>
                                <!--<td class="labelText"><bean:message key="hrm.HrmEmpPersonalDetailsLng.lngSpeak" /></td> -->
                                <td><enrgise:checkbox  property="lngSpeak" alt="A" formName="HrmPersonalDtlsForm" name="HrmPersLngDtls"  titleKey="hrm.HrmEmpPersonalDetailsLng.lngSpeak" styleClass="optional" disabledClass="locked" onclick="doCheckInitialise(this,0);" onchange="doChangeDetail(0)"/><html:hidden property="lngSpeak" name="HrmPersLngDtls" /></td>
                                <!--<td class="labelText"><bean:message key="hrm.HrmEmpPersonalDetailsLng.lngRead" /></td> -->
                                <td><enrgise:checkbox  property="lngRead" alt="A" formName="HrmPersonalDtlsForm" name="HrmPersLngDtls"  titleKey="hrm.HrmEmpPersonalDetailsLng.lngRead" styleClass="optional" disabledClass="locked" onclick="doCheckInitialise(this,0);" onchange="doChangeDetail(0)"/><html:hidden property="lngRead" name="HrmPersLngDtls" /></td>
                                <!-- <td class="labelText"><bean:message key="hrm.HrmEmpPersonalDetailsLng.lngWrite" /></td> -->
                                <td><enrgise:checkbox  property="lngWrite" alt="A" formName="HrmPersonalDtlsForm" name="HrmPersLngDtls"  titleKey="hrm.HrmEmpPersonalDetailsLng.lngWrite" styleClass="optional" disabledClass="locked" onclick="doCheckInitialise(this,0);" onchange="doChangeDetail(0)"/><html:hidden property="lngWrite" name="HrmPersLngDtls" /></td>
                                </tr>
                            </logic:equal>
                        </logic:iterate>
         
           <!--Insert Logic Iterate Here-->                                                      
                     </TBODY>
                    </TABLE>
                  </DIV>
                </TD>
              </TR>                     
  
 <!-- Get details starts -->
  
                          <TABLE border=0>
                        <tbody>
                         <tr>
                          <td colspan=11>	
                              <jsp:include page="GenDetailMenu.jsp" />
                             
                          </TD>
                      </tr>
                      
                        </tbody>
                   </TABLE>
             
                      </TBODY>
                </TABLE>
              </td>
            </tr>



        </TABLE>
     </td>
	 </tr>
 

<!-- Bottom Blue Bar -->
       <TR>
            <td>
              <TABLE  cellspacing="0" cellpadding="0" border=0>
                    <tr >
                        <td width=45% align=center bgColor=#4682b4></td>
                        <td  bgColor=#4682b4></td>
                        <td bgColor=#4682b4><enrgise:button name="HrmPersonalDtlsForm" property="butDraftSave"  onclick="return doDraftSave();"  ><u>D</u>raft<u></u> Save</enrgise:button></td>
                        <td bgColor=#4682b4></td>
                        <td align=right bgColor=#4682b4><img src="../includes/images/man.jpg"></td>
                   </TR>
                </table>
            </td>
          </tr>
 
<!-- Container Table Ending Columns Starts-->
  </TD>
    
</TR>
</TBODY>
</TABLE>

<!-- Container Table Ends -->
<!-- These four hidden fields must be present in pages where there is a detail part -->
<!-- Common Hidden Variables-->
<html:hidden name="HrmPersonalDtlsForm" property="screenName" value="HrmEmpPersLng" />
<html:hidden name="HrmPersonalDtlsForm" property="forwardedPage" />
<html:hidden name="HrmPersonalDtlsForm" property="positionRequested" />
<html:hidden name="HrmPersonalDtlsForm" property="screenMode" />

<html:hidden property="txtIndex" name="HrmPersonalDtlsForm"  />
<html:hidden property="userPageRequested" name="HrmPersonalDtlsForm" />
<html:hidden property="userPositionRequested"  name="HrmPersonalDtlsForm" />
<html:hidden property="pageRequested"  name="HrmPersonalDtlsForm" />
<html:hidden property="selectAll" value="check" name="HrmPersonalDtlsForm" />

<html:hidden property="lovKey" name="HrmPersonalDtlsForm"  />
<html:hidden property="txtSearchFields" name="HrmPersonalDtlsForm"  />
<html:hidden property="txtDisplayFields" name="HrmPersonalDtlsForm"  />
<html:hidden property="headerPrimaryKey" name="HrmPersonalDtlsForm" />
<html:hidden property="headerDataChanged" name="HrmPersonalDtlsForm" />
<html:hidden property="detailDataChanged" name="HrmPersonalDtlsForm" />

<input type="hidden" name="multipleFlag" >
<input type="hidden" name="queryParam" >

<html:hidden property="firstLoad" name="HrmPersonalDtlsForm" />

<!-- Screen Specific variables -->
<html:hidden property="empNumberId" name="HrmPersonalDtlsForm"  />

<html:hidden property="draftSave" name="HrmPersonalDtlsForm"  />
<html:hidden property="empId" name="HrmPersonalDtlsForm" />
<!-- Hidden fields end -->

</html:form>
</body>
</html:html>

<script language="javascript">
function doChangeHeader()
{
 document.getElementsByName("headerDataChanged")[0].value="true"; 
 //document.forms[0].headerDataChanged.value="true";
}
function doDraftSave()
{
 document.getElementsByName("draftSave")[0].value="true";
 return doBaseSave();
}

function doQueryMode()
{
 
  return "HrmPersonalDtlsLngQueryModeAction.do";
}


function doInsertMode()
{

  return "HrmPersonalDtlsLngNewModeAction.do";
}


function doExecute()
{
   return "HrmPersonalDtlsLngGetHeaderAction.do";
}

function doSave()
{
  document.getElementsByName("headerDataChanged")[0].value="Y";
  return "HrmPersonalDtlsLngSaveAction.do";
  
}

function doDelete()
{

  return "HrmPersonalDtlsLngDeleteAction.do";
  
}

function doRefresh()
{

  return "HrmPersonalDtlsLngRefreshAction.do";
  
}
function doExit()
{

  return "HrmPersonalDtlsLngExitAction.do";
  
}
function doPrevHeader()
{
  return "HrmPersonalDtlsLngGetNextHeaderAction.do"; 
}

function doNextHeader()
{
  return "HrmPersonalDtlsLngGetNextHeaderAction.do"; 
}

function doJumpHeader()
{
  return "HrmPersonalDtlsLngGetNextHeaderAction.do"; 
}

function doGetDetail()
{
 
  return "HrmPersonalDtlsLngDetailAction.do";
}

function doAddRow()
{

  return "HrmPersonalDtlsLngAddRowAction.do"; 
}

function doDelRow()
{
 return "HrmPersonalDtlsLngDeleteRowAction.do";  
}

function doGetDetailTableName()
{
  return "HrmPersonalDtlsLngBatch";
}

function doPrevDetail()
{

  return "HrmPersonalDtlsLngGetDetailPageAction.do";  
}

function doNextDetail()
{

  return "HrmPersonalDtlsLngGetDetailPageAction.do";
}

function doJumpDetail()
{
  return  "HrmPersonalDtlsLngGetDetailPageAction.do"; 
}


function doGetInsertData()
{

}
function ShowEmployeeNo()
{
        document.forms[0].queryParam.value ="employeeId="+ document.forms[0].empId.value ;
        document.forms[0].lovKey.value = "LngDtlsEmpNo" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmEmpPersonalDetailsEdu.employeeNo,hrm.HrmEmpPersonalDetailsAddress.name";
        document.forms[0].txtDisplayFields.value = "empNumberId,employeeNo,firstName,middleName,lastName";
        document.forms[0].multipleFlag.value = "false";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmPersonalDtlsForm');
        return true;
}
function ShowMotherTongue(i)
{
        document.forms[0].lovKey.value = "PersDtlsMotTong" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmEmpPersonalDetails.code,hrm.HrmEmpPersonalDetails.desc";
        document.forms[0].txtIndex.value = i;
        document.forms[0].txtDisplayFields.value = "motherTongueId,motherTongueCode,motherTongue";
        document.forms[0].multipleFlag.value = "false";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmPersonalDtlsForm');
        return true;
        
}
function boxClicked(val)
{    
    if(document.getElementsByName("checked")[val].checked)
    {      
      document.getElementsByName("itemChecked")[val].value = "Y";      
    }
    else
    {     
      document.getElementsByName("itemChecked")[val].value = "N";     
    }      
}
</script>