$(document).ready(function()
{
	$('a[rel*=lightbox]').lightBox
	({
		overlayBgColor: '#ffffff',
		overlayOpacity: 0.8,
		containerResizeSpeed: 500,
		txtImage: 'Afbeelding',
		txtOf: 'van de',
		orderLink: '/frontends/bestel/',
		orderText: 'Deze foto bestellen'
	});

	//links
	$("#foldable > ul > ul").hide();
	$("#foldable > ul > ul:first").show();
	
	$("#foldable > ul > ul > ul").hide();
	$("#foldable > ul > ul > ul > ul").hide();
	
	$('#foldable > ul > li').click(function ()
	{
		if($(this).next("ul").css("display") == "none")
		{
			$("#foldable > ul > ul").hide();
			$("#foldable > ul > ul > ul").hide();
			$(this).next("ul").show();			
		}
	});
	
	//archief ( verder baserend op links )
	
	$('#foldable > ul > ul > li').click(function ()
	{
		if($(this).next("ul").css("display") == "none")
		{
			$("#foldable > ul > ul > ul").hide();
			$("#foldable > ul > ul > ul > ul").hide();
			$(this).next("ul").show();			
		}
	});
	
	$('#foldable > ul > ul > ul > li').click(function ()
	{
		if($(this).next("ul").css("display") == "none")
		{
			$("#foldable > ul > ul > ul > ul").hide();
			$(this).next("ul").show();			
		}
	});
	
	//kalender
	$('#calendarscroller').css("margin-left", "-" + $('.currentmonth').position().left + "px");

	$('.prevcal').click(function (){
		$('#calendarscroller').animate({
			'marginLeft' : "+=300px"
		});
	});	

	$('.nextcal').click(function (){
		$('#calendarscroller').animate({
			'marginLeft' : "-=300px"
		});
	});
	
});

