$(function(){
	$(".toggleListElement").click(function(){
		$(this).css({cursor: "pointer"});
		$(this).removeAttr("href");
		/*if($(this).parent().find("ul.groep").is(":hidden")){
			$(this).parent().find("ul.groep").css({display: "block"})
			//$(this).parent().find("ul.groep").find("ul.groep").css({display: "none"})
			//alert("");
		} else {
			$(this).parent().find("ul.groep").css({display: "none"})
		} */
		if ($(this).next().is(":hidden")) {
			$(this).parent().parent().children("li.liDepartment").find("ul.groep").css({display: "none"})
			$(this).next().css({display: "block"});
		} else {
			$(this).next().css({display: "none"})
			$(this).next().find("ul.groep").css({display: "none"});
		} 
	});
	

	$(".personeelDetail").css({display:"none"});
	
	$(".toggleEmployee").click(function(){
		$(this).css({cursor: "pointer"});
		$(this).removeAttr("href");
		var clickedLink = $(this);
		$(".personeelDetail").each(function(){
			if(clickedLink.attr("rev") == $(this).attr("id")){
				$(".personeelDetail").css({display:"none"});
				$(this).css({display:"block"});
			}
		});
	});
	
	// Selecteer de eerste categorie en de eerste employee
	$(".toggleListElement:first").click();
	$(".toggleEmployee:first").click();
});

