<%@ 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="HrmRecAdvAttrForm" action="HrmAdvLngReqBaseAction" type="wenrgise.hrms.webtier.form.HrmRecAdvAttrForm">
<bean:define id="ParentForm" name="HrmRecAdvAttrForm" toScope="request" />
<jsp:include page="GenIconMenu.jsp" />

<table>
<tr height="10">
<td colspan=12></td>
</tr>
</table>
<!--Top Most Blue Bar-->
<TABLE cellSpacing=0 bgColor=#bdd0ef>
    <tr>
        <TD  colSpan=12 class=mainHeader height=10><bean:message key="hrm.HrmAdvertisementAttribute.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>
    <tr>
        <td height=10>    
    </tr>
</TABLE>

<!--container table starts -->
<TABLE cellSpacing=0 cellPadding=0 border=0 >
 <TBODY>
  <TR>
    <TD>
     <!-- Body table Starts -->
      <TABLE cellSpacing=0 cellPadding=0 >
        <!--General Informationrmation Row Starts -->
       <tr>
        <td  class="subHeader" colspan=6 >Advertisement Attributes</td>
       </tr>
        <tr>
                 <td bgcolor="#4682B4"  align="right"  colspan=8 ><img src="../includes/images/pixel.gif" width="" height="1" border="0"></td>
       </tr>
        
        
       <tr>
                     <td  class="labelText"   ><bean:message key="hrm.HrmAdvertisementAttribute.refNo" /></td>
                     <td  ><html:text  property="refNo" titleKey="hrm.HrmAdvertisementAttribute.refNo" alt="AN" maxlength="25" size="23" styleClass="required" readonly="true"  /><enrgise:img height="16" align="center" src="../includes/images/lov.jpg" styleClass="icon" property="butrefNo"  name="HrmRecAdvAttrForm" onclick="ShowRefNo();" /><html:hidden property="refId" name="HrmRecAdvAttrForm" /></td>
                     <td  class="labelText"   ><bean:message key="hrm.HrmAdvertisementAttribute.position" /></td>
                     <td  ><html:text  property="desgn" titleKey="hrm.HrmAdvertisementAttribute.position" alt="AN" maxlength="25" size="23"  styleClass="required"  readonly="true" /><enrgise:img height="16" align="center" src="../includes/images/lov.jpg" styleClass="icon" property="butPosition"  name="HrmRecAdvAttrForm" onclick="ShowPositionNo();" />
                     <html:text  property="category" titleKey="hrm.HrmAdvertisementAttribute.position" alt="AN" maxlength="25" size="40"  styleClass="required"  readonly="true" /></td>
         </tr> 
               
               <!--User Information Row Starts -->
        <tr height="10" >
               <td colspan="6"></td>
                <td width="14%"></td>
         </tr>
               
      </table>
        
      
         <table cellspacing=0 cellpadding=0 border=0>
         <!-- Detail Information Row starts -->
 	 <TR>
       <TD colspan=6>
        <!--  Details Table Starts -->
         <TABLE cellSpacing=0 cellPadding=0 >
           <tr>
                <TD  bgColor=#76A2C7><IMG height=1 src="../includes/images/pixel.gif" width=10 border=0></TD>
                <TD class=disTabText noWrap bgColor=#76A2C7  onclick="doGetTab('HrmRecAdvAttrQualReqDtl','AdvLngReqGetTabAction.do')">Qualification Requirement<IMG height=1 src="../includes/images/pixel.gif" width=10 border=0></TD>
                <TD><IMG height=19  src="../includes/images/formtab_lb.gif" width=10  border=0></TD>                   
                                
                <TD  bgColor=#76A2C7><IMG height=1 src="../includes/images/pixel.gif" width=10 border=0></TD>
                <TD class=disTabText noWrap bgColor=#76A2C7  onclick="doGetTab('HrmRecAdvAttrLocVacencyDtl','AdvLngReqGetTabAction.do')">Location Wise Vacancy<IMG height=1 src="../includes/images/pixel.gif" width=10 border=0></TD>
                <TD><IMG height=19  src="../includes/images/formtab_lb.gif" width=10  border=0></TD>    
                
                <TD  bgColor=#76A2C7><IMG height=1 src="../includes/images/pixel.gif"  border=0></TD>
                <TD class=disTabText noWrap bgColor=#76A2C7 onclick="doGetTab('HrmRecAdvAttrWorkExpDtl','AdvLngReqGetTabAction.do')">Work Experience<IMG height=1 src="../includes/images/pixel.gif" width=10 border=0></TD>
                <TD><IMG height=19  src="../includes/images/formtab_lb.gif" width=10  border=0></TD>      
                
                <TD  bgColor=#76A2C7><IMG height=1 src="../includes/images/pixel.gif"  border=0></TD>
                <TD class=disTabText noWrap bgColor=#76A2C7  onclick="doGetTab('HrmRecAdvAttrJobDesc','AdvLngReqGetTabAction.do')">Job Description<IMG height=1 src="../includes/images/pixel.gif" width=10 border=0></TD>
                <TD><IMG height=19  src="../includes/images/formtab_lb.gif" width=10  border=0></TD>         
                                             
                <TD  bgColor=#76A2C7><IMG height=1 src="../includes/images/pixel.gif" width=10 border=0></TD>
                <TD class=disTabText noWrap bgColor=#76A2C7 onclick="doGetTab('HrmRecAdvAttrSkillReqDtl','AdvLngReqGetTabAction.do')">General Skill Requirement<IMG height=1 src="../includes/images/pixel.gif" width=10 border=0></TD>
                <TD><IMG height=19  src="../includes/images/formtab_lb.gif" width=10  border=0></TD>       
                                
                <TD width=10 bgColor=#4682b4><IMG height=1 src="../includes/images/pixel.gif" width=10 border=0></TD>
                <TD class=actTabText noWrap bgColor=#4682b4 >Language Requirement<IMG height=1 src="../includes/images/pixel.gif" width=10 border=0></TD>
                <TD><IMG height=19  src="../includes/images/formtab_r.gif" width=10  border=0></TD>                              
                                
                <td width="45%"></td>
                

          </tr>                  
          <TR >
 <!-- Detail table Container starts -->
              <TD colspan=19>
                <TABLE cellSpacing=0 cellPadding=0 border=0>
                  <TBODY>
                   <TR>
                     <TD >
                       <DIV id=divDtlTable style="height:250px" >
  			<!-- Detail table starts -->
                        <TABLE cellSpacing=0 cellPadding=0 id="advLngReq">
                         <TBODY>
                          <tr>
                              <TD class=tableHeader width="1%"><html:checkbox  property="selectAll"  onclick="toggleCheckBox('checked')"  /></td>
                              <TD class=tableHeader width="33%"><bean:message key="hrm.HrmAdvertisementAttribute.langCode" /></td>
                              <TD class=tableHeader width="33%"><bean:message key="hrm.HrmAdvertisementAttribute.langDesc" /></td>
                              <TD class=tableHeader width="33%"><bean:message  key="hrm.HrmAdvertisementAttribute.reqType" /></td>
                              
                              
                         </tr>
                         <logic:iterate id="langReq" name="HrmRecAdvAttrForm" property="arylstHrmAdvLngReqDtl" type="wenrgise.hrms.bean.HrmRecAdvAttrLngReqDtlBean" indexId="idx" >
                      <logic:notEqual name="langReq" property="status" value="D" >           
                       <tr>
                           <td ><html:checkbox property="checked"  alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);" /><html:hidden property="detailId" name="langReq" /><html:hidden property="itemChecked" name="langReq" /><html:hidden property="status"  name="langReq" /><html:hidden property="hdnLanguageId"  name="langReq" /><html:hidden property="hdnPrevDtlId"  name="langReq" /></td>
                          <td ><html:text  property="txtLangCode"  name="langReq" readonly="true" titleKey="hrm.HrmAdvertisementAttribute.langCode" size="15" styleClass="required"  style="width:94%" alt="P"  onchange='<%="doChangeDetail("+idx.toString()+")"%>' /><img src="../includes/images/lov.jpg" height="15" class="icon" align="center" name="butAdvAttrLanguageCode"  alt="<%=idx.toString()%>"  onclick=" return ShowLanguageCode(this.alt);" /></td>
                          <td ><html:text  property="txtLangDesc"  name="langReq" readonly="true" titleKey="hrm.HrmAdvertisementAttribute.langDesc" size="15" styleClass="required"  style="width:100%" alt="P"  onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>
                           <td align="center">
                                    <html:select  property="txtReqType" style="width:100%" name="langReq" styleClass="required"  alt="<%=idx.toString()%>" onchange='<%="doChangeDetail("+idx.toString()+")"%>' >  
                                                     <html:option value="" ><bean:message key="hrm.pleaseSelect"  /></html:option>
                                                     <html:option value="R" ><bean:message key="hrm.HrmAdvertisementAttribute.read"  /></html:option>
                                                     <html:option value="W" ><bean:message key="hrm.HrmAdvertisementAttribute.write"  /></html:option>                           
                                                     <html:option value="C" ><bean:message key="hrm.HrmAdvertisementAttribute.communicate"  /></html:option>
                                                     <html:option value="S" ><bean:message key="hrm.HrmAdvertisementAttribute.speakReadAndWrite"  /></html:option>
                                    </html:select>
                            </td>                             
                        </tr>
                  </logic:notEqual>
                  <logic:equal name="langReq" property="status" value="D"  >
                        <tr>
                            <td ><html:checkbox  disabled="true" property="checked"  alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);" /><html:hidden property="detailId" name="langReq" /><html:hidden property="itemChecked" name="langReq" /><html:hidden property="status"  name="langReq" /><html:hidden property="hdnLanguageId"  name="langReq" /><html:hidden property="hdnPrevDtlId"  name="langReq" /></td>
                            <td ><html:text  property="txtLangCode"  name="langReq" titleKey="hrm.HrmAdvertisementAttribute.qualCode" size="15" styleClass="deletedRow" readonly="true"  style="width:94%" alt="P"  onchange='<%="doChangeDetail("+idx.toString()+")"%>' /><img src="../includes/images/lov_dis.jpg" height="15" class="icon" align="center" name="butAdvAttrLanguageCode"  alt="<%=idx.toString()%>" /></td>
                            <td ><html:text  property="txtLangDesc"  name="langReq" titleKey="hrm.HrmAdvertisementAttribute.langDesc" size="15" styleClass="deletedRow" readonly="true"  style="width:100%" alt="P"  onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>
                            <td align="center">
                                    <html:select  property="txtReqType" style="width:100%" name="langReq" styleClass="locked"  alt="<%=idx.toString()%>" onchange='<%="doChangeDetail("+idx.toString()+")"%>' disabled="true" >
                                                    <html:option value="" ><bean:message key="hrm.pleaseSelect"  /></html:option>
                                                     <html:option value="R" ><bean:message key="hrm.HrmAdvertisementAttribute.read"  /></html:option>
                                                     <html:option value="W" ><bean:message key="hrm.HrmAdvertisementAttribute.write"  /></html:option>                           
                                                     <html:option value="C" ><bean:message key="hrm.HrmAdvertisementAttribute.communicate"  /></html:option>
                                                     <html:option value="S" ><bean:message key="hrm.HrmAdvertisementAttribute.speakReadAndWrite"  /></html:option>
                                    </html:select><html:hidden property="txtReqType" name="langReq" />
                            </td>     
                         </tr>
                  </logic:equal>
                  </logic:iterate>
            
           <!--Insert Logic Iterate Here-->                                                      
                     </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>
                        <td colspan="5" 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 -->
<html:hidden property="screenName" name="HrmRecAdvAttrForm" value="HrmRecAdvAttrLngReqDtl" />
<html:hidden name="HrmRecAdvAttrForm"  property="forwardedPage" />
<html:hidden property="positionRequested" name="HrmRecAdvAttrForm" />
<html:hidden property="screenMode" name="HrmRecAdvAttrForm" />
<html:hidden property="detailDataChanged" name="HrmRecAdvAttrForm" />
<html:hidden property="headerDataChanged" name="HrmRecAdvAttrForm" />
<html:hidden property="headerPrimaryKey" name="HrmRecAdvAttrForm" />

<html:hidden property="userPageRequested" name="HrmRecAdvAttrForm" />
<html:hidden property="userPositionRequested" name="HrmRecAdvAttrForm" />
<html:hidden property="pageRequested" name="HrmRecAdvAttrForm" />
<html:hidden property="prevDtlId" name="HrmRecAdvAttrForm"  />
<!------ addded for LOV ----->
<html:hidden property="firstLoad" name="HrmRecAdvAttrForm"  />
<html:hidden property="lovKey" name="HrmRecAdvAttrForm"  />
<html:hidden property="txtSearchFields" name="HrmRecAdvAttrForm"  />
<html:hidden property="txtDisplayFields" name="HrmRecAdvAttrForm"  />


<html:hidden property="txtIndex" name="HrmRecAdvAttrForm"  />

<html:hidden property="changeEnb" name="HrmRecAdvAttrForm"  />
<input type="hidden" name="multipleFlag" >
<input type="hidden" name="queryParam" >

</html:form>
</body>
</html:html>
<script language="javascript">
function boxClicked(val)
{    
    if(document.getElementsByName("checked")[val].checked)
    {      
      document.getElementsByName("itemChecked")[val].value = "Y";      
    }
    else
    {     
      document.getElementsByName("itemChecked")[val].value = "N";     
    }      
}
function doExit()
{
  return "AdvLngReqExitAction.do";
}
function doSave()
{
var oTable = document.getElementById(doGetDetailTableName());
    if(oTable == null)
    {
      return;
    }
    var iTr2 = parseInt(oTable.rows.length)-1;
  
for(i=0; i<iTr2; i++)
{
 document.getElementsByName("hdnPrevDtlId")[i].value=document.forms[0].prevDtlId.value;
  }  
  return "AdvLngReqSaveAction.do";
  
}
function doQueryMode()
{
 document.forms[0].changeEnb.value="S";
 document.forms[0].desgn.value="";
  return "AdvLngReqQueryModeAction.do";
}

function doRefresh()
{
  return "AdvLngReqRefreshAction.do";  
}

function doGetDetail()
{
 document.forms[0].prevDtlId.value=document.forms[0].headerPrimaryKey.value;
  document.forms[0].changeEnb.value="T";
  document.forms[0].screenMode.value="U";
  return "AdvLngReqGetDetailAction.do";
}

function doAddRow()
{
  document.forms[0].prevDtlId.value=document.forms[0].headerPrimaryKey.value;
  return "AdvLngReqAddRowAction.do"; 
}

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

function doGetDetailTableName()
{
  return "advLngReq";
}

function doPrevDetail()
{
  return "AdvLngReqGetDetailPageAction.do";  
}

function doNextDetail()
{
  return "AdvLngReqGetDetailPageAction.do";
}

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

function doOnLoad()
{
  if(document.forms[0].firstLoad.value!="false")
  {
    return  "AdvLngReqOnLoadAction.do"; 
  }
  
}
function ShowLanguageCode(i)
{
        
        document.forms[0].lovKey.value = "RecAdvAttrLanguage" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmAdvertisementAttribute.langCode";
        document.forms[0].txtIndex.value = i;
        document.forms[0].txtDisplayFields.value = "hdnLanguageId,txtLangCode,txtLangDesc";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmRecAdvAttrForm');
}
function ShowRefNo()
{
        document.forms[0].lovKey.value = "HrmRecAdvRefNo" + "HrmRecAdvAttrForm" + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmAdvertisementAttribute.refNo";
        document.forms[0].txtDisplayFields.value = "refId,refNo";       
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmRecAdvAttrForm');
        return true;
        
}
function ShowPositionNo()
{
        document.forms[0].queryParam.value ="RefNo="+ document.forms[0].refId.value +" " ;
        document.forms[0].lovKey.value = "HrmRecAdvPositionNo" + "HrmRecAdvAttrForm" + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmAdvertisementAttribute.grade,hrm.HrmAdvertisementAttribute.design";
        document.forms[0].txtDisplayFields.value = "headerPrimaryKey,desgn,category";       
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmRecAdvAttrForm');
        return true;
        
}
function doOnChangeLov(lovName)
{
   if((lovName=="HrmRecAdvRefNoHrmRecAdvAttrFormQ") || (lovName=="HrmRecAdvPositionNoHrmRecAdvAttrFormQ"))
    {
    doBaseValidate();
    }
}



function doValidate()
{
  return "AdvLngReqValidateAction.do"; 
}

</script>