// jsutil.js - JavaScript Utility Functions for Barbara Wilder

//======================================================================
//======================================================================
//
// jsutil.js - Javascript Utility Subroutines for Barbara Wilder
//
//    checkForm() - Ensure required fields are filled-out for
//                  Newsletter Subscription form.
//
//======================================================================
//======================================================================
   
//=======================================================
// Check the Newsletter Subscription form for a
// valid email address
//
// Input: The form
//=======================================================
function checkForm(theForm)
{
	var pattern = /^[a-zA-Z0-9]+[a-zA-Z0-9\._-]*@[a-zA-Z0-9_-]+[a-zA-Z0-9\._-]+$/;
	var result = theForm.email.value.match(pattern);
	
	if (result == null) {
		alert ("Please enter a valid email address:");
		theForm.email.focus();
		return false;
 		}

	// A-OK
	return true;
}


