$(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();
			}).trigger("resize");
		
		});
		
		
$(document).ready(function(){

    $("li.bttn").mouseover(function(){
        $(".section", this).stop().animate({height:'30px'},{queue:false, duration:1000, easing: 'easeOutCirc'});
    	$(".section p", this).stop().animate({ color: "#ffffff" }, 400);
    });

    $("li.bttn").mouseout(function(){
        $(".section", this).stop().animate({height:'63px'},{queue:false, duration:1000, easing: 'easeOutCirc'});
    	$(".section p", this).stop().animate({ color: "#5b5a5a" }, 400);
    });

	});
