// functions to validate form entry by JCNetworks


function validateForm(myform) { // -- function to check entire form --


if(myform.firstname.value == "") { //check for empty field
   alert("You must enter your First Name"); //is empty
   myform.firstname.focus( ); //jump to empty field
   return false; //stops submission
   }

if(myform.lastname.value == "") { //check for empty field
   alert("You must enter your Last Name"); //is empty
   myform.lastname.focus( ); //jump to empty field
   return false; //stops submission
   }
if(myform.contactEmail.value == "") { //check for empty field
   alert("You must enter a valid contact email address."); //is empty
   myform.contactEmail.focus( ); //jump to empty field
   return false; //stops submission
   }

if(myform.comments.value == "") { //check for empty field
   alert("You must enter something in the Message Area."); //is empty
   myform.comments.focus( ); //jump to empty field
   return false; //stops submission
   }

// -- validate checkbox at bottom of form
if (!document.myform.age.checked) {
   // box is not checked
   alert("Pursuant to the COPPA Act (2001) and our Privacy Policy you must verify that you are exactly 13 years of age or older to submit this form."); //is empty
   return false;
}


} // end validateForm function


// -- addtional function to check email compostition
function isValid() {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myform.contactEmail.value)){
return true;
}
alert ('This email address does not appear to be in a valid format.')
myform.contactEmail.focus( );
return false;
}



