
  <!-- Hide Script
          
  function VerifyAndSubmitForm() {	
    errorText = "";
    with (document.frmOrder)
    {
      if (Quantity.value == "")
      {
        errorText = errorText + "\n   - Number of copies you are ordering";
        Quantity.focus();
      }
      else if (isNaN(parseInt(Quantity.value)))
      {
        errorText = errorText + "\n   - Number of copies must be a number";
        Quantity.focus();
      }

      if (FirstName.value == "")
      {
        errorText = errorText + "\n   - First Name";
        FirstName.focus();
      }
      if (LastName.value == "")
      {
        errorText = errorText + "\n   - Last Name";
        LastName.focus();
      }
      if (ADDRESS.value == "")
      {
        errorText = errorText + "\n   - Street Address";
        ADDRESS.focus();
      }
      if (CITY.value == "")
      {
        errorText = errorText + "\n   - City";
        CITY.focus();
      }	
      if (COUNTRY.value == "")
      {
        errorText = errorText + "\n   - Country";
        COUNTRY.focus();
      }
      if (EMail.value == "")
      {
        errorText = errorText + "\n   - E-mail Address";
        EMail.focus();
      }
      if (NYResident[0].checked) {	
        if (NYCounty.value == "")
        {
          errorText = errorText + "\n   - the NY County where you reside";
          NYCounty.focus();
        }
      }

      if (errorText.length == 0)
      {
        originalQuantity = Quantity.value;
        if      ((Quantity.value >= 713) && (Quantity.value < 1000)) Quantity.value = 1000;
        else if ((Quantity.value >= 392) && (Quantity.value < 500)) Quantity.value = 500;
        else if ((Quantity.value >= 82)  && (Quantity.value < 100)) Quantity.value = 100;
        else if ((Quantity.value >= 22)  && (Quantity.value < 25)) Quantity.value = 25;
        // Set the price 
        AMOUNT.value = getPrice(parseInt(Quantity.value));
        // Set the order description ("one copy" is the default)
        DESCRIPTION.value = "One copy of MailAlert";
        sDesc = " copies of MailAlert";
        if (document.frmOrder.Upgrade[0].checked) sDesc = " upgrade copies of MailAlert";
        if (Quantity.value > 1) DESCRIPTION.value = Quantity.value + sDesc;
        if (Quantity.value != originalQuantity)
          DESCRIPTION.value = DESCRIPTION.value + "<br><font color='CC0000'>* NOTE:  Your order has been adjusted because it is cheaper for you to buy the "+Quantity.value+"-user pack than to purchase "+originalQuantity+" licenses.</font>";
        // Compute sales tax
        if (NYResident[0].checked)
        {
          theTax = eval(AMOUNT.value * (parseFloat(NYCounty.value)/100));
          theTax = eval(Math.round(theTax*100)/100);
          TAX.value = theTax;
        }
        else TAX.value = 0;

        return true;
      }
      else
      {
        errorText = "You have not entered information in the following required field(s):\n" + errorText;
        alert(errorText);
        return false;
      }
    }
    return false;
  }


  function getPrice( numCopies)
  {
    thePrice = 0;

    if (document.frmOrder.Upgrade[1].checked) // i.e. Upgrade = No
    {
      if      (numCopies >= 1000) thePrice = eval(numCopies *  5);
      else if (numCopies >=  500) thePrice = eval(numCopies *  7);
      else if (numCopies >=  100) thePrice = eval(numCopies *  9);
      else if (numCopies >=   25) thePrice = eval(numCopies * 11);
      else if (numCopies >=    5) thePrice = eval(numCopies * 13);
      else if (numCopies >=    1) thePrice = eval(numCopies * 15);
    }
    else
    {
      if      (numCopies >= 1000) thePrice = eval(numCopies *  3.35);
      else if (numCopies >=  500) thePrice = eval(numCopies *  4.70);
      else if (numCopies >=  100) thePrice = eval(numCopies *  6.00);
      else if (numCopies >=   25) thePrice = eval(numCopies *  7.40);
      else if (numCopies >=    5) thePrice = eval(numCopies *  9.00);
      else if (numCopies >=    1) thePrice = eval(numCopies * 10.00);
    }
  
    return thePrice;
  }
  // End Script -->
  
