function calculate(formName, form, width, length, thickness, unitIsInches)
{
     var calcResult;

     width = parseFloat(width);
     length = parseFloat(length);
     thickness = parseFloat(thickness);

     if (width <= 0 || width + "" == "NaN" || length <= 0 || length + "" == "NaN" || thickness <= 0 || thickness + "" == "NaN")
     {
         alert("Please enter a positive number in each of the " + "three input fields.");
         return false;
     }

     if (formName == "concrete")
     {
          if (unitIsInches)
               calcResult = width * length * (thickness / 12.0) / 27;
          else 
               calcResult = width * length * thickness / 27;
     }
     else
     {
          if (unitIsInches)
               calcResult = width * length * (thickness / 12.0) * 150 / 2000;
          else
               calcResult = width * length * thickness * 150 / 2000;
     }

     if (formName == "concrete")
          form.concreteResult.value = calcResult.toFixed(3);
     else
          form.asphaltResult.value = calcResult.toFixed(3);

    return true;
}