
function townOptionValidator(){
	
	// Make quick references to our fields
	
	var town = document.getElementById('town');
	
	// Check that the fields are not empty
	if(isEmpty(town) || town == "") {
		alert("You must choose the town where the automobile is located"); 
		return false;
	}
	if ( (document.forms[0].option[0].checked) || (document.forms[0].option[1].checked) ) {
		return true;
	} else {
		alert("You must choose a service option");
		return false;
	} 
		
}

function formValidator(){
			
	// Make quick references to our fields
	var name = document.getElementById('name');
	var make = document.getElementById('make');
	var model = document.getElementById('model');
	var year = document.getElementById('year');
	var address = document.getElementById('address');
	var email = document.getElementById('email');
	
	// Check that the fields are not empty
	if( isEmpty(name) || isEmpty(make) || isEmpty(model) || isEmpty(address) || isEmpty(year) ) {
		alert("You must enter data in all the required fields");
		return false;
	}
	// check that the email is either blank or valid
	if( !emailValidOrBlank(email) ) {
		alert("You did not enter a valid email address");
		return false;
	}
	return true;
}
