$(document).ready(function(event){
	
	$("#wrapper, .subwrapper, #list, .col1").fadeIn("slow");

	$("#logo a, .rects a, .squares a").click(function(a){
		a.preventDefault();
		var url = $(this).attr("href");
		$(".wrapper").fadeOut("slow", function(){
			window.location= url;
		});
		$(".subwrapper").fadeOut("slow", function(){
			window.location= url;
		});
		$("#list").delay(100).fadeOut("slow");
	});

	$("#list a").click(function(a){
		a.preventDefault();
		var url = $(this).attr("href");
		$(".subwrapper").fadeOut("slow", function(){
			window.location= url;
		});
	});

	$("#subnav a").click(function(a){
		a.preventDefault();
		var url = $(this).attr("href");
		$(".col1").fadeOut("slow", function(){
			window.location= url;
		});
	});


	$(".thumb").toggle(
		function(){
			$(this).children().fadeIn("slow");
			$(this).children().next().fadeOut("slow");

			$(this).prev().children().fadeOut("slow");
			$(this).prev().children().next().fadeIn("slow");
		},
		function(){
			$(this).children().fadeOut("slow");
			$(this).children().next().fadeIn("slow");

			$(this).prev().children().fadeIn("slow");
			$(this).prev().children().next().fadeOut("slow");
		}
	);


	$(".rects li").hover(
		function(){
			$(this).children("div").fadeTo("slow",0.2);
			$(this).children("p").delay(500).fadeIn("slow");
		},
		function(){
			$(this).children("div").delay(500).fadeTo("slow",1);
			$(this).children("p").fadeOut("slow");
		}
	);

	$("a.square").hover(
		function(){
			$(this).children("img").fadeTo("slow",0.5);
		},
		function(){
			$(this).children("img").delay(300).fadeTo("slow",1);
		}
	);

	$("video").click(
		function(){
			$(this).prev(".poster").fadeOut(1000);
		}
	);

	$("audio").click(
		function(){
			$(this).prev(".poster").fadeTo(1000, 0.3);
		}
	);

});


