function validateForm(formName)
{
	//Form Validation

	//Validate MLS Book Form
	if (formName == "mlsBook")
	{
		//Client Name
		if (notEmpty(document.mlsBook.clientName))
		{
			//Email Address
			if (validEmailAddress(document.mlsBook.emailAddress, document.mlsBook.confirmEmail))
			{
				//Client Comment Box Is Not Required
				return true;
			}
		}
	}
	else
	{
		//Validate MLS Search Form
		if (formName == "mlsSearch")
		{
			//Client Name
			if (notEmpty(document.mlsSearch.clientName))
			{
				//Email Address
				if (validEmailAddress(document.mlsSearch.emailAddress, document.mlsSearch.confirmEmail))
				{
					//MLS Info Box
					if (notEmpty(document.mlsSearch.mlsInfo))
					{
						return true;
					}
				}
			}
		}
		else
		{
			//Other Forms To Test
		}		
	}
	return false;
}	

//Not Empty
function notEmpty(fieldElement)
{
	if(fieldElement.value.length == 0)
	{
		alert('Field Cannot Be Empty.');
		fieldElement.focus();
		return false;
	}
	return true;
}

//Is Email
function validEmailAddress(emailElement, confirmElement)
{
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	
	//Is Not Empty
	if(notEmpty(emailElement))
	{
		//Valid Email
		if(emailElement.value.match(emailExp))
		{
			//Is Also Confirmed
			if(emailElement.value == confirmElement.value)
			{
				return true;
			}
			else
			{
				alert('Confirmed Email Address Is Different.');
				confirmElement.focus();					
			}
		}
		else
		{
			alert('Email Does Not Appear Valid.');
			emailElement.focus();				
		}
	}
	return false;
}	
