/* This script and many more are available free online at
The JavaScript Source!! http://www.javascriptsource.com
Created by: Jim Stiles | www.jdstiles.com */
function startCalc(){
  interval = setInterval("calc()",1);
}
function startCalc1(){
  
  intervaldd = setInterval("calcdd()",1);
}
function calc(){
  one = document.autoSumForm.total.value;
  two = document.autoSumForm.discount.value; 
  seven = document.autoSumForm.discount1.value;
  three = (one * 1) - (two * 1);
  nine = (three * 1) - (seven * 1);
  
  
  document.autoSumForm.amount_due.value = nine.toFixed(2);

  four = document.autoSumForm.tendered.value; 
  five=(four * 1) - (nine * 1);
  document.autoSumForm.change.value = five.toFixed(2);

  
}
function stopCalc(){
  clearInterval(interval);
 
}
function stopCalc1(){
  clearInterval(intervaldd);
}
function myFunction(){
	one = document.autoSumForm.total.value;
	document.autoSumForm.amount_due.value = one;
}

function calcdd(){
  onedd = document.autoSumForm1.discounthapper.value;
  twodd = document.autoSumForm1.pricehapper.value; 
  threedd = (twodd * 1) - (onedd * 1);
  document.autoSumForm1.totalhapper.value = threedd.toFixed(2);
  
}