function calc()
   {
//lettura dati
  var c = parseFloat (document.form1.capitale.value);
  var r = parseFloat (document.form1.tasso.value);
  var t = parseFloat (document.form1.tempo.value);
  var h = parseInt (document.form1.mod.value);
  var j = parseInt (document.form1.met.value);
    if (h==1) b=1
  else if (h==2) b=12
  else if (h==3) b=365
  m= Math.round((c*(1+((r/(100*b))*t)))*100000)/100000

  mc= Math.round((c*Math.pow((1+((r/(100*b)))),t))*100000)/100000
  if (j==1) document.form1.montante.value= m;
  else if (j==2) document.form1.montante.value= mc;
  if (j==1) document.form1.interesse.value= Math.round((m-c)*100000)/100000;
  else if (j==2) document.form1.interesse.value= Math.round((mc-c)*100000)/100000;
}