$(document).ready(function() {
	
	$('.lightbox').fancybox({ 
		'hideOnContentClick': false,
		'fixedNavigation':true,'overlayShow': true
	});
	
	$('.footerMenu > li').hover(function () {
		$(this).addClass("hover");
		$(this).children("ul").slideDown();
	},function () {
		
	});
	
	$('.footerMenu > li > ul').hover(function () {
		
	},function () {
		$(this).removeClass("hover");
		$(this).slideUp();
	});
	
	$('.oc').hide();
	
	buildNewHeight();
	
	var bodyheight = $('body').height();
	var windowheight = $(window).height();
	var maxHeight=Math.max(bodyheight,windowheight);
	
	if(maxHeight>600){
		$('#fancy_overlay').css({'height':maxHeight});
	}
	
	$('.linkview > li').hover(function () {
		var a= $(this).index('.linkview > li');
		$('.imgview > li:eq('+a+') > a').css({'border':'2px solid #501622'});
		//alert(a);
	},function () {
		var a= $(this).index('.linkview > li');
		$('.imgview > li:eq('+a+') > a').css({'border':'2px solid #6f7172'});
	});
	
	$('.imgview > li').hover(function () {
		var a= $(this).index('.imgview > li');
		$('.linkview > li:eq('+a+') > a').css({'color':'#501622'});
	},function () {
		var a= $(this).index('.imgview > li');
		$('.linkview > li:eq('+a+') > a').css({'color':'#000000'});
	});
	
	$('.SearchBox a.search').click(function(){
		$('#searchForm').submit();
	});
	
	$('h2.list').click(function(){
		$(this).next('.ProivitieLijst').slideToggle(500);
	});
	
	
	
	
});

function buildNewHeight(){
	var a=$('#Left').outerHeight();
	var b=$('#Right').outerHeight();
	if(a!=b){
		var maxHeight=Math.max(a,b);
		if(maxHeight>350){
			$('#Left').css({height:maxHeight});
			var c=maxHeight-$('#Header').outerHeight(true)-$('.Footer').outerHeight(true);
			$('#Right').css({height:maxHeight});
		}
	}
}



