// JavaScript Document<script type="text/javascript">

  function calc3(){
  var aantal = document.stickers.a_type3.value;
  var totaal = (aantal * 5.00);
  res1 = Math.round(totaal * Math.pow(10, 2));
  res = res1 / Math.pow(10, 2);
  document.stickers.totprijs3.value = add_nullen(res, 2);
  calcSubtotaal();
 }

 function calc5(){
  var aantal = document.stickers.a_type5.value;
  var totaal = (aantal * 2.50);
  res1 = Math.round(totaal * Math.pow(10, 2));
  res = res1 / Math.pow(10, 2);
  document.stickers.totprijs5.value = add_nullen(res, 2);
  calcSubtotaal();
 }
 function calcSubtotaal(){
 	
	var aantal = document.stickers.a_type3.value;
  	var totaal = (aantal * 5.00);
  	res = Math.round(totaal * Math.pow(10, 2));
  	res3 = res / Math.pow(10, 2);
		
	var aantal = document.stickers.a_type5.value;
  	var totaal = (aantal * 2.50);
  	res = Math.round(totaal * Math.pow(10, 2));
  	res5 = res / Math.pow(10, 2);
  
	value = eval(res3+res5);
	document.stickers.subtotaal.value = add_nullen(value, 2);
	calcTotaal();
 }
 function calcTotaal(){
 	var subtotaal = document.stickers.subtotaal.value;
  	res = Math.round(subtotaal * Math.pow(10, 2));
  	res1 = res / Math.pow(10, 2);
	value = eval(res1+2.00);
	document.stickers.totaal.value = add_nullen(value, 2);
 } 
function add_nullen(value, decimalen)
{
    var value_string = value.toString()
    var decimal_location = value_string.indexOf(".")

    if (decimal_location == -1) {
          decimal_part_length = 0
          value_string += decimalen > 0 ? "." : ""
    }
    else {

        decimal_part_length = value_string.length - decimal_location - 1
    }
    
    var pad_total = decimalen - decimal_part_length
    
    if (pad_total > 0) {
        
        // Pad the string with 0s
        for (var counter = 1; counter <= pad_total; counter++) 
            value_string += "0"
        }
    return value_string
}

function stopCalc(){
  clearInterval(interval);
}
