function DisplayAlert(formfield, msg) {
	alert(msg);
	formfield.focus();
	return false;
}

// checks for a Valid Email Address
// 		formfield	- is the email formfield object, (ie. form.Email)
//		EmailName	- is the name of date field FOR DISPLAY in the Alert Box,
//		required	- boolean flag, (true or false) to indicate if Email Address is required
function ChkEmail(formfield, EmailName, required) {
	if (!formfield) {return true;}

	email = formfield.value;
	EmailName = 'Please enter a valid ' + EmailName;
	invalidChars = " /:,;"
	if (email == "" && required) { return DisplayAlert(formfield, EmailName); }
	if (email == "") { return true; }

	for (i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i)
		if (email.indexOf(badChar,0) != -1) { return DisplayAlert(formfield, EmailName); }
	}

	atPos = email.indexOf("@",1)
	if (atPos == -1) { return DisplayAlert(formfield, EmailName); }
	if (email.indexOf("@",atPos+1) != -1) { return DisplayAlert(formfield, EmailName); }

	periodPos = email.indexOf(".",atPos)
	if (periodPos == -1) { return DisplayAlert(formfield, EmailName); }
	if (periodPos+3 > email.length) { return DisplayAlert(formfield, EmailName); }
	return true;
}
