$(function() {                   
		var theWindow        = $(window),
			$bg              = $("#bg"),
			aspectRatio      = 1900 / 1080;                                                                
		function resizeBg() {                                
				if ( (theWindow.width() / theWindow.height()) < aspectRatio ) {
					$bg
						.removeClass()
						.addClass('bgheight');
				} else {
					$bg
						.removeClass()
						.addClass('bgwidth');
				}                                                        
		}                                                                
		theWindow.resize(function() {
				resizeBg();
		}).trigger("resize");                
});
