var http_request

function fnGetFileUploadDetail(pic_file_nm, pic_file_type, pic_file_size, pic_temp_file_nm){
	if (eval(pic_file_size)==0 || eval(pic_file_size)>50000){
		if (eval(pic_file_size)==0) alert("Picture file type is incorrect !!!");
		else alert("Picture size must over 50 kb !!!");
		
		document.getElementById('app_pic').src="../data/app/bg.gif";
		document.getElementById('pic_hide').value="";
		document.getElementById('pic_file_nm').value="";
		document.getElementById('pic_file_type').value="";
		document.getElementById('pic_file_size').value="";
		document.getElementById('pic_temp_file_nm').value="";
	}
	else{
		document.getElementById('pic_file_nm').value=pic_file_nm;
		document.getElementById('pic_file_type').value=pic_file_type;
		document.getElementById('pic_file_size').value=pic_file_size;
		document.getElementById('pic_temp_file_nm').value=pic_temp_file_nm;
	}
	document.getElementById('pic_file').disabled=false;
	
	/*alert(document.getElementById('pic_file_nm').value);
	alert(document.getElementById('pic_file_type').value);
	alert(document.getElementById('pic_file_size').value);
	alert(document.getElementById('pic_temp_file_nm').value);*/
	
	return true;
}

function fnGetParameters(bBack, pg_num, opt){
	if (bBack=="1" || (pg_num.substr(0, 1)=="0" && pg_num!="0.1" && pg_num!="0.4")) return null;
	else{
		switch (pg_num){
			case "0.1":
				if (opt=="forgot pwd"){
					var poststr="email="+encodeURI(document.getElementById("email").value);
				}
				else return null;
				
				return poststr;
			
			case "0.4":
				if (opt=="login"){
					var poststr="email="+encodeURI(document.getElementById("email").value)+
					"&pwd="+encodeURI(document.getElementById("pwd").value);
				}
				else if (opt=="change pwd"){
					var poststr="old_pwd="+encodeURI(document.getElementById("old_pwd").value)+
					"&pwd="+encodeURI(document.getElementById("pwd").value)+
					"&conf_pwd="+encodeURI(document.getElementById("conf_pwd").value);
				}
				
				return poststr;
			
			case "1":
				var poststr="app_first_nm="+encodeURI(document.getElementById("app_first_nm").value)+
				"&app_last_nm="+encodeURI(document.getElementById("app_last_nm").value)+
				"&email="+encodeURI(document.getElementById("email").value)+
				"&pwd="+encodeURI(document.getElementById("pwd").value)+
				"&conf_pwd="+encodeURI(document.getElementById("conf_pwd").value);
				
				return poststr;
			
			case "2":
				var poststr="pic_old="+encodeURI(document.getElementById("pic_old").value)+
				"&pic_hide="+encodeURI(document.getElementById("pic_hide").value)+
				"&pic_file_nm="+encodeURI(document.getElementById("pic_file_nm").value)+
				"&pic_file_type="+encodeURI(document.getElementById("pic_file_type").value)+
				"&pic_file_size="+encodeURI(document.getElementById("pic_file_size").value)+
				"&pic_temp_file_nm="+encodeURI(document.getElementById("pic_temp_file_nm").value)+
				"&jobs_1="+encodeURI(document.getElementById("jobs_1").value)+
				"&jobs_2="+encodeURI(document.getElementById("jobs_2").value)+
				"&work_on_sat="+encodeURI(document.frm_nm.elements["work_on_sat"][0].checked? "y" : "n")+
				"&present_salary="+encodeURI(document.getElementById("present_salary").value)+
				"&exp_salary="+encodeURI(document.getElementById("exp_salary").value)+
				"&title_th="+encodeURI(document.getElementById("title_th").value)+
				"&app_first_nm_th="+encodeURI(document.getElementById("app_first_nm_th").value)+
				"&app_last_nm_th="+encodeURI(document.getElementById("app_last_nm_th").value)+
				"&title_en="+encodeURI(document.getElementById("title_en").value)+
				"&app_first_nm_en="+encodeURI(document.getElementById("app_first_nm_en").value)+
				"&app_last_nm_en="+encodeURI(document.getElementById("app_last_nm_en").value)+
				"&id_card_no_1="+encodeURI(document.getElementById("id_card_no_1").value)+
				"&id_card_no_2="+encodeURI(document.getElementById("id_card_no_2").value)+
				"&id_card_no_3="+encodeURI(document.getElementById("id_card_no_3").value)+
				"&id_card_no_4="+encodeURI(document.getElementById("id_card_no_4").value)+
				"&id_card_no_5="+encodeURI(document.getElementById("id_card_no_5").value)+
				"&birth_dt="+encodeURI(document.getElementById("birth_dt").value)+
				"&nationality="+encodeURI(document.getElementById("nationality").value)+
				"&race="+encodeURI(document.getElementById("race").value)+
				"&religion="+encodeURI(document.getElementById("religion").value)+
				"&marital_status="+encodeURI(document.getElementById("marital_status").value)+
				"&height="+encodeURI(document.getElementById("height").value)+
				"&weight="+encodeURI(document.getElementById("weight").value)+
				"&curr_addr="+encodeURI(document.getElementById("curr_addr").value)+
				"&province="+encodeURI(document.getElementById("province").value)+
				"&tel="+encodeURI(document.getElementById("tel").value)+
				"&mobile="+encodeURI(document.getElementById("mobile").value)+
				"&email="+encodeURI(document.getElementById("email").value);
				
				return poststr;
			
			case "3":
				var poststr="en_listening="+encodeURI(document.frm_nm.elements["en_listening"][0].checked? "A" : 
				(document.frm_nm.elements["en_listening"][1].checked? "B" : 
				(document.frm_nm.elements["en_listening"][2].checked? "C" : "D")))+
				"&en_speaking="+encodeURI(document.frm_nm.elements["en_speaking"][0].checked? "A" : 
				(document.frm_nm.elements["en_speaking"][1].checked? "B" : 
				(document.frm_nm.elements["en_speaking"][2].checked? "C" : "D")))+
				"&en_reading="+encodeURI(document.frm_nm.elements["en_reading"][0].checked? "A" : 
				(document.frm_nm.elements["en_reading"][1].checked? "B" : 
				(document.frm_nm.elements["en_reading"][2].checked? "C" : "D")))+
				"&en_writing="+encodeURI(document.frm_nm.elements["en_writing"][0].checked? "A" : 
				(document.frm_nm.elements["en_writing"][1].checked? "B" : 
				(document.frm_nm.elements["en_writing"][2].checked? "C" : "D")))+
				"&jp_listening="+encodeURI(document.frm_nm.elements["jp_listening"][0].checked? "A" : 
				(document.frm_nm.elements["jp_listening"][1].checked? "B" : 
				(document.frm_nm.elements["jp_listening"][2].checked? "C" : 
				(document.frm_nm.elements["jp_listening"][3].checked? "D" : ""))))+
				"&jp_speaking="+encodeURI(document.frm_nm.elements["jp_speaking"][0].checked? "A" : 
				(document.frm_nm.elements["jp_speaking"][1].checked? "B" : 
				(document.frm_nm.elements["jp_speaking"][2].checked? "C" : 
				(document.frm_nm.elements["jp_speaking"][3].checked? "D" : ""))))+
				"&jp_reading="+encodeURI(document.frm_nm.elements["jp_reading"][0].checked? "A" : 
				(document.frm_nm.elements["jp_reading"][1].checked? "B" : 
				(document.frm_nm.elements["jp_reading"][2].checked? "C" : 
				(document.frm_nm.elements["jp_reading"][3].checked? "D" : ""))))+
				"&jp_writing="+encodeURI(document.frm_nm.elements["jp_writing"][0].checked? "A" : 
				(document.frm_nm.elements["jp_writing"][1].checked? "B" : 
				(document.frm_nm.elements["jp_writing"][2].checked? "C" : 
				(document.frm_nm.elements["jp_writing"][3].checked? "D" : ""))))+
				"&other_lang_spec="+encodeURI(document.getElementById("other_lang_spec").value)+
				"&other_listening="+encodeURI(document.frm_nm.elements["other_listening"][0].checked? "A" : 
				(document.frm_nm.elements["other_listening"][1].checked? "B" : 
				(document.frm_nm.elements["other_listening"][2].checked? "C" : 
				(document.frm_nm.elements["other_listening"][3].checked? "D" : ""))))+
				"&other_speaking="+encodeURI(document.frm_nm.elements["other_speaking"][0].checked? "A" : 
				(document.frm_nm.elements["other_speaking"][1].checked? "B" : 
				(document.frm_nm.elements["other_speaking"][2].checked? "C" : 
				(document.frm_nm.elements["other_speaking"][3].checked? "D" : ""))))+
				"&other_reading="+encodeURI(document.frm_nm.elements["other_reading"][0].checked? "A" : 
				(document.frm_nm.elements["other_reading"][1].checked? "B" : 
				(document.frm_nm.elements["other_reading"][2].checked? "C" : 
				(document.frm_nm.elements["other_reading"][3].checked? "D" : ""))))+
				"&other_writing="+encodeURI(document.frm_nm.elements["other_writing"][0].checked? "A" : 
				(document.frm_nm.elements["other_writing"][1].checked? "B" : 
				(document.frm_nm.elements["other_writing"][2].checked? "C" : 
				(document.frm_nm.elements["other_writing"][3].checked? "D" : ""))))+
				"&toeic="+encodeURI(document.getElementById("toeic").value)+
				"&toefl="+encodeURI(document.getElementById("toefl").value)+
				"&jp_test_level="+encodeURI(document.frm_nm.elements["jp_test_level"][0].checked? "1" : 
				(document.frm_nm.elements["jp_test_level"][1].checked? "2" : 
				(document.frm_nm.elements["jp_test_level"][2].checked? "3" : 
				(document.frm_nm.elements["jp_test_level"][3].checked? "4" : ""))))+
				"&os="+encodeURI(document.getElementById("os").value)+
				"&ms_office="+encodeURI(document.getElementById("ms_office").value)+
				"&internet="+encodeURI(document.getElementById("internet").value)+
				"&programming="+encodeURI(document.getElementById("programming").value)+
				"&db="+encodeURI(document.getElementById("db").value)+
				"&other_skill="+encodeURI(document.getElementById("other_skill").value);
				
				return poststr;
			
			case "4":
				var poststr="qs_knowledge="+encodeURI(document.getElementById("qs_knowledge").value)+
				"&other_engineer_skill="+encodeURI(document.getElementById("other_engineer_skill").value)+
				"&typing_th="+encodeURI(document.getElementById("typing_th").value)+
				"&typing_en="+encodeURI(document.getElementById("typing_en").value)+
				"&driving_license="+encodeURI(document.frm_nm.elements["driving_license"][0].checked? "y" : "n")+
				"&car="+encodeURI(document.frm_nm.elements["car"][0].checked? "y" : "n")+
				"&educ_level1="+encodeURI(document.getElementById("educ_level1").value)+
				"&inst_nm_1="+encodeURI(document.getElementById("inst_nm_1").value)+
				"&from_yr_1="+encodeURI(document.getElementById("from_yr_1").value)+
				"&until_yr_1="+encodeURI(document.getElementById("until_yr_1").value)+
				"&major_course_1="+encodeURI(document.getElementById("major_course_1").value)+
				"&gpa_1="+encodeURI(document.getElementById("gpa_1").value)+
				"&educ_level2="+encodeURI(document.getElementById("educ_level2").value)+
				"&inst_nm_2="+encodeURI(document.getElementById("inst_nm_2").value)+
				"&from_yr_2="+encodeURI(document.getElementById("from_yr_2").value)+
				"&until_yr_2="+encodeURI(document.getElementById("until_yr_2").value)+
				"&major_course_2="+encodeURI(document.getElementById("major_course_2").value)+
				"&gpa_2="+encodeURI(document.getElementById("gpa_2").value)+
				"&educ_level3="+encodeURI(document.getElementById("educ_level3").value)+
				"&inst_nm_3="+encodeURI(document.getElementById("inst_nm_3").value)+
				"&from_yr_3="+encodeURI(document.getElementById("from_yr_3").value)+
				"&until_yr_3="+encodeURI(document.getElementById("until_yr_3").value)+
				"&major_course_3="+encodeURI(document.getElementById("major_course_3").value)+
				"&gpa_3="+encodeURI(document.getElementById("gpa_3").value)+
				"&study_abroad="+encodeURI(document.frm_nm.elements["study_abroad"][0].checked? "y" : 
				(document.frm_nm.elements["study_abroad"][1].checked? "n" :""))+
				"&course1="+encodeURI(document.getElementById("course1").value)+
				"&inst_1="+encodeURI(document.getElementById("inst_1").value)+
				"&place_1="+encodeURI(document.getElementById("place_1").value)+
				"&certificate_1="+encodeURI(document.getElementById("certificate_1").value)+
				"&start_dt_1="+encodeURI(document.getElementById("start_dt_1").value)+
				"&end_dt_1="+encodeURI(document.getElementById("end_dt_1").value)+
				"&course2="+encodeURI(document.getElementById("course2").value)+
				"&inst_2="+encodeURI(document.getElementById("inst_2").value)+
				"&place_2="+encodeURI(document.getElementById("place_2").value)+
				"&certificate_2="+encodeURI(document.getElementById("certificate_2").value)+
				"&start_dt_2="+encodeURI(document.getElementById("start_dt_2").value)+
				"&end_dt_2="+encodeURI(document.getElementById("end_dt_2").value)+
				"&course3="+encodeURI(document.getElementById("course3").value)+
				"&inst_3="+encodeURI(document.getElementById("inst_3").value)+
				"&place_3="+encodeURI(document.getElementById("place_3").value)+
				"&certificate_3="+encodeURI(document.getElementById("certificate_3").value)+
				"&start_dt_3="+encodeURI(document.getElementById("start_dt_3").value)+
				"&end_dt_3="+encodeURI(document.getElementById("end_dt_3").value);
				
				return poststr;
			
			case "5": case "6": case "7":
				var poststr="com_nm="+encodeURI(document.getElementById("com_nm").value)+
				"&com_nationality="+encodeURI(document.getElementById("com_nationality").value)+
				"&com_location="+encodeURI(document.getElementById("com_location").value)+
				"&district="+encodeURI(document.getElementById("district").value)+
				"&com_bus="+encodeURI(document.getElementById("com_bus").value)+
				"&bus_spec="+encodeURI(document.getElementById("bus_spec").value)+
				"&com_prod="+encodeURI(document.getElementById("com_prod").value)+
				"&prod_spec="+encodeURI(document.getElementById("prod_spec").value)+
				"&pos_start="+encodeURI(document.getElementById("pos_start").value)+
				"&start_from_dt="+encodeURI(document.getElementById("start_from_dt").value)+
				"&start_to_dt="+encodeURI(document.getElementById("start_to_dt").value)+
				"&start_salary="+encodeURI(document.getElementById("start_salary").value)+
				"&pos_end="+encodeURI(document.getElementById("pos_end").value)+
				"&end_from_dt="+encodeURI(document.getElementById("end_from_dt").value)+
				"&end_to_dt="+encodeURI(document.getElementById("end_to_dt").value)+
				"&end_salary="+encodeURI(document.getElementById("end_salary").value)+
				"&job_desc="+encodeURI(document.getElementById("job_desc").value)+
				"&reason_leaving="+encodeURI(document.getElementById("reason_leaving").value);
				
				return poststr;
			
			case "8":
				var poststr="hobby="+encodeURI(document.getElementById("hobby").value)+
				"&strong_point="+encodeURI(document.getElementById("strong_point").value)+
				"&weak_point="+encodeURI(document.getElementById("weak_point").value)+
				"&habit="+encodeURI(document.getElementById("habit").value)+
				"&relative_nm="+encodeURI(document.getElementById("relative_nm").value)+
				"&department="+encodeURI(document.getElementById("department").value)+
				"&relation="+encodeURI(document.getElementById("relation").value);
				
				return poststr;
			
			default:
		}
	}
	
	return null;
}

function fnMakePOSTRequest(bBack, page_number, idx, opt){
	//if (bBack=="0" && page_number=="2"){ alert(document.getElementById("pic_file").value); return false;}
	
	if (!fnValidate(bBack, page_number, opt)) return false;
	else var parameters=fnGetParameters(bBack, page_number, opt);
	
	http_request=GetXmlHttpObject();
	if (http_request==null){
		  alert ("Your browser does not support AJAX!");
		  return;
	}
	var url="page_update.php";
	url=url+"?b="+bBack;
	url=url+"&p="+page_number;
	url=url+"&app_idx="+idx;
	if (typeof opt!="undefined") url=url+"&option="+opt;
	
	http_request.onreadystatechange=stateChanged;
	http_request.open("POST",url,true);
	if (parameters!=null){
		http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		http_request.setRequestHeader("Content-length", parameters.length);
		http_request.setRequestHeader("Connection", "close");
	}
	http_request.send(parameters); //null);
}

function fnShowCalendar(sobjID){
	showCalendar(sobjID, 'dd/mm/y');
}

function fnValidate(bBack, pg_num, opt){
	if (bBack=="1" || (pg_num.substr(0, 1)=="0" && pg_num!="0.1" && pg_num!="0.4")) return true;
	else{
		switch (pg_num){
			case "0.1":
				if (opt=="forgot pwd"){
					e=document.getElementById("email");
					if (Trim(e.value)==""){
						alert("Please fill User E-mail !!!");
						e.focus();
						return false;	
					}
					else if(!fnCheckEmail(Trim(e.value))){
						alert("User E-mail is incorrect !!!");
						e.focus();
						return false;
					}
				}
				
				break;
			
			case "0.4":
				if (opt=="login"){
					e=document.getElementById("email");
					if (Trim(e.value)==""){
						alert("Please fill User E-mail !!!");
						e.focus();
						return false;	
					}
					else if(!fnCheckEmail(Trim(e.value))){
						alert("User E-mail is incorrect !!!");
						e.focus();
						return false;
					}
					
					e=document.getElementById("pwd");
					if (Trim(e.value)==""){
						alert("Please fill Password !!!");
						e.focus();
						return false;	
					}
				}
				else if (opt=="change pwd"){
					e=document.getElementById("old_pwd");
					if (Trim(e.value)==""){
						alert("Please fill Old Password !!!");
						e.focus();
						return false;	
					}
					
					e=document.getElementById("pwd");
					if (Trim(e.value)==""){
						alert("Please fill Password !!!");
						e.focus();
						return false;	
					}
					else if(e.value!=document.getElementById("conf_pwd").value){
						alert("Password and Confirm Password not match !!!");
						e.focus();
						return false;
					}
				}
				
				break;
			
			case "1":
				e=document.getElementById("app_first_nm");
				if (Trim(e.value)==""){
					alert("Please fill First Name !!!");
					e.focus();
					return false;	
				}
				
				e=document.getElementById("app_last_nm");
				if (Trim(e.value)==""){
					alert("Please fill Last Name !!!");
					e.focus();
					return false;	
				}
				
				e=document.getElementById("email");
				if (Trim(e.value)==""){
					alert("Please fill User E-mail !!!");
					e.focus();
					return false;	
				}
				else if(!fnCheckEmail(Trim(e.value))){
					alert("User E-mail is incorrect !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("pwd");
				if (Trim(e.value)==""){
					alert("Please fill Password !!!");
					e.focus();
					return false;	
				}
				else if(e.value!=document.getElementById("conf_pwd").value){
					alert("Password and Confirm Password not match !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("chkAccept");
				if (!e.checked){
					alert("Please read the data privacy statement and accept it. !!!");
					e.focus();
					return false;	
				}
				
				break;
			
			case "2":
				e=document.getElementById("jobs_1");
				if (e.value==""){
					alert("Please select Interest Postion 1 !!!");
					e.focus();
					return false;
				}
				
				e=document.frm_nm.elements["work_on_sat"][0];
				if (!e.checked){
					e=document.frm_nm.elements["work_on_sat"][1];
					if (!e.checked){
						alert("Please fill 'Can you work on saturday' !!!");
						e.focus();
						return false;
					}
				}
				
				e=document.getElementById("exp_salary");
				if (e.value==""){
					alert("Please select Expected Salary !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("title_th");
				if (e.value==""){
					alert("Please select คำนำหน้าชื่อ !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("app_first_nm_th");
				if (Trim(e.value)==""){
					alert("Please fill ชื่อ !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("app_last_nm_th");
				if (Trim(e.value)==""){
					alert("Please fill นามสกุล !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("title_en");
				if (e.value==""){
					alert("Please select Prefix Name !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("app_first_nm_en");
				if (Trim(e.value)==""){
					alert("Please fill Name !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("app_last_nm_en");
				if (Trim(e.value)==""){
					alert("Please fill Last name !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("id_card_no_1");
				if (Trim(e.value)==""){
					alert("ID Card No. is incorrect !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("id_card_no_2");
				str=Trim(e.value);
				if (str.length<4){
					alert("ID Card No. is incorrect !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("id_card_no_3");
				str=Trim(e.value);
				if (str.length<5){
					alert("ID Card No. is incorrect !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("id_card_no_4");
				str=Trim(e.value);
				if (str.length<2){
					alert("ID Card No. is incorrect !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("id_card_no_5");
				if (Trim(e.value)==""){
					alert("ID Card No. is incorrect !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("birth_dt");
				if (e.value==""){
					alert("Please fill Date of Birth !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("nationality");
				if (e.value==""){
					alert("Please select Nationality !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("race");
				if (e.value==""){
					alert("Please fill Race !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("religion");
				if (e.value==""){
					alert("Please fill Religion !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("marital_status");
				if (e.value==""){
					alert("Please select Marital Status !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("height");
				if (e.value==""){
					alert("Please fill Height !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("weight");
				if (e.value==""){
					alert("Please fill Weight !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("curr_addr");
				if (e.value==""){
					alert("Please fill Current Address !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("province");
				if (e.value==""){
					alert("Please select Province !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("tel");
				if (e.value==""){
					alert("Please fill Tel !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("mobile");
				if (e.value==""){
					alert("Please fill Mobile Phone !!!");
					e.focus();
					return false;
				}
				
				e=document.getElementById("email");
				if (e.value==""){
					alert("Please fill E-mail address !!!");
					e.focus();
					return false;
				}
				
				break;
			
			case "3":
				e=document.frm_nm.elements["en_listening"][0];
				if (!e.checked){
					e=document.frm_nm.elements["en_listening"][1];
					if (!e.checked){
						e=document.frm_nm.elements["en_listening"][2];
						if (!e.checked){
							e=document.frm_nm.elements["en_listening"][3];
							if (!e.checked){
								alert("Please fill 'English Listening' !!!");
								e.focus();
								return false;
							}
						}
					}
				}
				
				e=document.frm_nm.elements["en_speaking"][0];
				if (!e.checked){
					e=document.frm_nm.elements["en_speaking"][1];
					if (!e.checked){
						e=document.frm_nm.elements["en_speaking"][2];
						if (!e.checked){
							e=document.frm_nm.elements["en_speaking"][3];
							if (!e.checked){
								alert("Please fill 'English Speaking' !!!");
								e.focus();
								return false;
							}
						}
					}
				}
				
				e=document.frm_nm.elements["en_reading"][0];
				if (!e.checked){
					e=document.frm_nm.elements["en_reading"][1];
					if (!e.checked){
						e=document.frm_nm.elements["en_reading"][2];
						if (!e.checked){
							e=document.frm_nm.elements["en_reading"][3];
							if (!e.checked){
								alert("Please fill 'English Reading' !!!");
								e.focus();
								return false;
							}
						}
					}
				}
				
				e=document.frm_nm.elements["en_writing"][0];
				if (!e.checked){
					e=document.frm_nm.elements["en_writing"][1];
					if (!e.checked){
						e=document.frm_nm.elements["en_writing"][2];
						if (!e.checked){
							e=document.frm_nm.elements["en_writing"][3];
							if (!e.checked){
								alert("Please fill 'English Writing' !!!");
								e.focus();
								return false;
							}
						}
					}
				}
				
				if (Trim(document.getElementById("os").value)==""){
					if (Trim(document.getElementById("ms_office").value)==""){
						if (Trim(document.getElementById("internet").value)==""){
							if (Trim(document.getElementById("programming").value)==""){
								if (Trim(document.getElementById("db").value)==""){
									if (Trim(document.getElementById("other_skill").value)==""){
										alert("Please fill Computer Skills !!!");
										document.getElementById("os").focus();
										return false;
									}
								}
							}
						}
					}
				}
				
				break;
			
			case "4":
				e=document.frm_nm.elements["driving_license"][0];
				if (!e.checked){
					e=document.frm_nm.elements["driving_license"][1];
					if (!e.checked){
						alert("Please fill 'Driving license' !!!");
						e.focus();
						return false;
					}
				}
				
				e=document.frm_nm.elements["car"][0];
				if (!e.checked){
					e=document.frm_nm.elements["car"][1];
					if (!e.checked){
						alert("Please fill 'Car' !!!");
						e.focus();
						return false;
					}
				}
				
				break;
			
			case "5": case "6": case "7":
				break;
			
			case "8":
				break;
			
			default:
				return false;
		}
	}
	
	return true;
}

function stateChanged(){
	if (http_request.readyState==4){
		if (http_request.status==200){
			document.getElementById("show_page").innerHTML=http_request.responseText;
			//alert(document.getElementById("show_page").innerHTML);
		}
		else{
			alert('There was a problem with the request.');
		}
	}
}

/*function GetXmlHttpObject(){
	var http_request=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		http_request=new XMLHttpRequest();
		
		if (http_request.overrideMimeType) {
			// set type accordingly to anticipated content type
			//http_request.overrideMimeType('text/xml');
			http_request.overrideMimeType('text/html');
		}
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			http_request=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			http_request=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	
	return http_request;
}*/
