function Compute_cost(Mileage)
{
var dist = Mileage.distance.value ;
Mileage.cost.value = 7 ;
var cst = 0;
if  (dist >0) 
    {
     cst = "" + Math.round(((2.50 * dist) + 2.50) *100)/100;
     cst = "" + Math.round(( (.38*Math.floor(5*dist))+ 2.50) *100)/100;
     if(cst.lastIndexOf('.') < 0)
     {
       cst = cst + '.00';
     }
     else if (cst.length - cst.lastIndexOf('.') == 2)
     {
       cst = cst + '0';
     }
    } 
else
   {
    cst  = '2.50' ;
   }
  Mileage.cost.value = cst;
}

