

function CheckForm() {
	var matchKeyword = document.frmSiteSearch.search.value.match(/^.{3,}$/);
	if (document.frmSiteSearch.search.value == "") {
		alert("Please enter the Keyword(s) to search");
		document.frmSiteSearch.search.focus();
		return false;
	}

	if (matchKeyword == null) {
		alert("Your search was not specific enough. \nPlease try again.");
		document.frmSiteSearch.search.value = "";
		document.frmSiteSearch.search.focus();
		return false;
	}
	else {
		document.frmSiteSearch.submit();
	}
}


function ValidateContactForm() {

	var matchFirstName = document.forms.ContactForm.FirstName.value.match(/^([a-zA-Z]+)$/)
	var matchLastName = document.forms.ContactForm.LastName.value.match(/^([a-zA-Z]+)$/)
	var matchPhone = document.forms.ContactForm.Phone.value.match(/^(\d{3})-\d{3}-\d{4}$/);
	var matchEmail = document.forms.ContactForm.Email.value.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/);
	var matchComments = document.forms.ContactForm.Comments.value.match(/^([\S\s]{1,500})$/);

	if (document.forms.ContactForm.FirstName.value == "") 
	{
		alert("Please enter your First Name.");
		document.forms.ContactForm.FirstName.focus();
		return;
	}

	if (matchFirstName == null) {
		alert("Please enter a valid First Name. \n(Only letters may be entered.)");
		document.forms.ContactForm.FirstName.focus();
		return;
		}

	if (document.forms.ContactForm.LastName.value == "") 
	{
		alert("Please enter your Last Name.");
		document.forms.ContactForm.LastName.focus();
		return;
	}

	if (matchLastName == null) {
		alert("Please enter a valid Last Name. \n(Only letters may be entered.)");
		document.forms.ContactForm.LastName.focus();
		return;
		}

	if (document.forms.ContactForm.Phone.value == "") {
		alert("Please enter your Daytime Phone Number. \n(Example: xxx-xxx-xxxx)");
		document.forms.ContactForm.Phone.focus();
		return;
		}

	if (matchPhone == null) {
		alert("Please enter a valid Daytime Phone Number. \n(Format: xxx-xxx-xxxx)");
		document.forms.ContactForm.Phone.focus();
		return;
		}

	if (document.forms.ContactForm.Email.value == "") {
		alert("Please enter your E-mail Address.");
		document.forms.ContactForm.Email.focus();
		return;
		}

	if (matchEmail == null) {
		alert("Please enter a valid E-mail Address. \n(Format: name@domain.com, net, gov, etc.)");
		document.forms.ContactForm.Email.focus();
		return;
		}

	if (document.forms.ContactForm.Comments.value == "") 
	{
		alert("Please enter your Question or Comments.");
		document.forms.ContactForm.Comments.focus();
		return;
	}

	if (matchComments == null) {
		alert("Please limit your Question or Comments to 500 Characters");
		document.forms.ContactForm.Comments.focus();
		return;
	}

		document.forms.ContactForm.submit();
}

function ValidateClientLogin() {
	if(document.forms.ClientLoginForm.UserId.value == "") {
		alert("Please enter your User ID");
		document.forms.ClientLoginForm.UserId.focus();
		return;
	}

	if(document.forms.ClientLoginForm.UserPassword.value == "") {
		alert("Please enter your Password.");
		document.forms.ClientLoginForm.UserPassword.focus();
		return;
	}

	document.forms.ClientLoginForm.submit();
	document.forms.ClientLoginForm.UserId.value = "";
	document.forms.ClientLoginForm.UserPassword.value = "";
}

function ValidateForgotPassword() {
	if(document.forms.ForgotPasswordForm.email.value == "") {
		alert("Please enter your E-mail Address");
		document.forms.ForgotPasswordForm.email.focus();
		return;
	}

	document.forms.ForgotPasswordForm.submit();
}


//function ClearForgotPasswordForm() {
//	document.forms.ForgotPasswordForm.UserId.value = "";
//	document.forms.ForgotPasswordForm.UserId.focus();
//}
		