function formValidator(){
	// Make quick references to our fields
	var name = document.getElementById('name');
	var phone = document.getElementById('phone');	
	var email = document.getElementById('email');
	var passengerCount = document.getElementById('passengerCount');
	
	
	// Check each input in the order that it appears in the form!
	//if(isAlphabet(lead_Fname, "Please enter only letters for your First name")){
		if(notEmpty(name, "You must fill in your first name") && isAlphabet(name, "Please enter only letters for your name")){
			if(notEmpty(phone, "You must fill in your phone number") && isNumeric(phone, "Please enter only numbers for the phone number")){
				if(notEmpty(email, "You must fill in your email address") && emailValidator(email, "Please enter a valid email address")){
					if(notEmpty(passengerCount, "You must fill in the number of passengers") && isInRange(passengerCount, "The passenger count must be in the range of 15 - 10,000") && isNumeric(passengerCount, "The passenger count entry must be numeric only")){
		return true;
					}
				}
			}
		}
	return false;
	
}

function notEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus(); // set the focus to this input
		return false;
	}
	return true;
}

function isNumeric(elem, helperMsg){
	var numericExpression = /^[0-9]+$/;
	if(elem.value.match(numericExpression)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isAlphabet(elem, helperMsg){
	var alphaExp = /^[a-zA-Z\s]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function emailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(elem.value.match(emailExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isInRange(elem, helperMsg){
	var n=document.form1.passengerCount.value; //Get the value of textbox into variable
	if (n<15 || n >10000){
		alert(helperMsg);
		elem.focus();
		return false;
	}else{
		return true;
	}
}