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

	// Strip leading blanks
	theForm.txtFName.value = theForm.txtFName.value.replace(/^\s+/,'');
	// Strip trailing blanks
	theForm.txtFName.value = theForm.txtFName.value.replace(/\s+$/,'');
	if ('' == theForm.txtFName.value)
	{
		alert ('Please tell us your first name');
		theForm.txtFName.focus();
		return false;
	}

	// Strip leading blanks
	theForm.txtLName.value = theForm.txtLName.value.replace(/^\s+/,'');
	// Strip trailing blanks
	theForm.txtLName.value = theForm.txtLName.value.replace(/\s+$/,'');
	if ('' == theForm.txtLName.value)
	{
		alert ('Please tell us your last name');
		theForm.txtLName.focus();
		return false;
	}
	
	// Strip leading blanks
	theForm.txtEmail.value = theForm.txtEmail.value.replace(/^\s+/,'');
	// Strip trailing blanks
	theForm.txtEmail.value = theForm.txtEmail.value.replace(/\s+$/,'');
	if ('' == theForm.txtEmail.value)
	{
		alert ('Please tell us your email address');
		theForm.txtEmail.focus();
		return false;
	}
	
	// Strip leading blanks
	theForm.txtEmail.value = theForm.txtEmail.value.replace(/^\s+/,'');
	// Strip trailing blanks
	theForm.txtEmail.value = theForm.txtEmail.value.replace(/\s+$/,'');
	if (IsValidEmail(theForm.txtEmail.value) == false)
	{
		alert("Please provide a valid email address.");
		theForm.txtEmail.focus();
		return false;
	}

	// Strip leading blanks
	theForm.txtPhone.value = theForm.txtPhone.value.replace(/^\s+/,'');
	// Strip trailing blanks
	theForm.txtPhone.value = theForm.txtPhone.value.replace(/\s+$/,'');
	//if ('' == theForm.txtPhone.value)
	//{
	//	alert ('Please tell us your phone number');
	//	theForm.txtEmail.focus();
	//	return false;
	//}
	
	// Strip leading blanks
	theForm.txtMsg.value = theForm.txtMsg.value.replace(/^\s+/,'');
	// Strip trailing blanks
	theForm.txtMsg.value = theForm.txtMsg.value.replace(/\s+$/,'');
	if ('' == theForm.txtMsg.value)
	{
		alert ('Your message currently contains no text. Please enter a message.');
		theForm.txtMsg.focus();
		return false;
	}
	
	theForm.submit();
	return true;
}
function IsValidEmail(varEmail)
{
	//-- Email address must contain @ and dot, and must not contain spaces
	if (-1 != varEmail.indexOf(" "))
		return false;
	if (-1 == varEmail.indexOf("@"))
		return false;
	if (-1 == varEmail.indexOf("."))
		return false;
	return true;
}
