BLIP.Class.create("BLIP.Unit.DropDown.HoverDropDown", BLIP.Unit.DropDown,
	function(config) {
		this.onOver = config.onOver;
		BLIP.Unit.DropDown.call(this, config);
	},
	{
		selector: ".HoverDropDown",

		mouseOutTimeout : null,

		init : function() {
			this.initEvents();
		},

		initEvents : function() {
			this.domRoot.hover(
				this.delegate(this.on_captionOver),
				this.delegate(this.on_captionOut)
			);
		},

		on_captionOver : function() {
			if (this.onOver) {
				this.onOver();
			}

			clearTimeout(this.mouseOutTimeout);
			if (!this.domRoot.hasClass("Open")) {
				this.openDropDown();
			}
		},

		on_captionOut : function() {
			var thisContext = this;
			this.mouseOutTimeout = setTimeout(function() {
				thisContext.closeDropDown();
			}, 500);
		}
	}
);

