
$(document).ready(function() {
						   
	if($("#peoples").length){
		$("#peoples div").hover(function(){
			var int = $(this).attr("id").split("_")[1];
			$(this).addClass("hover");
			$("#default_content").hide();
			$(".peoples_"+int).stop(true, true).fadeIn();
		},function(){
			var int = $(this).attr("id").split("_")[1];
			$(this).removeClass("hover");
			$(".peoples_"+int).hide();	
			$("#default_content").stop(true, true).fadeIn();
		});
	}

	/* ---- mega menu ----------------------------------------------------------------------- */
	
	$("#menu li.item").hover(function(){
	
	   var ref = $(this);
	   var t = setTimeout(function() {
			$(ref).addClass("hovering");
			$(ref).find(".bigmenu").stop(true, true).slideDown();
			$(ref).children(".left, .right, .last").addClass("lefthover");
	   }, 250);
	   
	   $(this).data('timeout', t);
	   
	}, function(){	 
		clearTimeout($(this).data('timeout'));
		
		$(this).removeClass("hovering");
		$(this).find(".bigmenu").stop(true, true).slideUp();
		$(this).children(".left, .right, .last").removeClass("lefthover");
	});

	/* -------------------------------------------------------------------------------------- */

	/* ----- index.html ------------------------------------------------ */
	
	//equalheights columns frontnews columns
	if ($("#frontnews").length) {
		$("#frontnews > div").each(function(){
			var currentTallest = 0;
			
			$("#frontnews > div").each(function(){	
				if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
			});
			
			$(this).height(currentTallest+"px");							 
		});
	}
	
	//page redirect partner events
	if ($("#partner_epidm").length) {
		$("#partner_epidm").click(function() {
			window.location = "http://www.epidm.nl";
		});
	}
	
	if ($("#partner_links").length) {
		$("#partner_links").click(function() {
			window.location = "#";
		});
	}
	/* ------ page details projects.html ---------------------------------*/
	
	//mousehover met cell font kleuren
	$(".projects tbody tr").hover(
	    function() 
	    {
	        $(this).children('td').addClass('hover');
	       $(this).children('td').children('a').addClass('hover');
	    }, 
	    function() 
	    {
	        $(this).children('td').removeClass('hover');
	       $(this).children('td').children('a').removeClass('hover');	        
	    }
	);
	
	//cellsort example
	$(".projects .cellsort").click(function(){
		if ($(this).hasClass("down")) {
			$(this).removeClass("down");
			$(this).addClass("up");
		} else {
			$(this).removeClass("up");
			$(this).addClass("down");			
		}
	});
	/* ------ page details projects.html ---------------------------------*/
	
	//mousehover met cell font kleuren
	$(".themes tbody tr").hover(
	    function() 
	    {
	        $(this).children('td').addClass('hover');
	       $(this).children('td').children('a').addClass('hover');
	    }, 
	    function() 
	    {
	        $(this).children('td').removeClass('hover');
	       $(this).children('td').children('a').removeClass('hover');	        
	    }
	);
	
	//cellsort example
	$(".themes .cellsort").click(function(){
		if ($(this).hasClass("down")) {
			$(this).removeClass("down");
			$(this).addClass("up");
		} else {
			$(this).removeClass("up");
			$(this).addClass("down");			
		}
	});
	
});
