// JavaScript Document


$(document).ready(function () {
	function hideAll() {
		$('ul.aboutus_sl').hide();
		$('ul.whatwedo_sl').hide();
		$('ul.getinvolved_sl').hide();
		$('ul.fundraising_sl').hide();
	};
							
		
	
    $("a[rel]").overlay({expose: '#000000', opacity: 0.6}); 
	
	$('.aboutus a').hover(function () {
		 $(document).stopTime("remove");
		 $('ul.aboutus_sl').show();
		 $('ul.whatwedo_sl').hide();
		 $('ul.getinvolved_sl').hide();
		 $('ul.fundraising_sl').hide();
	});
	
	$('.whatwedo a').hover(function () {
		$(document).stopTime("remove");
		$('ul.whatwedo_sl').show();
		$('ul.aboutus_sl').hide();
		$('ul.getinvolved_sl').hide();
		$('ul.fundraising_sl').hide();
	});
	$('.getinvolved a').hover(function () {
		$(document).stopTime("remove");
		$('ul.getinvolved_sl').show();
	 	$('ul.aboutus_sl').hide();
	 	$('ul.whatwedo_sl').hide();
	 	$('ul.fundraising_sl').hide();
	});


	$('.fundraising a').hover(function () {
		$(document).stopTime("remove");
		$('ul.getinvolved_sl').hide();
	 	$('ul.aboutus_sl').hide();
	 	$('ul.whatwedo_sl').hide();
	 	$('ul.fundraising_sl').show();
	});




	$('.home a').hover(function () {
		hideAll();
	});

	$('.fundraising a').mouseout(function () {
		$(document).oneTime(500, "remove", function() {
		    hideAll();
		});					   
	});

	
	$('.media a').hover(function () {
		hideAll();
	});

	$('.contact a').hover(function () {
		hideAll();
	});

	$('.aboutus a').mouseout(function () {
		$(document).oneTime(500, "remove", function() {
		    hideAll();
		});					   
	});
	
	$('.whatwedo a').mouseout(function () {
		$(document).oneTime(500, "remove", function() {
		    hideAll();
		});					   
	});
	
	$('.getinvolved a').mouseout(function () {
		$(document).oneTime(500, "remove", function() {
		    hideAll();
		});					   
	});
	
		
	
	$('.aboutus_sl').hover(function(){$('.aboutus a').addClass('selected2');}, function(){$('.aboutus a').removeClass('selected2');});
	$('.whatwedo_sl').hover(function(){$('.whatwedo a').addClass('selected2');}, function(){$('.whatwedo a').removeClass('selected2');});
	$('.getinvolved_sl').hover(function(){$('.getinvolved a').addClass('selected2');}, function(){$('.getinvolved a').removeClass('selected2');});
	$('.fundraising_sl').hover(function(){$('.fundraising a').addClass('selected2');}, function(){$('.fundraising a').removeClass('selected2');});
	
	$('.secondary_nav a').hover(function () {
		$(document).stopTime("remove");	
	});
	
	$('.secondary_nav span').mouseover(function () {
		$(document).stopTime("remove");	
	});
	
	$('.secondary_nav a').mouseout(function () {
		$(document).oneTime(500, "remove", function() {
		    hideAll();
		});					   
	});
	
	$('.secondary_nav span').mouseout(function () {
		$(document).oneTime(500, "remove", function() {
		    hideAll();
		});					   
	});
});