<!--

function isEmail(elm) {
	if (elm.value.indexOf("@") != "-1" &&
		elm.value.indexOf(".") != "-1" &&
		elm.value != "")
	return true;
	else return false;
}

function isPhone(elm) {
var elmstr = elm.value + "";
	if (elmstr.length != 12) return false;
	for (var i = 0; i < elmstr.length; i++) {
		if ((i < 3 && i > -1) ||
			(i > 3 && i < 7) ||
			(i > 7 && i < 12)) {
			if (elmstr.charAt(i) < "0" ||
				elmstr.charAt(i) > "9") return false;
		}
		else if (elmstr.charAt(i) != "-") return false;
	}
	return true;
}

function isFax(elm) {
var elmstr = elm.value + "";
	if (elmstr.length != 12) return false;
	for (var i = 0; i < elmstr.length; i++) {
		if ((i < 3 && i > -1) ||
			(i > 3 && i < 7) ||
			(i > 7 && i < 12)) {
			if (elmstr.charAt(i) < "0" ||
				elmstr.charAt(i) > "9") return false;
		}
		else if (elmstr.charAt(i) != "-") return false;
	}
	return true;
}

function HowChecked(theForm) {
  for (i=0; i<theForm.How.length; i++) {
    if (theForm.How[i].checked) {
      return true;
    }
  }

}

function listonsiteChecked(theForm) {
  for (i=0; i<theForm.listonsite.length; i++) {
    if (theForm.listonsite[i].checked) {
      return true;
    }
  }

}


function validateForm(theForm){

	if (theForm.member.selectedIndex == 0)
	{
		alert("Please make a selection for the \"Member\" field.");
		theForm.member.focus();
		return (false);
	}
	
	if (theForm.fname.value == "")
	{
		alert("Please enter a value for the \"First Name\" field.");
		theForm.fname.focus();
		return (false);
	}
	
	if (theForm.lname.value == "")
	{
		alert("Please enter a value for the \"Last Name\" field.");
		theForm.lname.focus();
		return (false);
	}
	
	if (theForm.title.value == "")
	{
		alert("Please enter a value for the \"Title\" field.");
		theForm.title.focus();
		return (false);
	}
	
	if (theForm.affiliation.value == "")
	{
		alert("Please enter a value for the \"Affiliation\" field.");
		theForm.affiliation.focus();
		return (false);
	}
	
	if (theForm.addr1.value == "")
	{
		alert("Please enter a value for the \"Address1\" field.");
		theForm.addr1.focus();
		return (false);
	}	
	
	if (theForm.city.value == "")
	{
		alert("Please enter a value for the \"City\" field.");
		theForm.city.focus();
		return (false);
	}	
	
	if (theForm.zip.value == "")
	{
		alert("Please enter a value for the \"Zip\" field.");
		theForm.zip.focus();
		return (false);
	}	

	if (theForm.Country_ID.selectedIndex != 0)
	{
		if (theForm.Country_ID.value == 26){
		if (theForm.StateID.value == ""){
		alert("Please make a selection for the \"State\" field.");
		theForm.StateID.focus();
		return (false);
		}
		}
	}

	if (theForm.Country_ID.selectedIndex == 0)
	{
		if (theForm.StateID.value == ""){
		alert("Please make a selection for the \"State\" field.");
		theForm.StateID.focus();
		return (false);
		}
	}
	
	if (theForm.email.value == "")
	{
		alert("Please enter a value for the \"Email\" field.");
		theForm.email.focus();
		return (false);
	}
	
	if (isEmail(theForm.email) == false)
	{
		alert("You did not enter a valid email address.");
		theForm.email.focus();
		return (false);
	}

	if (theForm.phone.value.length > 25)
	{
		alert("Please enter at most 25 characters in the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	}
	
	if (theForm.fax.value.length > 25)
	{
		alert("Please enter at most 25 characters in the \"Fax\" field.");
		theForm.Fax.focus();
		return (false);
	}	
	
	if (!HowChecked(theForm)) 
	{
		alert("\"How\" did you hear about our site.");
		return (false);
	}
	 
	if (!listonsiteChecked(theForm)) 
	{
		alert("Would you like your \"listing\" available on our web site?");
		return (false);
	} 

return (true);
}
//-->