var blnInProgress = false;

function chkItem(frmObj)
{
	if (IsEmptyRtnMsg(frmObj.fName, "Please input your First Name" ) ) return false;
	if (IsEmptyRtnMsg(frmObj.lName, "Please input your Last Name" ) ) return false;
	if (chkRadioButton(frmObj.gender, "Please specify your gender" ) ) return false;
	if (IsEmptyRtnMsg(frmObj.birthday2, "Please input your birthdate" ) ) return false;
	if (IsEmptyRtnMsg(frmObj.birthday3, "Please input your birthdate" ) ) return false;
	if (IsEmptyRtnMsg(frmObj.birthday1, "Please input your birthdate" ) ) return false;
	if (IsEmptyRtnMsg(frmObj.nationality, "Please input your nationality" ) ) return false;
	if (IsEmptyRtnMsg(frmObj.email, "Please input your email address" ) ) return false;	

	if (IsEmptyRtnMsg(frmObj.dateOfAvailability2, "Please input your Date of Availability" ) ) return false;
	if (IsEmptyRtnMsg(frmObj.dateOfAvailability1, "Please input your Date of Availability" ) ) return false;

	// location checbox //
	var loc = "";
	if(frmObj.locChk.length == null) {
		if(frmObj.locChk.checked) loc = frmObj.locChk.value + "|^|";
	} else {
		for(var i=0; i<frmObj.locChk.length; i++) {
			if(frmObj.locChk[i].checked) loc += frmObj.locChk[i].value + "|^|";
		}
	}
	frmObj.loc.value = loc;

	// studentType checbox //
	var studentType = "";
	if(frmObj.studentTypeChk.length == null) {
		if(frmObj.studentTypeChk.checked) studentType = frmObj.studentTypeChk.value + "|^|";
	} else {
		for(var i=0; i<frmObj.studentTypeChk.length; i++) {
			if(frmObj.studentTypeChk[i].checked) studentType += frmObj.studentTypeChk[i].value + "|^|";
		}
	}
	frmObj.studentType.value = studentType;

	// nationality eduBackground 를 체크해서 등록할수 있는지 결과값 저장 //
	if(frmObj.nationality.value != "ETC") {
		frmObj.chkResult.value = "Y";
	}

	if (frmObj.chkResult.value == "N") {
		alert("Sorry, you're not qualifed");
		return false;
	}

	return true;
}

function submitForm(frmObj)
{
	if (blnInProgress == true) { alert("Now uploading, please wait!"); return false; }

	if (chkItem ( frmObj)) { 
		if (document.all || document.getElementById) { 
			frmObj.submit(); 
		}else { 
			alert("두번은 전송할 수 없습니다"); 
			return false; 
		 } 
	}
	else { return; }	

	blnInProgress = true;
}

function nationChk(val) {	// Nationality
	if(val == "ETC") {
		alert("Sorry, you're not qualifed");
		return;
	}
}