// Adds a class to the drop down items so that internet explorer can fake the 
// :hover pseudo class.
dropDownMenu = function() {
	var currentSection = $$('body').first().identify(); // Get the id of the current template being used

	switch( currentSection ) { // Check what section the user is in based on the id of the <body>
		case "product-description":
			currentSection = "nav-shopping";
		case "our-story":
			currentSection = "nav-story";
		case "be-mindful":
			currentSection = "nav-mindful";
	}
	
	var els = $$("#dropdown-nav>li"); // only effect the immediate <li> elements

	els.invoke( 'observe', 'mouseover', function() { 
		this.addClassName('ie-hover'); // Fake the :hover pseudo-class in IE6

		if ( currentSection == this.down(0).identify()) {
			this.down(0).addClassName('active'); // Turn on the active state for the top level link
		}
	} );
	
	els.invoke( 'observe', 'mouseout', function() { 
		this.removeClassName('ie-hover');
		
		if ( currentSection == this.down(0).identify()) {
			this.down(0).removeClassName('active'); // Turn off the active state for the top level link
		}
	} );
	
}

document.observe("dom:loaded", function() {
  dropDownMenu();
});
