$(document).ready(function() {
	
	// RELEVANTE LINKS ABSOLUUT MAKEN!!!
	$('#inhoud .view a').each(function(intIndex){
		 var check = $(this).html();
		 if (check != ""){
		 
		 var hrefnew = $(this).attr('href');
		 hrefnew = hrefnew.replace("../../../", "http://www.wervingenselectiegids.nl/");
		 }
		 
		 $(this).attr({href:hrefnew});
	});
	
	
	
	/* FIX Gelijkebehandelings-wetgeving */
	var thisTitle = $("#inhoud h1").attr("id");
	if (thisTitle == "page_8")
	{
		$("#inhoud h1").html("Gelijkebehandelingswetgeving");
	}


	/* TEST CUSTOMMADE SUBMENU */
	/* VAR IF IE6 */
	
	var daWorstBrowser = false;
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var ieversion=new Number(RegExp.$1);if (ieversion>=6) { daWorstBrowser = true; } }

	/* ADD UNOBJECT.. JS */
	if(daWorstBrowser == true) {
		var elCount = 2;
	} else {
		var elCount = 1;
	}

	$("#submenu ul li ul li").each(function(intIndex){
		if($(this).hasClass('aktief') != true && $(this).contents().length > elCount) {
			$(this, ":first-child").addClass("pmenu");
			$('#submenu ul li ul li ul li').removeClass("pmenu");
		}
	});
	$("#submenu ul li.pmenu").each(function(i) {
		if($(this).find(".aktief").length > 0) {
			$(this).removeClass('pmenu');
		}
	});
	$("li.pmenu").mouseenter(function(){ 
		$('li.hover').stop();
		$(this, "#submenu ul li ul li").addClass('hover');
		var hTot = $('li.hover ul').innerHeight()+20;
		$('li.hover').animate({height: hTot+"px"}, 300);
	});
	$("li.pmenu").mouseleave(function(){ 
		$('li.hover').stop();
		$('li.hover').animate({height: "20px"}, 300);
		$(this, "#submenu ul li ul li").removeClass('hover');
	});
	/* END TESTCASE */
	
	
	$('#formblock').hide();	
	
	$('#feedbackBtn').click(function(e){
		e.preventDefault();
		
		$('#formblock').toggle(500);
	});
});
