<%@ 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  onkeydown="hotKeys(event);"; scroll=auto>

<html:form name="HrmTrnInstCourseForm" action="HrmTrnInstCourseBaseAction" type="wenrgise.hrms.webtier.form.HrmTrngInstCourseDtlForm">
<bean:define id="ParentForm" name="HrmTrnInstCourseForm" 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()" /><enrgise:img name="ParentForm" property="butInsert" onmouseover='this.src="../includes/images/insert_act.jpg"' onmouseout='this.src="../includes/images/insert.jpg"' alt="Insert (Alt+N)" src="../includes/images/insert.jpg"  onclick="doBaseInsertMode()"/></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()" />
    <img name="ParentForm" property="butDelete" alt="Delete (Ctrl+D)" src="../includes/images/delete_dis.jpg" /><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><enrgise:text property="newPositionRequested" size="1"  maxlength="3" onkeydown="isInteger(event)" title="wenrgise.common.jumpDetail" alt="N" disabledClass="locked" styleClass="optional" /></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>
<html:hidden property="detailDataChanged" name="HrmTrnInstCourseForm" />

<!--Top Most Blue Bar-->
<TABLE cellSpacing=0 bgColor=#bdd0ef>
    <tr>
        <TD  colSpan=12 class=mainHeader height=10><bean:message  key="hrmTCDtlMainHeader.title" /></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><bean:message  key="hrmTCDtlSubHeader.title" /></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.HrmTrnInCoDtl.instituteCode" />
                <td colspan="3"><enrgise:text  property="instituteCode" titleKey="hrm.HrmTrnInCoDtl.instituteCode" alt="AN" maxlength="20" size="23" styleClass="required" disabledClass="required" onchange="doChangeHeader();" /><enrgise:img name="HrmTrnInstCourseForm" height="16" align="center" src="../includes/images/lov.jpg" property="butInstituteCode"  onclick="return ShowInstCode();" />
                <enrgise:text  property="instituteName" titleKey="hrm.HrmTrnInCoDtl.instituteName" alt="A" maxlength="300" size="58"  styleClass="required" disabledClass="locked" onchange="doChangeHeader();"  /></td>
              
                <td width="15%" class="labelText"><bean:message  key="hrm.HrmTrnInCoDtl.type" /></td>
                        <td><enrgise:select property="type" titleKey="hrm.HrmTrnInCoDtl.type" styleClass="required" disabledClass="required" onchange="doChangeHeader();">
                        <enrgise:option value="" > <bean:message key="hrm.pleaseSelect" /></enrgise:option>
                        <enrgise:option value="E" > <bean:message key="hrm.HrmTrnInCoDtl.external" /></enrgise:option>
                        <enrgise:option value="I" > <bean:message key="hrm.HrmTrnInCoDtl.internal" /></enrgise:option>
                        <enrgise:option value="F" > <bean:message key="hrm.HrmTrnInCoDtl.forigen" /></enrgise:option>
                        </enrgise:select>
                </td>
               
            </TR>
            
            <tr>
                <td class=labelText><bean:message key="hrm.HrmTrnInCoDtl.inCharge" /></td>
                <td><enrgise:text  property="inCharge" titleKey="hrm.HrmTrnInCoDtl.inCharge" onkeypress="isName(event)"  maxlength="20" alt="AN" size="26" styleClass="optional" disabledClass="locked" onchange="doChangeHeader();"  /></td>
                <td class=labelText><bean:message key="hrm.HrmTrnInCoDtl.address" /></td>
                <td><enrgise:textarea  property="address" titleKey="hrm.HrmTrnInCoDtl.address" alt="P" rows="2" cols="28" styleClass="required" disabledClass="required" onchange="doChangeHeader();" /></td>
            
                <td class=labelText><bean:message key="hrm.HrmTrnInCoDtl.email" /></td>
                <td><enrgise:text  property="email" titleKey="hrm.HrmTrnInCoDtl.email" alt="AN" maxlength="40" size="26" styleClass="optional" disabledClass="locked"  onchange="doChangeHeader();" /></td>
            </tr>            
            
            <tr>
                <td class=labelText><bean:message key="hrm.HrmTrnInCoDtl.country" /></td>
                <td><enrgise:text  property="country" titleKey="hrm.HrmTrnInCoDtl.country" maxlength="20" alt="N" size="23" styleClass="required" disabledClass="required"  onchange="doChangeHeader();" /><enrgise:img name="HrmTrnInstCourseForm" height="16" align="center" src="../includes/images/lov.jpg" property="Country"   onclick="return ShowCountryCode()" /></td>
                <td class=labelText><bean:message key="hrm.HrmTrnInCoDtl.city" /></td>
                <td><enrgise:text  property="city" titleKey="hrm.HrmTrnInCoDtl.city" maxlength="60" size="26" styleClass="optional" disabledClass="locked" onchange="doChangeHeader();" /></td>
                <td class=labelText><bean:message key="hrm.HrmTrnInCoDtl.state" /></td>
                <td><enrgise:text  property="state" titleKey="hrm.HrmTrnInCoDtl.state" maxlength="20" onkeypress="isName(event)"  alt="A" size="26" styleClass="optional" disabledClass="locked"  onchange="doChangeHeader();" /></td>
                
            </tr>
            
            <tr>
                <td class=labelText><bean:message key="hrm.HrmTrnInCoDtl.pin" /></td>
                <td><enrgise:text  property="pin" titleKey="hrm.HrmTrnInCoDtl.pin" alt="AN" onkeypress="isInteger(event)"  maxlength="10" size="26" styleClass="required" disabledClass="required"  onchange="doChangeHeader();" /></td>
                <td class=labelText><bean:message key="hrm.HrmTrnInCoDtl.phone" /></td>
                <td><enrgise:text  property="phone" titleKey="hrm.HrmTrnInCoDtl.phone" alt="AN" onkeypress="isInteger(event)"   maxlength="10" size="26" styleClass="optional" disabledClass="locked"  onchange="doChangeHeader();" /></td>
                 <td class=labelText><bean:message key="hrm.HrmTrnInCoDtl.fax" /></td>
                <td><enrgise:text  property="fax" titleKey="hrm.HrmTrnInCoDtl.fax" alt="AN" onkeypress="isInteger(event)"  maxlength="10" size="26" styleClass="optional" disabledClass="locked"  onchange="doChangeHeader();" /></td>
               
            </tr>
            
            
            
            
            <tr height="10">
                <td colspan="6"></td>
            </tr>
         </table>
        
                      
         <table cellspacing=0 cellpadding=0 border=0>
          <!-- Detail Information Row starts -->
          <TR>
            <TD colspan=6>
            <!-- Tab Table Starts -->
            <TABLE cellSpacing=0 cellPadding=0 >
            <tr>                                             
                          <td bgcolor="#4682B4"><img src="../includes/images/pixel.gif" width="10" height="1" border="0"></td>
                          <td bgcolor="#4682B4" nowrap class=actTabText ><bean:message  key="hrmTCDtlTabHeader.title" /><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 height=10>
              
            <!-- Detail table Container starts -->
              <TD colSpan=5>
              <TABLE cellSpacing=0 cellPadding=0 border=0>
                <TBODY>
                 <TR>
                  <TD >
                  <DIV id=divDtlTable style="height:250px">
                    <TABLE  border="0" cellSpacing=0 cellPadding=0>
                     <TBODY>
                          <tr>
                            <TD class=tableHeader width="1%"><input type="checkbox" name="selectAll"  onclick="toggleCheckBox('checked')"  /></td>
                            <TD class=tableHeader><bean:message key="hrm.HrmTrnInCoDtl.course" /></td>
                            <TD class=tableHeader><bean:message  key="hrm.HrmTrnInCoDtl.courseName" /></td>
                                                     
                         </tr>
                        <logic:iterate id="HrmTrngInsCrsDtl" name="HrmTrnInstCourseForm" property="arrHrmTrngCrsDtl" type="wenrgise.hrms.bean.HrmTrngInsCrsDtlbean" indexId="idx" >
                          <logic:notEqual name="HrmTrngInsCrsDtl" property="status" value="D" >
                            <tr class='<bean:write name="HrmTrnInstCourseForm" property="listRowClass"/>'  >
                                <td class=tableText>
                                <html:hidden property="courseId"  name="HrmTrngInsCrsDtl" />
                                <html:hidden property="status"  name="HrmTrngInsCrsDtl" />
                                <html:hidden property="detailId"  name="HrmTrngInsCrsDtl" />
                                <html:hidden property="itemChecked" name="HrmTrngInsCrsDtl" />
                                <html:hidden property="selectAll"  value="check" />
                                <html:checkbox property="checked"  name="HrmTrnInstCourseForm" alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);" />
                                </td>
                                <td class=tableText><enrgise:text property="txtCourse" formName="HrmTrnInstCourseForm" name="HrmTrngInsCrsDtl" styleClass="required" disabledClass="required" style="width:90%" maxlength="20" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /><enrgise:img name="HrmTrnInstCourseForm" height="16" align="center" alt="<%=idx.toString()%>"  src="../includes/images/lov.jpg" property="butCourse" onclick="return ShowCourseName(this.alt);" /></td>
                                <td class=tableText><enrgise:text property="txtCourseName" formName="HrmTrnInstCourseForm" name="HrmTrngInsCrsDtl" styleClass="required" disabledClass="required" style="width:100%" maxlength="20" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>
                            </tr>
                           </logic:notEqual>
                          <logic:equal name="HrmTrngInsCrsDtl" property="status" value="D"  > 
                              <tr class='<bean:write name="HrmTrnInstCourseForm" property="listRowClass"/>'  >
                                <td class=tableText>
                                <html:hidden property="courseId"  name="HrmTrngInsCrsDtl" />
                                <html:hidden property="status"  name="HrmTrngInsCrsDtl" />
                                <html:hidden property="detailId"  name="HrmTrngInsCrsDtl" />
                                <html:hidden property="itemChecked" name="HrmTrngInsCrsDtl" />
                                <html:hidden property="selectAll"  value="check" />
                                <html:checkbox property="checked"  name="HrmTrnInstCourseForm" disabled="true" alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);" />
                                </td>
                                <td class=tableText><html:text property="txtCourse" name="HrmTrngInsCrsDtl" styleClass="deletedRow" style="width:90%" maxlength="20"  readonly="true" /><img name="HrmTrnInstCourseForm" height="16" align="center" alt="<%=idx.toString()%>"  src="../includes/images/lov_dis.jpg" property="butCourse" /></td>
                                <td class=tableText><html:text property="txtCourseName" name="HrmTrngInsCrsDtl" styleClass="deletedRow" style="width:100%" maxlength="20" readonly="true" /></td>
                            </tr>
                            </logic:equal>
                         
                         
                         </logic:iterate>
                      </TBODY>
                      </TABLE>
                      </DIV>
                      </TD>
                    </TR>
               <tr>
                <td>	
                <!--Buttons for Add Row and Save row-->
                    <jsp:include page="GenDetailMenu.jsp" flush="true" />
		            </TD>
		         </tr>
        </TABLE>
      </td>
     </tr>
  </TABLE>
</td>
</tr>
              <!-- Tab Table Ends -->

      <!-- Bottom Blue Bar -->
       <TR>
            <td>
              <TABLE  cellspacing="0" cellpadding="0" border=0>
                    <tr>
                        <td width=40% 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-->
    
</TBODY>
</TABLE>

<!-- Container Table Ends -->
<html:hidden name="HrmTrnInstCourseForm"  property="screenMode" />
<html:hidden name="HrmTrnInstCourseForm"  property="screenName" value="HrmTrngInstCourseDtl" />
<html:hidden name="HrmTrnInstCourseForm"  property="forwardedPage" />
<html:hidden property="positionRequested" name="HrmTrnInstCourseForm" />

<html:hidden property="lovKey" name="HrmTrnInstCourseForm"  />
<html:hidden property="txtSearchFields" name="HrmTrnInstCourseForm"  />
<html:hidden property="txtDisplayFields" name="HrmTrnInstCourseForm"  />
<html:hidden property="txtIndex" name="HrmTrnInstCourseForm"  />

<html:hidden property="trgInstId" name="HrmTrnInstCourseForm"  />
<html:hidden property="trgInstCountryId" name="HrmTrnInstCourseForm"  />
<html:hidden property="trgInstCityId" name="HrmTrnInstCourseForm"  />

<html:hidden property="userPageRequested"  />
<html:hidden property="userPositionRequested" />
<html:hidden property="pageRequested" />
<input type="hidden" name="multipleFlag" >
<input type="hidden" name="queryParam" >

<html:hidden property="headerPrimaryKey" name="HrmTrnInstCourseForm" />

<html:hidden property="headerDataChanged" name="HrmTrnInstCourseForm" />
</html:form>
</body>
</html:html>

<SCRIPT>


function doChangeHeader()
{

 document.forms[0].headerDataChanged.value="true";
}


function doQueryMode()
{

  return "HrmTrngInsCrsDtlQueryModeAction.do";
}


function doInsertMode()
{

  return "HrmTrngInsCrsDtlNewModeAction.do";
}


function doExecute()
{

  return "HrmTrngInsCrsDtlGetHeaderAction.do";
}

function doSave()
{
 
  return "HrmTrngInsCrsDtlSaveAction.do";
}

function doDelete()
{

  return "HrmTrngInsCrsDtlDeleteAction.do";
  
}

function doRefresh()
{

  return "HrmTrngInsCrsDtlRefreshAction.do";
  
}

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

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

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

function doGetDetail()
{

  return "HrmTrngInsCrsDtlGetDetailAction.do";
}

function doAddRow()
{

  return "HrmTrngInsCrsDtlAddRowAction.do"; 
}

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

function doGetDetailTableName()
{
  return "tableName";
}

function doPrevDetail()
{

  return "HrmTrngInsCrsDtlGetDetailPageAction.do";  
}

function doNextDetail()
{

  return "HrmTrngInsCrsDtlGetDetailPageAction.do";
}

function doJumpDetail()
{
  return  "HrmTrngInsCrsDtlGetDetailPageAction.do"; 
}
function doExit()
{
  return  "HrmTrngInsCrsDtlExitAction.do"; 
}

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

function doGetInsertData()
{}


function ShowInstCode()
{
      document.forms[0].lovKey.value = "TrgInstCode" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
      document.forms[0].txtSearchFields.value = "hrm.HrmTrnInCoDtl.instituteCode,hrm.HrmTrnInCoDtl.instituteName";
      document.forms[0].txtDisplayFields.value = "trgInstId,instituteCode,instituteName,type,inCharge,address,country,city,state,pin,phone,fax,email,trgInstCityId,trgInstCountryId";
      document.forms[0].multipleFlag.value="false";
      showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmTrnInstCourseForm');
      return true;
}

function ShowCountryCode()
{
      document.forms[0].lovKey.value = "TrgInstCountryCode" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
      document.forms[0].txtSearchFields.value = "hrm.HrmTrnInCoDtl.country";
      document.forms[0].txtDisplayFields.value = "trgInstCountryId,country";
      document.forms[0].multipleFlag.value="false";
      showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmTrnInstCourseForm');
      return true;
}

function ShowCityCode()
{ 
      document.forms[0].lovKey.value = "TrgInstCityCode" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
      document.forms[0].txtSearchFields.value = "hrm.HrmTrnInCoDtl.city";
      document.forms[0].txtDisplayFields.value = "trgInstCityId,city";
      document.forms[0].multipleFlag.value="false";
      document.forms[0].queryParam.value="trgInstCountryId="+document.forms[0].trgInstCountryId.value;
      showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmTrnInstCourseForm');
      return true;
}
function ShowCourseName(i)
{ 
      document.forms[0].lovKey.value = "TrgCourseCode" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
      document.forms[0].txtSearchFields.value = "hrm.HrmTrnInCoDtl.course,hrm.HrmTrnInCoDtl.courseName";
      document.forms[0].txtIndex.value = i;
      document.forms[0].txtDisplayFields.value = "courseId,txtCourse,txtCourseName";
      document.forms[0].multipleFlag.value="false";
      showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmTrnInstCourseForm');
      return true;
}

function doOnChangeLov(lovName)
{
   if((lovName=="TrgInstCountryCodeHrmTrngInstCourseDtlQ")||(lovName=="TrgInstCountryCodeHrmTrngInstCourseDtlU")||(lovName=="TrgInstCountryCodeHrmTrngInstCourseDtlN"))
    {
      doBaseValidate();
    }
}
function boxClicked(val)
{    
    if(document.getElementsByName("checked")[val].checked)
    {      
      document.getElementsByName("itemChecked")[val].value = "Y";      
    }
    else
    {     
      document.getElementsByName("itemChecked")[val].value = "N";     
    }      
}
</script>
 