$.extend(jQuery.easing,{easeOutBack:function(g,a,e,b,f,h){void 0==h&&(h=1.70158);return b*((a=a/f-1)*a*((h+1)*a+h)+1)+e},easeInQuad:function(g,a,e,b,f){return b*(a/=f)*a+e},easeInOutCirc:function(g,a,e,b,f){return 1>(a/=f/2)?-b/2*(Math.sqrt(1-a*a)-1)+e:b/2*(Math.sqrt(1-(a-=2)*a)+1)+e},easeInOutSine:function(g,a,e,b,f){return-b/2*(Math.cos(Math.PI*a/f)-1)+e}}); var ddmegamenu={startzindex:100,wrapperoffset:[10,25],ismobile:null!=navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i),init:function(g){function a(h){h.each(function(){var c=e(this),j=f.width(),d=e("#"+c.attr("rel").replace(/\[\w+\]/,""));/\[left\]/.test(c.attr("rel"));d.wrap('<div class="megawrapper" style="z-index:'+ddmegamenu.startzindex+';position:absolute;top:0;left:-100px;visibility:hidden"><div style="position:absolute;overflow:hidden;left:0;top:0;width:100%;height:100%;"></div></div>').css({visibility:"inherit", top:-d.outerHeight()}).data("timer",{});var i=d.closest("div.megawrapper").css({width:j,height:d.outerHeight()+ddmegamenu.wrapperoffset[1]}),j=c.closest("div.megawrapper");0<j.length?i.appendTo(j):(i.appendTo(document.body),d.data("istopmenu",!0));c.bind("click"==g.trigger?"click":"mouseenter",function(){clearTimeout(d.data("timer").hide);var a=c.parents("ul").offset();c.closest("li").addClass("megavisible");d.data("istopmenu")&&(h.removeClass("selected"),c.addClass("selected"));i.css({visibility:"visible", left:a.left,top:a.top+c.outerHeight(),zIndex:++ddmegamenu.startzindex});d.stop().animate({top:0},b.dur,b.easing);if("click"==g.trigger&&!ddmegamenu.ismobile)return!1});c.mouseleave(function(){d.data("timer").hide=setTimeout(function(){d.stop().animate({top:-d.outerHeight()},b.dur,function(){i.css({visibility:"hidden"})});c.removeClass("selected");c.closest("li").removeClass("megavisible");c.blur()},b.hidedelay)});c.click(function(){if(ddmegamenu.ismobile)return!1});i.mouseenter(function(){clearTimeout(d.data("timer").hide)}); i.bind("mouseleave click",function(a){d.data("timer").hide=setTimeout(function(){d.stop().animate({top:-d.outerHeight()},"click"==a.type?0:b.dur,function(){i.css({visibility:"hidden"})});c.removeClass("selected");c.closest("li").removeClass("megavisible");c.blur()},b.hidedelay)});a(d.find("a[rel]"))})}var e=jQuery,b=e.extend({fx:"slide",easing:"easeInOutSine",dur:"normal",hidedelay:200},g);if("none"==b.fx)b.dur=0;var f=e("#"+b.menuid);$anchors=f.attr("rel")?f:f.find("a[rel]");a($anchors)},docinit:function(g){jQuery(function(){ddmegamenu.init(g)})}};
