<!--
re = /\w{1,}/;


//-----------------
// trimming strings
//-----------------
function rtrim(str)
	{
	return str.replace( /\s*$/, "" );
	}
function trim(str)
	{
	return( (""+str).replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1') );
	}

var errmsg=""
var errno=0





/*---------------------------
  validating eligibility test
-----------------------------*/
function validateEligibilityTest(form1)
	{
	errmsg=""
	errno=0
	errno+=validate2(form1.ap_applicantsBirthCountryAndStatus)
	errno+=validate2(form1.ap_applicantsHighestEducationList)
	errno+=validate2(form1.ap_jopProfile)
 
	if (form1.ap_applicantsBirthCountryStatus.value=="N")
		errno+=validate2(form1.sp_spousesBirthCountryAndStatus)
		
	if (errno!=0)
		{
		alert("Please check the required fields")
		return false;
		}
	return true;
	}

function storeCountry(form1)
	{
	form1.ap_applicantsBirthCountry.value=form1.ap_applicantsBirthCountryAndStatus.value.substr(0,2)
	form1.ap_applicantsBirthCountryStatus.value=form1.ap_applicantsBirthCountryAndStatus.value.substr(2,1)

	if(form1.ap_applicantsBirthCountryStatus.value=="N")
		{
		form1.sp_spousesBirthCountry.value=form1.sp_spousesBirthCountryAndStatus.value.substr(0,2)
		form1.sp_spousesBirthCountryStatus.value=form1.sp_spousesBirthCountryAndStatus.value.substr(2,1)
		document.getElementById('spanApplicantsBirthCountry').innerHTML=form1.ap_applicantsBirthCountryAndStatus.options[form1.ap_applicantsBirthCountryAndStatus.selectedIndex].text
		document.getElementById('trAdditional1').style.display=""
		document.getElementById('trAdditional2').style.display=""
		}	
	else
		{
		form1.sp_spousesBirthCountryAndStatus.value=""
		form1.sp_spousesBirthCountry.value=""
		form1.sp_spousesBirthCountryStatus.value=""
		document.getElementById('spanApplicantsBirthCountry').innerHTML=""
		document.getElementById('trAdditional1').style.display="none"
		document.getElementById('trAdditional2').style.display="none"
		}
	}

function storeEducation(form1)
	{
	form1.ap_applicantsHighestEducation.value=form1.ap_applicantsHighestEducationList.options[form1.ap_applicantsHighestEducationList.selectedIndex].text
	}


//-->


