/*
---------------------------------------------------------------------------------------------------------
Function No   : 01
---------------------------------------------------------------------------------------------------------
Purpose 	  : To create a combo and a visibility hidden text box 
			    as user choose Bachelor or Masters from Level of Education 
			    combo box and reset the arrangement otherwise in Academic Qualification Section.  
---------------------------------------------------------------------------------------------------------
Page		  : Step_02.asp, Step_02_edit.asp
---------------------------------------------------------------------------------------------------------
Author  	  : Pulak
---------------------------------------------------------------------------------------------------------
Last Modified : 05 Feb 2005 
---------------------------------------------------------------------------------------------------------
*/
function EduLevel_ChangedStatus_Step02(id1){
	var sid;
	var sValue;
	var strHtml;
	var chkBoxCtl;
	
	sid=id1.slice(11)
	sValue = document.getElementById(id1).options[document.getElementById(id1).options.selectedIndex].value;

	if (sValue=="4" || sValue=="5"){
		document.getElementById('InstituteName'+sid).innerHTML="";
		document.getElementById('Concentration_Major'+sid).innerHTML="";
		
		//INSTITUTE NAME (Combo and a Visibility  Hidden Textbox):
		strHtml = "<select size='1' name='cboInstitute" + sid + "' id='cboInstitute" + sid + "' onchange=\"ShowTextBox_InstituteNameTextBox_Step02('cboInstitute" + sid + "','spnInstitute" + sid + "','txtInstituteName" + sid + "','chkFInst" + sid + "')\" class='BDJdropdownlist2'>" + instituteH +"</select><span class='red_text'><b>*</b></span>";
		strHtml = strHtml + "<br><span class='style_ColoredText' id='spnInstitute" + sid + "' style='visibility:hidden'>Specify Institute:</span>"; 
		strHtml = strHtml + "<input type='text' class='texts2' name='txtInstituteName" + sid + "' id ='txtInstituteName" + sid + "' size='22' maxlength='80' style='visibility:hidden'>";
		document.getElementById('InstituteName'+sid).innerHTML= strHtml;
		
		//CONCENTRATION/MAJOR (Combo and a Visibility  Hidden Textbox):		
		strHtml = "";
		strHtml = "<select name='cboSubject" + sid + "' id='cboSubject" + sid + "' onchange=\"ShowTextBox_ConcentrationMajorTextBox_Step02('cboSubject"+ sid +"','spnText" + sid + "','txtSubject" + sid + "')\" class='BDJdropdownlist'>" + majorH +"</select><span class='red_text'><b>*</b></span>";
		strHtml = strHtml + "<br><span class='style_ColoredText' id='spnText" + sid + "' style='visibility:hidden'>Please Specify : </span>";
		strHtml = strHtml + "<input type='text' class='texts2' name='txtSubject" + sid +"' id='txtSubject" + sid + "' size='22' maxlength='150' style='visibility:hidden'></br>";		
		document.getElementById('Concentration_Major'+sid).innerHTML = strHtml;
		
		//CHECK BOX STATUS CHANGE
		document.getElementById('chkFInst' + sid).disabled=true;
		document.getElementById('chkFInst' + sid).checked=false; 
	}
	else{
		//INSTITUTE NAME (Textbox):
		document.getElementById('InstituteName'+sid).innerHTML="";
		document.getElementById('InstituteName'+sid).innerHTML="<input type='text' class='texts2' name='txtInstituteName" + sid +"' id='txtInstituteName" + sid + "' size='54' maxlength='150'><span class='red_text'><b>*</b></span>";
		
		//CONCENTRATION/MAJOR (Textbox):
		document.getElementById('Concentration_Major'+ sid).innerHTML = "";
		document.getElementById('Concentration_Major'+ sid).innerHTML = "<input type='text' class='texts2' name='txtSubject" + sid +"' id='txtSubject" + sid + "' size='54' maxlength='150'><span class='red_text'><b>*</b></span>";

		//CHECK BOX STATUS CHANGE
		document.getElementById('chkFInst' + sid).disabled=false; 
	}
}//End of The EduLevel_ChangedStatus_Step02()

/*
---------------------------------------------------------------------------------------------------------
Function No   : 02
---------------------------------------------------------------------------------------------------------
Purpose 	  : To show the visibility hidden textbox created through 
			    the function  EduLevel_ChangedStatus_Step02() 
---------------------------------------------------------------------------------------------------------
Page		  : Step_02.asp, Step_02_Edit.asp
---------------------------------------------------------------------------------------------------------
Author  	  : Pulak
---------------------------------------------------------------------------------------------------------
Last Modified : 05 Feb 2005 
---------------------------------------------------------------------------------------------------------
*/
function ShowTextBox_InstituteNameTextBox_Step02(strCombo,strSpan,txtText,chkBox){
	var strText;
	strText = document.getElementById(strCombo).value

	if(strText == "Others"){
	   document.getElementById(strSpan).style.visibility="visible";
	   document.getElementById(txtText).style.visibility="visible";
		
	   document.getElementById(chkBox).disabled = false; 
	}else{
		document.getElementById(strSpan).style.visibility="hidden";
		document.getElementById(txtText).style.visibility="hidden";
		
		document.getElementById(chkBox).disabled = true;
		document.getElementById(chkBox).checked=false;
	}
}//End of ShowTextBox_InstituteName_Step02()

/*
---------------------------------------------------------------------------------------------------------
Function No   : 03
---------------------------------------------------------------------------------------------------------
Purpose 	  : To show the visibility hidden textbox 
			    created through the function  EduLevel_ChangedStatus_Step02() 
---------------------------------------------------------------------------------------------------------
Page		  : Step_02.asp, Step_02_Edit.asp
---------------------------------------------------------------------------------------------------------
Author  	  : Pulak
---------------------------------------------------------------------------------------------------------
Last Modified : 05 Feb 2005 
---------------------------------------------------------------------------------------------------------
*/
function ShowTextBox_ConcentrationMajorTextBox_Step02(strCombo, strSpan, strTextBox){
	var strText;
	strText = document.getElementById(strCombo).value
	
	if (strText=="Others"){
		document.getElementById(strSpan).style.visibility="visible";
		document.getElementById(strTextBox).style.visibility="visible";
	}else{
		document.getElementById(strSpan).style.visibility="hidden";
		document.getElementById(strTextBox).style.visibility="hidden";
	}
}//End of ShowTextBox_ConcentrationMajorTextBox_Step02()

/*
---------------------------------------------------------------------------------------------------------
Function No   : 04
---------------------------------------------------------------------------------------------------------
Purpose 	  : To show the visibility hidden textbox and change label caption
			    as user detect result type in Result Como box. 
---------------------------------------------------------------------------------------------------------
Page		  : Step_02.asp, Step_02_Edit.asp
---------------------------------------------------------------------------------------------------------
Author  	  : Pulak
---------------------------------------------------------------------------------------------------------
Last Modified : 05 Feb 2005 
---------------------------------------------------------------------------------------------------------
*/
function Show_MarksTextBox_Step02(ID,txtTextBox1,spnStar,spnCGPAScale,txtTextBox2,spnCGPAStar, spnHideResult){
	var sValue;
	var SID;

	SID=ID.slice(9);
	sValue = document.getElementById(ID).options[document.getElementById(ID).options.selectedIndex].value;
	
	//SELECT, DON'T MENTION
	if(sValue == -1 || sValue == 0 || sValue == 9){
	  document.getElementById('Caption_Marks'+SID).innerHTML = "";
	  document.getElementById(txtTextBox1).style.visibility="hidden";
	  document.getElementById(spnStar).style.visibility="hidden";
	  
	  document.getElementById(spnCGPAScale).style.visibility="hidden";
	  document.getElementById(txtTextBox2).style.visibility="hidden";
	  document.getElementById(spnCGPAStar).style.visibility="hidden";
	  document.getElementById(spnHideResult).style.visibility="hidden";	//<--  
	  document.getElementById('Caption_Year'+SID).innerHTML="Year of Passing :";
	}
	
	//APPEARED, ENROLLED
	if(sValue == 12 || sValue == 10){
	  document.getElementById('Caption_Marks'+SID).innerHTML="";
	  document.getElementById(txtTextBox1).style.visibility="hidden";	  
	  document.getElementById(spnStar).style.visibility="hidden";
	  
	  document.getElementById(spnCGPAScale).style.visibility="hidden";
	  document.getElementById(txtTextBox2).style.visibility="hidden";
	  document.getElementById(spnCGPAStar).style.visibility="hidden";
	  document.getElementById(spnHideResult).style.visibility="hidden";	//<-- 	  
	  document.getElementById('Caption_Year'+SID).innerHTML="Expected Year of Passing :";
	}
	
	//FIRST, SECOND, THIRD
	if(sValue == 15 || sValue == 14 || sValue == 13){
	  document.getElementById('Caption_Marks'+SID).innerHTML="<font class=texts2>Marks(%) :</font>";
	  document.getElementById(txtTextBox1).value = "";
	  document.getElementById(txtTextBox1).style.visibility="visible";	  
	  document.getElementById(spnStar).style.visibility="hidden";
	  
	  document.getElementById(spnCGPAScale).style.visibility="hidden";
	  document.getElementById(txtTextBox2).style.visibility="hidden";
	  document.getElementById(spnCGPAStar).style.visibility="hidden";
	  document.getElementById(spnHideResult).style.visibility="visible";	//<-- 	  
	  document.getElementById('Caption_Year'+SID).innerHTML="Year of Passing :";
	  
	}
	
	//CGPA
	if(sValue == 11){
	  document.getElementById('Caption_Marks'+SID).innerHTML="CGPA :";
	  document.getElementById(txtTextBox1).value= "";
	  document.getElementById(txtTextBox1).style.visibility="visible";
	  document.getElementById(spnStar).style.visibility="visible";
	  
	  document.getElementById(spnCGPAScale).style.visibility="visible";
	  document.getElementById(txtTextBox2).value="";
	  document.getElementById(txtTextBox2).style.visibility="visible";
	  document.getElementById(spnCGPAStar).style.visibility="visible";
	  document.getElementById(spnHideResult).style.visibility="visible";	//<-- 	  
	  document.getElementById('Caption_Year'+SID).innerHTML="Year of Passing :";
	}
}// End of Show_Marks_Step02()

function PopulateMarksOption(chkResult, cboResult, txtTextBox1, txtTextBox2)
{
	var intResultType = document.getElementById(cboResult).value;
	
	if (document.getElementById(chkResult).checked == true)
	{
		if(intResultType == 13 || intResultType == 14 || intResultType == 15)
		{
			document.getElementById(txtTextBox1).value = "";
			document.getElementById(txtTextBox1).disabled = true;
		}
		
		if(intResultType == 11)
		{
			document.getElementById(txtTextBox1).value = "";
			document.getElementById(txtTextBox1).disabled = true;

			document.getElementById(txtTextBox2).value = "";
			document.getElementById(txtTextBox2).disabled = true;
		}
	}
	
	if (document.getElementById(chkResult).checked == false)
	{
		if(intResultType == 13 || intResultType == 14 || intResultType == 15)
		{
			document.getElementById(txtTextBox1).value = "";
			document.getElementById(txtTextBox1).disabled = false;
		}
		
		if(intResultType == 11)
		{
			document.getElementById(txtTextBox1).value = "";
			document.getElementById(txtTextBox1).disabled = false;

			document.getElementById(txtTextBox2).value = "";
			document.getElementById(txtTextBox2).disabled = false;
		}
	}
}
/*
---------------------------------------------------------------------------------------------------------
Function No   : 05
---------------------------------------------------------------------------------------------------------
Purpose 	  : To add controls dynamically in AcademicQualification section of the Step 02.
---------------------------------------------------------------------------------------------------------
Page		  : step_02.asp, step_02_edit.asp
---------------------------------------------------------------------------------------------------------
Author  	  : Pulak
---------------------------------------------------------------------------------------------------------
Last Modified : 05 Feb 2005
---------------------------------------------------------------------------------------------------------
*/

/*--------------------------------------------------------------------------------------------------------*/
/*-----------------------------------------------Major Group---------------------------------------------*/

function Show_Major_group(ID,txtTextBox1){
	var sValue;
	var SID;

	SID=ID.slice(8);
	sValue = document.getElementById(ID).options[document.getElementById(ID).options.selectedIndex].value;
	
	//SELECT, DON'T MENTION
	if(sValue == -1 || sValue == 21 || sValue == 22 || sValue == 23 || sValue == 24 || sValue == 25 || sValue == 26 || sValue == 27){
	  document.getElementById('Caption_Group'+SID).innerHTML = "";
	  document.getElementById(txtTextBox1).style.visibility="hidden";
	 
	  }
	
	
	//FIRST, SECOND, THIRD
	if(sValue == 28){
	  document.getElementById('Caption_Group'+SID).innerHTML="<font class=texts2>Other's :</font>";
	  document.getElementById(txtTextBox1).value = "";
	  document.getElementById(txtTextBox1).style.visibility="visible";	  
	
	}

}// End of Show_Major_group()









/*------------------------------------------------End Group----------------------------------------------*/







function AddControls_AcademicQualification_Step02(strMyString){
	var Counter = document.getElementById("txtAcademicCounter").value;
	var strHtml;
	var intLevel =Counter;
		
	intLevel++;
	
	if(Counter <10){
		strHtml = "<table width='100%' border='0' cellspacing='1' cellpadding='0' style='margin-bottom:1px;' class='alt2'>"; 
		//SECTION HEAD LINE
		strHtml = strHtml + "<tr class='alt1'>";
		strHtml = strHtml + "<td height='29' colspan='2' align='center'  class='texts2'>";
		strHtml = strHtml + "<input name='hEd_ID" + Counter + "' type='hidden' id='hEd_ID" + Counter + "' value='-1'>";
		strHtml = strHtml + "<U><strong>Academic Qualification :" + intLevel + "</strong></U>";
		strHtml = strHtml + "</td>";
		strHtml = strHtml + "</tr>";			

		//LEVEL OF EDUCATION:
		strHtml = strHtml + "<tr>";
		strHtml = strHtml +	"<td width='182' height='29'  class='texts2' align='right'>Level of Education :</td>";
		strHtml = strHtml + "<td width='392' >";
        strHtml = strHtml + "<SELECT name='cboEduLevel" + Counter + "' size=1 class='texts2'  style='width:180' id='EducationLevel' onChange='EduLevel_ChangedStatus_Step02(this.id);'>";
		strHtml = strHtml + levelH ;
        strHtml = strHtml + "</SELECT><span class='red_text'><b>*</b></span>";
		strHtml = strHtml + "</td>";
		strHtml = strHtml + "</tr>";

		//EXAM/DEGREE TITLE:
		strHtml = strHtml + "<tr class='alt1'>";
		strHtml = strHtml + "<td height='29' align='right' class='texts2'>Exam/Degree Title :</td>";
		strHtml = strHtml + "<td>";
		strHtml = strHtml + "<INPUT class='texts2' id='ExamTitle' maxLength=100 size='54' name='txtExamTitle" + Counter + "'><span class='red_text'><b>*</b></span>";
		strHtml = strHtml + "</td>";
		strHtml = strHtml + "</tr>";
			
		//===================================
		//========Major / Group==========
		
		strHtml = strHtml + "<tr>";
		strHtml = strHtml + "<td height='29' align='right' class='texts2'>Major/Group :</td>";
		strHtml = strHtml + "<td class='BDJValues' id='Group'>";
		strHtml = strHtml + "<SELECT name='cboGroup" + Counter + "' id='cboGroup" + Counter + "' onChange=\"Show_Major_group(this.id,'txtGroup" + Counter + "');\"><span class='red_text'><b>*</b></span>";
		strHtml = strHtml + resultHH;
		strHtml = strHtml + "</SELECT><span class='red_text'><b>*</b></span>";
		trHtml = strHtml + "</td>";
		strHtml = strHtml + "</tr>";
		
		
    	//Group Text:
		strHtml = strHtml + "<tr>";
		strHtml = strHtml + "<td height='29' align='right' class='texts2' id='Caption_Group" + Counter + "'></td>";
		strHtml = strHtml + "<td class='texts2' id='TextBox_Group'>";
		strHtml = strHtml + "<INPUT class='texts2' onkeypress='return blockNonNumbers(this, event, true, false);' id='txtGroup" + Counter + "' onblur='extractNumber(this,2,false)' onkeyup='extractNumber(this,2,false)' style='width:300; background-color: rgb(255, 255, 206);VISIBILITY: hidden' maxLength=300 size=10 name='txtGroup" + Counter + "'>";
        strHtml = strHtml + "</td>";
		strHtml = strHtml + "</tr>";
		
	   //INSTITUTE NAME:-->
		strHtml = strHtml + "<tr class='alt1'>";
		strHtml = strHtml + "<td height='29' align='right'  class='texts2'>Institute Name  :</td>";
		strHtml = strHtml + "<td id='InstituteName" + Counter + "' class='texts2'>";
		strHtml = strHtml + "<INPUT class='texts2' id='InstituteName' maxLength=80 size='54' name='txtInstituteName" + Counter + "'><span class='red_text'><b>*</b></span>";
		strHtml = strHtml + "</td>";
		strHtml = strHtml + "</tr>";
			
		//Result:---------------------------------------------------------------------------------
		strHtml = strHtml + "<tr class='alt1'>";
		strHtml = strHtml + "<td height='29' align='right' class='texts2'>Result : </td>";
		strHtml = strHtml + "<td class='texts2'>";
		strHtml = strHtml + "<SELECT name='cboResult" + Counter + "' id='cboResult' onChange=\"Show_MarksTextBox_Step02(this.id,'txtResult" + Counter + "','spnStar" + Counter + "','spnCGPAScale" + Counter + "','txtCGPAScale" + Counter + "','spnCGPAStar" + Counter + "','spnHideResult" + Counter + "');\"><span class='red_text'><b>*</b></span>";
		strHtml = strHtml + resultH;	
		strHtml = strHtml + "</SELECT><span class='red_text'><b>*</b></span>";
        strHtml = strHtml + "</td>";
		strHtml = strHtml + "</tr>";
		
		//Marks:
		strHtml = strHtml + "<tr>";
		strHtml = strHtml + "<td height='29' align='right' class='texts2' id='Caption_Marks'></td>";
		strHtml = strHtml + "<td class='texts2' id='TextBox_Marks'>";
	    strHtml = strHtml + "<INPUT class='texts2' onkeypress='return blockNonNumbers(this, event, true, false);' id='txtResult" + Counter + "' onblur='extractNumber(this,2,false)' onkeyup='extractNumber(this,2,false)' style='background-color: rgb(255, 255, 206); VISIBILITY: hidden' maxLength=5 size=10 name='txtResult" + Counter + "'>";
	    strHtml = strHtml + "<span class='red_text' id='spnStar" + Counter + "' style='visibility:hidden'><b>*</b></span>";
        strHtml = strHtml + "<span class='texts2' id='spnCGPAScale" + Counter + "'  style='visibility:hidden'>Scale :</span>";
	    strHtml = strHtml + "<input name='txtCGPAScale" + Counter + "' type='text' class='texts2' id='txtCGPAScale" + Counter + "' onblur='extractNumber(this,2,false)' onkeypress=\"return blockNonNumbers(this, event, true, false);\" onkeyup='extractNumber(this,2,false)' size='3' maxlength='1' style='VISIBILITY: hidden'>";	
	    strHtml = strHtml + "<span class='red_text' id='spnCGPAStar" + Counter + "' style='visibility:hidden'><b>*</b></span>";
		strHtml = strHtml + "</td>";
		strHtml = strHtml + "</tr>";			
		
		//Year of Pass:
		strHtml = strHtml + "<tr class='alt1'>";
		strHtml = strHtml + "<td height='29' align='right'  class='texts2' id='Caption_Year" + Counter + "'>Year of Passing : </td>";
		strHtml = strHtml + "<td  class='texts2'>";
		strHtml = strHtml + "<SELECT name='FYEAR" + Counter + "' class='texts2' id='Year of passing'>";
		strHtml = strHtml + yearH;
		strHtml = strHtml + "</SELECT><span class='red_text'><b>*</b></span>";
		strHtml = strHtml + "</td>";
		strHtml = strHtml + "</tr>";
		
		//DURATION:-->
		strHtml = strHtml + "<tr>";
		strHtml = strHtml + "<td height='29' align='right'  class='texts2'>Duration : </td>";
		strHtml = strHtml + "<td  class='texts2'>";
		strHtml = strHtml + "<INPUT class=texts2 maxLength='50' size='54' id='txtEduDuration' name='txtEduDuration" + Counter + "'>";
		strHtml = strHtml + "</td>";
		strHtml = strHtml + "</tr>";
		
		//ACHIEVEMENT:-->
		strHtml = strHtml + "<tr class='alt1'>";
		strHtml = strHtml + "<td height='29' align='right'  class='texts2'>Achievement : </td>";
		strHtml = strHtml + "<td  class='texts2'>";
		strHtml = strHtml + "<INPUT class=texts2 maxLength=100 size='54' name='txtAchievement" + Counter + "' id='txtAchievement'>";
		strHtml = strHtml + "</td>";
		strHtml = strHtml + "</tr>";
		
		strHtml = strHtml + "</table>";
		
		if(strMyString=="Insert"){
		   	document.getElementById("spnAcademic"+Counter).innerHTML += strHtml; 			
			Counter++;
			document.getElementById("txtAcademicCounter").value=Counter;
		}
			
		if(strMyString=="Edit"){
			document.getElementById("spnAcademic"+Counter).innerHTML += strHtml; 			
			Counter++;
			document.getElementById("txtAcademicCounter").value=Counter;			
		}
	}
	else{
		alert("System does not permit to enter more then 8 academic details.")
	}
}//End of AddControls_AcademicQualification_Step02()

/*
---------------------------------------------------------------------------------------------------------
Function No   : 06
---------------------------------------------------------------------------------------------------------
Purpose 	  : To remove dynamically added controls from Academic Qualification section of the Step 02
---------------------------------------------------------------------------------------------------------
Page		  : step_02.asp, step_02_edit.asp 
---------------------------------------------------------------------------------------------------------
Author  	  : Pulak
---------------------------------------------------------------------------------------------------------
Last Modified : 05 Feb 2005 
---------------------------------------------------------------------------------------------------------
*/
function RemoveControls_AcademicQualification_Step02(strMyString){
	var Counter = parseInt(document.getElementById("txtAcademicCounter").value);
	
	if(strMyString=="Insert"){
	  //document.getElementById("spnAcademic"+(Counter-4)).innerHTML = "";
	  Counter--;
	  document.getElementById("spnAcademic"+Counter).innerHTML = "";
	  document.getElementById("txtAcademicCounter").value = Counter;
	}
	
	if(strMyString=="Edit"){
	   Counter--;
	   document.getElementById("spnAcademic"+Counter).innerHTML = "";
	   document.getElementById("txtAcademicCounter").value=Counter;
	}
}//End of RemoveControls_AcademicQualification_Step02()

/*
---------------------------------------------------------------------------------------------------------
Function No   : 07
---------------------------------------------------------------------------------------------------------
Purpose 	  : To determine the Enable and Disable state of 
				the Add and Remove buttons in Academic Qualification section of the Step 02
---------------------------------------------------------------------------------------------------------			   
Page		  : Step_02.asp, Step_02_Edit.asp				   
---------------------------------------------------------------------------------------------------------			   
Author  	  : Pulak
---------------------------------------------------------------------------------------------------------
Last Modified : 05 Feb 2005 
---------------------------------------------------------------------------------------------------------
*/
function ChangeButtonState_AcademicQualification_Step02(cmdAdd,cmdRemove,txtAcademicCounter,txtInitialRecord){
	var Counter = parseInt(document.getElementById(txtAcademicCounter).value);
	
	if(txtInitialRecord=="Insert"){
		//Add Button:
		if (Counter >= 10){
			document.getElementById(cmdAdd).disabled = true;
		}		
		if (Counter < 10){
			document.getElementById(cmdAdd).disabled = false;
		}		

		//Remove Button:
		if (Counter > 1){  // After 1 remove button enable 
			document.getElementById(cmdRemove).disabled = false;
		}
		if (Counter == 1){
			document.getElementById(cmdRemove).disabled = true;
		}
	}
	
	if(txtInitialRecord!="Insert"){
		//Add Button
		if (Counter >= 10){
			EnableDisable(cmdAdd,true);
		}
		if (Counter < 10){
			EnableDisable(cmdAdd,false);
		}

		//Remove Button
		if (Counter > parseInt(document.getElementById(txtInitialRecord).value)){
			EnableDisable(cmdRemove,false);
		}
		if (Counter == parseInt(document.getElementById(txtInitialRecord).value)){
			EnableDisable(cmdRemove,true);
		}
	}
}//End of ChangeButtonState_AcademicQualification_Step02()
	
/*
---------------------------------------------------------------------------------------------------------
Function No   : 08
---------------------------------------------------------------------------------------------------------
Purpose 	  : To add controls dynamically in Training section of the Step 02.
---------------------------------------------------------------------------------------------------------
Pages         : step_02.asp, step_02_edit.asp 
---------------------------------------------------------------------------------------------------------
Author  	  : Pulak
---------------------------------------------------------------------------------------------------------
Last Modified : 04 Feb 2005 
---------------------------------------------------------------------------------------------------------
*/
function AddControl_Training_Step02(){
		var Counter1 = document.getElementById("txtTrainingCounter").value;
		var strHtml1;
		var intLevel =Counter1;
		
		intLevel++;
		if(Counter1 < 10 ){
			strHtml1 = "<table width='100%' border='0' cellspacing='0' cellpadding='0' style='margin-bottom:1px;' >";			
			//BLOCK IDENTIFICATION:
			 strHtml1 = strHtml1 + "<tr>";
			 strHtml1 = strHtml1 + "<td height='29' colspan='2' align='center' class='texts2'><U class='BDJPanelNavNormal'><strong><span class='style_SubSectionHeadLine'>";
			 strHtml1 = strHtml1 + "<input name='hT_ID" + Counter1 + "' id='hT_ID" + Counter1 + "' type='hidden' value='-1'>";
			 strHtml1 = strHtml1 + "</span>Training : " + intLevel + "</strong></U></td>";
			 strHtml1 = strHtml1 + "</tr>";
			
			 //TRAINING TITLE:
			 strHtml1 = strHtml1 + "<tr>";
			 strHtml1 = strHtml1 + "<td width='25%' height='29' align='right' class='texts2'>Training Title :</td>";
			 strHtml1 = strHtml1 + "<td width='75%' class='texts2'>";
			 strHtml1 = strHtml1 + "<INPUT class=texts2 name='txtTName" + Counter1 + "' id='txtTName" + Counter1 + "' maxLength=100 size='54'>";
			 strHtml1 = strHtml1 + "</td>";    
			 strHtml1 = strHtml1 + "</tr>";
		 
			 //TOPIC COVERED:
			 strHtml1 = strHtml1 + "<tr>";
			 strHtml1 = strHtml1 + "<td height='29' align='right' class='texts2'>Topics Covered :</td>";
			 strHtml1 = strHtml1 + "<td  class='texts2'>";
			 strHtml1 = strHtml1 + "<INPUT class=texts2 name='txtTTopic" + Counter1 + "' id='txtTTopic" + Counter1 + "' maxLength=300 size='54'></td>";
			 strHtml1 = strHtml1 + "</tr>";

			 //INSTITUTE:
			 strHtml1 = strHtml1 + "<tr>";
			 strHtml1 = strHtml1 + "<td height='29' align='right'  class='texts2'>Institute :</td>";
			 strHtml1 = strHtml1 + "<td  class='texts2'>";
			 strHtml1 = strHtml1 + "<INPUT class=texts2 name='txtTInstitute" + Counter1 + "' id='txtTInstitute" + Counter1 + "' maxLength=80 size='54'></td>";
			 strHtml1 = strHtml1 + "</tr>";
		 
			 //COUNTRY:
			 strHtml1 = strHtml1 + "<tr >";
			 strHtml1 = strHtml1 + "<td height='29' align='right'  class='texts2'>Country :</td>";
			 strHtml1 = strHtml1 + "<td class='texts2'>";
			 strHtml1 = strHtml1 + "<INPUT class=texts2 name='txtTCountry" + Counter1 + "' id='txtTCountry" + Counter1 + "' maxLength=50 size='54'></td>";
			 strHtml1 = strHtml1 + "</tr>";
		 
			 <!--LOCATION-->       
			 strHtml1 = strHtml1 + "<tr>"
			 strHtml1 = strHtml1 + "<td height='29' align='right' class='texts2'>Location : </td>";
			 strHtml1 = strHtml1 + "<td class='texts2'>";
			 strHtml1 = strHtml1 + "<INPUT class=texts2 name='txtTLocation" + Counter1 + "' id='txtTLocation" + Counter1 + "' maxLength=50 size='54'></td>";
			 strHtml1 = strHtml1 + "</tr>";

			 //TRAINING YEAR:-->
			 strHtml1 = strHtml1 + "<tr >";
			 strHtml1 = strHtml1 + "<td height='29' align='right' class='texts2'>Training Year : </td>";
			 strHtml1 = strHtml1 + "<td  class='texts2'>";
			 strHtml1 = strHtml1 + "<SELECT class='texts2' name='FYEART" + Counter1 + "' id='YEAR" + Counter1 + "' size=1>";
			 strHtml1 = strHtml1 + TyearH;
			 strHtml1 = strHtml1 + "</SELECT>";
			 strHtml1 = strHtml1 + "</td>";
			 strHtml1 = strHtml1 + "</tr>";
		 
			 //DURATION:
			 strHtml1 = strHtml1 + "<tr>";
			 strHtml1 = strHtml1 + "<td height='29' align='right'  class='texts2'>Duration : </td>";
			 strHtml1 = strHtml1 + "<td class='texts2'>";
			 strHtml1 = strHtml1 + "<INPUT class=texts2 name='txtTDuration" + Counter1 + "' id='txtTDuration" + Counter1 + "'  maxLength=20 size=13>";
			 strHtml1 = strHtml1 + "</td>";
			 strHtml1 = strHtml1 + "</tr>";

			strHtml1 = strHtml1 + "</table>";
			
			document.getElementById("spnTraining"+Counter1).innerHTML += strHtml1; 			
			Counter1++;
			document.getElementById("txtTrainingCounter").value=Counter1;		
		}
		else{
			alert("System does not permit to add more then 10 training details.");
		}	
}//End of AddControl_Training_Step02()

/*
---------------------------------------------------------------------------------------------------------
Function No   : 09
---------------------------------------------------------------------------------------------------------
Purpose 	  : To remove dynamically added controls from Training section of the Step 02
---------------------------------------------------------------------------------------------------------
Page		  : step_02.asp, step_02_edit.asp
---------------------------------------------------------------------------------------------------------
Author  	  : Pulak
---------------------------------------------------------------------------------------------------------
Last Modified : 04 Feb 2005
---------------------------------------------------------------------------------------------------------
*/
function RemoveControls_Training_Step02(){
	var Counter = parseInt(document.getElementById("txtTrainingCounter").value);	
	
	Counter--;
	document.getElementById("spnTraining"+Counter).innerHTML = "";
	document.getElementById("txtTrainingCounter").value=Counter;
}//End of RemoveControls_Training_Step_02_Edit()

/*
---------------------------------------------------------------------------------------------------------
Function No   : 10
---------------------------------------------------------------------------------------------------------
Purpose 	  : To determine the Enable and Disable state of the Add and Remove buttons 
				in Training section of the Step 02.
---------------------------------------------------------------------------------------------------------
Page		  : step_02.asp, step_02_edit.asp
---------------------------------------------------------------------------------------------------------
Author  	  : Pulak
---------------------------------------------------------------------------------------------------------
Last Modified : 04 Feb 2005
---------------------------------------------------------------------------------------------------------
*/
function ChangeButtonState_Training_Step02(cmdAdd,cmdRemove,txtCounter,txtInitialRecord){
	var Counter = parseInt(document.getElementById(txtCounter).value);
	
	//Works in Step_02.asp Page
	if(txtInitialRecord =="Insert"){
		//Add Button
		if (Counter >= 10){
			document.getElementById(cmdAdd).disabled = true;
		}
		if (Counter < 10){
			document.getElementById(cmdAdd).disabled = false;
		}

		//Remove Button
		if (Counter == 1){
			document.getElementById(cmdRemove).disabled = true;
		}		
		if (Counter > 1){
			document.getElementById(cmdRemove).disabled = false;
		}
	}//
	
	//Works in Stape_02_Edit.asp Page
	if (txtInitialRecord !="Insert"){
		if (Counter >= 10){
			EnableDisable(cmdAdd,true);
		}
		if (Counter < 10){
			EnableDisable(cmdAdd,false);
		}

		//Remove Button
		if (Counter == parseInt(document.getElementById(txtInitialRecord).value)){
			EnableDisable(cmdRemove,true);
		}		
		if (Counter > parseInt(document.getElementById(txtInitialRecord).value)){
			EnableDisable(cmdRemove,false);
		}
	}//
}//End of ChangeButtonState_Training_Step02()

/*
---------------------------------------------------------------------------------------------------------
Function No   : 11
---------------------------------------------------------------------------------------------------------
Purpose 	  : To add controls dynamically in Professional Qualification section of the Step 02.
---------------------------------------------------------------------------------------------------------
Page		  : step_02.asp, step_02_edit.asp
---------------------------------------------------------------------------------------------------------
Author  	  : Pulak
---------------------------------------------------------------------------------------------------------
Last Modified : 05 Feb 2005
---------------------------------------------------------------------------------------------------------
*/
function AddControl_ProQualification_Step02(strMyString){
	/*
	Parameter Description:
	----------------------
	strMyString holds value either "Insert" or "Edit". It determines the path of the image of calender 
	contol. Tn the associated pages, this image is loaded from different locations.
	*/
		var strHtml;
		var Counter = document.getElementById("txtPECounter").value;
		
		var intLevel =Counter;
		intLevel++;
		if(Counter < 10 ){
			 strHtml = "<table width='100%' border='0' cellspacing='1' cellpadding='0' style='margin-bottom:1px;' class='alt2'>";
			 //BLOCK IDENTIFICATION:
			 strHtml = strHtml + "<tr class='alt1'>";
			 strHtml = strHtml + "<td height='29' colspan='2' align='center' class='texts2'>";
			 strHtml = strHtml + "<input name='hP_ID" + Counter + "' type='hidden' id='hP_ID" + Counter + "' value='-1'>";
			 strHtml = strHtml + "</span><U><strong>Training : " + intLevel + " </strong></U></td>";
			 strHtml = strHtml + "</tr>";

			 //TITLE:
			 strHtml = strHtml + "<tr>";
			 strHtml = strHtml + "<td height='29' align='right' class='texts2' width='25%'>Certification :</td>"
			 strHtml = strHtml + "<td class='texts2' width='75%'>";
			 strHtml = strHtml + "<INPUT class=texts2 id='txtPName" + Counter + "' maxLength='80' size='54' name='txtPName" + Counter + "'>";
			 strHtml = strHtml + "</td>";
			 strHtml = strHtml + "</tr>";
			
			 //TOPIC:
			 /*
			 strHtml = strHtml + "<tr>";
			 strHtml = strHtml + "<td height='29' align='right' bgcolor='#e9ece9' class='texts2'>Topic :</td>";
			 strHtml = strHtml + "<td bgcolor='#e9ece9' class='BDJValues'>";
			 strHtml = strHtml + "<INPUT class=texts2 id='txtPTopic" + Counter + "' maxLength=300 size='54' name='txtPTopic" + Counter + "'></td>";
			 strHtml = strHtml + "</tr>";
			 */	
			//INSTITUTE
			strHtml = strHtml + "<tr class='alt1'>";
			strHtml = strHtml + "<td height='29' align='right'  class='texts2'>Institute :</td>";
			strHtml = strHtml + "<td class='texts2'>";
			strHtml = strHtml + "<INPUT class=texts2 id='txtInstitute" + Counter + "' maxLength=80 size='54' name='txtInstitute" + Counter + "'></td>";
			strHtml = strHtml + "</tr>";
			
			//LOCATION:        
			strHtml = strHtml + "<tr>";
			strHtml = strHtml + "<td height='29' align='right'  class='texts2'>Location : </td>";
			strHtml = strHtml + "<td class='texts2'>";
			strHtml = strHtml + "<INPUT class=texts2 id='txtPPlace" + Counter + "' maxLength=50 size=15 name='txtPPlace" + Counter + "'></td>";
			strHtml = strHtml + "</tr>";
			
			//DATE:
			/*			
			strHtml = strHtml + "<tr>";
			strHtml = strHtml + "<td height='29' align='right' bgcolor='#e9ece9' class='texts2'>From : </td>";
			strHtml = strHtml + "<td nowrap bgcolor='#e9ece9' class='BDJValues'>";
			strHtml = strHtml + "<INPUT class=texts2 id='txtPFrom" + Counter + "' onclick=\"popUpCalendar(this, document.getElementById('txtPFrom" + Counter + "'),'mm/dd/yyyy', 0, 0)\" readOnly size=9 name='txtPFrom" + Counter + "'>";
			strHtml = strHtml + "<img src='images/icons/calendar.gif' alt='Choose Date' width='17' height='16' class='BDJValign' onClick=\"popUpCalendar(this, document.getElementById('txtPFrom" + Counter + "'),'mm/dd/yyyy', 0, 0)\"'> <span class='texts2'>To</span>";
			strHtml = strHtml + "<INPUT class=texts2 id='txtPTo" + Counter + "'  onclick=\"popUpCalendar(this, document.getElementById('txtPTo" + Counter+ "'),  'mm/dd/yyyy', 0, 0)\" readOnly size=9 name='txtPTo" + Counter + "'>";
			strHtml = strHtml + "<img src='images/icons/calendar.gif' alt='Choose Date' width='17' height='16' class='BDJValign' onClick=\"popUpCalendar(this, document.getElementById('txtPTo" + Counter+ "'),  'mm/dd/yyyy', 0, 0)\"'></td>";
			strHtml = strHtml + "</tr>";
			*/
			strHtml = strHtml + "<tr class='alt1'>";
			strHtml = strHtml + "<td height='29' align='right'  class='texts2'>From : </td>";
			strHtml = strHtml + "<td nowrap  class='texts2'>";
			strHtml = strHtml + "<SELECT name='cboFromDay" + Counter + "' id='cboFromDay" + Counter + "'>";
			strHtml = strHtml + "<option value='day' selected>day</option>";
			strHtml = strHtml + "<option value='01'>01</option>";
			strHtml = strHtml + "<option value='02'>02</option>";
			strHtml = strHtml + "<option value='03'>03</option>";
			strHtml = strHtml + "<option value='04'>04</option>";
			strHtml = strHtml + "<option value='05'>05</option>";
			strHtml = strHtml + "<option value='06'>06</option>";
			strHtml = strHtml + "<option value='07'>07</option>";
			strHtml = strHtml + "<option value='08'>08</option>";
			strHtml = strHtml + "<option value='09'>09</option>";
			strHtml = strHtml + "<option value='10'>10</option>";
			strHtml = strHtml + "<option value='11'>11</option>";
			strHtml = strHtml + "<option value='12'>12</option>";
			strHtml = strHtml + "<option value='13'>13</option>";
			strHtml = strHtml + "<option value='14'>14</option>";
			strHtml = strHtml + "<option value='15'>15</option>";
			strHtml = strHtml + "<option value='16'>16</option>";
			strHtml = strHtml + "<option value='17'>17</option>";
			strHtml = strHtml + "<option value='18'>18</option>";
			strHtml = strHtml + "<option value='19'>19</option>";
			strHtml = strHtml + "<option value='20'>20</option>";
			strHtml = strHtml + "<option value='21'>21</option>";
			strHtml = strHtml + "<option value='22'>22</option>";
			strHtml = strHtml + "<option value='23'>23</option>";
			strHtml = strHtml + "<option value='24'>24</option>";
			strHtml = strHtml + "<option value='25'>25</option>";
			strHtml = strHtml + "<option value='26'>26</option>";
			strHtml = strHtml + "<option value='27'>27</option>";
			strHtml = strHtml + "<option value='28'>28</option>";
			strHtml = strHtml + "<option value='29'>29</option>";
			strHtml = strHtml + "<option value='30'>30</option>";
			strHtml = strHtml + "<option value='31'>31</option>";
			strHtml = strHtml + "</SELECT>";
			strHtml = strHtml + "<SELECT name='cboFromMonth" + Counter + "' id='cboFromMonth" + Counter + "'>";
			strHtml = strHtml + "<option value='mon' selected>mon</option>";
			strHtml = strHtml + "<option value='1'>Jan</option>";
			strHtml = strHtml + "<option value='2'>Feb</option>";
			strHtml = strHtml + "<option value='3'>Mar</option>";
			strHtml = strHtml + "<option value='4'>Apr</option>";
			strHtml = strHtml + "<option value='5'>May</option>";
			strHtml = strHtml + "<option value='6'>Jun</option>";
			strHtml = strHtml + "<option value='7'>Jul</option>";
			strHtml = strHtml + "<option value='8'>Aug</option>";
			strHtml = strHtml + "<option value='9'>Sep</option>";
			strHtml = strHtml + "<option value='10'>Oct</option>";
			strHtml = strHtml + "<option value='11'>Nov</option>";
			strHtml = strHtml + "<option value='12'>Dec</option>";
			strHtml = strHtml + "</SELECT>";
			strHtml = strHtml + "<SELECT name='cboFromYear" + Counter + "' id='cboFromYear" + Counter + "'>";
			strHtml = strHtml + "<option value='year' selected>year</option>";
			var y = new Date();
			for (var i = y.getFullYear()-50; i <= y.getFullYear(); i++ )
			{
				strHtml = strHtml + "<option value='"+i+"'>"+i+"</option>";
			}
			strHtml = strHtml + "</SELECT>";
			strHtml = strHtml + "<span class='texts2'>&nbsp;To&nbsp;</span>";
			strHtml = strHtml + "<SELECT name='cboToDay" + Counter + "' id='cboToDay" + Counter + "'>";
			strHtml = strHtml + "<option value='day' selected>day</option>";
			strHtml = strHtml + "<option value='01'>01</option>";
			strHtml = strHtml + "<option value='02'>02</option>";
			strHtml = strHtml + "<option value='03'>03</option>";
			strHtml = strHtml + "<option value='04'>04</option>";
			strHtml = strHtml + "<option value='05'>05</option>";
			strHtml = strHtml + "<option value='06'>06</option>";
			strHtml = strHtml + "<option value='07'>07</option>";
			strHtml = strHtml + "<option value='08'>08</option>";
			strHtml = strHtml + "<option value='09'>09</option>";
			strHtml = strHtml + "<option value='10'>10</option>";
			strHtml = strHtml + "<option value='11'>11</option>";
			strHtml = strHtml + "<option value='12'>12</option>";
			strHtml = strHtml + "<option value='13'>13</option>";
			strHtml = strHtml + "<option value='14'>14</option>";
			strHtml = strHtml + "<option value='15'>15</option>";
			strHtml = strHtml + "<option value='16'>16</option>";
			strHtml = strHtml + "<option value='17'>17</option>";
			strHtml = strHtml + "<option value='18'>18</option>";
			strHtml = strHtml + "<option value='19'>19</option>";
			strHtml = strHtml + "<option value='20'>20</option>";
			strHtml = strHtml + "<option value='21'>21</option>";
			strHtml = strHtml + "<option value='22'>22</option>";
			strHtml = strHtml + "<option value='23'>23</option>";
			strHtml = strHtml + "<option value='24'>24</option>";
			strHtml = strHtml + "<option value='25'>25</option>";
			strHtml = strHtml + "<option value='26'>26</option>";
			strHtml = strHtml + "<option value='27'>27</option>";
			strHtml = strHtml + "<option value='28'>28</option>";
			strHtml = strHtml + "<option value='29'>29</option>";
			strHtml = strHtml + "<option value='30'>30</option>";
			strHtml = strHtml + "<option value='31'>31</option>";
			strHtml = strHtml + "</SELECT>";
			strHtml = strHtml + "<SELECT name='cboToMonth" + Counter + "' id='cboToMonth" + Counter + "'>";
			strHtml = strHtml + "<option value='mon' selected>mon</option>";
			strHtml = strHtml + "<option value='1'>Jan</option>";
			strHtml = strHtml + "<option value='2'>Feb</option>";
			strHtml = strHtml + "<option value='3'>Mar</option>";
			strHtml = strHtml + "<option value='4'>Apr</option>";
			strHtml = strHtml + "<option value='5'>May</option>";
			strHtml = strHtml + "<option value='6'>Jun</option>";
			strHtml = strHtml + "<option value='7'>Jul</option>";
			strHtml = strHtml + "<option value='8'>Aug</option>";
			strHtml = strHtml + "<option value='9'>Sep</option>";
			strHtml = strHtml + "<option value='10'>Oct</option>";
			strHtml = strHtml + "<option value='11'>Nov</option>";
			strHtml = strHtml + "<option value='12'>Dec</option>";
			strHtml = strHtml + "</SELECT>";
			strHtml = strHtml + "<SELECT name='cboToYear" + Counter + "' id='cboToYear" + Counter + "'>";
			strHtml = strHtml + "<option value='year' selected>year</option>";
			var y = new Date();
			for (var i = y.getFullYear()-50; i <= y.getFullYear(); i++ )
			{
				strHtml = strHtml + "<option value='"+i+"'>"+i+"</option>";
			}
			strHtml = strHtml + "</SELECT>";			
			strHtml = strHtml + "</td>";
			strHtml = strHtml + "</tr>";			
			strHtml = strHtml + "</table>";
			document.getElementById("spnPEducation"+Counter).innerHTML += strHtml; 			
			Counter++;
			document.getElementById("txtPECounter").value=Counter;
		}
		else{
		   alert("System does not permit to enter more then 10 professional education details.");
		}			
}//End of AddControl_ProQualification_Step02()

/*
---------------------------------------------------------------------------------------------------------
Function No   : 12
---------------------------------------------------------------------------------------------------------
Purpose 	  : To remove dynamically added controls from Professional Qualification section of the Step 02
---------------------------------------------------------------------------------------------------------
Page		  : step_02.asp, step_02_edit.asp
---------------------------------------------------------------------------------------------------------
Author  	  : Pulak
---------------------------------------------------------------------------------------------------------
Last Modified : 05 Feb 2005
---------------------------------------------------------------------------------------------------------
*/
function RemoveControl_ProQualification_Step02(){
	var Counter = parseInt(document.getElementById("txtPECounter").value);
	Counter--;
	document.getElementById("spnPEducation"+Counter).innerHTML = "";
	document.getElementById("txtPECounter").value=Counter;
}//End of RemoveControl_ProQualification_Step02()

/*
---------------------------------------------------------------------------------------------------------
Function No   : 13
---------------------------------------------------------------------------------------------------------
Purpose 	  : To determine the Enable and Disable state of the Add and Remove buttons 
				in Training section of the Step 02.
---------------------------------------------------------------------------------------------------------
Page		  : step_02.asp, step_02_edit.asp
---------------------------------------------------------------------------------------------------------
Author  	  : Pulak
---------------------------------------------------------------------------------------------------------
Last Modified : 04 Feb 2005
---------------------------------------------------------------------------------------------------------
*/
function ChangeButtonState_ProQualification_Step02(cmdAdd,cmdRemove,txtCounter,txtInitialRecord){
	var Counter = parseInt(document.getElementById(txtCounter).value);
	
	//Works in Step_02.asp Page
	if(txtInitialRecord =="Insert"){
		//Add Button
		if (Counter >= 10){
			document.getElementById(cmdAdd).disabled = true;
		}
		if (Counter < 10){
			document.getElementById(cmdAdd).disabled = false;
		}

		//Remove Button
		if (Counter == 1){
			document.getElementById(cmdRemove).disabled = true;
		}		
		if (Counter > 1){
			document.getElementById(cmdRemove).disabled = false;
		}
	}//
	
	//Works in Stape_02_Edit.asp Page
	if (txtInitialRecord !="Insert"){
		if (Counter >= 10){
			EnableDisable(cmdAdd,true);
		}
		if (Counter < 10){
			EnableDisable(cmdAdd,false);
		}

		//Remove Button
		if (Counter == parseInt(document.getElementById(txtInitialRecord).value)){
			EnableDisable(cmdRemove,true);
		}		
		if (Counter > parseInt(document.getElementById(txtInitialRecord).value)){
			EnableDisable(cmdRemove,false);
		}
	}//
}//End of ChangeButtonState_Training_Step02()
