$(window).load(function() {
    windowResize();
});

$(window).resize(windowResize);
//$(window).scroll(windowScroll);

var imgRatio = 1600 / 974;

function windowResize() {
    var screenRatio = $(window).width() / $(window).height();
    if (screenRatio > imgRatio) {
        $('#bg_image img').css('width', $(window).width()).css('height', null);
    } else {
        $('#bg_image img').css('height', $(window).height()).css('width', null);
    }
    $('#bg_image').css('width', $(window).width()).css('height', $(window).height());
    $('#bg_image_cover').css('width', $(window).width()).css('height', $(window).height());
}

function windowScroll() {
  //  alert("scroll " + $(this).scrollTop() );
	
	//var d = $(this).scrollTop() + 'px';
	//$('#bg_image img').css('margin-top', d);
}
