function Validate(theForm)
{

	if (!theForm.LoginName.value==""){
		if (theForm.LoginPassword.value==""){
			alert ("You must enter a password.");
			theForm.LoginPassword.focus();
			return false;
		}
 	}else{
		if (theForm.UserNameFullFirst.value==""){
			alert ("You must enter a First Name.");
			theForm.UserNameFullFirst.focus();
			return false;
		}
		if (theForm.UserNameFullLast.value==""){
			alert ("You must enter a Last Name.");
			theForm.UserNameFullLast.focus();
			return false;
		}

		if (theForm.Update.value=="0")
			if (theForm.Name.value==""){
				alert ("You must enter a User Name.");
				theForm.Name.focus();
				return false;
			}else{
				if (theForm.Pass.value==""){
					alert ("You must enter a Password.");
					theForm.Pass.focus();
					return false;
				}else{
					if (theForm.ValPass.value==""){
						alert ("You must enter a validating Password.");
						theForm.ValPass.focus();
						return false;
					}else{
						if (!(theForm.Pass.value==theForm.ValPass.value)){
							alert ("Your passwords must match.");
							theForm.ValPass.focus();
							return false;
						}
					}
				}
			}
	
		if (theForm.BillToAddress1.value==""){
			alert ("You must enter a Billing Address.");
			theForm.BillToAddress1.focus();
			return false;
		}
		if (theForm.BillToCity.value==""){
			alert ("You must enter a Billing City.");
			theForm.BillToCity.focus();
			return false;
		}
		if (theForm.BillToZip.value==""){
			alert ("You must enter a Billing Zip Code.");
			theForm.BillToZip.focus();
			return false;
		}else{
			var checkOK = "0123456789-";
			var checkStr = theForm.BillToZip.value;
			var allValid = true;
			var decPoints = 0;
			var allNum = "";
			for (i = 0;  i < checkStr.length;	i++){
				ch = checkStr.charAt(i);
				for (j = 0;  j < checkOK.length;  j++)
					if (ch == checkOK.charAt(j))
						break;
				if (j == checkOK.length){
					allValid = false;
					break;
				}
				if (ch != ",")
					allNum += ch;
			}
			if (!allValid){
				alert("Please enter only digit characters in the Zip Code.");
				theForm.BillToZip.focus();
				return (false);
			}
		}
	
		if (!theForm.BillPhoneDay.value==""){
			var matchArr = theForm.BillPhoneDay.value.match(/^(\(?\d{3}\)|\d{3}\-)\d{3}-\d{4}$/)
			if (matchArr==null){
				alert ("Your Day Phone Number is not correct. Please make sure that it is in the form (xxx)xxx-xxxx OR xxx-xxx-xxxx.");
				theForm.BillPhoneDay.focus();
				return false;
			}
		}
		if (!theForm.BillPhoneNight.value==""){
			var matchArr = theForm.BillPhoneNight.value.match(/^(\(?\d{3}\)|\d{3}\-)\d{3}-\d{4}$/)
			if (matchArr==null){
				alert ("Your Night Phone Number is not correct. Please make sure that it is in the form (xxx)xxx-xxxx OR xxx-xxx-xxxx.");
				theForm.BillPhoneNight.focus();
				return false;
			}
		}

		if (theForm.UserEmail.value==""){
			alert ("You must enter an Email Address.");
			theForm.UserEmail.focus();
			return false;
		}else{
			emailCheck(theForm.UserEmail.value);
		}

		if (theForm.UserCompany.value=="")
			if (theForm.ByOrganization0.options[theForm.ByOrganization0.selectedIndex].text==""){
				alert ("You must enter an Organization.");
				theForm.ByOrganization0.options[theForm.ByOrganization0.selectedIndex].focus();
				return false;
			}else{
				theForm.UserCompany.value = theForm.ByOrganization0.options[theForm.ByOrganization0.selectedIndex].text+"-"+theForm.ByOrganization1.options[theForm.ByOrganization1.selectedIndex].text+"-"+theForm.ByOrganization2.options[theForm.ByOrganization2.selectedIndex].text+"<>---??";
	//			  alert (theForm.UserCompany.value);
	//			theForm.UserCompany.value = theForm.ByOrganization0.options[theForm.ByOrganization0.selectedIndex].text+"-"+theForm.ByOrganization1.options[theForm.ByOrganization1.selectedIndex].text+"-"+theForm.ByOrganization2.options[theForm.ByOrganization2.selectedIndex].text+"<>??"+theForm.Chapter0.options[theForm.Chapter0.selectedIndex].text+"-"+theForm.Chapter1.options[theForm.Chapter1.selectedIndex].text+"-"+theForm.Chapter2.options[theForm.Chapter2.selectedIndex].text;
			}
//		alert (theForm.UserCompany.value);

  }
  return (true);
}
