/* Copyright (C) YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */

(function(b){var a=function(){};a.prototype=b.extend(a.prototype,{name:"dropdownMenu",initialize:function(a,e){var e=b.extend({mode:"default",duration:600,transition:"easeOutExpo"},e),f={width:0,height:0};switch(e.mode){case "width":f={width:0};break;case "height":f={height:0}}a.find("li.parent").each(function(){var a=b(this),c=a.find("ul:first");if(c.length){var d={width:c.css("width"),height:c.css("height")};if(!b.browser.msie)f.opacity=0,d.opacity=c.css("opacity");c.css(f);a.bind({mouseenter:function(){var b=
a.parent();b.css("overflow")=="hidden"&&b.css("overflow","visible");c.css("overflow","hidden");c.animate(d,e.duration,e.transition)},mouseleave:function(){c.stop();c.css(f)}})}});if(e.fancy){var d=b.extend({mode:"move",transition:"easeOutExpo",duration:500,onEnter:null,onLeave:null},e.fancy),g=a.find("ul:first").append('<li class="fancy bg1"><div class="fancy-1"><div class="fancy-2"><div class="fancy-3"></div></div></div></li>').find(".fancy:first").hide(),h=a.find(".active:first"),j=null,k=function(a,
c,b){if(!c||!(j&&a.get(0)==j.get(0)))g.stop().show().css("visibility","visible"),b=b?0:d.duration,d.mode=="move"?!h.length&&!c?g.hide():g.animate({left:a.position().left+"px",width:a.outerWidth()+"px"},b,d.transition):c?g.css({opacity:h?0:1,left:a.position().left+"px",width:a.width()+"px"}).animate({opacity:1},b):g.animate({opacity:0},b),j=c?a:null};a.find("li.level1").each(function(a){var c=b(this);c.bind({mouseenter:function(){k(c,!0);if(d.onEnter)d.onEnter(c,a,g)},mouseleave:function(){k(h,!1);
if(d.onLeave)d.onLeave(c,a,g)}})});h.length&&d.mode=="move"&&k(h,!0,!0)}}});b.fn[a.prototype.name]=function(){var i=arguments,e=i[0]?i[0]:null;return this.each(function(){var f=b(this);if(a.prototype[e]&&f.data(a.prototype.name)&&e!="initialize")f.data(a.prototype.name)[e].apply(f.data(a.prototype.name),Array.prototype.slice.call(i,1));else if(!e||b.isPlainObject(e)){var d=new a;a.prototype.initialize&&d.initialize.apply(d,b.merge([f],i));f.data(a.prototype.name,d)}else b.error("Method "+e+" does not exist on jQuery."+
a.name)})}})(jQuery);

