function resz(){
	var img = $("#bg-image");
	
	var winW = $(window).width();
	var winH = $(window).height();
			
	var w = img.attr("width");
	var h = img.attr("height");
	
	img.css({'width': winW+'px', 'height':((winW*h)/w)+'px'});
	
	if(parseInt(img.css("height"),10) < parseInt(winH,10)) {
		img.css({'width': (((winH)*w)/h)+'px', 'height':winH+'px'});
	}
}
$(window).resize(resz);
$(window).load(resz);
$(document).ready(resz);
