		function ClearResponse()
			{
			var ctlResponse = document.getElementById("LoginResponse")
			if ( ctlResponse )
				ctlResponse.innerHTML = '&nbsp;';

			var ctlResponse = document.getElementById("F_Response")
			if ( ctlResponse )
				ctlResponse.innerHTML = '&nbsp;';

			var ctlResponse = document.getElementById("M_Response")
			if ( ctlResponse )
				ctlResponse.innerHTML = '&nbsp;';

			}
			
		function ForgotMyPassword()
			{
			var ctl = document.getElementById('txtUsername');

			ClearResponse();

			if ( ctl.value.length == 0 )
				{
				alert("Please enter your Username and then try again.");
				return false;
				}

			document.getElementById('divPleaseWait').style.display = 'block';
			return SubmitRequest("EmailType=ForgotMyPassword&txtUsername=" + ctl.value, "ajaxSendEmail.php", "LoginResponse", 'UpdateControls', '"divPleaseWait"');            
			
			}	// End ForgotMyPassword()
			
		function Login()
			{
			ClearResponse();
			SubmitForm(document.getElementById('frmLogin'), 'ajaxLoginSubmit.php', 'LoginResponse');
			return false;
			}
			
		function SubmitRegistration(Gender)
			{
			var ResponseId = Gender + '_Response';
			var FormId = "frmUserRegistration_" + Gender;

			ClearResponse();

			if ( ! validate(Gender) )
				return false;

			document.getElementById('divPleaseWait').style.display = 'block';
			return SubmitForm(document.getElementById(FormId), "ajaxUserRegistrationSubmit.php?Gender=" + Gender, ResponseId, 'UpdateControls');
	    
			}   // End SubmitRegistration()

		function UpdateControls(statusCode, responseText, obj_id)
			{
			document.getElementById('divPleaseWait').style.display = 'none';
			if ( statusCode == '0005' )
				{
				document.getElementById('Registration_F').style.visibility = 'hidden';
				document.getElementById('Registration_M').style.visibility = 'hidden';
				}
			}	// End UpdateControls()

		function validate(Gender)
			{
			var strErrorMessage = '';
			var ctlPassword = document.getElementById('txtPassword_' + Gender);
			var ctlPasswordConfirmation = document.getElementById('txtPasswordConfirmation_' + Gender);
			var FormId = "frmUserRegistration_" + Gender;

			strErrorMessage = strErrorMessage + verifyField("txtFirstName_" + Gender, "Please enter your First name.\n", true, '', "tabled_input", "tabled_input_error");
			strErrorMessage = strErrorMessage + verifyField("txtLastName_" + Gender, "Please enter your Last name.\n", true, '', "private_input", "tabled_input_error");
			strErrorMessage = strErrorMessage + verifyField("txtUsername_" + Gender, "Please enter the Username you wish use when logging into the website.\n", true, '', "private_input", "tabled_input_error");
			strErrorMessage = strErrorMessage + verifyField("txtPassword_" + Gender, "Please enter the Password you wish use when logging into the website.\n", true, '', "private_input", "tabled_input_error");
			strErrorMessage = strErrorMessage + verifyField("txtPasswordConfirmation_" + Gender, "Please enter the Password you wish use when logging into the website a second time to ensure it was typed correctly.\n", true, '', "private_input", "tabled_input_error");
			if ( ctlPassword.value != ctlPasswordConfirmation.value )
				{
				strErrorMessage = strErrorMessage + "The 'Password' and the 'Confirm Password' are not the same.  Please re-enter the 'Confirm Password' and ensure it matches your desired 'Password'.\n";
				ctlPassword.className = "tabled_input_error";
				ctlPasswordConfirmation.className = "tabled_input_error";
				}
			strErrorMessage = strErrorMessage + verifyField("txtEmailAddress_" + Gender, "Please enter a valid email address.\n", true, "emailaddress", "private_input", "tabled_input_error");
			strErrorMessage = strErrorMessage + verifyField("txtAntiSpamCode_" + Gender, "Please enter the characters seen in the 'Validation Code' into the validation code data entry field.\n", true, '', "private_input", "tabled_input_error");

			if(strErrorMessage.length)
				{
				window.alert(strErrorMessage);
				return false;
				}
        
			return true;

			}	// End validate()

