$(document).ready(function(event){

	$(".wrapper").delay(200).fadeIn(1100);

	function mouseover(event){
		$(this).animate({fontSize:"24px", "line-height":"24px"},300);
	}

	function mouseout(event){
		$(".links a, h2 a").animate({fontSize:"16px"},300);
	}

	$("a").hover(mouseover, mouseout);
	$("a").click(function(a){
		a.preventDefault();
		var url = $(this).attr("href");
		$(".wrapper").fadeOut("slow", function(){
			window.location= url;
		});
	});


	$(".thumbs img").hover(
		function(){
			$(this).fadeTo(300,.3);
		},
		function(){
			$(this).fadeTo(300,1);
		}
	);

	$(".thumbs img").click(
		function(){
			var sample = $(this).parent("a").attr("href");
			$(".sample .image img").attr({src:sample});

			$(".close").delay(800).fadeIn("slow");
			$(".shade").fadeIn("slow");
			$(".sample, table, .sample .image")
				.fadeIn("slow")
				.delay(1200)
				.animate({maxHeight:"600px"},1200);
			return false;
		}
	);

	$(".close").click(
		function(){
			$(".sample, table, .sample .image").animate({maxHeight:"0"},500).delay(500).fadeOut("slow");
			$(".close").delay(500).fadeOut("slow");
			$(".shade").delay(1000).fadeOut("slow");
			return false;
		}
	);

});
