$(document).ready(function() {

	//logo takes you to homepage

	$('h1').click(function() {
		window.location = "./index.php"
	});
	
	//hide nav if on case study page

	if ($('.case').length) {
		$('.mid_nav').hide();		
	}

	$('#nav_container').mouseenter(function () {
    	if ($('.mid_nav').is(':hidden')) {
    		$('.mid_nav').stop(true, true).show('clip',{direction: 'vertical'}, 200);
	  	};
	  });
	$('#nav_container').mouseleave(function () {
    $('.mid_nav').stop(true, true).hide('clip',{direction: 'vertical'}, 200);
  }); 


		$('#all_show').click(function () {
			$('#work_list a').show('clip',{direction: 'vertical'}, 200);
	  		$('#work_hero ul li a').removeClass('active');
			$(this).addClass('active');
			return false;
		});

		$('#trans_show').click(function () {
			$('#work_list a:not(.tra)').stop(true, true).fadeOut('fast');
			$('#work_list a.tra').stop(true, true).fadeIn('fast');
	  		$('#work_hero ul li a').removeClass('active');
			$(this).addClass('active');			
			return false;
		});

		$('#med_show').click(function () {
			$('#work_list a:not(.med)').stop(true, true).fadeOut('fast');
			$('#work_list a.med').stop(true, true).fadeIn('fast');
	  		$('#work_hero ul li a').removeClass('active');
			$(this).addClass('active');			
			return false;
		});

		$('#con_show').click(function () {
			$('#work_list a:not(.con)').stop(true, true).fadeOut('fast');
			$('#work_list a.con').stop(true, true).fadeIn('fast');
	  		$('#work_hero ul li a').removeClass('active');
			$(this).addClass('active');			
			return false;
		});
		
		$('#eqp_show').click(function () {
			$('#work_list a:not(.eqp)').stop(true, true).fadeOut('fast');
			$('#work_list a.eqp').stop(true, true).fadeIn('fast');
	  		$('#work_hero ul li a').removeClass('active');
			$(this).addClass('active');			
			return false;
		});

// Remove focus outlines
$("a").keypress(function() {
     this.blur();
     this.hideFocus = false;
     this.style.outline = null;
});
$("a").mousedown(function() {
     this.blur();
     this.hideFocus = true;
     this.style.outline = 'none';
});

});	
