// <script>function formchecker(theForm) {	var allvalid = true;	var alertstr = "";	var validstr = "All form data is correct.\n\n";	var num_of_elements = theForm.length;	var radio_selected = false;	var checkbox_selected = false;	for (var i=0; i<num_of_elements; i++) {		var theElement = theForm.elements[i];		var element_type = theElement.type;		var element_name = theElement.name;		var element_value = theElement.value;// Check all text boxes and text area boxes and drop down lists		if (element_value.length == 0) {				alertstr += "" + element_name + " is missing.\n\n";				allvalid = false;			} // Check Buttons ...		if (element_type == "button") {			// Don't check buttons - use the onClick event to invoke functions.		} 	// .... End of loop through form elements ....	}	// Check accuracy of email address .... 	txt=document.usam.email.value;		if (txt.indexOf("@")<3){		alertstr += "Your email address seems wrong. Please check the prefix and '@' sign.\n\n";		allvalid = false;   }      txt=document.usam.email.value;   	if ((txt.indexOf(".com")<5)&&(txt.indexOf(".org")<5)&&(txt.indexOf(".gov")<5)&&(txt.indexOf(".net")<5)&&(txt.indexOf(".mil")<5)&&(txt.indexOf(".edu")<5)){		alertstr += "Your email seems wrong. Please check the suffix for accuracy. (It should include a .com, .edu, .net, .org, .gov or .mil)\n\n";		allvalid = false;   }// All elements checked - now determine if form is OK ...	if (allvalid) {		return true;	} else {		alert (alertstr);		return false;	}}
