// initPage
$(function(){
	initDrop();
});

// initDrop
function initDrop(){
	var speed = 200;
	var hoverClass = 'hover';
	$('#nav').each(function(){
		var wrapp = $(this);
		var elements = wrapp.find('>li');
		elements.each(function(){
			var element = $(this);
			var drop = element.find('.drop');
			if(drop.length){
				var slide = drop.find('>ul');
				var width = drop.show().outerWidth();
				drop.hide();
				element.hover(function(){
					element.addClass(hoverClass);
					drop.show();
					slide.css({marginLeft: -width}).stop().animate({marginLeft:0}, {duration:speed});
				}, function(){
					slide.stop().animate({marginLeft: -width}, {duration:speed, complete:function(){
drop.hide();
element.removeClass(hoverClass);
					}});
				})
			}
		});
	})
}

