module_prijs = 0;
extra_prijs = 0;
	
$(function() {

	function updateTotaal()
	{
		var prijs = 0;
		prijs = 750 + parseInt(module_prijs) + parseInt(extra_prijs);
		prijs_btw = prijs * 1.19;
		
		$("#prijs_totaal").html("&euro; " + prijs + ",-");
		$("#prijs_incbtw").html("Bedrag inclusief 19% btw: &euro; " + prijs_btw.toFixed(2) + " ");
	}
	
	$("input[type=checkbox]").click(function(){ 
			var query_string = ''; 
				
			$("input[type=checkbox]").each( 
			function() 
			{ 
				if(this.checked)
				{
					query_string += "&" + this.name + "=" + this.value; 
				}
			}); 
	
			$.ajax( 
			{ 
				type: "POST", 
				url: "/wp-content/themes/bitalic/process_ajax.php", 
				data: "part=modules" + query_string, 
				success: 
					function(t) 
					{ 
						$("#prijs_modules").html("&euro; " + t + ",-");
						module_prijs = t;
						updateTotaal();
					}, 
				error: 
					function() 
					{ 
					  alert("Helaas is het op dit moment niet mogelijk uw verzoek af te handelen. Probeer het later nog eens."); 
					} 
			}); 
	}); 
	$("select").change(function(){ 
		var query_string = ''; 
			
		$("select").each( 
		function() 
		{ 
				query_string += "&" + this.name + "=" + this.value; 
		}); 

		$.ajax( 
		{ 
			type: "POST", 
			url: "/wp-content/themes/bitalic/process_ajax.php", 
			data: "part=extra" + query_string, 
			success: 
				function(t) 
				{ 
					$("#prijs_extra").html("&euro; " + t + ",-");
					extra_prijs = t;
					updateTotaal();
				}, 
			error: 
				function() 
				{ 
				  alert("Helaas is het op dit moment niet mogelijk uw verzoek af te handelen. Probeer het later nog eens."); 
				} 
		}); 
}); 

});


