jQuery(document).ready(function($) {
	
	$("li a:contains('Location')").addClass('gray');
	$("li a:contains('Newsroom')").addClass('gray');
	$("li a:contains('Contact')").addClass('gray');
	$("li a:contains('About')").css('background', 'none');
	
	$("li a:contains('About')").hover(function(){
  			$("#menu ul li:first").removeClass("first").addClass("firsthover");
		},
		function(){
  			$("#menu ul li:first").removeClass("firsthover").addClass("first");
	});
	
	$("li a:contains('Contact')").hover(function(){
  			$("#menu ul li:last").removeClass("last").addClass("lasthover");
		},
		function(){
  			$("#menu ul li:last").removeClass("lasthover").addClass("last");
	});
	
	
	$('.staff_entry').hide();
	
	$('a.open_staff').toggle(function(){
		
		var src = $(this).find('img').attr("src");
  		var newsrc = src.replace("open","close");
  		$(this).find('img').attr("src", newsrc);
		
		var the_id = $(this).attr('id');
		
		$("#staff_"+ the_id +"").show("slow");
		},
	function(){
		
		var src = $(this).find('img').attr("src");
  		var newsrc = src.replace("close","open");
  		$(this).find('img').attr("src", newsrc);
		
		var the_id = $(this).attr('id');

		$("#staff_"+ the_id +"").hide("slow");
	});
	
	
	$('a.close_staff').click(function(){
		
		var the_id = $(this).attr('id');
		$("#staff_"+ the_id +"").hide("slow");	
		
		var src = $("a.open_staff").find('img').attr("src");
  		//alert(src);
		var newsrc = src.replace("close","open");							  
		$("a.open_staff").find('img').attr("src", newsrc);
	});
	
	$("a[href^='http://']").each(function(){
    	var thehref = $(this).attr('href');
    	if(thehref.match(window.location.host)){
    		//do nothing
    	} else {
       		$(this).attr('target', '_blank');
   		}
	});

	
	
});
