function initHover(){
	var _t = false;
	var _H = [];
	var _duration = 600; //in ms
	var h_class = 'hover';
	var _li = jQuery('#nav > li');
	_li.each(function(){
		var _boxes = jQuery(this).children('div.drop');
		var _boxH = _boxes.show().outerHeight(true);
		_H.push(_boxH);
		_boxes.height(0);
	});
	 _li.mouseenter(function(){
		var _i = _li.index(jQuery(this));
		var _f = true;
		jQuery(this).addClass(h_class);
		var _box = jQuery(this).children('div.drop');
		
		if(_f){
			_box.animate({height:_H[_i]},  {queue:false, duration:_duration, easing:'easeOutBounce'});
			_f = false;
		}
		if(_t){
			_t = clearTimeout();
		}
	}).mouseleave(function(){
		jQuery(this).removeClass(h_class);
		var _box = jQuery(this).children('div.drop');
		_t = setTimeout(function(){
			_box.animate({height:0}, {duration:_duration, easing: 'easeOutBounce', complete:function(){
				_f = true;
			}});
		}, 30)
	});
}

jQuery(document).ready(function(){
	initHover();
});
jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	}
});
