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.pagestotal.value = dp((document.calcform.ratetotal.value)*(document.calcform.pagesquantity.value) * (document.calcform.designlevel.value))
document.calcform.imagestotal.value = dp((document.calcform.imagesprice.value)*(document.calcform.imagesquantity.value))
document.calcform.total4.value = dp((document.calcform.price4.value)*(document.calcform.pagesquantity.value)*(document.calcform.ratetotal.value))
document.calcform.carttotal.value = dp((document.calcform.cartprice.value)*(document.calcform.cart.value))
document.calcform.calendartotal.value = dp((document.calcform.calendarprice.value)*(document.calcform.calendar.value))
document.calcform.total5.value = dp((document.calcform.price5.value)*(document.calcform.quantity5.value))
document.calcform.total6.value = dp((document.calcform.price6.value)*(document.calcform.quantity6.value))
document.calcform.total7.value = dp((document.calcform.price7.value)*(document.calcform.quantity7.value))


document.calcform.subtotal.value = dp (eval(document.calcform.pagestotal.value) + eval(document.calcform.imagestotal.value) + eval(document.calcform.total4.value) + eval(document.calcform.carttotal.value) + eval(document.calcform.calendartotal.value) + eval(document.calcform.total5.value) + eval(document.calcform.total6.value) + eval(document.calcform.total7.value))

document.calcform.tax.value = dp((document.calcform.subtotal.value)/50.0)
document.calcform.total.value = dp((document.calcform.subtotal.value))
document.calcform.totalsa.value = dp((document.calcform.subtotal.value)*1.8)
}