<!--
	function validate_form() {			
		if (check_valid_essential_contents(document.Order_Form.Forename.value) != true){
			alert("Please complete a valid entry for your Forename");
			self.document.Order_Form.Forename.focus();
			return false;			
		}
		
		if (check_valid_essential_contents(document.Order_Form.Surname.value) != true){
			alert("Please complete a valid entry for your Surname");
			self.document.Order_Form.Surname.focus();
			return false;			
		}
		
		if (check_valid_essential_contents(document.Order_Form.Address_Line_1.value) != true){
			alert("Please complete a valid First line of the Address");
			self.document.Order_Form.Address_Line_1.focus();
			return false;			
		}
		
		if (check_valid_nonessential_contents(document.Order_Form.Address_Line_2.value) != true){
			alert("Please complete a valid Second line of the Address");
			self.document.Order_Form.Address_Line_2.focus();
			return false;			
		}
		
		if (check_valid_essential_contents(document.Order_Form.City.value) != true){
			alert("Please complete a valid Town or City");
			self.document.Order_Form.City.focus();
			return false;			
		}
		
		if (trim(document.Order_Form.County.value) == "Select"){
			alert("Please complete a valid County");
			self.document.Order_Form.County.focus();
			return false;			
		}
		
		if (trim(document.Order_Form.Country.value) == "Select"){
			alert("Please complete a valid Country");
			self.document.Order_Form.Country.focus();
			return false;			
		}
		
		if (trim(document.Order_Form.Country.value) !== "United Kingdom" & trim(document.Order_Form.Country.value) !== "Ireland" & trim(document.Order_Form.Delivery_Country.value) == "Select"){
			alert("Sorry - orders to outside of the United Kingdom and Northern Ireland can not be taken online. Please contact us by Email or Phone for a quotation for haulage");
			self.document.Order_Form.Country.focus();
			return false;			
		}
		
		if (check_valid_postcode_contents(document.Order_Form.Postcode.value) != true){
			alert("Please complete a valid Postcode");
			self.document.Order_Form.Postcode.focus();
			return false;
		}			
		
		if (check_valid_email_contents(document.Order_Form.Email.value) != true){			
			self.document.Order_Form.Email.focus();
			return false;
		}	
		
		if (check_valid_nonessential_contents(document.Order_Form.Delivery_Address_Line_1.value) != true){
			alert("Please complete a valid First line of the Delivery Address");
			self.document.Order_Form.Delivery_Address_Line_1.focus();
			return false;			
		}
		
		if (check_valid_nonessential_contents(document.Order_Form.Delivery_Address_Line_2.value) != true){
			alert("Please complete a valid Second line of the Delivery Address");
			self.document.Order_Form.Delivery_Address_Line_2.focus();
			return false;			
		}
		
		if (check_valid_nonessential_contents(document.Order_Form.Delivery_City.value) != true){
			alert("Please complete a valid Delivery Town or City");
			self.document.Order_Form.Delivery_City.focus();
			return false;			
		}			
			
		if (trim(document.Order_Form.Delivery_Country.value) !== "United Kingdom" & trim(document.Order_Form.Delivery_Country.value) !== "Ireland" & trim(document.Order_Form.Delivery_Country.value) !== "Select") {
			alert("Sorry - orders to outside of the United Kingdom and Northern Ireland can not be taken online. Please contact us by Email or Phone for a quotation for haulage");
			self.document.Order_Form.Delivery_Country.focus();
			return false;			
		}
		
		if (trim(document.Order_Form.Delivery_Address_Line_1.value) !== "" | trim(document.Order_Form.Delivery_Address_Line_2.value) !== "" | trim(document.Order_Form.Delivery_City.value) == "" | trim(document.Order_Form.Delivery_County.value) !== "Select" | trim(document.Order_Form.Delivery_Country.value) !== "Select") {
			if (check_valid_postcode_contents(document.Order_Form.Delivery_Postcode.value) != true){
				alert("Please complete a valid Delivery Postcode");
				self.document.Order_Form.Delivery_Postcode.focus();
				return false;
			}	
		}	
		
		if (!(document.Order_Form.Terms_and_Conditions.checked)) {
			alert("Please select that you have read the terms and conditions");			
			return false;			
		}	
		
		return true;
	}	
	
	function check_valid_postcode_contents(inputbox) {
		var teststring
		var outputstring
		teststring  = trim(inputbox.toString())
		if (inputbox == "") {
			return true
		}
		if (isblank(teststring)) {
			return true
		}
		outputstring = removeblank(teststring)		
		if (!isNaN(outputstring)) {
			return false
		}
		if (outputstring.length < 6 || outputstring.length > 8) {
			return false
		}			
		size = teststring.length;
		if (!(isNaN(outputstring.charAt(0)))) {   
   			return false;
  		}
		if (isNaN(teststring.charAt(size-3))){ 
      		return false;
  		}	
		if (!(isNaN(teststring.charAt(size-2)))) {   
   			return false;
  		}	
		if (!(isNaN(teststring.charAt(size-1)))) {
      		return false;
  		}
		if (!(teststring.charAt(size-4) == " ")) {   
   			return false;
   		}
 		count1 = teststring.indexOf(" ");
        count2 = teststring.lastIndexOf(" ");
 		if (count1 != count2){   
   			return false;
  		}
		return true
	}
	
	function check_valid_email_contents(inputbox) {
			if (inputbox == "") {
				alert("Please complete a valid Email Address");
				return false
			}
			
			var teststring 

			teststring = trim(inputbox.toString())
			
			if (isblank(teststring)) {
				alert("Please complete a valid Email Address");
				return false
			}		

			// Convert inputbox to string			
			
			outputstring = removeblank(teststring)

			// Check for at least 7 chrs

			if (outputstring.length <= 6){
				alert("The email address you have entered is not in a valid format");				
				return false;
			}

			// Check for Illegal Characters

			var illegalchrs = new Array("*","£","$","!")

			var counter
	
			for (counter=0; counter <= illegalchrs.length; counter++){
				if (outputstring.indexOf(illegalchrs[counter]) != -1){
				alert("You have entered an invalid character in your email address");				
				return false;
				}				
			}

			// Check for the @ and the dots


			// First check that they both exist

			var atpositionback = outputstring.lastIndexOf("@")

			var dotpositionback = outputstring.lastIndexOf(".")

			var atpositionfront = outputstring.indexOf("@")


			if (atpositionback == -1){
				alert("The email address you have entered is not in a valid format");				
				return false;
			}

			if (dotpositionback == -1){
				alert("The email address you have entered is not in a valid format");				
				return false;
			}

			if (atpositionfront != atpositionback){
				alert("The email address you have entered is not in a valid format");				
				return false;
			}

			if (atpositionback > dotpositionback){
				alert("The email address you have entered is not in a valid format");				
				return false;
			}				
		return true
	}
	
	function check_valid_essential_contents(inputbox) {
		var teststring
		var outputstring		
		teststring = trim(inputbox.toString())
		if (inputbox == "") {
			return false
		}
		if (isblank(teststring)) {
			return false
		}
		outputstring = removeblank(teststring)	
		if (!isNaN(outputstring)) {
			return false
		}
		if (outputstring.length < 2) {
			return false
		}			
		return true
	}	
	
	function check_valid_nonessential_contents(inputbox) {
		var teststring
		var outputstring		
		teststring = trim(inputbox.toString())
		if (inputbox == "") {
			return true
		}
		if (isblank(teststring)) {
			return true
		}
		outputstring = removeblank(teststring)	
		if (!isNaN(outputstring)) {
			return false
		}
		if (outputstring.length < 2) {
			return false
		}			
		return true
	}		
	
	function isblank(inbox) {
		for (var i = 0; i <  inbox.length; i++) {
			var c = inbox.charAt(i)
			if (c != " "){		
				return false;
			}
		}
		return true
	}
	
	function removeblank(inbox) {
		var output = ""
		for( var i = 0; i <  inbox.length; i++) {
			var c = inbox.charAt(i)
			if (c != " "){		
				output = output + c			
			}
		}
		return output
	}
	
	function trim(str) {	
   		return str.replace(/^\s*|\s*$/g,"");
	}

//-->