// JavaScript Document

	$(document).ready(function(){
		
		
			  
			  $(".caption").mouseenter(function(){
					$(this).find(".info").hide();
					$(this).find(".topic").hide();
					$(this).find(".counter").hide();
					$(this).find(".post-caption").hide();
					$(this).find("#nav_1235717").show();
				});
				
				$(".caption").mouseleave(function(){
					$(this).find(".info").show();
					$(this).find(".post-caption").show();
					$(this).find(".topic").show();
					$(this).find(".counter").show();
					$(this).find("#nav_1235717").hide();
					backgrounds();
				});
				


			
			function backgrounds() {	
				
				$(".fashion-li").hover(function(){
					$("body").find(".fashion").show();
				}, function(){
					$("body").find(".fashion").hide();
				});
				
				$(".advertising-li").hover(function(){
					$("body").find(".advertising").show();
				}, function(){
					$("body").find(".advertising").hide();
				});
				
				
				
				$(".film-li").hover(function(){
					$("body").find(".film").show();
				}, function(){
					$("body").find(".film").hide();
				});
				
				$(".portraits-li").hover(function(){
					$("body").find(".portraits").show();
				}, function(){
					$("body").find(".portraits").hide();
				});
				
				$(".kids-li").hover(function(){
					$("body").find(".kids").show();
				}, function(){
					$("body").find(".kids").hide();
				});
				
				$(".books-li").hover(function(){
					$("body").find(".books").show();
				}, function(){
					$("body").find(".books").hide();
				});
				
				$(".biography-li").hover(function(){
					$("body").find(".biography").show();
				}, function(){
					$("body").find(".biography").hide();
				});
				
				
				
				$(".sketch-books-li").hover(function(){
					$("body").find(".sketch-books").show();
				}, function(){
					$("body").find(".sketch-books").hide();
				});
				
				$(".zines-li").hover(function(){
					$("body").find(".zines").show();
				}, function(){
					$("body").find(".zines").hide();
				});
				
				$(".screenprints-li").hover(function(){
					$("body").find(".screenprints").show();
				}, function(){
					$("body").find(".screenprints").hide();
				});
				
				$(".more-stuff-li").hover(function(){
					$("body").find(".more-stuff").show();
				}, function(){
					$("body").find(".more-stuff").hide();
				});
				
				$(".blog-li").hover(function(){
					$("body").find(".blog").show();
				}, function(){
					$("body").find(".blog").hide();
				});
	
	
				$(".contact-li").hover(function(){
					$("body").find(".contact").show();
				}, function(){
					$("body").find(".contact").hide();
				});
			}
			
		backgrounds();
			
		
		
			/*var w = $(window).width();
			var h = $(window).height();
			var ratio = w/h;
			//alert(ratio);
			if(ratio>1.5){ //landscape
				$(".big img").width(w);
				$(".big img").height('auto');
				$(".big img").css("margin-top","-"+h/4+"px");
				$(".contact img").css("margin-top","0");
				$("#background").width(w);
				$("#background").height('auto');
				$("#background").css("margin-top","-"+h/4+"px");
				$(".contact-content #background").css("margin-top","0");
			} else if ((ratio<1.5) && (ratio < 1.7)){// if w<h
				$(".big img").width(w);
				$(".big img").height('auto');
				$("#background").width(w);
				$("#background").height('auto');
			} else if (ratio > 1.7){
				$(".big img").width('auto');
				$(".big img").height(h);
				$("#background").width('auto');
				$("#background").height(h);
			} else {
				$(".big img").width('auto');
				$(".big img").height(h);
				$("#background").width('auto');
				$("#background").height(h);
			}
		*/
		
		/*$(window).load(function() {    

        var theWindow        = $(window),
            $bg              = $(".big img"),
            aspectRatio      = $bg.width() / $bg.height();
		var $bgStatic              = $("#background");

        function resizeBg() {

                if ( (theWindow.width() / theWindow.height()) < aspectRatio ) {
                    $bg
                        .removeClass()
                        .addClass('bgheight');
					$bgStatic
                        .removeClass()
                        .addClass('bgheight');
                } else {
                    $bg
                        .removeClass()
                        .addClass('bgwidth');
					$bgStatic
                        .removeClass()
                        .addClass('bgwidth');	
                }

        }

        theWindow.resize(function() {
                resizeBg();
        }).trigger("resize");

		});*/
		
		

	
	});
	



