$(document).ready(function() {
	function showMenu(){
		$(this).addClass("hovering");
	}
	function hideMenu(){
		$(this).removeClass("hovering");
	}
	var navConfig = {    
		 over: showMenu,  
		 timeout: 200,   
		 out: hideMenu,
		 interval: 200
	};	
    $("#menu li.menu").hoverIntent(navConfig);
	
	$("#menu ul.sub-menu li")
		.mouseover(function(){
			$(this).addClass("over");
		})
		.mouseout(function(){
			$(this).removeClass("over");
		});
		
		
	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");
	
	
	$("ul#designers li img")
		.mouseover(function() { 
			var src = $(this).attr("src").replace(".png", "-over.png");
			$(this).attr("src", src);
		})
		.mouseout(function() {
			var src = $(this).attr("src").replace("-over", "");
			$(this).attr("src", src);
		});		
});
