// JavaScript Document
/*	-------------------------------------------------
	FUNCTIONS
	-------------------------------------------------	*/
	function validateLogin() {
		var boolErrorFound			= false;
		var strErrorText			= "";

		if ($("#strEmail").val().length < 3) {
			boolErrorFound				= true;
			strErrorText				+= "- Please enter your e-mail address.\n";
		} else if (($("#strEmail").val().indexOf("@") == -1) || ($("#strEmail").val().indexOf(".") == -1)) {
			boolErrorFound				= true;
			strErrorText				+= "- Please enter a valid e-mail address.\n";
		}
		if ($("#strPassword").val().length < 3) {
			boolErrorFound				= true;
			strErrorText				+= "- Please enter a password to use for your account.\n";
		}

		if (boolErrorFound) {
			alert(STR_STANDARD_ERROR + strErrorText);
			return false;
		} else {
			return true;
		}
	}

	function validateForgot() {
		var boolErrorFound			= false;
		var strErrorText			= "";

		if ($("#strForgotEmail").val().length < 3) {
			boolErrorFound				= true;
			strErrorText				+= "- Please enter your e-mail address.\n";
		} else if (($("#strForgotEmail").val().indexOf("@") == -1) || ($("#strForgotEmail").val().indexOf(".") == -1)) {
			boolErrorFound				= true;
			strErrorText				+= "- Please enter a valid e-mail address.\n";
		}

		if (boolErrorFound) {
			alert(STR_STANDARD_ERROR + strErrorText);
			return false;
		} else {
			return true;
		}
	}

	function validateRegistration() {
		var boolErrorFound			= false;
		var strErrorText			= "";

		if ($("#strName").val().length < 3) {
			boolErrorFound				= true;
			strErrorText				+= "- Please enter your name.\n";
		}
		if ($("#strEmail").val().length < 3) {
			boolErrorFound				= true;
			strErrorText				+= "- Please enter your e-mail address.\n";
		} else if (($("#strEmail").val().indexOf("@") == -1) || ($("#strEmail").val().indexOf(".") == -1)) {
			boolErrorFound				= true;
			strErrorText				+= "- Please enter a valid e-mail address.\n";
		}
		if ($("#strPassword").val().length < 3) {
			boolErrorFound				= true;
			strErrorText				+= "- Please enter a password to use for your account.\n";
		} else { 
			if ($("#strPasswordV").val().length < 3) {
				boolErrorFound				= true;
				strErrorText				+= "- Please enter your password again in the \"Confirm Password\" box.\n";
			} else {
				if ($("#strPassword").val() != $("#strPasswordV").val()) {
					boolErrorFound				= true;
					strErrorText				+= "- The passwords you entered did not match.  Please enter them again.\n";
					
					$("#strPassword").val("");
					$("#strPasswordV").val("");
				}
			}
		}
		if ($("#strPhone").val().length < 3) {
			boolErrorFound			= true;
			strErrorText			+= "- Please enter your phone number.\n";
		}

		if (boolErrorFound) {
			alert(STR_STANDARD_ERROR + strErrorText);
			return false;
		} else {
			return true;
		}
	}
	
