$(document).ready( function() {

	// autotab
	$('#birthdate-day').autotab({ target: 'birthdate-month', previous: 'name', maxlength: 2, format: 'numeric' });
	$('#birthdate-month').autotab({ target: 'birthdate-year', previous: 'birthdate-day', maxlength: 2, format: 'numeric' });
	$('#birthdate-year').autotab({ target: 'email', previous: 'birthdate-month', maxlength: 4, format: 'numeric' });
	
	// show or hide the company-section of the registration form
	if ($("#registrationtype-company").attr("checked") == true) {
		$("#company-details").show();
	} else {
		$("#company-details").hide();
	}

	$("#registrationtype-private").click( function() {
		if ($("#company-details").is(":visible")) {
			$("#company-details").slideUp("normal");
		}
	});

	$("#registrationtype-company").click( function() {
		if ($("#company-details").is(":hidden")) {
			$("#company-details").slideDown("normal");
		}
	});

});