	
function validatefield(field)
{
	return !(field.value=="");
}


function checkselect(field)
{
	return !(field.options[field.selectedIndex].value=='');
}


function altcheckselect(field)
{
	return !(field.options[field.selectedIndex].value==0);
}



function checknumeric(field,error)
{
	if (isNaN(field.value)==true)
	{
		alert('The following field must be numeric:\n\n'+error);
		field.focus();
		return false;
	}
	return true;
}

function checkother(field,otherfield,error)
{
	if (field.value=='OTHER') 
	{
		if (otherfield.value=='') 
		{
			alert('Not all required fields have been completed:\n\n' + error);
			otherfield.focus();
			return false;
		}
	}
	return true;
}
	

function mStringLength(strPassed)
{
	var strX = new String(strPassed)
	if (strX=='undefined')
	{
		return 0;
	}
	else
	{
		return strX.length;
	}
}



	
function validateform()
{
	
	var backtodiv;
	backtodiv=currentTab;
	var thedoc;
	var result;
	var firstError;
	var firstErrorDiv;
	var errorList;
	var checkMe;
	
	result='';
	firstError='';
	firstErrorDiv=1;
	errorList='';
	
	if (document.all)
	{
		thedoc=document.all;
	}
	else
	{
		thedoc=document.FormA;
	}
	
	
	doClick(2);


	if (thedoc.Country.options[thedoc.Country.selectedIndex].text=='Ireland')
	{
		thedoc.PostOutcode.value='NA';
		thedoc.PostIncode.value='NA';
	}
	else
	{
		if ((thedoc.PostOutcode.value=='NA') && (thedoc.PostIncode.value=='NA'))
		{
			thedoc.PostOutcode.value='';
			thedoc.PostIncode.value='';
		}
	}




	checkMe=thedoc.Title;
	if (checkselect(checkMe)==false)
	{
		errorList=errorList+'Title\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}

	checkMe=thedoc.FirstName;
	if ((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=1))
	{
		errorList=errorList+'First Name (not just initial)\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}

	checkMe=thedoc.LastName;
	if (validatefield(checkMe)==false)
	{
		errorList=errorList+'Last Name\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}

	if (((validatefield(thedoc.CurrAddNumber)==false) && (validatefield(thedoc.CurrAddName)==false) && (validatefield(thedoc.CurrAddFlatNumber)==false)))
	{
		errorList=errorList+'House or Flat Number or Name\n';
		thedoc.CurrAddNumber.style.backgroundColor='cc0000';
		thedoc.CurrAddName.style.backgroundColor='cc0000';
		thedoc.CurrAddFlatNumber.style.backgroundColor='cc0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=thedoc.CurrAddName; firstErrorDiv=currentTab; }
	}
	else
	{
		thedoc.CurrAddNumber.style.backgroundColor='ffffff';
		thedoc.CurrAddName.style.backgroundColor='ffffff';
		thedoc.CurrAddFlatNumber.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.CurrAddStreet;
	if ((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=1))
	{
		errorList=errorList+'Address\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}

	checkMe=thedoc.CurrAddTown;
	if ((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=1))
	{
		errorList=errorList+'Town\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.CurrAddCounty;
	if ((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=1))
	{
		errorList=errorList+'County\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.PostOutcode;
	if (((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=1))||((validatefield(thedoc.PostIncode)==false) || (mStringLength(thedoc.PostIncode.value)<=1)))
	{
		errorList=errorList+'Current Post Code\n';
		checkMe.style.backgroundColor='ff0000';
		thedoc.PostIncode.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
		thedoc.PostIncode.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.Country;
	if (checkselect(checkMe)==false)
	{
		errorList=errorList+'Country\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.CurrentAddressSinceMM;
	if (checkselect(checkMe)==false)
	{
		errorList=errorList+'Date moved into current address\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.CurrentAddressSinceYYYY;
	if (checkselect(checkMe)==false)
	{
		errorList=errorList+'Date moved into current address\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.MaritalStatus;
	if (checkselect(checkMe)==false)
	{
		errorList=errorList+'Marital Status\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}

	doClick(3);

	if ((requirePrev==1)&&(((validatefield(thedoc.prevAddNumber)==false) && (validatefield(thedoc.prevAddName)==false) && (validatefield(thedoc.prevAddFlatNumber)==false))))
	{
		errorList=errorList+'Previous Address House or Flat Number or Name\n';
		thedoc.prevAddNumber.style.backgroundColor='cc0000';
		thedoc.prevAddName.style.backgroundColor='cc0000';
		thedoc.prevAddFlatNumber.style.backgroundColor='cc0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=thedoc.prevAddName; firstErrorDiv=currentTab; }
	}
	else
	{
		thedoc.prevAddNumber.style.backgroundColor='ffffff';
		thedoc.prevAddName.style.backgroundColor='ffffff';
		thedoc.prevAddFlatNumber.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.prevAddStreet;
	if ((requirePrev==1)&&((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=1)))
	{
		errorList=errorList+'Previous Address\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}

	checkMe=thedoc.prevAddTown;
	if ((requirePrev==1)&&((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=1)))
	{
		errorList=errorList+'Previous Address Town\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.prevAddCounty;
	if ((requirePrev==1)&&((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=1)))
	{
		errorList=errorList+'Previous Address County\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	if (thedoc.PrevAddCountryID.options[thedoc.PrevAddCountryID.selectedIndex].text=='Ireland')
	{
		thedoc.prevAddPostOutCode.value='NA';
		thedoc.prevAddPostInCode.value='NA';
	}
	else
	{
		if ((thedoc.prevAddPostOutCode.value=='NA') && (thedoc.prevAddPostOutCode.value=='NA'))
		{
			thedoc.prevAddPostOutCode.value='';
			thedoc.prevAddPostInCode.value='';
		}
	}


	checkMe=thedoc.prevAddPostOutCode;
	if ((requirePrev==1)&&(((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=1))||((validatefield(thedoc.prevAddPostInCode)==false) || (mStringLength(thedoc.prevAddPostInCode.value)<=1))))
	{
		errorList=errorList+'Previous Address Post Code\n';
		checkMe.style.backgroundColor='ff0000';
		thedoc.prevAddPostInCode.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		thedoc.prevAddPostInCode.style.backgroundColor='ffffff';
		checkMe.style.backgroundColor='ffffff';
	}



	checkMe=thedoc.PrevAddCountryID;
	if ((requirePrev==1)&&(checkselect(checkMe)==false))
	{
		errorList=errorList+'Previous Address Country\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.PreviousAddressSinceMM;
	if ((requirePrev==1)&&(checkselect(checkMe)==false))
	{
		errorList=errorList+'Date moved into Previous address\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.PreviousAddressSinceYYYY;
	if ((requirePrev==1)&&(checkselect(checkMe)==false))
	{
		errorList=errorList+'Date moved into Previous address\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}
	

	if ((requirePrev2==1)&&(((validatefield(thedoc.prev2AddNumber)==false) && (validatefield(thedoc.prev2AddName)==false) && (validatefield(thedoc.prev2AddFlatNumber)==false))))
	{
		errorList=errorList+'2nd Previous Address House or Flat Number or Name\n';
		thedoc.prev2AddNumber.style.backgroundColor='cc0000';
		thedoc.prev2AddName.style.backgroundColor='cc0000';
		thedoc.prev2AddFlatNumber.style.backgroundColor='cc0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=thedoc.prev2AddName; firstErrorDiv=currentTab; }
	}
	else
	{
		thedoc.prev2AddNumber.style.backgroundColor='ffffff';
		thedoc.prev2AddName.style.backgroundColor='ffffff';
		thedoc.prev2AddFlatNumber.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.prev2AddStreet;
	if ((requirePrev2==1)&&((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=1)))
	{
		errorList=errorList+'2nd Previous Address\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}

	checkMe=thedoc.prev2AddTown;
	if ((requirePrev2==1)&&((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=1)))
	{
		errorList=errorList+'2nd Previous Address Town\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.prev2AddCounty;
	if ((requirePrev2==1)&&((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=1)))
	{
		errorList=errorList+'2nd Previous Address County\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}

	if (thedoc.Prev2AddCountryID.options[thedoc.Prev2AddCountryID.selectedIndex].text=='Ireland')
	{
		thedoc.prev2AddPostOutCode.value='NA';
		thedoc.prev2AddPostInCode.value='NA';
	}
	else
	{
		if ((thedoc.prev2AddPostInCode.value=='NA') && (thedoc.prev2AddPostOutCode.value=='NA'))
		{
			thedoc.prev2AddPostOutCode.value='';
			thedoc.prev2AddPostInCode.value='';
		}
	}

	checkMe=thedoc.prev2AddPostOutCode;
	if ((requirePrev2==1)&&(((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=1))|| ((validatefield(thedoc.prev2AddPostInCode)==false) || (mStringLength(thedoc.prev2AddPostInCode.value)<=1))))
	{
		errorList=errorList+'2nd Previous Address Post Code\n';
		thedoc.prev2AddPostInCode.style.backgroundColor='ff0000';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
		thedoc.prev2AddPostInCode.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.Prev2AddCountryID;
	if ((requirePrev2==1)&&(checkselect(checkMe)==false))
	{
		errorList=errorList+'2nd Previous Address Country\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.Previous2AddressSinceMM;
	if ((requirePrev2==1)&&(checkselect(checkMe)==false))
	{
		errorList=errorList+'Date moved into 2nd Previous address\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.Previous2AddressSinceYYYY;
	if ((requirePrev2==1)&&(checkselect(checkMe)==false))
	{
		errorList=errorList+'Date moved into 2nd Previous address\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}
		

	doClick(4);


	checkMe=thedoc.DOBDD;
	if ((checkselect(checkMe)==false)||(checkselect(thedoc.DOBMM)==false)||(checkselect(thedoc.DOBYYYY)==false))
	{
		errorList=errorList+'Date Of Birth\n';
		checkMe.style.backgroundColor='ff0000';
		thedoc.DOBMM.style.backgroundColor='ff0000';
		thedoc.DOBYYYY.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
		thedoc.DOBMM.style.backgroundColor='ffffff';
		thedoc.DOBYYYY.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.PlaceOfBirth;
	if ((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=6))
	{
		errorList=errorList+'Place Of Birth (Town AND Country)\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.HouseStatus;
	if (checkselect(checkMe)==false)
	{
		errorList=errorList+'House Status\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.HomeTelephoneCode;
	if (((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=2)) || ((validatefield(thedoc.HomeTelephone)==false) || (mStringLength(thedoc.HomeTelephone)<=5)))
	{
		errorList=errorList+'Home Telephone Number\n';
		checkMe.style.backgroundColor='ff0000';
		thedoc.HomeTelephone.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
		thedoc.HomeTelephone.style.backgroundColor='ffffff';
	}
	
	if ( (mStringLength(thedoc.MobileTelephone.value)>0) && (mStringLength(thedoc.MobileTelephoneCode.value)==0) )
	{
		errorList=errorList+'Please split mobile telephone number into code and number\n';
		thedoc.MobileTelephoneCode.style.backgroundColour='ff0000';
		thedoc.MobileTelephone.style.backgroundColour='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=thedoc.MobileTelephoneCode; firstErrorDiv=currentTab; }
	}
	else
	{
		thedoc.MobileTelephoneCode.style.backgroundColour='ffffff';
		thedoc.MobileTelephone.style.backgroundColour='ffffff';
	}

	checkMe=thedoc.EmailAddress;
	if ((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=7))
	{
		errorList=errorList+'Email Address\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}

	checkMe=thedoc.GoodsTypeID;
	if (checkselect(checkMe)==false)
	{
		errorList=errorList+'Goods Type\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}

	doClick(5);

	checkMe=thedoc.JobType;
	if (altcheckselect(checkMe)==false)
	{
		errorList=errorList+'Employment Type\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.JobDescription;
	if ((requireWorkDetails==1)&&((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=2)))
	{
		errorList=errorList+'Job Description\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.EmployerName;
	if ((requireWorkDetails==1)&&((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=2)))
	{
		errorList=errorList+'Employer Name\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}

	checkMe=thedoc.EmployerStreet;
	if ((requireWorkDetails==1)&&((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=2)))
	{
		errorList=errorList+'Employer Address\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}

	checkMe=thedoc.EmployerTown;
	if ((requireWorkDetails==1)&&((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=2)))
	{
		errorList=errorList+'Employer Town\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}

	checkMe=thedoc.EmployerCounty;
	if ((requireWorkDetails==1)&&((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=2)))
	{
		errorList=errorList+'Employer County\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}

	checkMe=thedoc.EmployerPostOutcode;
	if ((requireWorkDetails==1)&&(((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=1))||((validatefield(thedoc.EmployerPostIncode)==false) || (mStringLength(thedoc.EmployerPostIncode.value)<=1))))
	{
		errorList=errorList+'Employer Post Code\n';
		checkMe.style.backgroundColor='ff0000';
		thedoc.EmployerPostIncode.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
		thedoc.EmployerPostIncode.style.backgroundColor='ffffff';
	}

	checkMe=thedoc.EmployerCountry;
	if ((requireWorkDetails==1)&&(checkselect(checkMe)==false))
	{
		errorList=errorList+'Employer Country\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}

	checkMe=thedoc.EmployerTelephoneCode;
	if ((requireWorkDetails==1)&&(((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=2)) || ((validatefield(thedoc.EmployerTelephone)==false) || (mStringLength(thedoc.EmployerTelephone)<=5))))
	{
		errorList=errorList+'Work Telephone Number\n';
		checkMe.style.backgroundColor='ff0000';
		thedoc.EmployerTelephone.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
		thedoc.EmployerTelephone.style.backgroundColor='ffffff';
	}
		
	checkMe=thedoc.EmploymentSinceMM;
	if ((requireWorkDetails==1)&&((checkselect(checkMe)==false) || (checkselect(thedoc.EmploymentSinceYYYY)==false)))
	{
		errorList=errorList+'Employment Start Date\n';
		checkMe.style.backgroundColor='ff0000';
		thedoc.EmploymentSinceYYYY.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
		thedoc.EmploymentSinceYYYY.style.backgroundColor='ffffff';
	}


	doClick(6);

	checkMe=thedoc.BankName;
	if ((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=2))
	{
		errorList=errorList+'Bank Name\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}
/*
	checkMe=thedoc.BankBranch;
	if ((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=2))
	{
		errorList=errorList+'Bank Branch\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}
*/
	checkMe=thedoc.BankSortCodeA;
	if ((((validatefield(checkMe)==true) && (mStringLength(checkMe.value)==2)) && ((validatefield(thedoc.BankSortCodeB)==true) && (mStringLength(thedoc.BankSortCodeB.value)==2)) && ((validatefield(thedoc.BankSortCodeC)==true) && (mStringLength(thedoc.BankSortCodeC.value)==2)))==false)
	{
		errorList=errorList+'Bank Sort Code\n';
		checkMe.style.backgroundColor='ff0000';
		thedoc.BankSortCodeB.style.backgroundColor='ff0000';
		thedoc.BankSortCodeC.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
		thedoc.BankSortCodeB.style.backgroundColor='ffffff';
		thedoc.BankSortCodeC.style.backgroundColor='ffffff';
	}

	checkMe=thedoc.AccountNumber;
	if ((validatefield(checkMe)==false) || (mStringLength(checkMe.value)<=2))
	{
		errorList=errorList+'Bank Account Number\n';
		checkMe.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
	}


	checkMe=thedoc.BankSinceMM;
	if ((checkselect(checkMe)==false) || (checkselect(thedoc.BankSinceYYYY)==false)) 
	{
		errorList=errorList+'Date Bank Account Opened\n';
		checkMe.style.backgroundColor='ff0000';
		thedoc.BankSinceYYYY.style.backgroundColor='ff0000';
		if ((firstError=='') || (firstError=='undefined')) { firstError=checkMe; firstErrorDiv=currentTab; }
	}
	else
	{
		checkMe.style.backgroundColor='ffffff';
		thedoc.BankSinceYYYY.style.backgroundColor='ffffff';
	}

	if (errorList!='')
	{
		doClick(firstErrorDiv);
		firstError.focus();
		alert('Not all required fields have been completed:\n\n' + errorList + '\n\nThey have been highlighted in Red.\n\n');
		return false;
	}

	doClick(backtodiv);
	return true;
}
