// STANDARD.js

	//*************************
	//enquiryValidation()
	//form for validating the enquiries
	function enquiryValidation()
	{		
		//initiate error variables
		errorList 		= "";
		errorCount 		= 0;
		errorMessage	= "";		
	
		//get the required values from the form
		title 		= document.getElementById("Title").value;
		forename	= document.getElementById("Forename").value;
		surname		= document.getElementById("Surname").value;
		address1	= document.getElementById("Address1").value;
		postcode	= document.getElementById("Postcode").value;
		email		= document.getElementById("Email").value;
		subject		= document.getElementById("Subject").value;
		comments 	= document.getElementById("Comments").value;		
				
		//check there is a value for each
		if(isBlank(title))
		{
			errorList 	+= "\n- You must enter your title.     ";
			errorCount 	+= 1;
		}
		
		if(isBlank(forename))
		{
			errorList 	+= "\n- You must enter your forename.     ";
			errorCount 	+= 1;
		}
		
		if(isBlank(surname))
		{
			errorList 	+= "\n- You must enter your surname.     ";
			errorCount 	+= 1;
		}
		
		if(isBlank(address1))
		{
			errorList 	+= "\n- You must enter the first line of your address.     ";
			errorCount 	+= 1;
		}
		
		if(isBlank(postcode))
		{
			errorList 	+= "\n- You must enter your postcode.     ";
			errorCount 	+= 1;
		}
		
		if(isBlank(email))
		{
			errorList 	+= "\n- You must enter an email address.     ";
			errorCount 	+= 1;
		}
		else
		{
			errorList 	+= "\n- You must enter a valid email address.     ";
			errorCount 	+= 1;
		}
		
		if(isBlank(subject))
		{
			errorList 	+= "\n- You must enter a subject for your enquiry.     ";
			errorCount 	+= 1;
		}
		
		if(isBlank(comments))
		{
			errorList 	+= "\n- You must enter details of your enquiry.     ";
			errorCount 	+= 1;
		}
		
		if(errorCount==0)
		{
			return true;
		}
		else 
		{
			if(errorCount==1)
			{
				errorMessage = "The following error has occured -     ";
				errorMessage += "\n" + errorList + "\n";
				errorMessage += "\nPlease fix this errors before clicking 'Send Enquiry'";
			} else
			{
				errorMessage = "The following errors have occured -     ";
				errorMessage += "\n" + errorList + "\n";
				errorMessage += "\nPlease fix these errors before clicking 'Send Enquiry'.";	
			}
			
			alert(errorMessage);
			return false;
		}
	}
	//*************************	
	
	//*************************
	//isBlank
	//function to check if there is a value present.
	function isBlank(val){
		if(val==null){return true;}
		if(val.length==0) {return true;}
		return false;     
	}
	//*************************	
	
	//*************************
	//isEmail
	//function to check the validity of an email
	function isEmail(email) {
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))
		{
			return true
		}
		else {
			return false;	
		}
	}
	//*************************
