function SendEmail()
{
	var theForm;
	theForm = document.forms['frmSendMail'];

	// First Name
	theForm.txtFName.value = theForm.txtFName.value.replace(/^\s+|\s+$/g, '');
	if ('' == theForm.txtFName.value)
	{
		alert('Please provide your first name.');
		theForm.txtFName.focus();
		return false;
	}

	// Last Name
	theForm.txtLName.value = theForm.txtLName.value.replace(/^\s+|\s+$/g, '');
	if ('' == theForm.txtLName.value)
	{
		alert('Please provide your last name.');
		theForm.txtLName.focus();
		return false;
	}

	// Email Address
	theForm.txtEmail.value = theForm.txtEmail.value.replace(/^\s+|\s+$/g, '');
	if ('' == theForm.txtEmail.value)
	{
		alert('Please provide your email address.');
		theForm.txtEmail.focus();
		return false;
	}

	// Confirm Email Address
	theForm.txtConfirmEmail.value = theForm.txtConfirmEmail.value.replace(/^\s+|\s+$/g, '');
	if ('' == theForm.txtConfirmEmail.value)
	{
		alert('Please confirm your email address.');
		theForm.txtConfirmEmail.focus();
		return false;
	}

	if (IsValidEmail(theForm.txtEmail.value) == false)
	{
		alert("Please provide a valid email address.");
		theForm.txtEmail.focus();
		return false;
	}

	// Message
	theForm.txtMsg.value = theForm.txtMsg.value.replace(/^\s+|\s+$/g, '');
	if ('' == theForm.txtMsg.value)
	{
		alert('Please type a message.');
		theForm.txtEmail.focus();
		return false;
	}

	theForm.submit();
	return true;
}

function IsValidEmail(varEmail)
{
	//-- Email address must contain @ and dot, and must not contain spaces, slashes, or quotes (whether double or single)
	if (-1 != varEmail.indexOf(" "))
		return false;
	if (-1 != varEmail.indexOf("\\"))
		return false;
	if (-1 != varEmail.indexOf("\'"))
		return false;
	if (-1 != varEmail.indexOf("\""))
		return false;
	if (-1 == varEmail.indexOf("@"))
		return false;
	if (-1 == varEmail.indexOf("."))
		return false;
	return true;
}

