(function($) {

	jQuery.extend( jQuery.easing,
	{
		easeMenu: function (x, t, b, c, d) {
			return c*((t=t/d-1)*t*t + 1) + b;
		}
	});

	$.fn.dropMenu = function(settings) {
		var config = {'speed': 300};
 
		if (settings) $.extend(config, settings);
		
		this.each(function() {		
			$(this).find('li').each(function() {
				if ($(this).children('ul').length > 0) {
					$(this).children('a').addClass('more');
				}
				
				if ($(this).position().left>550) {
					$(this).addClass('right');
				}
				
				$(this).hover(function() {
					$('#searchcriteria').blur();
					$(this).find('li a').stop().css({paddingTop:0, paddingBottom:0});
					$(this).addClass('hover');
					$(this).find('li a').animate({paddingTop:8, paddingBottom:8},{duration:config.speed, easing:'easeMenu'});
				}, function() {
					$(this).removeClass('hover');
				});
			});	
		});
		return this;
	};
 })(jQuery);

