// modern menu 3 // copyright (c) creativetier // contact@creativetier.com (function(e){function i(){t=e.support.transition;return this.each(s)}function s(){var t=e(this);var n=t.children("li");var r=n.find("li");var i=t.find(".mm-group li");n.each(function(){var n;if(t.hasclass("mm-vertical"))n="ver";else n="hor";o(e(this),n)});r.not(i).each(function(){o(e(this),"ver")});i.each(function(){o(e(this),"hor")})}function o(t,i){var s=t.children("a");var o=math.round(s.height());var a=math.round(s.width());s.css("height",o);var f=s.children("span");if(i=="ver")var l=f.width();var c=f.html();var h=s.wrapinner('
').children(".mm-container");h.prepend(''+c+"");var p=h.children(".mm-over");if(t.hasclass("mm-icon"))p.addclass(f.attr("class")+"-over");if(i=="ver"){h.css("width",2*a);h.children("span").css("width",l)}if(i=="hor")h.css("margin-top",-o);else h.addclass("mm-horizontal").css({"margin-left":-a});var d=t.children("ul");if(d.length){if(i=="hor")h.addclass("mm-drop");if(i=="hor"){f.wrapinner('
');p.wrapinner('
')}else{f.wrapinner('
');p.wrapinner('
')}}var v,m;t.hover(function(){if(i=="hor")v={"margin-top":0};else v={"margin-left":0};u(h,v,n,r);if(d.length){if(i=="hor")v={left:0};else v={left:a};d.css(v);if(i=="hor"){v={"margin-top":-30};m={"margin-top":0}}else{v={"margin-left":-30};m={"margin-left":0}}d.css(v);e.extend(m,{opacity:1});u(d,m,n,r)}},function(){if(i=="hor")v={"margin-top":-o};else v={"margin-left":-a};u(h,v,n,r);if(d.length)d.css({left:"-5000px",opacity:0})})}function u(e,n,r,i){e.stop();if(t)e.transition(n,r,i[0]);else e.animate(n,r,i[1])}var t;var n=200;var r=["in-out","swing"];e.fn.modernmenu=i;e.support.transition=function(){var e=document.body||document.documentelement,t=e.style,n=t.transition!==undefined||t.webkittransition!==undefined||t.moztransition!==undefined||t.mstransition!==undefined||t.otransition!==undefined;return n}()})(jquery)