function Validator(theForm)
{

  if (theForm.Quantity.value == "")
  {
    alert("Please enter the quantity for the Number of Email Contacts to Purchase.");
    theForm.Quantity.focus();
    return (false);
  }

  if (theForm.Quantity.value < 2)
  {
    alert("You must order at least a quantity of 2.");
    theForm.Quantity.focus();
    return (false);
  }

  if (theForm.Quantity.value.length < 1)
  {
    alert("Please enter at least 1 character in the \"Number of Email Contacts to Purchase\" field.");
    theForm.Quantity.focus();
    return (false);
  }

  if (theForm.Quantity.value.length > 4)
  {
    alert("Please enter at most 4 characters in the \"Number of Email Contacts to Purchase\" field.");
    theForm.Quantity.focus();
    return (false);
  }

  var checkOK = "0123456789-.";
  var checkStr = theForm.Quantity.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  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 += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Number of Email Contacts to Purchase\" field.");
    theForm.Quantity.focus();
    return (false);
  }

  if (decPoints > 1 || !validGroups)
  {
    alert("Please enter a valid number in the \"Quantity\" field.");
    theForm.Quantity.focus();
    return (false);
  }
  return (true);
}
