function formValidator(ContactForm)
{
    var name        = document.ContactForm.Name;
    var company     = document.ContactForm.Company;
    var areacode    = document.ContactForm.AreaCode;
    var phonenumber = document.ContactForm.PhoneNumber;
    var email       = document.ContactForm.Email;
    var comments    = document.ContactForm.Comments;
    
    if (name.value == "")
    {
        window.alert("Please enter your name.");
        name.focus();
        return false;
    }
 
   
    if (company.value == "")
    {
        window.alert("Please enter your company name.");
        company.focus();
        return false;
    }

    
    if (areacode.value == "")
    {
        window.alert("Please enter your area code.");
        areacode.focus();
        return false;
    }
	if (areacode.value.length != 3)
	{
	    window.alert("Please enter 3 digits for your area code");
    	areacode.focus();
	    return false;
	}
	var checkOK = "0123456789";
	var checkStr = areacode.value;
	var allValid = true;
	var validGroups = true;
	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 (!allValid)
	{
	    alert("Please enter only the digits 0 through 9 for your area code");
	    areacode.focus();
	    return false;
	}
 
    
    if (phonenumber.value == "")
    {
        window.alert("Please enter your phone number.");
        phonenumber.focus();
        return false;
    }
	if (phonenumber.value.length != 7)
	{
	    window.alert("Please enter 7 digits for your phone number");
    	phonenumber.focus();
	    return false;
	}
	var checkOK = "0123456789";
	var checkStr = phonenumber.value;
	var allValid = true;
	var validGroups = true;
	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 (!allValid)
	{
	    alert("Please enter only the digits 0 through 9 for your phone number");
	    phonenumber.focus();
	    return false;
	}

  
    if (email.value == "")
    {
        window.alert("Please enter your E-mail address.");
        email.focus();
        return false;
    }
    if (email.value.indexOf("@", 0) < 0)
    {
        window.alert("Please enter a valid E-mail address.");
        email.focus();
        return false;
    }
    if (email.value.indexOf(".", 0) < 0)
    {
        window.alert("Please enter a valid E-mail address.");
        email.focus();
        return false;
    }
	
    return true;
}
