/*
	Author: Bryan Absher
	This class opens a menu when the mouse
	is over a menu item.

*/

dojo.provide("site.HMenuBar");

dojo.require("dijit.MenuBar");

dojo.declare("site.HMenuBar", dijit.MenuBar, {

	constructor: function(){
		// summary:
		//		Sets up local variables etc.
		// tags:
		//		private

		// parameter to dijit.popup.open() about where to put popup (relative to this.domNode)
		this._orient = this.isLeftToRight() ? {BL: 'TL'} : {BR: 'TR'};
	},
	
	
	onHover: function(e){
		console.log(e);
	},
	
	onItemHover: function(item){
		this.inherited(arguments);
		this.focusChild(item);

		if(item.popup){
			this._openPopup();
		}else{
			// before calling user defined handler, close hierarchy of menus
			// and restore focus to place it was when menu was opened
			this.onExecute();

			// user defined handler for click
			//item.onClick(evt);
		}
	}
	
});