function formValidator(){
	// Make quick references to our fields
	var contactname = document.getElementById('Contact_Name');
	var companyname = document.getElementById('Contact_Company_Name');
	var contactphone = document.getElementById('Contact_Phone_Number');
	var email = document.getElementById('Contact_Email_Address');
	var besttime = document.getElementById('Contact_Best_Time');
	var bestday = document.getElementById('Contact_Best_Day');
	var cruise = document.getElementById('Cruise_Giveaway');
	var eventtype = document.getElementById('Event_Type');
	var eventstyle = document.getElementById('Event_Style');
	var eventplace = document.getElementById('Event_Place');
	var eventmonth = document.getElementById('Event_Month');
	var eventday = document.getElementById('Event_Day');
	var eventyear = document.getElementById('Event_Year');
	var eventtime = document.getElementById('Event_Time');
	var numberguests = document.getElementById('Number_Guests');
	var locationsite = document.getElementById('Location_Site');
	var locationname = document.getElementById('Location_Name');
	var locationaddress = document.getElementById('Location_Address');
	var locationcity = document.getElementById('Location_City');
	var locationcounty = document.getElementById('Location_County');
	
	// Check each input in the order that it appears in the form!
	if(lengthRestriction(contactname, 2, 30)){
	if(lengthRestriction(companyname, 2, 30)){
	if(isNumericPhone(contactphone, "Please Enter A Valid Phone Number")){
	if(lengthRestriction(contactphone, 2, 30)){
	if(emailValidator(email, "Please Enter A Valid Email Address")){
	if(lengthRestriction(besttime, 2, 30)){
	if(lengthRestriction(bestday, 2, 30)){
	if(lengthRestriction(cruise, 2, 30)){
	if(lengthRestriction(eventtype, 2, 30)){
	if(lengthRestriction(eventstyle, 2, 30)){
	if(lengthRestriction(eventplace, 2, 30)){
	if(lengthRestriction(eventmonth, 2, 30)){
	if(lengthRestriction(eventday, 2, 30)){
	if(lengthRestriction(eventyear, 2, 30)){
	if(lengthRestriction(eventtime, 2, 30)){
	if(lengthRestriction(numberguests, 2, 30)){
	if(lengthRestriction(locationsite, 2, 30)){
	if(lengthRestriction(locationname, 2, 30)){
	if(lengthRestriction(locationaddress, 2, 30)){
	if(lengthRestriction(locationcity, 2, 30)){
	if(lengthRestriction(locationcounty, 2, 30)){
		return true;
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	
	return false;
	
}

function isEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus(); // set the focus to this input
		return true;
	}
	return false;
}

function isNumeric(elem, helperMsg){
	var numericExpression = /^[0-9]+$/;
	if(elem.value.match(numericExpression)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isNumericPhone(elem, helperMsg){
	var numericExpression = /((\(\d{3}\) ?)|(\d{3}[- \.]))?\d{3}[- \.]\d{4}(\s(x\d+)?){0,1}$/;
	if(elem.value.match(numericExpression)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isAlphabet(elem, helperMsg){
	var alphaExp = /^[a-zA-Z]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isAlphanumeric(elem, helperMsg){
	var alphaExp = /^[a-zA-Z0-9]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function lengthRestriction(elem, min, max){
	var uInput = elem.value;
	if(uInput.length >= min && uInput.length <= max){
		return true;
	}else{
		alert("Please Enter More Than " +min+ " But Less Than " +max+ " characters");
		elem.focus();
		return false;
	}
}

function madeSelection(elem, helperMsg){
	if(elem.value == "Please Choose"){
		alert(helperMsg);
		elem.focus();
		return false;
	}else{
		return true;
	}
}

function emailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+\&]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,6}$/;
	if(elem.value.match(emailExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}
