(function($) {

	$.extend( $.easing,
	{
		uberEase: function (x, t, b, c, d) {
			return -c *(t/=d)*(t-2) + b;
		}
	});

	$.fn.uberSlide = function(settings) {
		var config = {'speed': 200, 'pathToOgg':'', 'pathToMP3':''};
 
		if (settings) $.extend(config, settings);
		
		$(this).children('li').each(function() {
			if ($(this).find('ul').length>0) {
				$(this).addClass('more');
			}
	
			if (config.pathToOgg!='' & config.pathToMP3!="") {
				$('body').append("<audio class='menuaudio' preload='auto'><source src='"+config.pathToOgg+"' type='audio/ogg' /><source src='"+config.pathToMP3+"' type='audio/mpeg' /></audio>");
			}			
		});
			
		$(this).children('li').hover(function() {
			var newtop;
			if ($(this).find('p').length>0)
			{				
				newtop=$(this).find('p').height()+209;
			} else {
				newtop=199;
			}
			$(this).find('ul').css({'top': -newtop+10});
			$(this).addClass('hover');
			$(this).find('ul').stop().animate({'top':-newtop},{duration:config.speed, 'easing':'uberEase'});

			if (audio.length > 0) {
				try {
					if (!!(audio.get($(this).index()).canPlayType)) {
						audio.get($(this).index()).pause();
						audio.get($(this).index()).currentTime=0;
						audio.get($(this).index()).play();
					}
				} 
				catch (ex) {}
			}
		}, function() {
			$(this).removeClass('hover');
		});			
		
		var audio=$('.menuaudio');	
		
		return this;
	};
 })(jQuery);

