$(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');
	});

	resizeImage();
});

//Op resize functie relocate uitvoeren
$(window).bind('resize', function() {
	resizeImage();
});

//Afbeelding fullscreen weergeven
function resizeImage()
{
	var l_iWidth = $(window).width();
	var l_iHeight = $(window).height();

	if( ( l_iWidth / 16 ) > ( l_iHeight / 9 ) )
	{
		newHeight = ( l_iWidth / 16 ) * 9;
		marginTop = ( newHeight - l_iHeight ) / 2;

		$('img.studio-bg').css( 'width', l_iWidth );
		$('img.studio-bg').css( 'height', newHeight );
		$('img.studio-bg').css( 'top', '-'+marginTop+'px' );
		$('img.studio-bg').css( 'left', '0px' );
	}
	else
	{
		newWidth = ( l_iHeight / 9 ) * 16;
		marginLeft = ( newWidth - l_iWidth ) / 2;

		$('img.studio-bg').css( 'width', newWidth );
		$('img.studio-bg').css( 'height', l_iHeight );
		$('img.studio-bg').css( 'left', '-'+marginLeft+'px' );
		$('img.studio-bg').css( 'top', '0px' );
	}
}
