	function validate_form_login(thisForm)
	{
		with (thisForm)
		{
			
			if (thisForm.login_email.value == "")
			{
				alert("You must enter an email address!");
				login_email.focus();
				return false;
			}
			
			else
			{
				// test if valid email address, must have @ and .
				var checkEmail = "@.";
				var checkStr = thisForm.login_email.value;
				var EmailValid = false;
				var EmailAt = false;
				var EmailPeriod = false;
				
				for (i = 0;  i < checkStr.length;  i++)
				{
					ch = checkStr.charAt(i);
					for (j = 0;  j < checkEmail.length;  j++)
					{
						if (ch == checkEmail.charAt(j) && ch == "@")
							EmailAt = true;
						
						if (ch == checkEmail.charAt(j) && ch == ".")
							EmailPeriod = true;
						
						if (EmailAt && EmailPeriod)
							break;
						
						if (j == checkEmail.length)
							break;
					}
					
					// if both the @ and . were in the string
					if (EmailAt && EmailPeriod)
					{
						EmailValid = true
						break;
					}
				}
				
				if (!EmailValid)
				{
					alert("Email address \"" + thisForm.login_email.value + "\" appears incorrect.");
					thisForm.login_email.focus();
					return (false);
				}
			}

		}
	}

	
	
	function validate_form_new_user(thisForm)
	{
		with (thisForm)
		{
			
			if (thisForm.user_email.value == "")
			{
				alert("You must enter an email address!");
				user_email.focus();
				return false;
			}
			
			else
			{
				// test if valid email address, must have @ and .
				var checkEmail = "@.";
				var checkStr = thisForm.user_email.value;
				var EmailValid = false;
				var EmailAt = false;
				var EmailPeriod = false;
				
				for (i = 0;  i < checkStr.length;  i++)
				{
					ch = checkStr.charAt(i);
					for (j = 0;  j < checkEmail.length;  j++)
					{
						if (ch == checkEmail.charAt(j) && ch == "@")
							EmailAt = true;
						
						if (ch == checkEmail.charAt(j) && ch == ".")
							EmailPeriod = true;
						
						if (EmailAt && EmailPeriod)
							break;
						
						if (j == checkEmail.length)
							break;
					}
					
					// if both the @ and . were in the string
					if (EmailAt && EmailPeriod)
					{
						EmailValid = true
						break;
					}
				}
				
				if (!EmailValid)
				{
					alert("Email address \"" + thisForm.user_email.value + "\" appears incorrect.");
					thisForm.user_email.focus();
					return (false);
				}
			}
			
			if (thisForm.user_password1.value == "")
			{
				alert("You must enter a password!");
				user_password1.focus();
				return false;
			}
			
			if (thisForm.user_password2.value == "")
			{
				alert("You must confirm your password!");
				user_password2.focus();
				return false;
			}
			
			if (thisForm.user_firstname.value == "")
			{
				alert("You must enter your name!");
				user_firstname.focus();
				return false;
			}
			
			if (thisForm.user_lastname.value == "")
			{
				alert("You must enter your name!");
				user_lastname.focus();
				return false;
			}
			
		}
	}

	
	function validate_form_submit_ad(thisForm)
	{
		with (thisForm)
		{
			
			if (thisForm.title.value == "")
			{
				alert("You must enter title!");
				title.focus();
				return false;
			}
		}
	}

	
	function validate_form_reset_password(thisForm)
	{
		with (thisForm)
		{
			
			if (thisForm.reset_email.value == "")
			{
				alert("You must enter your email address!");
				reset_email.focus();
				return false;
			}
		
			if (thisForm.reset_code.value == "")
			{
				alert("You must enter the code sent to you!");
				reset_code.focus();
				return false;
			}

			if (thisForm.reset_password1.value == "")
			{
				alert("You must enter your new password!");
				reset_password1.focus();
				return false;
			}
			
			if (thisForm.reset_password2.value == "")
			{
				alert("You must confirm your new password!");
				reset_password2.focus();
				return false;
			}
}
	}
	
	
	