// JavaScript Document
// One or more not special email characters, @, 1 or more letter/number/dash, 0 or more dot & letter/number/dash, dot 2 to 6 letter.
		function isEmail(string){
			return (/^[^\s()<>@,;:\\"\/\[\]?=]+@\w[\w-]*(\.\w[\w-]*)*\.[a-z]{2,}$/i).test(string);
		}
		
		//(1 or 2 letters, 1 or 2 letters or numbers)(0 or more spaces)(1 number, 2 letters)
		function isUkPostcode(string){
			return (/^[a-z]{1,2}\w{1,2}\s+\d[a-z]{2}$/i).test(string);
		}
		
		// Last tested 26/04/2001 - this should be reviewed regularly as phone numbers change regularly
		// Allows parenthesis around area code and spaces in the number
		// Accepts the format (01962) 339441 but not +44 1962 339441
		function isUkPhone(string){
			return (/^\(?0[1278][\d\s\)]{6,14}$/).test(string);
		}
		
		function isCharacters(string){
			return (/./).test(string);
		}
		
		function checkForm(form){
			var reportText = "";
			if (!isCharacters(form.customers_name.value)) reportText += "You have not entered a name.\n";
			if (!isCharacters(form.address1.value)) reportText += "You have not entered an address.\n";
			if (!isCharacters(form.customer_postal_code.value)) reportText += "You have not entered a postal / ZIP code.\n";
			if (!isCharacters(form.customer_country.value)) reportText += "You have not entered a country.\n";
			if (!isCharacters(form.DaytimeContact.value || form.mobile_phone.value)) reportText += "You have not entered a contact number.\n";
			if (isCharacters(form.customer_email.value) && !isEmail(form.customer_email.value)) reportText += "You don't appear to have entered a valid e-mail address.\n";
			if (form.Type_of_service.options[form.Type_of_service.selectedIndex].value=='0') reportText += "You have not selected a type of service.\n"; 
			if (form.transit_mode.options[form.transit_mode.selectedIndex].value=='0') reportText += "You have not selected a transportation method.\n"; 
			if (reportText) {
				
				reportIntro = "Sorry, the form is not complete: \n-------------------\n\n"
				reportText = reportIntro + reportText;
				alert(reportText);
			}
			else form.submit();
		}

		
