$(document).ready(function(){
	
	// wobble it (original top value: 230px)
	$("#tryme").animate({ 
	        top: "235px"
		}, "fast");
	$("#tryme").animate({ 
	        top: "225px"
		}, "fast");
	$("#tryme").animate({ 
	        top: "235px"
		}, "fast");
	$("#tryme").animate({ 
	        top: "225px"
		}, "fast");
	$("#tryme").animate({ 
	        top: "235px"
		}, "fast");
	$("#tryme").animate({ 
	        top: "225px"
		}, "fast");
	$("#tryme").animate({ 
	        top: "230px"
		}, "fast");
		
	// hover behaviour for cards (all use same adjustment)
	$(".card-animated").hover(
		function () {
			// over
			
			// hide "try me" arrow
			$("#tryme").fadeOut("slow");
				
			// show hovered card
			$(this).animate({ 
			        top: "190px"
				}, "slow");
		}, 
		function () {
			// out
			
			// cards only disappear when card below is hovered,
			// or when mouse leaves container
		}
	);
	
	// container hover
	$("#container").hover(
		function () {
			// over
		},
		function () {
			// out
			
			// stop all animation
			$(".card-animated").stop(true);
			
			// hide all cards
			$(".card-animated").animate({
					top: "0"
				}, "fast");
			
		}
	);
	
	// when hovering, hide all the cards above me
	// (only applies to bottom 2 cards)
	$("#card-caffeine").hover(
		function () {
			// over
			
			$("#card-ibis").animate({
					top: "0"
				}, "fast");
		},
		function () {
			// out	
		}
	);
	$("#card-jayphoto").hover(
		function () {
			// over
			
			$("#card-ibis").animate({
					top: "0"
				}, "fast");
			
			$("#card-caffeine").animate({
					top: "0"
				}, "fast");
		},
		function () {
			// out	
		}
	);

});