function format(x){
   var x  = '' + x;
   var mod = x.length - 3;
   var y;
   y = x.substring(0,mod) + '.' + x.substring(mod,mod+3);
   return y;
}

function compute(){
   var a = new Array();
   var b = new Array();
   var c = new Array();
   var x = new Array();

   var res = '';

   a[0] = 0;
   a[1] = 15;
   a[2] = 18;
   a[3] = 20;
   a[4] = 22;
   a[5] = 24;
   a[6] = 26;
   a[7] = 29;
   a[8] = 35;
   a[9] = 40;
   a[10] = 45;

   b[0] = 0;
   b[1] = 0.90;
   b[2] = 0.95;
   b[3] = 1;
   b[4] = 1.10;

   c[0] = 0;
   c[1] = 1;
   c[2] = 0.3;
   c[3] = 1.2;

   x[1] = Math.floor(window.document.tf.f1.value);
   if (x[1] < 1 || x[1] > 24){
       x[1] = 0;
   }

   x[2] = Math.floor(window.document.tf.f2.value);
   if (x[2] < 1 || x[2] > 10){
       x[2] = 0;
   }
   x[3] = Math.floor(window.document.tf.f3.value);
   if (x[3] < 1 || x[3] > 4){
       x[3] = 0;
   }
   x[4] = Math.floor(window.document.tf.f4.value);
   if (x[4] < 1 || x[4] > 3){
       x[4] = 0;
   }
   var y = x[1]*a[x[2]]*b[x[3]]*c[x[4]]*30*0.46;
   y = Math.floor(y);


   if (y > 0){
      if (y > 999){
         y = format(y);
      }
      res = y;
   }
   window.document.tf.result.value = res;
}

