function calculeer(product){

	if (product == "aantal_compleet"){
		var x = (document.getElementById("aantal_compleet").value * 35);
		var x = x.toFixed(2);
		document.getElementById("totaal_compleet").value = x;
		document.getElementById("totaal_compleet_hid").value = x;  
	}

	if (product == "aantal_onderhoudsset"){
		var x = (document.getElementById("aantal_onderhoudsset").value * 19.95);
		var x = x.toFixed(2);	
		document.getElementById("totaal_onderhoudsset").value = x ;
		document.getElementById("totaal_onderhoudsset_hid").value = x;  
	}

	if (product == "aantal_pehabin"){
		var x = (document.getElementById("aantal_pehabin").value * 19.95);
		var x = x.toFixed(2);		
		document.getElementById("totaal_pehabin").value = x;
		document.getElementById("totaal_pehabin_hid").value = x;  
	}

	var y = (document.getElementById("totaal_pehabin_hid").value/1) + (document.getElementById("totaal_onderhoudsset_hid").value/1) + (document.getElementById("totaal_compleet_hid").value/1);
	var y = y.toFixed(2); 
	document.getElementById("eindtotaal").value = y;
	document.getElementById("eindtotaal_hid").value = (document.getElementById("totaal_pehabin_hid").value/1) + (document.getElementById("totaal_onderhoudsset_hid").value/1) + (document.getElementById("totaal_compleet_hid").value/1);     

}

function IsNumeric(veld) {
   if (veld == "aantal_compleet"){
     var sText = document.getElementById("aantal_compleet").value;
	}
   if (veld == "aantal_onderhoudsset"){
     var sText = document.getElementById("aantal_onderhoudsset").value;
	}
   if (veld == "aantal_pehabin"){
     var sText = document.getElementById("aantal_pehabin").value;
	}	 
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

   for (i = 0; i < sText.length && IsNumber == true; i++) { 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) {
           IsNumber = false;						 
		}
	}

	if(IsNumber){	
    	calculeer(veld);
	} else {
		if (veld == "aantal_compleet"){
			alert("Vul een getal in.");
			document.getElementById("naam").focus();
			document.getElementById("aantal_compleet").focus();					
			return false;
		}

       if (veld == "aantal_onderhoudsset"){
          	alert("Vul een getal in.");
			document.getElementById("naam").focus();
			document.getElementById("aantal_onderhoudsset").focus();					
		   	return false;
    	 }

       if (veld == "aantal_pehabin"){
          	alert("Vul een getal in.");
			document.getElementById("naam").focus();
			document.getElementById("aantal_pehabin").focus();					
		    return false;
    	 }			 			 
	 }
}
