<!-- //
// Form validation, verify data prior to submit.

// 'f' is used as an alias to the form object on the page



function checkform(f) {  // check form elements
	var t = "";
	var c_flag = (f.F09_state.selectedIndex > 0) || (f.F10_country.value != 'U.S.A.')
	t += (f.F04_name.value) ? "" : "Your name is missing\n";
	t += (f.F05_phone.value) ? "" : "Your phone number is missing\n";
	t += (f.F07_address.value) ? "" : "Your street address is missing\n";
	t += (f.F08_city.value) ? "" : "Your city is missing\n";
	t += (c_flag) ? "" : "Your state (if in the U.S.A.) is missing\n";
	t += (f.F09_zip.value) ? "" : "Your ZIP code is missing\n";

//validate email address
 if ( f.F06_email.value.indexOf("@") == -1){
  t += "Please enter a valid email address\n";
 }
 else {
  ea = f.F06_email.value.split("@");
   if (ea[1].indexOf(".") == -1){
    t += "Please enter a valid email address\n";
   }
   else {
    dom = ea[1].split(".");
     if ((!dom[0])||(dom[0].length <= 0))
     t += "Please enter a valid domain name in your email address\n";
     else if ((!dom[01])||(dom[1].length <= 1))
     t += "Please enter a valid domain name in your email address\n";
   }
 }
 //end of email address validation


	if (t != "") {
		t = "The information you entered could not be submitted,\nfor the following reasons:\n\n" + t;
		alert(t);
		return false;
		}
	else {
		return true;
		}
		// end if
	} // end checkform
		
function submitit(f) {
	if (checkform(f)) {
		f.submit()
		} // end if
	} // end submitit
 // -->



