jQuery.event.add(window, "resize", ResizeLayout);
jQuery.event.add(window, "load", ResizeLayout);

function ResizeLayout()
	{
	// Background image should be 1920 * 1440 !!!

	var BackgroundHeight = $(window).width() / 1920 * 1440;
	var WindowHeight = $(window).height();

	if (WindowHeight > BackgroundHeight)
		{
		var BackgroundCorrection = Math.round((WindowHeight-BackgroundHeight)/2);
		var LogoCorrection = BackgroundCorrection +15;
		var SocialmediaCorrection = WindowHeight - BackgroundCorrection;

		$('#bgphoto').css({top: BackgroundCorrection});
		$('#bgphoto').css({height: BackgroundHeight});

		$('#logo').css({top: LogoCorrection});
		$('#socialmedia').css({top: SocialmediaCorrection});
		}

	if ($(window).height() < 625)
		{
		$('#mainmenu').css({marginTop: 0});
		$('#mainmenu').css({top: 0});
		$('#content').css({marginTop: 0});
		$('#content').css({top: 41});
		$('#content-middle').css({height: WindowHeight-75});
		$('#content-div').css({height: WindowHeight-75});
		}
	}
