// JavaScript Document

// NGV Multimedia, Jon Luker, April 2009
//
// Created for Dali navigation system
// requires jQuery
//
/*global jQuery */


jQuery(document).ready(function(){
	
	// GREY OUT CURRENT PAGE ON MENU
	// modify the appearance of the current page on the menu (tying filename to id)
	function filterPath(pathString) {
		return pathString.replace(/^\//,'').replace(/\/(index\.\w{3,4})?$/,'');
	}
	
	jQuery('a').filter(function() {
		return filterPath(this.pathname) == filterPath(location.pathname);
	}).addClass('inactive');

	// MENU ROLLOVERS
	// trigger bounding box similar to home page effect
	
	jQuery('#one').hover(function(){					// do this when hover event is active
		jQuery("#one").addClass("outlineon");
							
		jQuery("#two").removeClass("outlineon");
		jQuery("#three").removeClass("outlineon");
		jQuery("#four").removeClass("outlineon");
		jQuery("#five").removeClass("outlineon");
		jQuery("#six").removeClass("outlineon");

		},function(){ 								// when event has ended
			jQuery("#one").removeClass("outlineon");
		});
	
	
	jQuery('#two').hover(function(){					// do this when hover event is active
		jQuery("#two").addClass("outlineon");
		jQuery("#six").addClass("outlineon");
		
		jQuery("#one").removeClass("outlineon");
		jQuery("#three").removeClass("outlineon");
		jQuery("#four").removeClass("outlineon");
			jQuery("#five").removeClass("outlineon");

		},function(){									// when event has ended
			jQuery("#two").removeClass("outlineon");
					jQuery("#six").removeClass("outlineon");

		});
	
	jQuery('#three').hover(function(){					// do this when hover event is active
		jQuery("#three").addClass("outlineon");
		jQuery("#four").addClass("outlineon");
			jQuery("#five").addClass("outlineon");
		
		jQuery("#one").removeClass("outlineon");
		jQuery("#two").removeClass("outlineon");
		jQuery("#six").removeClass("outlineon");

		},function(){									// when event has ended 
			jQuery("#three").removeClass("outlineon");
			jQuery("#four").removeClass("outlineon");
						jQuery("#five").removeClass("outlineon");

		});
	
	jQuery('#four').hover(function(){					// do this when hover event is active
		jQuery("#three").addClass("outlineon");
		jQuery("#four").addClass("outlineon");
			jQuery("#five").addClass("outlineon");
		
		
		jQuery("#one").removeClass("outlineon");
		jQuery("#two").removeClass("outlineon");

		},function(){									// when event has ended 
			jQuery("#three").removeClass("outlineon");
			jQuery("#four").removeClass("outlineon");
						jQuery("#five").removeClass("outlineon");

		});
	
	jQuery('#five').hover(function(){					// do this when hover event is active
		jQuery("#three").addClass("outlineon");
		jQuery("#four").addClass("outlineon");
			jQuery("#five").addClass("outlineon");
		
		jQuery("#one").removeClass("outlineon");
		jQuery("#two").removeClass("outlineon");
		jQuery("#six").removeClass("outlineon");

		},function(){									// when event has ended 
			jQuery("#three").removeClass("outlineon");
			jQuery("#four").removeClass("outlineon");
						jQuery("#five").removeClass("outlineon");

		});
	
		jQuery('#six').hover(function(){					// do this when hover event is active
		jQuery("#two").addClass("outlineon");
		jQuery("#six").addClass("outlineon");
		
		jQuery("#one").removeClass("outlineon");
		jQuery("#three").removeClass("outlineon");
		jQuery("#four").removeClass("outlineon");
			jQuery("#five").removeClass("outlineon");

		},function(){									// when event has ended
			jQuery("#two").removeClass("outlineon");
					jQuery("#six").removeClass("outlineon");

		});

});

 

