// Returns true of email is valid
// otherwise returns false

function validateEmail(emailStrOrField,	// either the actual email string or the form field object containing the string
						alertMe) {
	if (alertMe == undefined) alertMe = 1	// default
	if (emailStrOrField.value != undefined) var emailStr = emailStrOrField.value
	else var emailStr = emailStrOrField
	if (emailStr != '') {		// if an email was specified
		if (emailStr.match(/\S+@\S+\.\S+/g) == null) {	// format: a@b.c
			if (alertMe) alert("Email is invalid or contains a space.\n\nPlease re-enter.")
			if (typeof emailStrOrField.focus != undefined) emailStrOrField.focus()
			return false
		}
	}
	return true
}
