<!--
function dp(price) 
{
   string = "" + price;
   number = string.length - string.indexOf('.');
   if (string.indexOf('.') == -1)
      return string + '.00';
   if (number == 1)
      return string + '00';
   if (number == 2)
      return string + '0';
   if (number > 3)
      return string.substring(0,string.length-number+3);
return string;
}

function calculate()
{
document.calcform.totaltrasporto.value = dp((document.calcform.pricetrasporto.value))
document.calcform.totalpagamento.value = dp((document.calcform.pricepagamento.value))

document.calcform.totalAF700.value = dp((document.calcform.priceAF700.value)*(document.calcform.quantityAF700.value))
document.calcform.totalAF202.value = dp((document.calcform.priceAF202.value)*(document.calcform.quantityAF202.value))
document.calcform.totalAF200.value = dp((document.calcform.priceAF200.value)*(document.calcform.quantityAF200.value))
document.calcform.totalKT1000.value = dp((document.calcform.priceKT1000.value)*(document.calcform.quantityKT1000.value))
document.calcform.totalKT1200.value = dp((document.calcform.priceKT1200.value)*(document.calcform.quantityKT1200.value))
document.calcform.totalAX400.value = dp((document.calcform.priceAX400.value)*(document.calcform.quantityAX400.value))
document.calcform.totalAX252.value = dp((document.calcform.priceAX252.value)*(document.calcform.quantityAX252.value))
document.calcform.totalAX250.value = dp((document.calcform.priceAX250.value)*(document.calcform.quantityAX250.value))
document.calcform.totalAX100.value = dp((document.calcform.priceAX100.value)*(document.calcform.quantityAX100.value))
document.calcform.totalES800.value = dp((document.calcform.priceES800.value)*(document.calcform.quantityES800.value))
document.calcform.totalES300.value = dp((document.calcform.priceES300.value)*(document.calcform.quantityES300.value))
document.calcform.totalES500.value = dp((document.calcform.priceES500.value)*(document.calcform.quantityES500.value))
document.calcform.totalL5S.value = dp((document.calcform.priceL5S.value)*(document.calcform.quantityL5S.value))
document.calcform.totalJF350.value = dp((document.calcform.priceJF350.value)*(document.calcform.quantityJF350.value))
document.calcform.totalAmbient3000.value = dp((document.calcform.priceAmbient3000.value)*(document.calcform.quantityAmbient3000.value))
document.calcform.totalAmbient5000.value = dp((document.calcform.priceAmbient5000.value)*(document.calcform.quantityAmbient5000.value))
document.calcform.totalEC100.value = dp((document.calcform.priceEC100.value)*(document.calcform.quantityEC100.value))
document.calcform.totalPL4J.value = dp((document.calcform.pricePL4J.value)*(document.calcform.quantityPL4J.value))
document.calcform.totalPL2.value = dp((document.calcform.pricePL2.value)*(document.calcform.quantityPL2.value))
document.calcform.totalPL3T.value = dp((document.calcform.pricePL3T.value)*(document.calcform.quantityPL3T.value))
document.calcform.totalPR10.value = dp((document.calcform.pricePR10.value)*(document.calcform.quantityPR10.value))
document.calcform.totalPR10F.value = dp((document.calcform.pricePR10F.value)*(document.calcform.quantityPR10F.value))

document.calcform.subtotal1.value = dp(eval(document.calcform.totalAF700.value) + eval(document.calcform.totalAF202.value) + eval(document.calcform.totalAF200.value) + eval(document.calcform.totalKT1000.value) + eval(document.calcform.totalKT1200.value) + eval(document.calcform.totalAX400.value) + eval(document.calcform.totalAX252.value) + eval(document.calcform.totalAX250.value) + eval(document.calcform.totalAX100.value) + eval(document.calcform.totalES800.value) + eval(document.calcform.totalES300.value) + eval(document.calcform.totalES500.value) + eval(document.calcform.totalL5S.value) + eval(document.calcform.totalJF350.value) + eval(document.calcform.totalAmbient3000.value) + eval(document.calcform.totalAmbient5000.value) + eval(document.calcform.totalEC100.value) + eval(document.calcform.totalPL4J.value) + eval(document.calcform.totalPL2.value) + eval(document.calcform.totalPL3T.value) + eval(document.calcform.totalPR10.value) + eval(document.calcform.totalPR10F.value))



document.calcform.subtotal.value = dp(eval(document.calcform.totaltrasporto.value) + eval(document.calcform.subtotal1.value) + eval(document.calcform.totalpagamento.value))



document.calcform.tax.value = dp((document.calcform.subtotal.value)*0.210)
document.calcform.total.value = dp(eval(document.calcform.subtotal.value) + eval(document.calcform.tax.value))
}

//-->
<!--
function numeralsOnly(evt) {
evt = (evt) ? evt : event;
var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode 
: ((evt.which) ? evt.which : 0));
if (charCode> 31 && (charCode < 48 || charCode> 57)) {
alert("Solo numeri! Only numbers!");
return false;
}
return true;
}
--> 

