$(document).ready(function(){
	
		
	var pre = "info";
	var end = "benjamin-concepts.nl";
	$("a.email").attr({href: "mailto:"+pre+"@"+end}).html(pre+"@"+end);
	
	$("a.back").click(function(){
		history.back();
		return false;
	});
	
	$("form .aanhef label").each(function(){
		
		if ( $(this).attr("for")=="aanhef" ) {
			$(this).css({visibility:"hidden"});
		} else if ( $(this).attr("for")=="radio_dhr" || $(this).attr("for")=="radio_mevr" ) {
			$(this).addClass("small");
		}
	
	});
	
	$("#content ul li ul a").click(function(){ window.location = $(this).attr("href"); });
	$("#content ul li").toggle(
		function() {
			$("ul", this).slideDown();
		},
		function() {
			$("ul", this).slideUp();
		}
	);
	
	$("form").submit(function() {
		var error = 0;
		$(".verplicht input").each(function(){
			if ( $(this).val()=="" ) { 
				error++;
			}
		});
				
		if (error>0) {
			$(this).append("<p>U heeft niet alle verplichte velden ingevuld!</p>");
			$("form p:last").fadeTo(2000,1).fadeOut(500);
			return false;
		} else {
			$(this).fadeOut(500);
			return true;
		}
			
	});

});
