// JavaScript Document

function validateForm(form) { //This is the name of the function

     if (form.fname.value == "") { //This checks to make sure the field is not empty
   alert("fname field is empty."); //Informs user of empty field
   form.fname.focus( ); //This focuses the cursor on the empty field
   return false; //This prevents the form from being submitted
   }
     if (form.lname.value == "") { //This checks to make sure the field is not empty
   alert("lname field is empty."); //Informs user of empty field
   form.lname.focus( ); //This focuses the cursor on the empty field
   return false; //This prevents the form from being submitted
   }
     if (form.company.value == "") { //This checks to make sure the field is not empty
   alert("company field is empty."); //Informs user of empty field
   form.company.focus( ); //This focuses the cursor on the empty field
   return false; //This prevents the form from being submitted
   }
     if (form.address1.value == "") { //This checks to make sure the field is not empty
   alert("address1 field is empty."); //Informs user of empty field
   form.address1.focus( ); //This focuses the cursor on the empty field
   return false; //This prevents the form from being submitted
   }
     if (form.city.value == "") { //This checks to make sure the field is not empty
   alert("city field is empty."); //Informs user of empty field
   form.city.focus( ); //This focuses the cursor on the empty field
   return false; //This prevents the form from being submitted
   }
     if (form.state.value == "") { //This checks to make sure the field is not empty
   alert("state field is empty."); //Informs user of empty field
   form.state.focus( ); //This focuses the cursor on the empty field
   return false; //This prevents the form from being submitted
   }
     if (form.zip.value == "") { //This checks to make sure the field is not empty
   alert("zip field is empty."); //Informs user of empty field
   form.zip.focus( ); //This focuses the cursor on the empty field
   return false; //This prevents the form from being submitted
   }
     if (form.phone.value == "") { //This checks to make sure the field is not empty
   alert("phone field is empty."); //Informs user of empty field
   form.phone.focus( ); //This focuses the cursor on the empty field
   return false; //This prevents the form from being submitted
   }
     if (form.email.value == "") { //This checks to make sure the field is not empty
   alert("email field is empty."); //Informs user of empty field
   form.email.focus( ); //This focuses the cursor on the empty field
   return false; //This prevents the form from being submitted
   }
      if (form.code.value != "5936300") { //This checks to make sure the field is not empty
   alert("submission code is incorrect."); //Informs user of empty field
   form.email.focus( ); //This focuses the cursor on the empty field
   return false; //This prevents the form from being submitted
   }
}