$(document).ready( function() {   
	
	$('.nav>li').each(function()
	{
		var re  = new RegExp($(this).attr('class'),'i');
		if (re.test(window.location.pathname)) 
		{
			$(this).addClass('current on');
		}
	});
	
	$('.nav>li>ul>li').each(function()
	{
		var re  = new RegExp($(this).attr('id'),'i');
		if (re.test(window.location.pathname)) 
		{
			$(this).addClass('on sub-cur');
		}
	});
	
	function showNav() 
		{ 
			var curNav = $(this).parent().find('li.current');
			$(curNav).removeClass('on');
			$(this).addClass('on');
		}
		function hideNav() 
		{ 
			var curNav = $(this).parent().find('li.current');
			$(this).removeClass('on');
			$(curNav).addClass('on');
		}
		
		function showSub() 
		{ 
			var curSubNav = $(this).parent().find('li.sub-cur');
			$(curSubNav).removeClass('on');
			$(this).addClass('on');
		}
		function hideSub() 
		{ 
			var curSubNav = $(this).parent().find('li.sub-cur');
			$(this).removeClass('on');
			$(curSubNav).addClass('on');
		}
		
		$(".nav>li").mouseenter(showNav).mouseleave(hideNav);
		$('.nav>li>ul>li').mouseenter(showSub).mouseleave(hideSub);
	
	
	
	// full story rollovers -press room
	$('.copy>a>.get-story').hover(
		function() { $(this).attr({src:"/images/full_story_btn_over.png"});
		},
		function() { $(this).attr({src:"/images/full_story_btn.png"});		
		});
	
	// GALLERY
	
	$('.photos>div>a>img').each(function()
	{
		$(this).hover(
		function() { $(this).css({'border-color' : '#343434'});
		},
		function() { 
				$(this).css({'border-color' : '#c8af70'});	
		});
		
		$(this).parent().click(function() 
		{
			return false;
		});
		$(this).click(function() 
		{
			$(this).addClass('current');
			var largePath = $(this).parent().attr('href');
			$("#large-photo").fadeOut(400, function() {
				$('#large-photo').attr({'src' : largePath});
				if (this.complete) $(this).fadeIn(400);
			  });
		});
	
	});
	
	$("ul.nav a").each(function()
	{
		if ( $(this).attr('href') != "javascript:void(0)" )
		{
			$(this).parent("li").css("cursor","pointer");
		}
		else
		{
			$(this)
			.css("cursor","default")
			.parent("li").css("cursor","default");
		}
	});

	


});
// END DOC READY