function ValidateBillingAddress(nSession)
{
	var msg = '';
	if ((document.BillingAddress.Password.value.length < 6) && ((document.BillingAddress.Password.value.length > 0) || (nSession == 0)))
		msg = msg + 'Password must be at least 6 characters long.\n';
	if (document.BillingAddress.Password.value != document.BillingAddress.ConfirmPassword.value)
		msg = msg + 'Password and confirmation must match.';

	if (document.BillingAddress.FirstName.value.length == 0)
		msg = msg + 'Please provide a First Name.\n';
	if (document.BillingAddress.LastName.value.length == 0)
		msg = msg + 'Please provide a Last Name.\n';
	if (document.BillingAddress.Address1.value.length == 0)
		msg = msg + 'Please provide an address.\n';
	if (document.BillingAddress.City.value.length == 0)
		msg = msg + 'City must not be empty.\n';
	if (document.BillingAddress.State.value.length == 0)
		msg = msg + 'State/Province/Region must not be empty.\n';
	if (document.BillingAddress.Zipcode.value.length < 5)
		msg = msg + 'ZIP/Postal Code must be at least 5 characters long.\n';
	if (document.BillingAddress.Phone.value.length < 13)
		msg = msg + 'Phone Number must in the (123)456-7890 format.\n';
	if (msg.length > 0)
	{
		alert(msg);
		return false;
	}
	return true;
}

function checkAcceptAgree()
{
	if (document.BillingAddress.AcceptAgreement.checked)
		return true;
	else
	{
		alert('You must accept the WebSite Agreement to continue.');
		return false;
	}
}

function ValidateAFAddress(nSession)
{
	var msg = '';
	if ((document.BillingAddress.Password.value.length < 6) && ((document.BillingAddress.Password.value.length > 0) || (nSession == 0)))
		msg = msg + 'Password must be at least 6 characters long.\n';
	if (document.BillingAddress.Password.value != document.BillingAddress.ConfirmPassword.value)
		msg = msg + 'Password and confirmation must match.';

	if (document.BillingAddress.FirstName.value.length == 0)
		msg = msg + 'Please provide a First Name.\n';
	if (document.BillingAddress.LastName.value.length == 0)
		msg = msg + 'Please provide a Last Name.\n';
	if (document.BillingAddress.Address1.value.length == 0)
		msg = msg + 'Please provide an address.\n';
	if (document.BillingAddress.City.value.length == 0)
		msg = msg + 'City must not be empty.\n';
	if (document.BillingAddress.State.value.length == 0)
		msg = msg + 'State/Province/Region must not be empty.\n';
	if (document.BillingAddress.Zipcode.value.length < 5)
		msg = msg + 'ZIP/Postal Code must be at least 5 characters long.\n';
	if (msg.length > 0)
	{
		alert(msg);
		return false;
	}
	else
		return true;
}

function checkJoinAcceptAgree(lFrom)
{
	var msg = '';

	if (!(lFrom || document.JoinInfo.cbAcceptAgreement.checked))
		msg = msg + 'You must check the box indicating that you accept the agreement.\n';
	if (document.JoinInfo.AcceptInitials.value.length == 0)
		msg = msg + 'You must enter your initials in the box.\n';
	if (document.JoinInfo.Title.value.length == 0)
		msg = msg + 'You must enter your title.\n';
	if (document.JoinInfo.YearsInBusiness.value.length == 0)
		msg = msg + 'You must enter the years you have been in business.\n';
	if (document.JoinInfo.YearsAtLocation.value.length == 0)
		msg = msg + 'You must enter the years you have been at your current location.\n';
	if (document.JoinInfo.WeeklyVisitors.value.length == 0)
		msg = msg + 'You must enter the number of visitors you have, on a weekly basis.\n';
	if (msg.length > 0)
	{
		alert(msg);
		return false;
	}
	else
		return true;
}

