<%@ 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" />
</head>

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

<html:form name="HrmEmplDepDtlsForm" action="HrmEmplDepDtlsBaseAction" type="wenrgise.hrms.webtier.form.HrmEmpDepDtlForm">
<bean:define id="ParentForm" name="HrmEmplDepDtlsForm" toScope="request" />

<jsp:include page="GenMenu.jsp" flush="true" />
<bean:define id="left" name="ParentForm" property="positionRequested"/>
<bean:define id="right" name="ParentForm" property="totalCount"/>
<table cellSpacing=0 bgColor=#bdd0ef>
<tr height=27>
  <td colSpan=11></td>
</tr>
  <TR > 
    <TD ><enrgise:img name="ParentForm" property="butQuery" onmouseover='this.src="../includes/images/query_act.jpg"' onmouseout='this.src="../includes/images/query.jpg"' alt="Query (Ctrl+Q)" src="../includes/images/query.jpg" onclick="doBaseQueryMode()" /><img  property="butInsert" src="../includes/images/insert_dis.jpg" /></TD>
    <TD width="2%"></TD>
    <TD ><enrgise:img name="ParentForm" property="butExecute" onmouseover='this.src="../includes/images/execute_act.jpg"' onmouseout='this.src="../includes/images/execute.jpg"' alt="Execute (Ctrl+U)" src="../includes/images/execute.jpg" onclick="doBaseExecute()" /><enrgise:img name="ParentForm" property="butSave" onmouseover='this.src="../includes/images/save_act.jpg"' onmouseout='this.src="../includes/images/save.jpg"' alt="Save (Ctrl+S)" src="../includes/images/save.jpg" onclick="doBaseSave()" />
    <enrgise:img name="ParentForm" property="butDelete" onmouseover='this.src="../includes/images/delete_act.jpg"' onmouseout='this.src="../includes/images/delete.jpg"' alt="Delete (Ctrl+D)" src="../includes/images/delete.jpg" onclick="doBaseDelete()" /><enrgise:img name="ParentForm" property="butRefresh" onmouseover='this.src="../includes/images/refresh_act.jpg"' onmouseout='this.src="../includes/images/refresh.jpg"' alt="Refresh (Ctrl+R)"  src="../includes/images/refresh.jpg" onclick="doBaseRefresh()" />
    <enrgise:img name="ParentForm" property="butPrint" onmouseover='this.src="../includes/images/print_act.jpg"' onmouseout='this.src="../includes/images/print.jpg"' alt="Print (Ctrl+P)"  src="../includes/images/print.jpg" /></TD>
    <TD width="2%" bgColor=#bdd0ef></TD>
    <TD><enrgise:img name="ParentForm" property="butExit" onmouseover='this.src="../includes/images/exit_act.jpg"' onmouseout='this.src="../includes/images/exit.jpg"' alt="Exit (Alt+X)"  src="../includes/images/exit.jpg"   onclick="doBaseExit()" />
    <enrgise:img name="ParentForm" property="butHelp" onmouseover='this.src="../includes/images/help_act.jpg"' onmouseout='this.src="../includes/images/help.jpg"' alt="Help (Ctrl+?)" src="../includes/images/help.jpg" onclick="doBaseHelp()" /></TD>    <TD width="50%"></TD>
    <TD ><enrgise:img name="ParentForm" property="butPrevHeader" src='../includes/images/butn_prev.jpg' onmouseover='this.src="../includes/images/butn_prev_act.jpg"' onmouseout='this.src="../includes/images/butn_prev.jpg"' alt="Butn_prev (Ctrl+<)" onclick="doBasePrevHeader()" /></td>
    <td class=dtlNavText><bean:write  name="left" /> of 
    <bean:write name="right" /></td>
    <td align=right><enrgise:img name="ParentForm" property="butNextHeader" src="../includes/images/butn_next.jpg" onmouseover='this.src="../includes/images/butn_next_act.jpg"' onmouseout='this.src="../includes/images/butn_next.jpg"' alt="Butn_next (Ctrl+>)" onclick="doBaseNextHeader()" /></td>
    <td align=right><html:text property="newPositionRequested" size="1" onkeydown="isInteger(event)" title=" " alt="N" /></td>
    <td ><enrgise:img name="ParentForm" property="butJumpHeader" alt="Go (Ctrl+G)" src="../includes/images/go.jpg" onmouseover='this.src="../includes/images/go_act.jpg"' onmouseout='this.src="../includes/images/go.jpg"' onclick="doBaseJumpHeader()" /></td>
    <td > </td>
</TR>
</TABLE>
<table>
<tr>
  <td colspan="11" class="userText"></td>
</tr>
<enrgise:checkSession/>
</TABLE>

<!--Top Most Blue Bar-->
<TABLE cellSpacing=0 bgColor=#bdd0ef>
    <tr>
        <TD  colSpan=12 class=mainHeader height=10><bean:message key="hrm.HrmEmployeeDependantDetails.heading" /></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 >
        <!--Inspection Header Starts -->
            <TR>
                  <TD class=subHeader colspan=6>Employee Details</TD>
            </TR>
            <TR>
                  <TD colspan=6 bgColor=#4682b4><IMG height=1 src="../includes/images/pixel.gif" width=1 border=0></TD>
            </TR>
            <tr>
                  <td class="labelText"><bean:message key="hrm.HrmEmployeeDependantDetails.employeeNo" /></td>
                  <td><enrgise:text  property="employeeNo" alt="N" maxlength="10" size="23" styleClass="required" disabledClass="required" titleKey="hrm.HrmEmployeeDependantDetails.employeeNo" /><enrgise:img name="HrmEmplDepDtlsForm" height="16" align="center"  src="../includes/images/lov.jpg" property="butEmpNo" onclick="return ShowEmplDepEmpNo()" /></td>              
                  <td></td>
                  <td class="labelText"><bean:message key="hrm.HrmEmployeeDependantDetails.employeeName" /></td>
                  <td colspan="2"><enrgise:text  property="employeeName" alt="A" maxlength="50" size="50" styleClass="locked" disabledClass="locked" titleKey="hrm.HrmEmployeeDependantDetails.employeeName" /></td>
                  
           </tr>
           
            
      </table>
      
      
         <table cellspacing=0 cellpadding=0 border=0>
         <!-- Detail Information Row starts -->
 	 <TR>
       <TD colspan=6>
        <!-- Scrutinized Applicant Details Table Starts -->
         <TABLE cellSpacing=0 cellPadding=0 >
           <tr>
                <td bgcolor="#4682B4" width="10"><img src="../includes/images/pixel.gif" width="10" height="1" border="0"></td>
                <td bgcolor="#4682B4" nowrap class=actTabText >Dependant Details<img src="../includes/images/pixel.gif" width="10" height="1" border="0"></td>
                <TD><IMG height=19  src="../includes/images/formtab_r.gif" width=10  border=0></TD>                              
                <TD width="100%" background="../includes/images/line_t.gif">&nbsp;</TD>
                <TD background="../includes/images/line_t.gif"><IMG height=1 src="../includes/images/pixel.gif" width=10 border=0></TD>
          </tr>                  
          <TR >
 <!-- Detail table Container starts -->
              <TD colspan=6>
                <TABLE cellSpacing=0 cellPadding=0 border=0>
                  <TBODY>
                   <TR>
                     <TD >
                       <DIV id=divDtlTable style="height:250px" >
  			<!-- Detail table starts -->
                        <TABLE cellSpacing=0 cellPadding=0>
                         <TBODY>
                          <tr>
                              <TD class=tableHeader width="1%"><html:checkbox property="selectAll" onclick="toggleCheckBox('selectAll')" /></TD>
                              <TD class=tableHeader ><bean:message key="hrm.HrmEmployeeDependantDetails.relationType" /></td>
                              <TD class=tableHeader ><bean:message  key="hrm.HrmEmployeeDependantDetails.depName" /></td>
                              <TD class=tableHeader ><bean:message  key="hrm.HrmEmployeeDependantDetails.sex" /></td>
                              <TD class=tableHeader ><bean:message  key="hrm.HrmEmployeeDependantDetails.DOB" /></td>
                              <TD class=tableHeader ><bean:message  key="hrm.HrmEmployeeDependantDetails.orgName" /></td>
                              <TD class=tableHeader ><bean:message  key="hrm.HrmEmployeeDependantDetails.incomeAmount" /></td>
                         </tr>
               <!--Insert Logic Iterate Here-->           
                      <logic:notEmpty name="HrmEmplDepDtlsForm" property="arrEmplDepDtls" > 
                        <logic:iterate id="HrmEmplDep" name="HrmEmplDepDtlsForm" property="arrEmplDepDtls" type="wenrgise.hrms.bean.HrmEmpDepDtlBean" indexId="idx" >
                          <logic:notEqual name="HrmEmplDep" property="status" value="D" >
                           <tr>
                              <TD class=tableText width="1%">
                               <html:hidden property="status"  name="HrmEmplDep" />
                                <html:hidden property="detailId"  name="HrmEmplDep"  />
                                <html:checkbox property="checked"  name="HrmEmplDepDtlsForm"   alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);" />
                                <html:hidden property="itemChecked" name="HrmEmplDep" />
                                <html:hidden property="txtRelationTypeId" name="HrmEmplDep" />
                                <html:hidden property="txtRelationTypeCode" name="HrmEmplDep" />
                              </TD>
                              <TD class=tableText ><enrgise:text name="HrmEmplDep"   property="txtRelationType" formName="HrmEmplDepDtlsForm" styleClass="required" disabledClass="required" style="width:80%"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);"  /><enrgise:img name="HrmEmplDepDtlsForm" height="16" align="center"  alt="<%=idx.toString()%>"  src="../includes/images/lov.jpg" property="butRel" onclick="return ShowEmplDepRelType(this.alt);" /></td>
                              <TD class=tableText ><enrgise:text name="HrmEmplDep" property="txtDepName" formName="HrmEmplDepDtlsForm" onkeypress="isName(event)"  styleClass="required" disabledClass="required" style="width:100%"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);"  /></td>
                              <TD class=tableText ><enrgise:select name="HrmEmplDep" property="txtSex" formName="HrmEmplDepDtlsForm" style="width:110%" styleClass="required" disabledClass="required"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);"  >
                                                     <enrgise:option value="" ></enrgise:option>
                                                     <enrgise:option value="M" ><bean:message key="hrm.HrmEmployeeDependantDetails.M" /></enrgise:option>
                                                     <enrgise:option value="F" ><bean:message key="hrm.HrmEmployeeDependantDetails.F" /></enrgise:option>
                                                  </enrgise:select>
                             </TD>
                              <TD class=tableText ><enrgise:text name="HrmEmplDep" property="txtDOB" formName="HrmEmplDepDtlsForm" styleClass="required" disabledClass="required" style="width:50%" alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);" /><enrgise:img src="../includes/images/cal.gif"  width="15" height="19" align="top" styleClass="lov" name="HrmEmplDepDtlsForm" property="butDOB" alt="<%=idx.toString()%>"  onclick="showCalendar('txtDOB',this);" /></td>
                              
                              
                              <TD class=tableText ><enrgise:text name="HrmEmplDep" property="txtOrgName" formName="HrmEmplDepDtlsForm" onkeypress="isName(event)" maxlength="50" styleClass="required" disabledClass="required" style="width:150%"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);"  /></td>
                              <TD class=tableText ><enrgise:text name="HrmEmplDep" property="txtIncomeAmount" formName="HrmEmplDepDtlsForm" onkeypress="isInteger(event)" maxlength="6" styleClass="required" disabledClass="required" style="width:50%"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);"  /></td>
                          </tr> 
                          </logic:notEqual>
                         
                          <logic:equal name="HrmEmplDep" property="status" value="D"  >
                             <tr>
                              <TD class=tableText width="1%">
                               <html:hidden property="status"  name="HrmEmplDep" />
                                <html:hidden property="detailId"  name="HrmEmplDep"  />
                                <html:checkbox property="checked"  name="HrmEmplDepDtlsForm" value="check" disabled="true" alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);" />
                                <html:hidden property="itemChecked" name="HrmEmplDep" />
                                <html:hidden property="txtRelationTypeCode" name="HrmEmplDep" />
                                <html:hidden property="txtRelationTypeId" name="HrmEmplDep" />
                              </TD>
                              <TD class=tableText ><html:text name="HrmEmplDep" property="txtRelationType" styleClass="deletedRow" style="width:80%"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);" readonly="true"  /><img name="HrmEmplDepDtlsForm" height="16" align="center"  alt="<%=idx.toString()%>"  src="../includes/images/lov_dis.jpg" name="butRel" /></td>
                              <TD class=tableText ><html:text name="HrmEmplDep" property="txtDepName" styleClass="deletedRow" style="width:100%"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);" readonly="true"  /></td>
                              <TD class=tableText ><html:select name="HrmEmplDep" property="txtSex" style="width:110%" styleClass="deletedRow" alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);" disabled="true" >
                                                     <html:option value="" ></html:option>
                                                     <html:option value="M" ><bean:message key="hrm.HrmEmployeeDependantDetails.M" /></html:option>
                                                     <html:option value="F" ><bean:message key="hrm.HrmEmployeeDependantDetails.F" /></html:option>
                                                  </html:select><html:hidden name="HrmEmplDep" property="txtSex" /></td>
                              <TD class=tableText ><html:text name="HrmEmplDep" property="txtDOB" styleClass="deletedRow" style="width:50%"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);" readonly="true" /><img src="../includes/images/cal_dis.gif" name="HrmEmplDepDtlsForm"  width="15" height="19" align="top" class="lov" name="butDOB" alt="<%=idx.toString()%>"  /></td>
                              <TD class=tableText ><enrgise:text name="HrmEmplDep" property="txtOrgName" formName="HrmEmplDepDtlsForm" onkeypress="isName(event)" maxlength="50" styleClass="deletedRow" disabledClass="required" style="width:150%"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);"  /></td>
                              <TD class=tableText ><enrgise:text name="HrmEmplDep" property="txtIncomeAmount" formName="HrmEmplDepDtlsForm" onkeypress="isInteger(event)" maxlength="6" styleClass="deletedRow" disabledClass="required" style="width:50%"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);"  /></td>
                          </tr> 
                          
                          </logic:equal>
                          
                          
                          
                        </logic:iterate>
                      </logic:notEmpty>                        
                                                                
                     </TBODY>
                    </TABLE>
                  </DIV>
                </TD>
              </TR>                     
  
  <!-- Get details starts -->
                        <tr>
                          <td colspan=11>	
                              <jsp:include page="GenDetailMenu.jsp" />
                          </TD>
                       </tr>
                  </TBODY>
                </TABLE>
              </td>
            </tr>



        </TABLE>
     </td>
	 </tr>
                <!-- Tab Table Ends -->

<!-- Bottom Blue Bar -->
       <TR>
            <td>
              <TABLE  cellspacing="0" cellpadding="0" border=0>
                   <tr>
                        <tr height="20">
                        <td width=45% align=center bgColor=#4682b4></td>
                        <td  bgColor=#4682b4></td>
                        <td  bgColor=#4682b4></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="HrmEmplDepDtlsForm" property="screenName" value="HrmEmpDepDtl" />
<html:hidden name="HrmEmplDepDtlsForm" property="forwardedPage" />
<html:hidden name="HrmEmplDepDtlsForm" property="positionRequested"  />
<html:hidden name="HrmEmplDepDtlsForm" property="screenMode"  />
<html:hidden property="detailDataChanged" name="HrmEmplDepDtlsForm" />
<html:hidden property="headerDataChanged" name="HrmEmplDepDtlsForm" />
<html:hidden property="headerPrimaryKey" name="HrmEmplDepDtlsForm" />
<html:hidden property="userPageRequested" name="HrmEmplDepDtlsForm"  />
<html:hidden property="userPositionRequested" name="HrmEmplDepDtlsForm"   />
<html:hidden property="pageRequested" name="HrmEmplDepDtlsForm"  />
<html:hidden property="lovKey" name="HrmEmplDepDtlsForm"  />
<html:hidden property="txtSearchFields" name="HrmEmplDepDtlsForm"  />
<html:hidden property="txtDisplayFields" name="HrmEmplDepDtlsForm"  />
<html:hidden property="txtIndex" name="HrmEmplDepDtlsForm"  />
<input type="hidden" name="multipleFlag" >
<input type="hidden" name="queryParam" >

<!-- Screen Specific variables -->
<html:hidden property="employeeNoId" name="HrmEmplDepDtlsForm" />




<!-- Hidden fields end -->
</html:form>
</body>
</html:html>
<script>


function boxClicked(val)
{    
    if(document.getElementsByName("checked")[val].checked)
    {      
      document.getElementsByName("itemChecked")[val].value = "Y";      
    }
    else
    {     
      document.getElementsByName("itemChecked")[val].value = "N";     
    }      
}

function doQueryMode()
{

  return "HrmEmpDepDtlsQueryModeAction.do";
}


function doInsertMode()
{

  return "HrmEmpDepDtlsNewModeAction.do";
}


function doExecute()
{

  return "HrmEmpDepDtlsGetHeaderAction.do";
}

function doSave()
{

  return "HrmEmpDepDtlsSaveAction.do";
  
}

function doDelete()
{

  return "HrmEmpDepDtlsDeleteAction.do";
  
}

function doRefresh()
{

  return "HrmEmpDepDtlsRefreshAction.do";
  
}

function doPrevHeader()
{
  return "HrmEmpDepDtlsGetNextHeaderAction.do"; 
}

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

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

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

function doAddRow()
{

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

  return "HrmEmpDepDtlsExitAction.do"; 
}

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

function doGetDetailTableName()
{
  return "tableName";
}

function doPrevDetail()
{

  return "HrmEmpDepDtlsGetDetailPageAction.do";  
}

function doNextDetail()
{

  return "HrmEmpDepDtlsGetDetailPageAction.do";
}

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

function ShowEmplDepEmpNo()
{
        document.forms[0].lovKey.value = "HrmEmplDepEmpNo" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmEmployeeDependantDetails.employeeNo,hrm.HrmEmployeeDependantDetails.employeeName";
        document.forms[0].txtDisplayFields.value = "headerPrimaryKey,employeeNo,employeeName";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmEmplDepDtlsForm');
        return true;
       
}
function ShowEmplDepRelType(i)
{
        document.forms[0].lovKey.value = "HrmEmplDepRelType" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmEmployeeDependantDetails.code,hrm.HrmEmployeeDependantDetails.relationType";
        document.forms[0].txtIndex.value = i;
        document.forms[0].txtDisplayFields.value = "txtRelationTypeId,txtRelationTypeCode,txtRelationType";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmEmplDepDtlsForm');
        return true;
       
}
function doGetInsertData()
{}

</script>