<!--
function validateForm(form) {

	// validate the Name
	if (!isAsci(form.Name)) {
		alert('Please enter a valid First Name');
		form.Name.focus();
		return false;

	}
	// validate the Surname
	if (!isAsci(form.Surname)) {
		alert('Please enter a valid Surname');
		form.Surname.focus();
		return false;
	}	
	// Validate the email address
	if (!validEmail(form.Email)) {
		alert('Your email address doesn\'t appear to be valid.\nPlease make sure that you enter a valid email address.');
		form.Email.focus();
		return false;
	}
	
	// validate the state field
	if (form.State.options[(form.State.selectedIndex)].value == ""){
		alert('Please select your state');
		form.State.focus();
		return false;

	}
	// validate the phone number
	if (form.Phone.value == '' || !validPhone(form.Phone.value)) {
		alert('Please enter a valid telephone number');
		form.Phone.focus();
		return false;	
		
	}	

	// validate the Enquiry
    if (form.Enquiry.value != "" )
    {
		if (!isAsci2(form.Enquiry)) {
			alert('Please enter valid characters in the Enquiry box. ie. a-Z 0-9 !?@#$%&()", Also URL links are not allowed!');
			form.Enquiry.focus();
			return false;
		}
    }

	return true;
}

function isAsci2(obj) {
	var check=/^[a-zA-Z0-9$@&()!.,?""''#%\s*]+$/;
	var exclude=/^[<>:\s*]+$/;
	
	if(obj.value.search(check) == -1)
		return false;
	else
		return true;
}

function isAsci(obj) {
	var check=/^[a-zA-Z\s*]+$/;

	
	if(obj.value.search(check) == -1)
		return false;
	else
		return true;
}

function validEmail(emailad) {
	var exclude=/[^@\-\.\_\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;
	
	if(((emailad.value.search(exclude) != -1)||(emailad.value.search(check)) == -1)||(emailad.value.search(checkend) == -1))
		return false;
	else
		return true;
}

function validPhone (value) {
	var phoneNumberSet = "0123456789-+-. ()\t\r\n\f";
	var loc;
	for (m=0;m<=value.length - 1;m++) {
		loc = phoneNumberSet.indexOf(value.charAt(m));
		if (loc == -1) { 			
			return false;
		}
	}
	return true;
}

function validPostcode (value) {
	var phoneNumberSet = "0123456789-+-. ()\t\r\n\f";
	var loc;
	for (m=0;m<=value.length - 1;m++) {
		loc = phoneNumberSet.indexOf(value.charAt(m));
		if (loc == -1) { 			
			return false;
		}
	}
	return true;
}

function validNumber (obj) {
	var check=/^[0-9]+$/;
	if(obj.value.search(check) == -1)
		return false;
	else
		return true;
}

// -->
