//<!-- Advanced Version 2.0.0.1 -->
<!--


var dtCh= "/";
var minYear=1900;
var maxYear=2100;
var noEmployment=false;

function XXvalidateXX()

{

formObj = document.getElementById('Table2FORM');

	var arr= new Array(200);
	var error_msg = "";

// ****** PERSONAL DETAILS *************************************

// uncomment areas below to make madatory
// firstname and lastname are mandatory enabled as default - DO NOT REMOVE

if(formObj.APL_1_firstname.value == ""){
		//alert("Please fill in your first name");
		arr[1] = "First name\n";
		//formObj.APL_1_firstname.focus();
		//return false;
	}
if(formObj.APL_1_lastname.value == ""){
		//alert("Please fill in your last name");
		//formObj.APL_1_lastname.focus();
		//return false;
		arr[2] = "Last name\n";
	}

//if(formObj.APL_1_initials.value == ""){
//		alert("Please fill in your initials");
//		formObj.APL_1_initials.focus();
//		return false;
//	}
//if(formObj.APL_1_known_as.value == ""){
//		alert("Please fill in known as field");
//		formObj.APL_1_known_as.focus();
//		return false;
//	}
//if(formObj.APL_1_dear.value == ""){
//		alert("Please fill in dear field");
//		formObj.APL_1_dear.focus();
//		return false;
//	}
//if(formObj.APL_1_title.selectedIndex == 0){
//		alert("Please fill in your title");
//		formObj.APL_1_title.focus();
//		return false;
//	}
//if(formObj.APL_1_sex.selectedIndex == 0){
//		alert("Please fill in your sex");
//		formObj.APL_1_sex.focus();
//		return false;
//	}
if(formObj.APL_1_address.value == ""){
		//alert("Please fill in your address");
		//formObj.APL_1_address.focus();
		//return false;
			arr[3] = "Address\n";
	}
//if(formObj.APL_1_country.value == ""){
//		alert("Please fill in county field");
//		formObj.APL_1_country.focus();
//		return false;
//	}
if(formObj.APL_1_phone.value == ""){
		//alert("Please fill in your phone number");
		//formObj.APL_1_phone.focus();
		//return false;
			arr[4] = "Phone Number\n";
	}


//if(formObj.APL_1_mobile.value == ""){
//		alert("Please fill in your mobile/cell number");
//		formObj.APL_1_mobile.focus();
//		return false;
//	}
//if(formObj.APL_1_car_phone.value == ""){
//		alert("Please fill in your car phone number");
//		formObj.APL_1_car_phone.focus();
//		return false;
//	}
//if(formObj.APL_1_pager_phone.value == ""){
//		alert("Please fill in your pager number");
//		formObj.APL_1_pager_phone.focus();
//		return false;
//	}
//if(formObj.APL_1_otherphone.value == ""){
//		alert("Please fill in the Other Phone field");
//		formObj.APL_1_otherphone.focus();
//		return false;
//	}
if(formObj.APL_1_email.value == ""){
		//alert("Please fill in your email address");
		//formObj.APL_1_email.focus();
		//return false;
			arr[5] = "Email Address\n";
	}
	// checks for valid email address

if(formObj.PRP_A_userskill5.selectedIndex == 0){
		arr[6] = "Work type\n";
}

//if(formObj.APL_1_user_year.value == ""){
//		arr[7] = "Availability date\n";
//}
//if(formObj.APL_1_user_text_2.value == ""){
//		alert("Please fill in your email address");
//		formObj.APL_1_email2.focus();
	//	return false;
	//	arr[6] = "Minimum Daily Rate\n";
//}

//if(formObj.APL_1_email2.value == ""){
//		alert("Please fill in your email address");
//		formObj.APL_1_email2.focus();
//		return false;
//	}
	// checks for valid email address

//if(formObj.APL_1_email2)
//{
	
//	if(formObj.APL_1_email2.value != "" )
//	{
//		email=formObj.APL_1_email2.value;
//		if (validate_email(email,"Not a valid e-mail address!")==false)
//		{
//			formObj.APL_1_email2.focus();
//			return false;
//		}
//	}
//}
//if(formObj.APL_1_home_fax.value == ""){
//		alert("Please fill in your home fax number");
//		formObj.APL_1_home_fax.focus();
//		return false;
//	}
//if(formObj.APL_1_other_fax.value == ""){
//		alert("Please fill in your other fax number");
//		formObj.APL_1_other_fax.focus();
//		return false;
//	}
//if(formObj.APL_1_knownto.value == ""){
//		alert("Please fill in the known to field");
//		formObj.APL_1_knownto.focus();
//		return false;
//	}
//if(formObj.APL_1_currentloc.selectedIndex == 0){
//		alert("Please fill in your current location");
//		formObj.APL_1_currentloc.focus();
//		return false;
//	}
//if(valButton(formObj.APL_1_relocate) == null){
//		alert("Please fill in your ability to relocate");
//		formObj.APL_1_relocate[0].focus();
//		//If this is a required field-make sure that the default "P"
//		// checked value is removed from ASP input form
//		return false;
//	}
//if(formObj.APL_1_requiredloc.selectedIndex < 0){
//		alert("Please fill in your required location");
//		formObj.APL_1_requiredloc.focus();
//		return false;
//	}
//if(formObj.APL_1_maritalstat.selectedIndex == 0){
//		alert("Please fill in your marital status");
//		formObj.APL_1_maritalstat.focus();
//		return false;
//	}
//if(formObj.APL_1_rating.selectedIndex == 0){
//		alert("Please fill in your rating");
//		formObj.APL_1_rating.focus();
//		return false;
//	}

//if(formObj.centYear.value == ""){
		//alert("Please fill in your date fo birth");
		//formObj.APL_1_dob_year.focus();
		//return false;
//		arr[7] = "Date of birth\n";
//	}

//if(formObj.APL_1_ref_1.value == ""){
//		alert("Please fill in your email address");
//		formObj.APL_1_email2.focus();
	//	return false;
	//	arr[6] = "Your 1st reference\n";
//}
//if(formObj.APL_1_ref_2.value == ""){
//		alert("Please fill in your email address");
//		formObj.APL_1_email2.focus();
	//	return false;
	//	arr[7] = "Your 2nd reference\n";
//}

if(formObj.APL_1_brief_comment.value == ""){
//		alert("Please fill in your email address");
//		formObj.APL_1_email2.focus();
	//	return false;
		arr[8] = "brief comment\n";
}

for (x in arr) 
	if( x != null) error_msg += arr[x];

if (error_msg == null || error_msg =="")
 {
 //alert ("Everything looks OK!");
  //return true;
 }
 else {
 alert ("Please complete the following fields:\n\n" + error_msg + "\n");
 return false;
}

	// checks for a valid date
if(formObj.centYear)
{
	if(formObj.centYear.value != "") 
	{
		ToValidate=validdate(formObj.APL_1_dob_day.selectedIndex,
			formObj.APL_1_dob_month.selectedIndex,
			formObj.centYear.value)
		if(formObj.centYear.value != "" && isDate(ToValidate)==false)
		{
			formObj.centYear.focus();
			return false;	
		}
	}
}


if(formObj.APL_1_email)
{
	if(formObj.APL_1_email.value != "" )
	{
		email=formObj.APL_1_email.value;
		if (validate_email(email,"Not a valid e-mail address!")==false)
		{
			formObj.APL_1_email.focus();
			return false;
		}
	}
}

//if(formObj.APL_1_prev_cand.selectedIndex == 0){
//		alert("Please fill in your previous candidate status");
//		formObj.APL_1_prev_cand.focus();
//		return false;
//	}

//if(formObj.APL_1_salary.value == ""){
//		alert("Please fill in your most recent salary (i.e. 38000)");
//		formObj.APL_1_salary.focus();
//		return false;
//	}
	//below checks for numbers only if filled in
if(formObj.APL_1_salary)
{
	if(formObj.APL_1_salary.value != "" && isInteger(formObj.APL_1_salary.value)==false)
	{
			alert("Please fill in your salary using numbers ONLY (i.e. 38000)");
			formObj.APL_1_salary.focus();
			return false;	
	}
}

if(formObj.APL_1_user_text_2)
{
	if(formObj.APL_1_user_text_2.value != "" && isInteger(formObj.APL_1_user_text_2.value)==false)
	{
			alert("Please fill in your minimum Daily Rate using numbers ONLY (i.e. 38000)");
			formObj.APL_1_user_text_2.focus();
			return false;	
	}
}

if(formObj.APL_1_user_text_5)
{
	if(formObj.APL_1_user_text_5.value != "" && isInteger(formObj.APL_1_user_text_5.value)==false)
	{
			alert("Please fill in your desired daily rate using numbers ONLY (i.e. 38000)");
			formObj.APL_1_user_text_5.focus();
			return false;	
	}
}
//if(formObj.APL_1_package.value == ""){
//		alert("Please fill in your most recent package (i.e. 38000)");
//		formObj.APL_1_package.focus();
//		return false;
//	}
	//below checks for numbers only if filled in
//if(formObj.APL_1_package)
//{
//	if(formObj.APL_1_package.value != "" && isInteger(formObj.APL_1_package.value)==false)
//	{
//			alert("Please fill in your package using numbers ONLY (i.e. 38000)");
//			formObj.APL_1_package.focus();
//			return false;	
//	}
//}
//if(formObj.APL_1_package_note.value == ""){
//		alert("Please fill in your most recent package note");
//		formObj.APL_1_package_note.focus();
//		return false;
//	}

//if(formObj.APL_1_local_salary.value == ""){
//		alert("Please fill in your local salary (i.e. 38000)");
//		formObj.APL_1_local_salary.focus();
//		return false;
//	}
	//below checks for numbers only if filled in
//if(formObj.APL_1_local_salary)
//{
//	if(formObj.APL_1_local_salary.value != "" && isInteger(formObj.APL_1_local_salary.value)==false)
//	{
//			alert("Please fill in your local salary using numbers ONLY (i.e. 38000)");
//			formObj.APL_1_local_salary.focus();
//			return false;	
//	}
//}

//if(formObj.APL_1_local_pkg.value == ""){
//		alert("Please fill in your most recent local package (i.e. 38000)");
//		formObj.APL_1_local_pkg.focus();
//		return false;
//	}
	//below checks for numbers only if filled in
//if(formObj.APL_1_local_pkg)
//{
//	if(formObj.APL_1_local_pkg.value != "" && isInteger(formObj.APL_1_local_pkg.value)==false){
//			alert("Please fill in your local package using numbers ONLY (i.e. 38000)");
//			formObj.APL_1_local_pkg.focus();
//			return false;	
//	}
//}
//if(formObj.APL_1_local_currency.selectedIndex == 0){
//		alert("Please fill in your currency");
//		formObj.APL_1_local_currency.focus();
//		return false;
//	}
//if(formObj.APL_1_origandtraining.value == "" || formObj.APL_1_origandtraining.value == " "){
//		alert("Please fill in the original training field");
//		formObj.APL_1_origandtraining.focus();
//		return false;
//	}
if(formObj.APL_1_brief_comment.value == "" || formObj.APL_1_brief_comment.value == " "){
		alert("Please fill in the brief comment field");
		formObj.APL_1_brief_comment.focus();
		return false;
	}
//if(formObj.APL_1_notes.value == "" || formObj.APL_1_notes.value == " "){
//		alert("Please fill in the notes field");
//		formObj.APL_1_notes.focus();
//		return false;
//	}



// ************************* EMPLOYMENT *****************************************

// current job check box valid only for first employment record
//if(valButton(formObj.CurrentConf)==null)
//		{
//			alert("Please confirm your employment current/recent employment");
//			formObj.CurrentConf[0].focus();
//			return false;
//		}

// if(noEmployment==false)
// {

// for (var e=0; e < formObj.EMP_recs.value; e++){	
 	// EMP_recs is a hidden field corresponding to xjobs value 
 	// from UpEx$config.asp to indicate how many work records are expected
  	// recnum=e+1;
	// Include the row number of work records that are mandatory
	// ie (recnum=="1" || recnum=="2") means that first and second work 
	// records are mandatory

// ****************** MANDATORY BEGINNING ***************************************
  	//if(recnum=="1" || recnum=="2")
	// {
		// company name field
		// if(formObj.elements['CMP_' + recnum + '_name'].value=="")
		// {
			// alert("Please fill in company name");
			// formObj.elements['CMP_' + recnum + '_name'].focus();
			// return false;
		// }
		//Company branch field field
		// if(formObj.elements['CMP_' + recnum + '_branch'].value=="")
		// {
			// alert("Please fill in branch field");
			// formObj.elements['CMP_' + recnum + '_branch'].focus();
			// return false;
		// }
		// Job Title field
		// if(formObj.elements['EMP_' + recnum + '_title'].value=="")
		// {
			// alert("Please fill in your job title");
			// formObj.elements['EMP_' + recnum + '_title'].focus();
			// return false;
		// }
		// Department field
		// if(formObj.elements['EMP_' + recnum + '_department'].value=="")
		// {
			// alert("Please fill in your department");
			// formObj.elements['EMP_' + recnum + '_department'].focus();
			// return false;
		// }
		//Assistant-Secretary field
		// if(formObj.elements['EMP_' + recnum + '_secretary'].value=="")
		// {
			// alert("Please fill in the assistant/secretary field");
			// formObj.elements['EMP_' + recnum + '_secretary'].focus();
			// return false;
		// }
		//Company main phone field
		// if(formObj.elements['CMP_' + recnum + '_phone'].value=="")
		// {
			// alert("Please fill in main company phone number");
			// formObj.elements['CMP_' + recnum + '_phone'].focus();
			// return false;
		// }
		// Direct Line field
		// if(formObj.elements['EMP_' + recnum + '_directline'].value=="")
		// {
			// alert("Please fill in your direct line number");
			// formObj.elements['EMP_' + recnum + '_directline'].focus();
			// return false;
		// }
		// INDUSTRY field
		// if(formObj.elements['PRP_' + recnum + '_industry'].selectedIndex<0)
		// {
			// alert("Please fill in an industry");
			// formObj.elements['PRP_' + recnum + '_industry'].focus();
			// return false;
		// }
		//year from field
		// if(formObj.elements['EMP_' + recnum + '_from_year'].value=="")
		// {
			// alert("Please fill in year from");
			// formObj.elements['EMP_' + recnum + '_from_year'].focus();
			// return false;
		// }								

	// *********year to field - logic below will ask for a year to only if 
		// current job (recnum=1) is tagged as NO
		// if(recnum=="1" && formObj.CurrentConf[1].checked == true)
		// {
			// if(formObj.elements['EMP_' + recnum + '_to_year'].value=="")
			// {
				// alert("Please fill in year to");
				// formObj.elements['EMP_' + recnum + '_to_year'].focus();
				// return false;
			// }
		// }
	//this will deal with previous employment year to madatory field only
		// if(recnum!="1")
		// {
			// if(formObj.elements['EMP_' + recnum + '_to_year'].value=="")
			// {
				// alert("Please fill in year to");
				// formObj.elements['EMP_' + recnum + '_to_year'].focus();
				// return false;
			// }
		// }
		// if(formObj.elements['EMP_' + recnum + '_note_text'].value=="")
		// {
			// alert("Please fill in comments of your work");
			// formObj.elements['EMP_' + recnum + '_note_text'].focus();
			// return false;
		// }
		// if(formObj.elements['CMP_' + recnum + '_comment'].value=="")
		// {
			// alert("Please give your comments of your company");
			// formObj.elements['CMP_' + recnum + '_comment'].focus();
			// return false;
		// }		

//*****************************MANDATORY EMPLOYMENT END**************************************
	// }

	//Check the from year value for invalid entry
	// if(formObj.elements['EMP_' + recnum + '_from_year'])
	// {
		// if(formObj.elements['EMP_' + recnum + '_from_year'].value!="" ) 
		// {
			// ToValidate=validdate(formObj.elements['EMP_' + recnum + '_from_day'].selectedIndex,
				// formObj.elements['EMP_' + recnum + '_from_month'].selectedIndex,
				// formObj.elements['EMP_' + recnum + '_from_year'].value)
  			// if(formObj.elements['EMP_' + recnum + '_from_year'].value != "" && isDate(ToValidate)==false)
  			// {
				// formObj.elements['EMP_' + recnum + '_from_year'].focus();
				// return false;	
 			// }
		// }
	// }
	//Check the to year value for invalid entry
	// if(formObj.elements['EMP_' + recnum + '_to_year'])
	// {
		// if(formObj.elements['EMP_' + recnum + '_to_year'].value!="" ) 
		// {
			// ToValidate=validdate(formObj.elements['EMP_' + recnum + '_to_day'].selectedIndex,
				// formObj.elements['EMP_' + recnum + '_to_month'].selectedIndex,
				// formObj.elements['EMP_' + recnum + '_to_year'].value)
  			// if(formObj.elements['EMP_' + recnum + '_to_year'].value != "" && isDate(ToValidate)==false)
  			// {
				// formObj.elements['EMP_' + recnum + '_to_year'].focus();
				// return false;	
 			// }
		// }
	// }
//***************  Mimimum employment record entry check *****************************
	// Makes sure that of any employment info is written then 
	// the mimimum of job title and company name is given and
	// in the case of first record, whether it is a current position or not
	// var hasinfo;
	//hasinfo=fieldCheckVal(formObj.elements['CMP_' + recnum + '_branch'])+
	//		fieldCheckVal(formObj.elements['EMP_' + recnum + '_secretary'])+
	//		fieldCheckVal(formObj.elements['EMP_' + recnum + '_department'])+
	//		fieldCheckVal(formObj.elements['PRP_' + recnum + '_industry'])+
	//		fieldCheckVal(formObj.elements['CMP_' + recnum + '_phone'])+
	// hasinfo=fieldCheckVal(formObj.elements['EMP_' + recnum + '_from_year'])+
			// fieldCheckVal(formObj.elements['EMP_' + recnum + '_to_year']);
	//		checkboxCheckVal(formObj.elements['EMP_' + recnum + '_interim'])+
	//		checkboxCheckVal(formObj.elements['EMP_' + recnum + '_ned'])+
	//		fieldCheckVal(formObj.elements['EMP_' + recnum + '_note_text'])+
	//		fieldCheckVal(formObj.elements['CMP_' + recnum + '_comment']);

	// if(recnum=="1")
	//this is the first employment record only
	// {
		//checks if any employment info entered but no company name/job title
		// if(hasinfo.length>0) 
		// {
			// if(formObj.elements['CMP_' + recnum + '_name'].value=="" || formObj.elements['EMP_' + recnum + '_title'].value=="")
			// {
				// alert("Need to fill in both company name and job title");
				// if(formObj.elements['CMP_' + recnum + '_name'].value=="")
				// {
					// formObj.elements['CMP_' + recnum + '_name'].focus();
					// return false;
				// }
				// else
				// {
					// formObj.elements['EMP_' + recnum + '_title'].focus();
					// return false;
				// }	
			// }
		// }
		//checks if only company name or job title filled in
		// else if((formObj.elements['CMP_' + recnum + '_name'].value=="" && formObj.elements['EMP_' + recnum + '_title'].value!="")||
			// (formObj.elements['CMP_' + recnum + '_name'].value!="" && formObj.elements['EMP_' + recnum + '_title'].value==""))
			// {
				// alert("Need to fill in both company name and job title");
				// if(formObj.elements['CMP_' + recnum + '_name'].value=="")
				// {
					// formObj.elements['CMP_' + recnum + '_name'].focus();
					// return false;
				// }
				// else
				// {
					// formObj.elements['EMP_' + recnum + '_title'].focus();
					// return false;
				// }
			// }
	// }
	//this deals with previous - no directline etc
	//checks if any employment info enetered but no company name/job title
	// else if(hasinfo.length>0) 
		// {
			// if(formObj.elements['CMP_' + recnum + '_name'].value=="" || formObj.elements['EMP_' + recnum + '_title'].value=="")
			// {
				// alert("Need to fill in both company name and job title");
				// if(formObj.elements['CMP_' + recnum + '_name'].value=="")
				// {
					// formObj.elements['CMP_' + recnum + '_name'].focus();
					// return false;
				// }
				// else
				// {
					// formObj.elements['EMP_' + recnum + '_title'].focus();
					// return false;
				// }	
			// }
		// }
	//checks if only company name or job title filled in
	// else if((formObj.elements['CMP_' + recnum + '_name'].value=="" && formObj.elements['EMP_' + recnum + '_title'].value!="")||
		// (formObj.elements['CMP_' + recnum + '_name'].value!="" && formObj.elements['EMP_' + recnum + '_title'].value==""))
		// {
			// alert("Need to fill in both company name and job title");
			// if(formObj.elements['CMP_' + recnum + '_name'].value=="")
				// {
					// formObj.elements['CMP_' + recnum + '_name'].focus();
					// return false;
				// }
				// else
				// {
					// formObj.elements['EMP_' + recnum + '_title'].focus();
					// return false;
				// }
		// }
// }
//*********************** end of minimum employment entry **************************************
// }
// ********************** END OF EMPLOYMENT SECTION *********************************************


// *********************************	SKILLS 	*************************************************
//if(formObj.PRP_A_industry.selectedIndex < 0){
//		alert("Please select an Industry");
//		formObj.PRP_A_industry.focus();
//		return false;
//	}
//if(formObj.PRP_A_jobfunction.selectedIndex<0){
//		alert("Please select a Job Function");
//		formObj.PRP_A_jobfunction.focus();
//		return false;
//	}
//if(formObj.PRP_A_language.selectedIndex < 0){
//		alert("Please select a Language");
//		formObj.PRP_A_language.focus();
//		return false;
//	}
//if(formObj.PRP_A_international.selectedIndex<0){
//		alert("Please select your International Experience");
//		formObj.PRP_A_international.focus();
//		return false;
//	}
//if(formObj.PRP_A_qualification.selectedIndex<0){
//		alert("Please select a Professional Qualification");
//		formObj.PRP_A_qualification.focus();
//		return false;
//	}
//if(formObj.PRP_A_nationality.selectedIndex<0){
//		alert("Please select your Nationality");
//		formObj.PRP_A_nationality.focus();
//		return false;
//	}
//if(formObj.PRP_A_userskill3.selectedIndex<0){
//		alert("Please select a skill");
//		formObj.PRP_A_userskill3.focus();
//		return false;
//	}
//if(formObj.PRP_A_userskill4.selectedIndex<0){
//		alert("Please select a skill");
//		formObj.PRP_A_userskill4.focus();
//		return false;
//	}
//if(formObj.PRP_A_userskill5.selectedIndex<0){
//		alert("Please select a skill");
//		formObj.PRP_A_userskill5.focus();
//		return false;
//	}
//if(formObj.PRP_A_userskill6.selectedIndex<0){
//		alert("Please select a skill");
//		formObj.PRP_A_userskill6.focus();
//		return false;
//	}
//if(formObj.PRP_A_userskill7.selectedIndex<0){
//		alert("Please select a skill");
//		formObj.PRP_A_userskill7.focus();
//		return false;
//	}
//if(formObj.PRP_A_userskill8.selectedIndex<0){
//		alert("Please select a skill");
//		formObj.PRP_A_userskill8.focus();
//		return false;
//	}


/********************************************** USER DEFINED FIELDS ***************************/

//if(formObj.APL_1_user_text_1.value==""){
//		alert("Please fill in this field");
//		formObj.APL_1_user_text_1.focus();
//		return false;
//	}
//if(formObj.APL_1_user_text_2.value==""){
//		alert("Please fill in this field");
//		formObj.APL_1_user_text_2.focus();
//		return false;
//	}
//if(formObj.APL_1_user_text_3.value==""){
//		alert("Please fill in this field");
//		formObj.APL_1_user_text_3.focus();
//		return false;
//	}
//if(formObj.APL_1_user_text_4.value==""){
//		alert("Please fill in this field");
//		formObj.APL_1_user_text_4.focus();
//		return false;
//	}
//if(formObj.APL_1_user_text_5.value==""){
//		alert("Please fill in this field");
//		formObj.APL_1_user_text_5.focus();
//		return false;
//	}
//if(formObj.APL_1_user_text_6.value==""){
//		alert("Please fill in this field");
//		formObj.APL_1_user_text_6.focus();
//		return false;
//	}
//if(formObj.APL_1_user_text_7.value==""){
//		alert("Please fill in this field");
//		formObj.APL_1_user_text_7.focus();
//		return false;
//	}
//if(formObj.APL_1_user_text_8.value==""){
//		alert("Please fill in this field");
//		formObj.APL_1_user_text_8.focus();
//		return false;
//	}
//if(formObj.APL_1_user_text_9.value==""){
//		alert("Please fill in this field");
//		formObj.APL_1_user_text_9.focus();
//		return false;
//	}

// ******************* NUMERIC USER DEFINED VALIDATION *************************

//if(isInteger(formObj.APL_1_user_text_1.value)==false){
//		alert("Please use numbers only for this field");
//		formObj.APL_1_user_text_1.focus();
//		return false;
//	}
if(isInteger(formObj.APL_1_user_text_2.value)==false){
		alert("Please use numbers only for this field");
		formObj.APL_1_user_text_2.focus();
		return false;
	}
//if(isInteger(formObj.APL_1_user_text_3.value)==false){
//		alert("Please use numbers only for this field");
//		formObj.APL_1_user_text_3.focus();
//		return false;
//	}
//if(isInteger(formObj.APL_1_user_text_4.value)==false){
//		alert("Please use numbers only for this field");
//		formObj.APL_1_user_text_4.focus();
//		return false;
//	}
if(isInteger(formObj.APL_1_user_text_5.value)==false){
		alert("Please use numbers only for this field");
		formObj.APL_1_user_text_5.focus();
		return false;
	}
//if(isInteger(formObj.APL_1_user_text_6.value)==false){
//		alert("Please use numbers only for this field");
//		formObj.APL_1_user_text_6.focus();
//		return false;
//	}
//if(isInteger(formObj.APL_1_user_text_7.value)==false){
//		alert("Please use numbers only for this field");
//		formObj.APL_1_user_text_7.focus();
//		return false;
//	}
//if(isInteger(formObj.APL_1_user_text_8.value)==false){
//		alert("Please use numbers only for this field");
//		formObj.APL_1_user_text_8.focus();
//		return false;
//	}
//if(isInteger(formObj.APL_1_user_text_9.value)==false){
//		alert("Please use numbers only for this field");
//		formObj.APL_1_user_text_9.focus();
//		return false;
//	}
	
// ******************* DATE USER DEFINED VALIDATION *************************

//if(isDate(formObj.APL_1_user_text_1.value)==false){
//		formObj.APL_1_user_text_1.focus();
//		return false;
//	}
//if(isDate(formObj.APL_1_user_text_2.value)==false){
//		formObj.APL_1_user_text_2.focus();
//		return false;
//	}
//if(isDate(formObj.APL_1_user_text_3.value)==false){
//		formObj.APL_1_user_text_3.focus();
//		return false;
//	}
//if(isDate(formObj.APL_1_user_text_4.value)==false){
//		formObj.APL_1_user_text_4.focus();
//		return false;
//	}
//if(isDate(formObj.APL_1_user_text_5.value)==false){
//		formObj.APL_1_user_text_5.focus();
//		return false;
//	}
//if(isDate(formObj.APL_1_user_text_6.value)==false){
//		formObj.APL_1_user_text_6.focus();
//		return false;
//	}
//if(isDate(formObj.APL_1_user_text_7.value)==false){
//		formObj.APL_1_user_text_7.focus();
//		return false;
//	}
//if(isDate(formObj.APL_1_user_text_8.value)==false){
//		formObj.APL_1_user_text_8.focus();
//		return false;
//	}
//if(isDate(formObj.APL_1_user_text_9.value)==false){
//		formObj.APL_1_user_text_9.focus();
//		return false;
//	}

	
//if(formObj.agree.checked == false){
//		alert("You need to agree to the Confidentiality Agreement before applying");
//		formObj.agree.focus();
//		return false;
		
//	}
return true;
}



function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function twodigitdate(s){
        // Check for number length.
	var c = s+1
		if (c<10) {c='0'+c};
    return c;
}

function validdate(strday,strmonth,stryear){
	var t_day = strday;
	var t_month = strmonth;
	var t_year = stryear;
	var fulldate;
	fulldate=twodigitdate(t_day)+dtCh+twodigitdate(t_month)+dtCh+t_year;
	return fulldate;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(0,pos1)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (dtStr.length=="0") return true
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : dd/mm/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

function validate_email(field,alerttext)
{
	apos=field.indexOf("@");
	dotpos=field.lastIndexOf(".")
	if(apos<1||dotpos-apos<2)
	{
		alert(alerttext);
		return false;
	}
	else
	{
		return true;
	}
}

function fieldCheckVal(field)
{
	var fieldval;
	if(field) {fieldval=field.value;}
	else {fieldval="";}
	return fieldval;
	
}

function checkboxCheckVal(field)
{
	var fieldval;
	if(field) {fieldval=field.checked;}
	else {fieldval="";}
	if(fieldval==false) fieldval="";
	return fieldval;
	
}

function fieldCheck(field)
{
	var fieldval;
	if(field) {fieldval=field.value;}
	else {fieldval=null;}
	return fieldval;
	
}

function checkboxCheck(field)
{
	var fieldval;
	if(field) {fieldval=field.checked;}
	else {fieldval=null;}
	return fieldval;
	
}

// Radio Button Validation
// copyright Stephen Chapman, 15th Nov 2004
// you may copy this function but please keep the copyright notice with it
function valButton(btn) {
var cnt = -1;
for (var i=0; i < btn.length; i++) {
   if (btn[i].checked) 
   {
   	cnt = i; 
   	i = btn.length;
   }
 }
 if (cnt > -1)
   return btn[cnt].value;
 else 
   return null;
}


//-->
