function formValidator(){
	// Make quick references to our fields
	var firstname = document.getElementById('first');
	var last = document.getElementById('last');
	var email = document.getElementById('email');
	var dob = document.getElementById('dob');
	var checkbox = document.getElementById('checkbox');
	var cell = document.getElementById('cell');


	// Check each input in the order that it appears in the form!
	//First and last name are currently optional

	//if(isEmpty(firstname, "First Name is required")){

	if(emailValidator(email, "A valid email is required")){

	if(checkDate(dob)){

	if(checkCheckBox("Please agree to join out mailing list, Thank you!")){

	//if(isNumeric(cell, "Please use all numbers - no dashes or symbols")){
	
						return true;

	//}
	//}
	}
	}
	}
	return false;
	alert("Not Validated");
}


//Checks to see if fields are empty

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

//Checks for all letters and no numbers

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


//Checks email structure

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 checkCheckBox(helperMsg){
			if(!document.Customer.MAILING_LIST.checked){
			alert(helperMsg);
			return false;
		}else{

			return true;
	}
}

//Checks for all numeric

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

}


//Checks for Date


  function checkDate(field)
  {
    var allowBlank = true;
    var minYear = 1902;
    var maxYear = (new Date()).getFullYear();

    var errorMsg = "";

    // regular expression to match required date format
    re = /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/;

    if(field.value != '') {
      if(regs = field.value.match(re)) {
        if(regs[2] < 1 || regs[2] > 31) {
          errorMsg = "Invalid value for day: " + regs[2];
        } else if(regs[1] < 1 || regs[1] > 12) {
          errorMsg = "Invalid value for month: " + regs[1];
        } else if(regs[3] < minYear || regs[3] > maxYear) {
          errorMsg = "Invalid value for year: " + regs[3] + " - must be between " + minYear + " and " + maxYear;
        }
      } else {
        errorMsg = "Invalid date format: Use mm/dd/yyyy";
      }
    } else if(allowBlank) {
      errorMsg = "Empty date not allowed!";
    }

    if(errorMsg != "") {
      alert(errorMsg);
      field.focus();
      return false;
    }

    return true;
  }

