<!--
function Validator(appform)
{
// check to see if the field is blank
if (appform.customer_name.value == "")
{
alert("You must enter your \"Name\".");
appform.customer_name.focus();
return (false);
}
if (appform.customer_title.value == "")
{
alert("You must enter your \"Title\".");
appform.customer_title.focus();
return (false);
}
if (appform.customer_company.value == "")
{
alert("You must enter your \"Company\".");
appform.customer_company.focus();
return (false);
}
if (appform.customer_address.value == "")
{
alert("You must enter an \"Address\".");
appform.customer_address.focus();
return (false);
}
if (appform.customer_city.value == "")
{
alert("You must enter an \"City\".");
appform.customer_city.focus();
return (false);
}
if (appform.customer_state.value == "")
{
alert("You must enter your 2 letter abreviation for your state.");
appform.customer_state.focus();
return (false);
}
if (appform.customer_zip.value == "")
{
alert("You must enter your \"Zip Code\".");
appform.customer_zip.focus();
return (false);
}

// only allow numbers to be entered
var checkOK = "0123456789";
var checkStr = appform.customer_zip.value;
var allValid = true;
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 numbers in the \"zip\" field.");
appform.customer_zip.focus();
appform.customer_zip.select();
return (false);
}

// check if email field is blank
if (appform.customer_email.value == "")
{
alert("Please enter a value for the \"email\" field.");
appform.customer_email.focus();
return (false);
}


// test if valid email address, must have @ and .
var checkEmail = "@.";
var checkStr = appform.customer_email.value;
var EmailValid = false;
var EmailAt = false;
var EmailPeriod = false;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkEmail.length;  j++)
{
if (ch == checkEmail.charAt(j) && ch == "@")
EmailAt = true;
if (ch == checkEmail.charAt(j) && ch == ".")
EmailPeriod = true;
	  if (EmailAt && EmailPeriod)
		break;
	  if (j == checkEmail.length)
		break;
	}
	// if both the @ and . were in the string
if (EmailAt && EmailPeriod)
{
		EmailValid = true
		break;
	}
}
if (!EmailValid)
{
alert("The \"email\" field must contain an \"@\" and a \".\".");
appform.customer_email.focus();
return (false);
}

if (appform.Phone.value == "")
{
alert("You must enter your phone number.");
appform.Phone.focus();
return (false);
}

if (appform.Fax.value == "")
{
alert("You must enter your fax number.");
appform.Fax.focus();
return (false);
}

if (appform.sponsoring_member.value == "")
{
alert("You must enter a \"Referring Boma Member\".");
appform.sponsoring_member.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (appform.membership_type.selectedIndex == 0)
{
alert("Please select a \"membership type\" from the selections.");
appform.membership_type.focus();
return (false);
}

if (appform.business_description.value == "")
{
alert("You must enter a \"Description of your business\".");
appform.business_description.focus();
return (false);
}


// check if the first drop down is selected, if so, invalid selection
if (appform.payment_method.selectedIndex == 0)
{
alert("Please select a \"payment method\" from the selections.");
appform.payment_method.focus();
return (false);
}

if (appform.payment_method.value != "3") {

if (appform.cardholder.value == "")
{
alert("You must enter your \"name\" as it appears on your credit card.");
appform.cardholder.focus();
return (false);
}
}
if (appform.payment_method.value != "3") {

if (appform.ccnumber.value == "")
{
alert("You must enter your \"credit card number\".");
appform.ccnumber.focus();
return (false);
}
// only allow numbers to be entered
var checkOK = "0123456789";
var checkStr = appform.ccnumber.value;
var allValid = true;
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 numbers in the \"credit card number\" field.");
appform.ccnumber.focus();
appform.ccnumber.select();
return (false);
}
// require that at least one character be entered
if (appform.ccnumber.value.length < 16)
{
alert("You must enter 16 characters in the \"Credit Card Number\" field.");
appform.ccnumber.focus();
return (false);
}
}

}
//-->
