
function validateForm() {
  var theForm = document.entryForm;
 
  if (theForm.Full_Name.value.length == 0) {
  	alert("Please specify your Name");
  return false;
  }
  if (theForm.Email.value.length == 0) {
  	alert("Please specify your Email Address");
  	return false;
  }
  if (validateEmail(theForm.Email.value) == false) {
  	alert("Please enter a valid Email Address");
  	return false;
  }

  if (theForm.Postal_Code.value.length == 0) {
  	alert("Please select a Zip Code");
  	return false;
  }
  
  if (theForm.CC_List.value.length == 0) {
  	alert("Please select an E-mail List");
  	return false;
  }

  if (theForm.Agreement.checked == false) {
  	alert("Please confirm your agreement to the terms of the contest by clicking the checkbox below the Phone field");
  	return false;
  }
  
  return true;
}


function validateSimpleForm() {
  var theForm = document.entryForm;
 
  if (theForm.Full_Name.value.length == 0) {
  	alert("Please specify your Name");
  return false;
  }
  if (theForm.Email.value.length == 0) {
  	alert("Please specify your Email Address");
  	return false;
  }
  if (validateEmail(theForm.Email.value) == false) {
  	alert("Please enter a valid Email Address");
  	return false;
  }
  
  return true;
}


function validateEmail(email) {
  return (email.indexOf(".") > 2) && (email.indexOf("@") > 0);
}

function validatePhoneNumber(phoneNumber) {
  var stripped = phoneNumber.replace(/[\(\)\.\-\ ]/g, '');
  stripped = parseInt(stripped);
  if (isNaN(stripped)) {
  	return false;
  }
  stripped = stripped + "";
  if (!(stripped.length == 10)) {
  	return false;
  }
  return true;
}


function submitForm() {
  var theForm = document.entryForm;
  theForm.submit();
}

