$(document).ready(function() {
	// -------- global functions -------- //
	
	// contact div open/close functions
    $('.contactBtn').click(function() {
		//$('.contact').slideDown(800);
		$('.contact').toggle("slow");
	});
	$('.closeContactBtn').click(function() {
		$('.contact').toggle("slow");
	});
	
	$(document).keyup(function(e) { 
	    if (e.which == 27) { 
			$('.contact').toggle("slow"); 
		}  
	});
	
	function closeContact() {
		$('.contact').toggle("slow");
	}
	
	// work bursts on work detail pages
	$('.detail .content .results .features a').each(function(index) {
	    $('.detail .content .results .features #feature_'+index).mouseenter(function () {
			$('.detail .content .results #feature_'+index+' .info').stop().animate({
				backgroundColor: "rgba(0,0,0,1)",
				height: "56px",
				top: "-74px"
			  }, 200 );
		});
	});
	
	$('.detail .content .results .features a').each(function(index) {
	    $('.detail .content .results .features #feature_'+index).mouseleave(function () {
			$('.detail .content .results #feature_'+index+' .info').stop().animate({
				backgroundColor: "rgba(0,0,0,.75)",
				height: "31px",
				top: "-49px"
			  }, 200 );
		});
	});	
	
	// work bursts on home page
	$('.home .results a').each(function(index) {
	    $('.results #feature_'+index).mouseenter(function () {
			$('.results #feature_'+index+' .info').stop().animate({
				backgroundColor: "rgba(0,0,0,1)",
				height: "72px",
				top: "-85px"
			  }, 200 );
		});
	});
	
	$('.home .results a').each(function(index) {
	    $('.results #feature_'+index).mouseleave(function () {
			$('.results #feature_'+index+' .info').stop().animate({
				backgroundColor: "rgba(0,0,0,.75)",
				height: "47px",
				top: "-60px"
			  }, 200 );
		});
	});
	
	// work bursts on work page
	$('.work_landing .results a').each(function(index) {
	    $('.results #feature_'+index).mouseenter(function () {
			$('.results #feature_'+index+' .info').stop().animate({
				backgroundColor: "rgba(0,0,0,1)",
				height: "72px",
				top: "-85px"
			  }, 200 );
		});
	});
	
	$('.work_landing .results a').each(function(index) {
	    $('.results #feature_'+index).mouseleave(function () {
			$('.results #feature_'+index+' .info').stop().animate({
				backgroundColor: "rgba(0,0,0,.75)",
				height: "47px",
				top: "-60px"
			  }, 200 );
		});
	});
	
	
});
