function validateForm()
	{
		var emailAddress = document.scholar.email.value;
		var at="@"
		var dot="."
		
		//remove spaces from telephone number
		var telString = "";
		var validateTel = document.scholar.personal_tel.value;
		validateTel = '' + validateTel;
		splitstring = validateTel.split(" ");
		for(i = 0; i < splitstring.length; i++)
		{
			telString += splitstring[i];
		}
		
		//remove spaces from telephone number
		var telString1 = "";
		var validateTel1 = document.scholar.witness_tel.value;
		validateTel1 = '' + validateTel1;
		splitstring = validateTel1.split(" ");
		for(i = 0; i < splitstring.length; i++)
		{
			telString1 += splitstring[i];
		}
		
		if(document.scholar.name.value=="")
			{
				alert("Please enter your Name")
				document.scholar.name.focus();
			}
			
		else if((document.scholar.dob1.value=="")||(document.scholar.dob2.value=="")||(document.scholar.dob3.value==""))
			{
				alert("Please fill out your Date of Birth")
					if(document.scholar.dob1.value=="")
						{document.scholar.dob1.focus();}
					else if(document.scholar.dob2.value=="")
						{document.scholar.dob2.focus();}
					else if(document.scholar.dob3.value=="")
						{document.scholar.dob3.focus();}
			}
		
		else if((isNaN(document.scholar.dob1.value))||(isNaN(document.scholar.dob2.value))||isNaN((document.scholar.dob3.value)))
			{
				alert("Please enter a numeric value")
				if(isNaN(document.scholar.dob1.value))
					{document.scholar.dob1.focus()}
				else if(isNaN(document.scholar.dob2.value))
					{document.scholar.dob2.focus()}
				else if(isNaN(document.scholar.dob3.value))
					{document.scholar.dob3.focus()}
			}

		else if(document.scholar.personal_address1.value=="")
			{
				alert("Please enter your Address")
				document.scholar.personal_address1.focus();
			}
		
		else if(document.scholar.personal_postcode.value=="")
			{
				alert("Please enter your Postcode")
				document.scholar.personal_postcode.focus();
			}
			
		else if(document.scholar.personal_tel.value=="")
			{
				alert("Please enter your Telephone Number")
				document.scholar.personal_tel.focus();
			}
		
		else if (isNaN(telString))
			{				
				alert("Please enter a valid Telephone Number")
				document.scholar.personal_tel.focus();
			}
			
		else if(document.scholar.email.value=="")
			{
				alert("Please enter your Email Address")
				document.scholar.email.focus();
			}	
			
		else if (emailAddress.indexOf(at)==-1)
			{
				alert("Please enter a valid Email Address")
				document.scholar.email.focus();
			}
		
		else if (emailAddress.indexOf(dot)==-1)
			{
				alert("Please enter a valid Email Address")
				document.scholar.email.focus();
			}
		
		else if(document.scholar.employer.value=="")
			{
				alert("Please enter the name of your Employer")
				document.scholar.employer.focus();
			}
			
		else if(document.scholar.address1.value=="")
			{
				alert("Please enter your Work Address")
				document.scholar.address1.focus();
			}
		
		else if(document.scholar.postcode.value=="")
			{
				alert("Please enter your Work Postcode")
				document.scholar.postcode.focus();
			}
			
		else if(document.scholar.current_employment.value=="")
			{
				alert("Please enter details of your Current Employment")
				document.scholar.current_employment.focus();
			}
			
		else if(document.scholar.witness_name.value=="")
			{
				alert("Please enter your the name of your Witness")
				document.scholar.witness_name.focus();
			}
			
		else if(document.scholar.witness_address1.value=="")
			{
				alert("Please enter your the address of your Witness")
				document.scholar.witness_address1.focus();
			}
			
		else if(document.scholar.witness_postcode.value=="")
			{
				alert("Please enter your the postcode of your Witness")
				document.scholar.witness_postcode.focus();
			}
		
		else if(document.scholar.witness_tel.value=="")
			{
				alert("Please enter a Telephone Number")
				document.scholar.witness_tel.focus();
			}
		else if (isNaN(telString1))
			{				
				alert("Please enter a valid Telephone Number")
				document.scholar.witness_tel.focus();
			}
			
		else
			{
				document.scholar.submit();
			}
	}