function checkthefields()
{
	//alert("Thank you for your job application.\nWe will respond as soon as possible.\n\nBest Regards,\nTaste of Belgium");
	var error = "";
	var cfm = "";

	if (document.application.lastname.value == "")
	{
		error = 'Please specify your last name';
	}
	if (document.application.firstname.value == "")
	{
		error = error + '\nPlease specify your first name';
	}
	if (!document.application.sex[0].checked && !document.application.sex[1].checked)
	{
		error = error + '\nPlease select your sex';
	}
	if (document.application.sex[1].checked && document.application.maidenname.value == "")
	{
		error = error + '\nPlease specify your maiden name';
	}
	if (document.application.birthdate.value == "")
	{
		error = error + '\nPlease specify your date of birth';
	}
	if (document.application.birthplace.value == "")
	{
		error = error + '\nPlease specify your place of birth';
	}
	if (document.application.address.value == "")
	{
		error = error + '\nPlease specify your address';
	}
	if (document.application.telephone.value == "")
	{
		error = error + '\nPlease specify your telephone number';
	}
	if (document.application.nationality.value == "")
	{
		error = error + '\nPlease specify your nationality';
	}
	if (document.application.workpermit.value == "")
	{
		error = error + '\nPlease specify your work permit or not applicable';
	}
	if (!checkValidation(document.application.email.value))
	{
		error = error + "\nPlease specify a valid email address";
	}
	if (document.application.civilstatus.value == "")
	{
		error = error + '\nPlease specify your civil status';
	}
	if (document.application.desiredposition.value == "")
	{
		error = error + '\nPlease specify the position you desire';
	}
	if (document.application.dateavailable.value == "")
	{
		error = error + '\nPlease specify the date that you are available';
	}
	if (document.application.expectedsalary.value == "")
	{
		error = error + '\nPlease specify the salary that you expect';
	}
	if (!document.application.notavailable[0].checked && !document.application.notavailable[1].checked)
	{
		error = error + '\nPlease select if there are hours/days that you are not available';
	}
	if (document.application.notavailable[0].checked && document.application.notavailexplain.value == "")
	{
		error = error + '\nPlease explain the hours/days that you are not available';
	}
	if (!document.application.appliedbefore[0].checked && !document.application.appliedbefore[1].checked)
	{
		error = error + '\nPlease answer the question if you applied before';
	}
	if (document.application.appliedbefore[0].checked && document.application.whenappliedbefore.value == "")
	{
		error = error + '\nPlease specify when you applied before';
	}
	if (!document.application.employedbefore[0].checked && !document.application.employedbefore[1].checked)
	{
		error = error + '\nPlease answer the question if you were employed here before';
	}
	if (document.application.employedbefore[0].checked && document.application.perioddepartment.value == "")
	{
		error = error + '\nPlease specify periode and department you were employed here before';
	}
	if (document.application.healthproblems[0].checked && document.application.healthproblemdescribe.value == "")
	{
		error = error + '\nPlease describe your potential health problems';
	}
	if (!document.application.physicalexam[0].checked && !document.application.physicalexam[1].checked)
	{
		error = error + '\nPlease answer the question if you are willing to undergo a physical exam';
	}
	if (document.application.physicalexam[1].checked && document.application.physicalexplain.value == "")
	{
		error = error + '\nPlease explain why you are not willing to undergo a physical exam';
	}
	if (!document.application.problemspolice[0].checked && !document.application.problemspolice[1].checked)
	{
		error = error + '\nPlease answer the question if you had problems with police';
	}
	if (document.application.problemspolice[0].checked && document.application.problemspoliceexplain.value == "")
	{
		error = error + '\nPlease explain why you had problems with police';
	}

	if (document.application.namehighschool.value == "")
	{
		cfm = cfm + '\nAre you sure to leave name High School empty ?';
	}
	if (document.application.dutchverbal.value == "")
	{
		error = error + '\nPlease select your verbal language capability for Dutch';
	}
	if (document.application.dutchwritten.value == "")
	{
		error = error + '\nPlease select your written language capability for Dutch';
	}
	if (document.application.englishverbal.value == "")
	{
		error = error + '\nPlease select your verbal language capability for English';
	}
	if (document.application.englishwritten.value == "")
	{
		error = error + '\nPlease select your written language capability for English';
	}
	if (document.application.spanishverbal.value == "")
	{
		error = error + '\nPlease select your verbal language capability for Spanish';
	}
	if (document.application.spanishwritten.value == "")
	{
		error = error + '\nPlease select your written language capability for Spanish';
	}
	if (document.application.papiamentoverbal.value == "")
	{
		error = error + '\nPlease select your verbal language capability for Papiamento';
	}
	if (document.application.papiamentowritten.value == "")
	{
		error = error + '\nPlease select your written language capability for Papiamento';
	}
	if (!document.application.contactemployer[0].checked && !document.application.contactemployer[1].checked)
	{
		error = error + '\nPlease answer the question if we may contact previous employer(s)';
	}
	if (document.application.contactemployer[1].checked && document.application.employerexplain.value == "")
	{
		error = error + '\nPlease explain why we may not contact your former or current employer';
	}
	if (document.application.user_code.value == "")
	{
		error = error + '\nPlease retype the confirmation code';
	}
	if (document.application.company1.value == "")
	{
		cfm = cfm + '\nAre you sure there is no former company to specify ?';
	}

	if (error == "")
	{
		if (cfm == "")
		{
			return true;
		}
		else
		{
			return(confirm (cfm));
		}
	}
	else
	{
		alert (error);
		return false;
	}
	return true;
}

function hideCells(a,b)
{
	document.getElementById(a).style.display='none';
	document.getElementById(b).style.display='none';
}

function showCells(a,b)
{
	document.getElementById(a).style.display='block';
	document.getElementById(b).style.display='block';
}

function showCells2(a,b,c,d)
{
	document.getElementById(a).innerHTML=c;
	document.getElementById(b).innerHTML=d;
}

function hideCells2(a,b)
{
	document.getElementById(a).innerHTML='&nbsp;';
	document.getElementById(b).innerHTML='&nbsp;';
}
