$(document).ready(function() {	
	
	
	
	$(".uitklap").click(function() {
		if(($(this).parent().find("p").is(':hidden')) == true){
			$(this).parent().find("p").show();
			$(this).find(".plus").hide();
			$(this).find(".min").show();
		} else {
			$(this).parent().find("p").hide();
			$(this).find(".plus").show();
			$(this).find(".min").hide();
		}
	});
	
	
	$(".vraag h3").click(function() {
		if(($(this).parent().find("p").is(':hidden')) == true){
			$(this).parent().find("p").show();
			$(this).parent().parent().find(".plus").hide();
			$(this).parent().parent().find(".min").show();
		} else {
			$(this).parent().find("p").hide();
			$(this).parent().parent().find(".plus").show();
			$(this).parent().parent().find(".min").hide();
		}
	});

	$("#formreactie").each( function(){

		$(this).validate({
			rules: {
				naam: {
					required: true,
					minlength: 3
				},
				email: {
					required: true,
					email: true
				},
				emailcode: {
					required: false,
					minlength: 5,
					maxlength: 10,
					number: true
				},
				beschrijving: {
					required: true,
					minlength: 10
				}
			},
			messages: {
				naam:  {
					required: "Vul je naam in.",
					minlength: "Deze naam is te kort."
				},
				email:  {
					required: "Vul je e-mailadres in.",
					email: "Dit e-mailadres is onjuist."
				},
				emailcode:  {
					required: "",
					minlength: "De referentiecode bestaat uit 5 getallen.",
					maxlength: "De referentiecode bestaat uit 5 getallen.",
					number: "De referentiecode bestaat uit 5 getallen."
				},
				beschrijving: {
					required: "Vul je bericht in.",
					minlength: "Dit bericht is te kort."
				}
			},
			errorPlacement: function(error, element) {
				element.parent().next().next().html(error);
			}
		});
	});

				
});
