window.addEvent('domready', function(){
	
	// Hide the sections so the CSS doesn't interfere with the JS and then add the events.
	$$('#nav-main ul').setStyle('display', 'none');
	$$('#nav-main > li').addEvents({
		'mouseenter': function() {
			var children = this.getChildren('ul');
			if (children.length) children[0].reveal({'link': 'cancel'})
		},
		'mouseleave': function() {
			var children = this.getChildren('ul');
			if (children.length) children[0].dissolve()
		}
	});
});

