  /* crossarrow - www.crossarrow.co.uk */
	
	
/* JAVASCRIPT STARTS HERE */


//VALIDATION FUNCTIONS FOR THE ALERT BOX ERROR REPORTING.

			function validateFirstName(myForm) 
			{
//Test to check Family Name is just letters.  Uses regular 
//expression below to test pattern and puts up alert box if incorrect.
			reFirstName = /^(\D+)$/
			if (reFirstName.test(myForm))
				return true;
						 else
        return false;
			}
						
			function validateSurname(myForm) 
			{
//Test to check Surname is just letters.  Uses regular 
//expression below to test pattern and puts up alert box if incorrect.
			reSurname = /^(\D+)$/
			if (reSurname.test(myForm))
				return true;
						 else
        return false;
			}
			
			
			function validateEmail(myForm) 
			{
//Test to check Email address input is correct.  Uses regular 
//expression below to test pattern and puts up alert box if incorrect.
			reEmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
			if (reEmail.test(myForm))
				return true;
						 else
        return false;
				}

			
// ALERT BOX FORM VALIDATIONS: The function is called from the form, which 
//then calls the appropriate validation functions. If false an alert appears.
// First is the family Name followed by Phone Number then Email address.

			function validateForm(myForm) 
			{
			if (validateFirstName(myForm.FirstName.value) == false) 
			{
				 alert("Please enter your first name.");
				 							 myForm.FirstName.focus();
				 							 myForm.FirstName.select();
			return false;
		}
		
			 
			if (validateSurname(myForm.Surname.value) == false) 
			{
				 alert("Please enter your surname.");
				 							 myForm.Surname.focus();
				 							 myForm.Surname.select();
			return false;
		}
			
											
			if (validateEmail(myForm.Email.value) == false) 
			{
				 alert("Sorry your email address does not seem right!  please try again.");
				 							myForm.Email.focus();
				 							myForm.Email.select();
			return false;
		}
		   
			return true;
}
			

/* JAVASCRIPT ENDS HERE */