
var ratio = 1697/1129;
var image_w = 0;
var image_h = 0;
var w;
var h;
var r;


function setSize() {
	w = $(window).width();
	h = $(window).height();
	r = w/h;
	if (r > ratio) {
		image_w = w;
		image_h = w / ratio;
	} else {
		image_h = h;
		image_w = h * ratio;
	}
	//console.log(w+','+h+','+image_w+','+image_h);
		
	$("#background img").attr( "width", image_w );
	$("#background img").attr( "height", image_h );
				
	$('#background img').css("margin-left",-image_w/2);
	$('#background img').css("margin-top",-image_h/2);
	//$("body").css("height",h);			
}

$(document).ready( function() {  
	setSize();
	
	$('#menu li').hover(
		function () { $(this).addClass('hover'); },
		function () { $(this).removeClass('hover'); }
	);
});

$(window).resize(function() {
	setSize();
});

