<!--
function FormatNumber(Number,Decimals,Separator)
{
 // **********************************************************
 // Placed in the public domain by Affordable Production Tools
 // March 21, 1998
 // Web site: http://www.aptools.com/
 //
 // November 24, 1998 -- Error which allowed a null value
 // to remain null fixed. Now forces value to 0.
 //
 // October 28, 2001 -- Modified to provide leading 0 for fractional number
 // less than 1.
 //
 // This function accepts a number to format and number
 // specifying the number of decimal places to format to. May
 // optionally use a separator other than '.' if specified.
 //
 // If no decimals are specified, the function defaults to
 // two decimal places. If no number is passed, the function
 // defaults to 0. Decimal separator defaults to '.' .
 //
 // If the number passed is too large to format as a decimal
 // number (e.g.: 1.23e+25), or if the conversion process
 // results in such a number, the original number is returned
 // unchanged.
 // **********************************************************
 Number += ""          // Force argument to string.
 Decimals += ""        // Force argument to string.
 Separator += ""       // Force argument to string.
 if((Separator == "") || (Separator.length > 1))
  Separator = "."
 if(Number.length == 0)
  Number = "0"
 var OriginalNumber = Number  // Save for number too large.
 var Sign = 1
 var Pad = ""
 var Count = 0
 // If no number passed, force number to 0.
 if(parseFloat(Number)){
  Number = parseFloat(Number)} else {
  Number = 0}
 // If no decimals passed, default decimals to 2.
 if((parseInt(Decimals,10)) || (parseInt(Decimals,10) == 0)){
  Decimals = parseInt(Decimals,10)} else {
  Decimals = 2}
 if(Number < 0)
 {
  Sign = -1         // Remember sign of Number.
  Number *= Sign    // Force absolute value of Number.
 }
 if(Decimals < 0)
  Decimals *= -1    // Force absolute value of Decimals.
 // Next, convert number to rounded integer and force to string value.
 // (Number contains 1 extra digit used to force rounding)
 Number = "" + Math.floor(Number * Math.pow(10,Decimals + 1) + 5)
 if((Number.substring(1,2) == '.')||((Number + '')=='NaN'))
  return(OriginalNumber) // Number too large to format as specified.
 // If length of Number is less than number of decimals requested +1,
 // pad with zeros to requested length.
 if(Number.length < Decimals +1) // Construct pad string.
 {
  for(Count = Number.length; Count <= Decimals; Count++)
   Pad += "0"
 }
 Number = Pad + Number // Pad number as needed.
 if(Decimals == 0){
  // Drop extra digit -- Decimal portion is formatted.
  Number = Number.substring(0, Number.length -1)} else {
  // Or, format number with decimal point and drop extra decimal digit.
 Number = Number.substring(0,Number.length - Decimals -1) +
          Separator +
          Number.substring(Number.length - Decimals -1,
          Number.length -1)}
 if((Number == "") || (parseFloat(Number) < 1))
  Number="0"+Number // Force leading 0 for |Number| less than 1.
 if(Sign == -1)
  Number = "-" + Number  // Set sign of number.
 return(Number)
}

function bereken(rekentype, waarde, i, optieId, keuzetype) {
	var aantalpersonen 	= document.stap_3.aantalpersonen.value;
	var aantaldagdelen	= document.stap_3.aantal_dagdelen.value;
	var totaal 			= Math.round(document.stap_3.reswiz_totaalprijs.value*Math.pow(10,2))/Math.pow(10,2);
	var valuta 			= String.fromCharCode(8364) + String.fromCharCode(160);

	if (keuzetype == 0) {
		var ind 			= eval('document.stap_3.optie_aantal_'+optieId+'.selectedIndex;');
		var optie_aantal 	= eval('document.stap_3.optie_aantal_'+optieId+'.options[ind].value;');
	}
	else {
		if (document.getElementById('optie_aantal_'+optieId).checked == true) {
			var optie_aantal 	= 1;
		}
		else{
			var optie_aantal 	= 0;
		}
	}
	
	var oude_aantal		= eval('document.stap_3.oude_aantal_'+optieId+'.value;');

	if (rekentype == 0) {
		totaal = (totaal + ((optie_aantal - oude_aantal) * waarde));
		optie_prijs = (optie_aantal * waarde)
	}
	if (rekentype == 1) {
		totaal = (totaal + ((optie_aantal - oude_aantal) * waarde));
		optie_prijs = (optie_aantal * waarde)
	}
	if (rekentype == 2) {
		totaal = (totaal + (((optie_aantal - oude_aantal) * waarde)) * aantaldagdelen);
		optie_prijs = (optie_aantal * waarde) * aantaldagdelen
	}
		
	if (optie_aantal > 0) {
		
		document.stap_3.optieId[i].value = optieId
		//document.getElementById("optie_" +i).style.display = "block";
	}
	else {
		document.stap_3.optieId[i].value = 0
		//document.getElementById("optie_" +i).style.display = "none";
	}

	totaal = Math.round(totaal*Math.pow(10,2))/Math.pow(10,2);
	
	eval('document.stap_3.oude_aantal_' + optieId + '.value = ' + optie_aantal + ';');
	eval('document.stap_3.optie_prijs_' + optieId + '.value = ' + optie_prijs + ';');

	var temp_a = ""+(optie_aantal * waarde);
	temp_a = Math.round(temp_a * 100 ) / 100;
	temp_a = FormatNumber(temp_a, '2', '.');
	document.getElementById("optiePrijs_"+optieId).firstChild.nodeValue = temp_a;
	
	//var temp_a = (optie_aantal * waarde);
	//temp_a = Math.round(temp_a * 100 ) / 100;
	//eval('document.getElementById("optiePrijs_'+optieId+'").firstChild.nodeValue =' + temp_a + ';');
	
	document.stap_3.reswiz_totaalprijs.value = FormatNumber(totaal, '2', '.');
	document.getElementById("totaal_optieprijs").firstChild.nodeValue = valuta + FormatNumber(totaal, '2', '.');
}


function bereken_addoptie(rekentype, waarde, i, optieId) {
	var aantalpersonen 	= document.add_optie.aantal_personen.value;
	var valuta 			= String.fromCharCode(8364) + String.fromCharCode(160);
	var ind 			= eval('document.add_optie.optie_aantal_'+optieId+'.selectedIndex;');
	var optie_aantal 	= eval('document.add_optie.optie_aantal_'+optieId+'.options[ind].value;');
	var oude_aantal		= eval('document.add_optie.oude_aantal_'+optieId+'.value;');


	if (optie_aantal > 0) {
		document.add_optie.optieId[i].value = optieId;
		//document.getElementById("optie_" +i).style.display = "block";
	}
	else {
		document.add_optie.optieId[i].value = 0;
		//document.getElementById("optie_" +i).style.display = "none";
	}

	eval('document.add_optie.oude_aantal_' + optieId + '.value = ' + optie_aantal + ';');

	
	var temp_a = (optie_aantal * waarde);
	temp_a = Math.round(temp_a * 100 ) / 100;
	
	eval('document.add_optie.optie_prijs_' + optieId + '.value = ' + temp_a + ';');
	eval('document.getElementById("optiePrijs_'+optieId+'").firstChild.nodeValue =' + temp_a + ';');
	
}




function bereken_gs(rekentype, waarde, i, optieId, keuzetype) {
	var totaal 			= Math.round(document.stap_3.reswiz_totaalprijs.value*Math.pow(10,2))/Math.pow(10,2);
	var valuta 			= String.fromCharCode(8364) + String.fromCharCode(160);

	if (keuzetype == 0) {
		var ind 			= eval('document.stap_3.optie_aantal_'+optieId+'.selectedIndex;');
		var optie_aantal 	= eval('document.stap_3.optie_aantal_'+optieId+'.options[ind].value;');
	}
	else {
		if (document.getElementById('optie_aantal_'+optieId).checked == true) {
			var optie_aantal 	= 1;
		}
		else{
			var optie_aantal 	= 0;
		}
	}
	
	var oude_aantal		= eval('document.stap_3.oude_aantal_'+optieId+'.value;');

	if (rekentype == 0) {
		totaal = (totaal + ((optie_aantal - oude_aantal) * waarde));
		optie_prijs = (optie_aantal * waarde)
	}
	if (rekentype == 1) {
		totaal = (totaal + ((optie_aantal - oude_aantal) * waarde));
		optie_prijs = (optie_aantal * waarde)
	}

		
	if (optie_aantal > 0) {
		document.stap_3.optieId[i].value = optieId
		//document.getElementById("optie_" +i).value = optieId
		//document.getElementById("optie_" +i).style.display = "block";
	}
	else {
		document.stap_3.optieId[i].value = 0
		//document.getElementById("optie_" +i).value
		//document.getElementById("optie_" +i).style.display = "none";
	}

	totaal = Math.round(totaal*Math.pow(10,2))/Math.pow(10,2);
	
	eval('document.stap_3.oude_aantal_' + optieId + '.value = ' + optie_aantal + ';');
	eval('document.stap_3.optie_prijs_' + optieId + '.value = ' + optie_prijs + ';');

	var temp_a = ""+(optie_aantal * waarde);
	temp_a = Math.round(temp_a * 100 ) / 100;
	temp_a = FormatNumber(temp_a, '2', '.');
	document.getElementById("optiePrijs_"+optieId).firstChild.nodeValue = temp_a;
	
	//var temp_a = (optie_aantal * waarde);
	//temp_a = Math.round(temp_a * 100 ) / 100;
	//eval('document.getElementById("optiePrijs_'+optieId+'").firstChild.nodeValue =' + temp_a + ';');
	
	document.stap_3.reswiz_totaalprijs.value = FormatNumber(totaal, '2', '.');
	document.getElementById("totaal_optieprijs").firstChild.nodeValue = FormatNumber(totaal, '2', '.');
}


// -->