// JavaScript Document
$(function(){
	
	$("#FAQAccordion").accordion({active:-1, collapsible:false, autoHeight: false});
	// click op het item meten 
	$(".faqItem-link").click(function(){
		var itemId = $(this).attr("rel");
		$.get("handleactions.php?action=faq_click&faq_item="+itemId);
	});
	
	resizeContentArea();
	$(window).resize(function(){ resizeContentArea() } );
	
});

function resizeContentArea(){
	
	var documentHeight = $(document).height();
	
	var menuHeight = $(".mainMenu").height();
	
	var contentHeight = $("#contentArea").height();
	var footerHeight = $("#mainFooter").height();
	
	
	var siteHeight = contentHeight+footerHeight+83;
	var verschilContent = documentHeight-siteHeight;
	var verschilMenu = documentHeight-menuHeight;
	
	//alert("Content: "+contentHeight+", Footer: "+footerHeight+", VerschilContent: "+verschilContent+", VerschilMenu: "+verschilMenu);
	
	if(siteHeight < documentHeight){
		contentHeight = contentHeight+verschilContent;
		menuHeight = menuHeight+verschilMenu;
		$("#contentArea").height(contentHeight);
		$(".mainMenu").height(menuHeight)
		
		//alert("menu:"+menuHeight+" content:"+contentHeight);
	}

}
