<!--

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 validateForm(theForm){

  if (theForm.CompanyName.value == "")
  {
    alert("Please enter a value for the \"Company Name\" field.");
    theForm.CompanyName.focus();
    return (false);
  }
  
    if (theForm.Address.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.Address.focus();
    return (false);
  }
  
    if (theForm.City.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.City.focus();
    return (false);
  }
  
  if (theForm.State.selectedIndex == 0)
  {
    alert("Please make a selection for the \"State\" field.");
    theForm.State.focus();
    return (false);
  }
  
   if (theForm.Zip.value == "")
  {
    alert("Please enter a value for the \"Zip\" field.");
    theForm.Zip.focus();
    return (false);
  }
  
   if (theForm.ContactName.value == "")
  {
    alert("Please enter a value for the \"Contact Name\" field.");
    theForm.ContactName.focus();
    return (false);
  }
  
  if (theForm.Phone.value == "")
  {
		alert("Please enter a value for the \"Phone\" field.");
		theForm.Phone.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 (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.Contact.value == "")
   {
		alert("How would you like us to \"Contact\" you?");
		theForm.Contact.focus();
		return (false);
 	}    
  
  return (true);
}
//-->