$(document).ready(function() {	
	$('#bedrijfstd').hide();

	$('#klantselect').change(function() {	
		menuval = $('#klantselect').val();
		if (menuval == "huidig")
		{			
			$.ajax({
				type: 'POST',
				url: 'includes/registratie/registratie_form2.inc.php',
				success: function(data) {				
					$('#reg_gegevens_content').html(data);
					$('#errorspan').slideUp();
				}
			});
		}
		if (menuval == "ander")
		{	
			$.ajax({
				type: 'POST',
				url: 'includes/registratie/registratie_form3.inc.php',
				success: function(data) {				
					$('#reg_gegevens_content').html(data);
					$('#errorspan').slideUp();
				}
			});
		}
		if (menuval == "nieuw")
		{	
			$.ajax({
				type: 'POST',
				url: 'includes/registratie/registratie_form.inc.php',
				success: function(data) {				
					$('#reg_gegevens_content').html(data);
					$('#errorspan').slideDown();
				}
			});
		}		
	 });

	 $('#klantnee').click(function() {
		$.ajax({
				type: 'POST',
				url: 'includes/registratie/registratie_form.inc.php',
				success: function(data) {
				$('#reg_gegevens_content').slideUp('slow', function() {
					$('#reg_gegevens_content').html(data);
					$('#reg_gegevens_content').slideDown();
				});
			}
		});
	 });
	 $('#klantja').click(function() {
		$.ajax({
				type: 'POST',
				url: 'includes/registratie/registratie_form3.inc.php',
				success: function(data) {
				$('#errorspan').slideUp();
				$('#reg_gegevens_content').slideUp('slow', function() {
					$('#reg_gegevens_content').html(data);	
					$('#reg_gegevens_content').slideDown();
				});
			}
		});
	 });	

	 $('#bedrijf_particulier1').click(function() {	
		$('#bedrijfstd').slideUp("slow");
		$("#reg_vestiging").html("Woonplaats");
		$("#bedrijf_consument").val("consument");
	 });
	 
	 $('#bedrijf_particulier2').click(function() {	
		$('#bedrijfstd').slideDown("slow");			
		$("#reg_vestiging").html("Vestigingsplaats");
		$("#bedrijf_consument").val("bedrijf");
	 });
	 
	 $('.regbutton').click(function() {
		data_id = this.id;
		data_id = data_id.substr(7)	
		data_id = "#park_" + data_id;
		if ($(this).is(':checked'))
		{
			$(data_id).attr('disabled', true);
		}
		else
		{				
			$(data_id).removeAttr('disabled');
		}
	});

	$('.parkbutton').click(function() {
		
		data_id = this.id;
		data_id = data_id.substr(5)	
		data_id = "#domein_" + data_id;
		if ($(this).is(':checked'))
		{
			$(data_id).attr('disabled', true);
		}
		else
		{				
			$(data_id).removeAttr('disabled');
		}
		
	});
});
