
function initMailPage() {
	window.focus();
	// Set initial focus
	if (document.MailPageForm) {
		document.MailPageForm.EmailTo.focus();
		document.MailPageForm.EmailTo.value = document.MailPageForm.EmailTo.value + "";
	}
}

function verifyMailPageForm() {
	var emailto = "";
	var yourname = "";
	var youremail = "";
	var empty_fields = "";
	var msg = "";
	var bFocus = false;

	// Ensure that an email address has been provided
	emailto = document.MailPageForm.EmailTo.value;
	if (emailto.length == 0) {
		empty_fields += "\n   - Email Address (to send page to)";
		document.MailPageForm.EmailTo.focus()
		bFocus = true;
	}
	// Ensure that a sender name has been provided
	namefrom = document.MailPageForm.NameFrom.value;
	if (namefrom.length == 0) {
		empty_fields += "\n   - Your Name";
		if (!bFocus) {
			document.MailPageForm.NameFrom.focus()
			bFocus = true;
		}
	}
	// Ensure that a sender email address has been provided
	emailfrom = document.MailPageForm.EmailFrom.value;
	if (emailfrom.length == 0) {
		empty_fields += "\n   - Your Email Address";
		if (!bFocus) {
			document.MailPageForm.EmailFrom.focus()
			bFocus = true;
		}
	}
	// Notify user of any errors
	if (empty_fields) {
		msg += "--------------------------------------------------------------------------------------\n";
		msg += "Your request could not be processed because of the following error(s).\n";
		msg += "Please correct the error(s) and re-submit.\n";
		msg += "--------------------------------------------------------------------------------------\n\n";
		msg += "The following required field(s) are empty:" + empty_fields + "\n\n";
        alert (msg);
		return false;
	}
	return true;
}
