(function($) {

jQuery.extend( jQuery.easing,
{
	easeSuperMenu: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	}
});


	$.fn.superMenu = function(settings) {
		var config = {'speed': 400};
 
		if (settings) $.extend(config, settings);
		
		this.each(function() {		
			$(this).find('li').each(function() {				
				$(this).hover(function() {
					$(this).addClass('hover').find('.navbox').css({'paddingTop':0}).animate({'paddingTop':10},{'duration': config.speed, 'easing':'easeSuperMenu'});
					if (menuAudio.length > 0) {
						try {
							if (!!(menuAudio.get($(this).index()).canPlayType)) {
								menuAudio.get($(this).index()).pause();
								menuAudio.get($(this).index()).currentTime = 0;
								menuAudio.get($(this).index()).play();
							}
						}
						catch (ex) {}
					}
				}, function() {
					$(this).removeClass('hover');
				});
				if (config.menuOgg!='' & config.menuMP3!="") {
					$('body').append("<audio class='menuaudio' preload='auto'><source src='"+config.menuOgg+"' type='audio/ogg' /><source src='"+config.menuMP3+"' type='audio/mpeg' /></audio>");
				}
			});
		});
		
		var menuAudio=$('.menuaudio');	
		
		return this;
	};
 })(jQuery);

