$(document).ready(function()
{	
	//Extra backup om menu te sluiten als er over ander menu gehoverd wordt.
	$('.menu > li .close-backstage').mouseover( function() {
		$('ul.contact').css('visibility', 'hidden');	
	});
	
	$('.menu > li .close-press').mouseover( function() {
		$('ul.contact').css('visibility', 'hidden');	
	});
	
	// Scrollbar toevoegen
	$('#vacanciescontainer').jScrollPane();

	//Vancancie tonen	
	$('.title-holder').click( function() 
	{
		$.g_iId = $(this).attr('name');
		
		$('.arrow-'+$.g_iId).attr( 'src', 'templates/pages/news/images/arrow-over.gif' );	
		
		if( $('#vacancieIntroText_'+$.g_iId ).is(':hidden') )
		{
			$("#vacancieIntroText_"+$.g_iId).hide( 0, function()
			{
				$("#vacancie_"+$.g_iId).slideDown( 500, function()
				{
					$("#vacanciescontainer").jScrollPane();
				} );
				
				$.g_sFold = true;
			});
		}
		else
		{
			$('#vacancie_'+$.g_iId).slideUp( 500, function()
			{
				$("#vacancieIntroText_"+$.g_iId).show();
				$("#vacanciescontainer").jScrollPane();
			});
			
			$('.arrow-'+$.g_iId).attr( 'src', 'templates/pages/news/images/arrow.gif' );
			
			$.g_sFold = false;
		}
		
		return false;
	});
	
	$('.title-holder').mouseover( function() 
	{
		var image = $(this).find('img');
		$( image ).attr( 'src', 'templates/pages/news/images/arrow-over.gif' );
	});
	
	$('.title-holder').mouseout( function() 
	{
		var image = $(this).find('img');
		var container = $(this).find('.vacancie').is(':hidden');
		
		if( container )
		{
			$(image).attr( 'src', 'templates/pages/news/images/arrow.gif' );
		}
	});
});

// DIT WORDT NIET MEER GEBRUIKT MAAR LATEN STAAN VOOR EVENTUEEL DE TOEKOMST
//Functie voor het berekenen van het content vlak (verhouding is 2:1)
function resizeContentTest()
{	
	var margin = 20;						// Margin om de content container in pixels
	var windowHeight = $(window).height();				// Browser viewport hoogte
	var windowWidth = $(window).width();				// Browser viewport hoogte
	var footerHeight = $('#footer').height();			// Hoogte van element #footer
	
	// Startpositie berekening bepalen (hoogte of breedte)
	if( windowWidth > Math.round( ( windowHeight - footerHeight ) * 2.13 ) )
	{
		contentHeight = ( windowHeight - footerHeight ) - Math.round( margin * 2.13 );
		contentWidth = Math.round( contentHeight * 2.13 );
	}
	else
	{
		contentWidth = windowWidth - Math.round( margin * 2.13 );
		contentHeight = Math.round( contentWidth / 2.13 );
	}
	
	$('#content').css( "height", contentHeight );
	$('#content').css( "width", contentWidth );
	
	relocate();
}
