jQuery.extend( jQuery.easing,
	{
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	}
});
function initHover(){
	var _t = false;
	var _H = [];
		var _duration = 700; //in ms
		var h_class = 'hover';
		var _li = $('#nav > li');
		_li.each(function(){
			var _boxes = $(this).children('.drop');
			var _boxH = _boxes.show().outerHeight(true);
			_H.push(_boxH);
			_boxes.height(0);
		});
		 _li.mouseenter(function(){
		 	var _i = _li.index($(this));
		 	var _f = true;
			$(this).addClass(h_class);
			var _box = $(this).children('.drop');
			
			if(_f){
				_box.animate({height:_H[_i]},  {queue:false, duration:_duration, easing: "easeInOutExpo"});
				_f = false;
			}
			if(_t){
				_t = clearTimeout();
			}
		}).mouseleave(function(){
			$(this).removeClass(h_class);
			var _box = $(this).children('.drop');
			_t = setTimeout(function(){
				_box.animate({height:0}, _duration, function(){
					_f = true;
				});
			}, 30)
		});
}
$(document).ready(function(){
	initHover();
});
