// function to calculate the sub-total cost of hosting services
function Total() {
   var tot = 0;
   tot += (20.00 * document.order.qty1.value * document.order.mon1.value);
   tot += (60.00 * document.order.qty2.value * document.order.mon2.value);
   
   document.order.totalcost.value = addCommas(tot.toFixed(2));
   Totil();
  
}

// function to calculate the sub-total of devices
function Tutal() {
   var tot = 0;
   tot += (1499.00 * document.order.quty1.value );
   tot += (1899.00 * document.order.quty2.value );
   tot += (1899.00 * document.order.quty3.value );
   tot += (1599.00 * document.order.quty4.value );
   tot += (1639.00 * document.order.quty5.value );
   tot += (2099.00 * document.order.quty6.value );
   
   document.order.totalcust.value = addCommas(tot.toFixed(2));
   Totil();
}


// function to calculate the grand total

function Totil() {
   var grandtot = 0;
   grandtot += (20.00 * document.order.qty1.value * document.order.mon1.value);
   grandtot += (60.00 * document.order.qty2.value * document.order.mon2.value);
   grandtot += (1499.00 * document.order.quty1.value );
   grandtot += (1899.00 * document.order.quty2.value );
   grandtot += (1899.00 * document.order.quty3.value );
   grandtot += (1599.00 * document.order.quty4.value );
   grandtot += (1639.00 * document.order.quty5.value );
   grandtot += (2099.00 * document.order.quty6.value );

   document.order.grandtotal.value = addCommas(grandtot.toFixed(2));
}

// function to calculate grand total for online payment form

function startCalc(){
  interval = setInterval("calc()",1);
  }
function calc(){
  a = document.onpay.amount1.value;
  b = document.onpay.amount2.value;
  c = document.onpay.amount3.value;
  d = document.onpay.amount4.value;
  e = document.onpay.amount5.value;
  f = document.onpay.amount6.value;
  total =  (a * 1) + (b * 1) + (c * 1) + (d * 1) + (e * 1) + (f * 1);
 
  document.onpay.grandtotal.value = addCommas(total.toFixed(2));}
  
function stopCalc(){
  clearInterval(interval);
}


