<!--

function validateMember()
{
	fv = new formValidator();
	
	if (fv.isEmpty("member_name"))
		fv.raiseError("Please specify your name.");
	
	if (fv.isEmpty("email_address"))
		fv.raiseError("Please specify an email address.");
	else
	{
		if (!fv.isEmailAddress("email_address"))
			fv.raiseError("Please specify a valid email address.");
	}
	
	if (fv.isEmpty("position"))
		fv.raiseError("Please specify your position.");
		
	if (fv.isEmpty("password"))
		fv.raiseError("Please specify a password.");
		
	if (fv.isEmpty("confirm_password"))
		fv.raiseError("Please confirm your password.");
		
	if (!fv.isSame("confirm_password", "password"))
		fv.raiseError("Please re-enter your password information");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}

function validateNewProperty()
{
	fv = new formValidator();
	
	if (fv.isEmpty("property_name"))
		fv.raiseError("Please specify your property's name.");
	
	if (fv.isEmpty("address"))
		fv.raiseError("Please specify the property's address.");
	
	if (!fv.isSelected("province"))
		fv.raiseError("Please specify a province.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}


function validateProfile()
{
	fv = new formValidator();
	
	if (fv.isEmpty("member_name"))
		fv.raiseError("Please specify your name.");
	
	if (fv.isEmpty("email_address"))
		fv.raiseError("Please specify an email address.");
	else
	{
		if (!fv.isEmailAddress("email_address"))
			fv.raiseError("Please specify a valid email address.");
	}
	
	if (fv.isEmpty("telephone"))
		fv.raiseError("Please specify a telephone number.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;

}

function validateChangePassword()
{
	fv = new formValidator();
	
	if (fv.isEmpty("current_password"))
		fv.raiseError("Please specify your current password.");

	if (fv.isEmpty("new_password"))
		fv.raiseError("Please specify your new password.");
	
	if (fv.isEmpty("confirm_new_password"))
		fv.raiseError("Please confirm your new password.");
		
	if (!fv.isSame("confirm_new_password", "new_password"))
		fv.raiseError("Please confirm your new password.");
		
	newPassword = new String(fv.findObj("new_password").value);
	if (newPassword.length < 5 || newPassword.length > 12)
		fv.raiseError("Your new password must be 5 to 12 characters long.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}

function validateForgottenPassword()
{
	fv = new formValidator();
	
	if (fv.isEmpty("email_address"))
		fv.raiseError("Please specify an email address.");
	else
	{
		if (!fv.isEmailAddress("email_address"))
			fv.raiseError("Please specify a valid email address.");
	}
	
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
	
}

function validateCalculatorApplicant()
{
	fv = new formValidator();
	
	if (fv.isEmpty("fullname"))
		fv.raiseError("Please specify your name.");
	
	if (fv.isEmpty("property_name"))
		fv.raiseError("Please specify your property's name.");
	
	if (fv.isEmpty("email_address"))
		fv.raiseError("Please specify an email address.");
	else
	{
		if (!fv.isEmailAddress("email_address"))
			fv.raiseError("Please specify a valid email address.");
	}
	
	if (fv.isEmpty("website"))
		fv.raiseError("Please specify your website address.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}

-->
