function Validate1stMD(theForm)
{
	if (theForm.Director_FirstName0.value.length == 0)
	{
		alert("Your business entity is required to have at least one member.  Please fill out the 1st member information.  You can utilize your contact information for this field as well.");
		theForm.Director_FirstName0.focus();
		return false;
	}
	if(checkRequiredTextField(theForm.Director_LastName0,"Please enter the member last name.")){return false;}
	if(checkRequiredTextField(theForm.Director_StreetAddress0,"Please enter the member street address.")){return false;}
	if(checkForPOBox(theForm.Director_StreetAddress0)){return false;}
	if(checkRequiredTextField(theForm.Director_City0,"Please enter the member city.")){return false;}
	if(checkRequiredSelect(theForm.Director_State0,"Please select a member state.",false)){return false;}
	if(checkRequiredTextField(theForm.Director_ZIP0,"Please enter the member ZIP code.")){return false;}

	return true;
}

function fillMDWithContactInfo(theForm)
{
	theForm.Director_FirstName0.value = theForm.Contact_FirstName.value;
	theForm.Director_LastName0.value = theForm.Contact_LastName.value;
	theForm.Director_StreetAddress0.value = theForm.Contact_StreetAddress.value;
	theForm.Director_City0.value = theForm.Contact_City.value;
	letSelectValue(theForm.Director_State0, getSelectValue(theForm.Contact_State));
	theForm.Director_ZIP0.value = theForm.Contact_ZIP.value;

return false;
}

function ValidateForm(theForm)
{

	if(checkRequiredSelect(theForm.State,"Please select a state.",true)){return false;}
	if(checkRequiredTextField(theForm.CompanyNameFirstchoice,"Please enter your first choice for the name.")){return false;}
	//if(checkRequiredTextField(theForm.CompanyNameSecchoice,"Please enter your second choice for the name.")){return false;}

	if(checkRequiredTextField(theForm.Contact_FirstName,"Please enter the contact first name.")){return false;}
	if(checkRequiredTextField(theForm.Contact_LastName,"Please enter the contact last name.")){return false;}
	if(checkRequiredTextField(theForm.Contact_StreetAddress,"Please enter the contact street address.")){return false;}
	if(checkForPOBox(theForm.Contact_StreetAddress)){return false;}
	if(checkRequiredTextField(theForm.Contact_City,"Please enter the contact city.")){return false;}
	if(checkRequiredTextField(theForm.Contact_County,"Please enter the contact County.")){return false;}
	if(checkRequiredSelect(theForm.Contact_State,"Please select a state.",false)){return false;}
	if(checkRequiredTextField(theForm.Contact_ZIP,"Please enter the contact ZIP code.")){return false;}
	if(checkRequiredTextField(theForm.Contact_Phone,"Please enter the contact phone number.")){return false;}
	if(checkForCountry(theForm.Contact_County)){return false;}
	if(theForm.Contact_Email.value == "")
	{
		alert("Please enter your email address.  This is necessary to utilize our online order status.  If for any reason, you do not have an email address available, you can also print out this form and fax your order to 1-631-224-7979");
		theForm.Contact_Email.focus();
		return false;
	}


	if(checkRequiredTextField(theForm.BusinessDescription,"Please enter the Type of Business.")){return false;}

	if (theForm.State.options[theForm.State.selectedIndex].value == "DE" && theForm.Agent[1].checked == true)
	{
		alert("If you are incorporating in the state of Delaware, you must choose Incorporatetime.com as your registered agent.  If you wish to act as your own registered agent, you may incorporate in the state that you reside in.");
		theForm.Agent[0].focus();
		return false;
	}


	//if (!isNumeric(theForm.SharesIssued,false,"Please enter a number for shares issued.")) {return(false);}
	//if (!isNumeric(theForm.ParValue,false,"Please enter a number for par value.")) {return(false);}

	if (!Validate1stMD(theForm)){ return false;}

	if (theForm.Agent[1].checked && false)		// && false
	{
		if (checkRequiredTextField(theForm.Agent_FirstName,"Please enter an Agent first name.")) {return(false);}
		if (checkRequiredTextField(theForm.Agent_LastName,"Please enter an Agent last name.")) {return(false);}
		if (checkRequiredTextField(theForm.Agent_Phone,"Please enter an Agent phone number.")) {return(false);}
		//if (checkRequiredTextField(theForm.Agent_Email,"Please enter an Agent email address.")) {return(false);}
	}

	var pbytPaymentMethod = getRadioValue(theForm.Payment);
	if (!(pbytPaymentMethod=="Call" || pbytPaymentMethod=="check"))		// || true
	{
		if(checkRequiredTextField(theForm.CardholderName,"Please enter your cardholder name or select a different payment method under Billing Information.")){return false;}
		if(checkRequiredTextField(theForm.CardNumber,"Please enter your credit card number or select a different payment method under Billing Information.")){return false;}
		if(checkRequiredSelect(theForm.Expdate_month,"Please enter your credit card expiration month or select a different payment method under Billing Information.",false)){return false;}
		if(checkRequiredSelect(theForm.Expdate_year,"Please enter your credit card expiration year or select a different payment method under Billing Information.",false)){return false;}
	}
   
	if  (!CheckCVV()){theForm.CVV.focus();	return false;}

	return true;

}

function CheckCVV()
{
		if (frmInc.Payment3.checked){
			if (frmInc.CVV.value.length == 4){
				return true;
			}
			else{
				alert('For American Express Cards: Please enter your CID number. The CID number is the 4-digit, offset-printed number located above your account number on the face of your card.');		
				return false;
			}
		}
		else{
			if (frmInc.CVV.value.length == 3){
				return true;
			}
			else{
				alert('Please enter your Credit Card Code/CID number.  The CID number is the 3-digit value printed on the signature panel on the back of Visa, MasterCard and Discover Cards immediately following the credit card account number.');		
				return false;
			}
		}
}




function checkState(theSelect)
{

//return true;

	var pstrState = theSelect.options[theSelect.selectedIndex].value;
	if (pstrState == "NCa")
	{
		//window.parent.location = "https://www.incorporatetime.com/north_carolina_llc.htm";
	}else{
		return true;
	}
}
