/* ******************************************************** *
 * *  This function will ensure the E-Mail Address is in  * *
 * *  proper e-mail address format.                       * *
 * ******************************************************** */
function validate_email(that, femail)
{
	var emailmsgString = "Please enter your e-mail address.";
	// If the E-Mail Address field is blank, it cannot be in proper e-mail address format..
	if (femail == "")
	{
		alert(emailmsgString);
		that.focus();
		return false;
	}
	else
	{
		// If the length is less than 6 characters, it cannot be in proper e-mail address format.
		if (femail.length < 6)
		{
			alert(emailmsgString);
			that.focus();
			return false;
		}
		else
		{
			//	Rules for the E-mail regular expression:
			//	1. The start of the e-mail must have at least one character before the @ sign
			//	2. There may be either a . or a -, but not together before the @ sign
			//	3. There must be an @ sign
			//	4. At least once character must follow the @ sign
			//	5. There may be either a . or a -, but not together in the address
			//	6. The address must end with a . followed by at least 2 characters
			var re;
			re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
			if (re.test(femail) == false)
			{
				alert(emailmsgString);
				that.focus();
				return false;
			}
		}
	}
	return true;
}
