$(document).ready(function() {
	//////////////////////////////////////////////////
	// Expand boxes homepage ! SlideDown goes UP; SlideUp goes DOWN because the #column box bottom is fixed.
	$("#column1").hover(function() {
		$("div#slide1").stop(true, true);
		$("div#slide1").slideDown("slow");
	}, function() {
		$("div#slide1").stop(true, true);
		$("div#slide1").slideUp("fast");
	});
	$("#column2").hover(function() {
		$("div#slide2").stop(true, true);
		$("div#slide2").slideDown("slow");
	}, function() {
		$("div#slide2").stop(true, true);
		$("div#slide2").slideUp("fast");
	});
	$("#column3").hover(function() {
		$("div#slide3").stop(true, true);
		$("div#slide3").slideDown("slow");
	}, function() {
		$("div#slide3").stop(true, true);
		$("div#slide3").slideUp("fast");
	});
	//////////////////////////////////////////////////   
	// Expand Panel Achterkant
	$("#open").click(function() {
		$("div#behind").slideDown("slow");
	});
	// Collapse Panel Achterkant
	$("#close").click(function() {
		$("div#behind").slideUp("slow");
	});
	// Switch buttons from "Hoe werkt het" to "Sluiten" on click
	$("#switchbutton a").click(function() {
		$("#switchbutton a").toggle();
	});
	//////////////////////////////////////////////////
	// Expand Panel Achterkant People
	$("#open").click(function() {
		$("div#behindPeople").slideDown("slow");
	});
	// Collapse Panel Achterkant
	$("#close").click(function() {
		$("div#behindPeople").slideUp("slow");
	});
	//////////////////////////////////////////////////
	//newspage slider right to left
	$('#newList li').each(
		function() {
			$('.toggle').click(function() {
				$('html, body').animate({ scrollTop: '500px' }, "fast");
				$(this).next('.newsItem').animate({
					left: -$('.newsItem').outerWidth()
				});
				//$('div#contentItemsContainer').css('overflow-y', 'auto');
			});
			$('.newsItem').click(function() {
				$(this).animate({
					left: 0
				});
				//$('div#contentItemsContainer').scrollTop(0); 
				//$('div#contentItemsContainer').css('overflow-y', 'hidden');
			});
		});
	//////////////////////////////////////////////////
	//tabs Route
	$('ul.tabNav a').click(function() {
		var curChildIndex = $(this).parent().prevAll().length + 1;
		$(this).parent().parent().children('.current').removeClass('current');
		$(this).parent().addClass('current');
		$(this).parent().parent().next('.tabContainer').children('.current').slideUp('fast', function() {
			$(this).removeClass('current');
			$(this).parent().children('div:nth-child(' + curChildIndex + ')').slideDown('normal', function() {
				$(this).addClass('current');
			});
		});
		return false;
	});
	//////////////////////////////////////////////////
});