$(document).ready(function(){
		
			var theWindow        = $(window),
			    $bg              = $("#bg"),
			    aspectRatio      = $bg.width() / $bg.height();    			    		
				
			function resizeBg() {
								
				if ( (theWindow.width() / theWindow.height()) < aspectRatio ) {
				    $bg
				    	.removeClass()
				    	.addClass('bgheight');
				} else {
				    $bg
				    	.removeClass()
				    	.addClass('bgwidth');
				}
				
			}
			                   			
			theWindow.resize(function() {
				resizeBg();
				
				if (theWindow.width() > 960) {
					$("#menu").css({left: ((theWindow.width() - 960) / 2)});
				}
				if (theWindow.height() < 560) {
					$("#menu img").css({margin: 0});
				}
				$("iframe#blog").css({height: (theWindow.height() - 200)});
				
			}).trigger("resize");
		
		});

