$(document).ready(function(){

	




// subscribeBlock: fade the labels in/out 

	
	// hide the labels on load if there is content in the input fields
	if ($('div#subscribeBlock input#naam').val() == '') { $('div#subscribeBlock input#naam').prev("label").fadeIn(); }
	if ($('div#subscribeBlock input#email').val() == '') { $('div#subscribeBlock input#email').prev("label").fadeIn(); }



	
	$('div#subscribeBlock input#naam').focus(function() // fadeout the label on focus
		{
		$(this).prev("label").fadeOut('fast');
		}
	);
	$('div#subscribeBlock input#naam').blur(function()  // fadein the label on blur if the input field is empty
		{
		if (this.value == '') { $(this).prev("label").fadeIn('fast'); }
		}
	);
	$('div#subscribeBlock input#email').focus(function() // fadeout the label on focus
		{
		$(this).prev("label").fadeOut('fast');
		}
	);
	$('div#subscribeBlock input#email').blur(function()  // fadein the label on blur if the input field is empty
		{
		if (this.value == '') { $(this).prev("label").fadeIn('fast'); }
		}
	);





	$('div#bedanktOverlay').click(function() // fadeout the thank you message
		{
		$(this).fadeOut('fast');
		}
	);

	$('div#bedanktMessageCloseBttn a').click(function(event) // fadeout the thank you message
		{
		event.preventDefault();
		}
	);






//////////////////////////////////////////////////////////////////////////////////////////




	function blockLink(name) 
		{
		$(name).hover(function()
			{
			$(this).css("cursor", "pointer");
			$(this).find("a").addClass("hover");
			window.status = $(this).find('a').attr('href');
			},
			function() {
			$(this).find("a").removeClass("hover");
			window.status = "";
			}
		).click(function()
			{
			window.location = $(this).find('a').attr('href');
			}
		);
		}


	blockLink('#nextDebate');
	blockLink('#recentDebate');
	blockLink('.previousEditionsOverviewBlock');
	blockLink('#previousEditionsBlock');
	//blockLink('#nextDebateBlock');




//////////////////////////////////////////////////////////////////////////////////////////




	$('div#previousEditionsOverview div:nth-child(3n)').addClass('third');






});