function validate_contact ()
{
	var empty_fields = "";
	var errors = "";
	var msg;
	var num_errs = 0;

	var name = document.contact_form.name.value;
	var email = document.contact_form.email.value;
	var comments = document.contact_form.comments.value;

	if (isblank (name)) {
		empty_fields += "\n* Name";
		num_errs++;
	}
	if (isblank (email)) {
		empty_fields += "\n* Email address";
		num_errs++;
	}
	if (isblank (comments)) {
		empty_fields += "\n* Comments";
		num_errs++;
	}

	if (!isemail (email)) {
		errors += "\nThe email address is not valid.";
		num_errs++;
	}
	if (comments.length > 5000) {
		errors += "\nThe comments field is limited to 5000 characters.";
		num_errs++;
	}

	if (num_errs == 0)
		return (true);
	else {
		msg  = "__________________________________________________\n\n"
		msg += "The form was not submitted because of the following error(s).\n"
		msg += "Please correct these error(s) and re-submit.\n";
		msg += "__________________________________________________\n\n"
	}

	if (empty_fields) {
		msg += "The following required field(s) are empty:" + empty_fields + "\n";
		if (errors)
			msg += "\n";
	}
	msg += errors;
	alert (msg);

	return (false);
}
