function calculate() {      distance = new Number(document.FrontPage_Form1.distance.value);   if (isNaN(distance)) {  alert ("Please enter the estimated distance of your trip in kilometers");}  tarrif = new Number(document.FrontPage_Form1.tarrifddb.value);  if (tarrif == 1) {  var cost = 1.60 * distance + 3.20;}else if (tarrif == 2)  {  var cost = 2.40 * distance +3.20;}else {  var cost = "error";  alert ("Please Enter either 1 or 2 for Tarrif");}     if (!isNaN(cost) &&         (cost != Number.POSITIVE_INFINITY) &&        (cost != Number.NEGATIVE_INFINITY)) {      document.FrontPage_Form1.cost.value = "$" + round(cost);    }    else {    document.FrontPage_Form1.cost.value = "error";    } }  function round(x)  { return Math.round(x*100)/100;}