!function(s){s.fn.dcVerticalMegaMenu=function(a){var t={classParent:"wf-mega",arrow:!0,classArrow:"wf-mega-icon",classContainer:"sub-container",classSubMenu:"sub",classMega:"mega",classSubParent:"mega-hdr",classSubLink:"mega-hdr",classRow:"row",rowItems:3,speed:"fast",effect:"show",direction:"right"},a=s.extend(t,a),e=this;return e.each(function(){function a(){s(this).addClass("mega-hover");var a=s("> a",this),e=(s(".sub",this),s(".sub-container",this)),i=e.width(),h=e.outerHeight(),n=e.height(),o=s(this).outerHeight(!0),l=a.offset(),c=s(window).scrollTop(),l=l.top-c,d=s(window).height(),g=d-l,u=g-h;if(0>u){var f=u-o;e.css({marginTop:f+"px"})}var w={right:r};"right"==t.direction&&(w={left:r}),"fade"==t.effect&&e.css(w).fadeIn(t.speed),"show"==t.effect&&e.css(w).show(),"slide"==t.effect&&(e.css({width:0,height:0,opacity:0}),e.show().css("right"==t.direction?{left:r}:{right:r}),e.animate({width:i,height:n,opacity:1},t.speed))}function i(){s(this).removeClass("mega-hover");var a=s(".sub-container",this);a.hide()}$mega=s(this),$mega.addClass("left"==t.direction?"left":"right");var r=$mega.width();s("> li",$mega).each(function(){var a=s(this),e=s("> ul",a);if(e.length>0){s("> a",a).addClass(t.classParent).append('<span class="'+t.classArrow+'"></span>'),e.addClass(t.classSubMenu).wrap('<div class="'+t.classContainer+'" />');var i=s("."+t.classContainer,a);if(s("ul",e).length>0){a.addClass(t.classParent+"-li"),i.addClass(t.classMega),s("> li",e).each(function(){s(this).addClass("mega-unit"),s("> ul",this).length?(s(this).addClass(t.classSubParent),s("> a",this).addClass(t.classSubParent+"-a")):(s(this).addClass(t.classSubLink),s("> a",this).addClass(t.classSubLink+"-a"))});var r=s(".mega-unit",a);rowSize=parseInt(t.rowItems);for(var h=0;h<r.length;h+=rowSize)r.slice(h,h+rowSize).wrapAll('<div class="'+t.classRow+'" />');var n=s(".mega-unit",e).outerWidth(!0),o=s(".row:eq(0) .mega-unit",e).length,l=n*o;s(".row",this).each(function(){s(".mega-unit:last",this).addClass("last");var a=void 0;s(".mega-unit > a",this).each(function(){var t=parseInt(s(this).height());(void 0===a||t>a)&&(a=t)}),s(".mega-unit > a",this).css("height",a+"px"),s(this).css("width",l+"px")});{var c=e.outerWidth(!0);i.outerWidth(!0)}s(".row",e).each(function(){var a=s(this).height();s(this).parent(".row").css("height",a+"px")}),s(".row:last",e).addClass("last"),s(".row:first",e).addClass("first")}else i.addClass("non-"+t.classMega)}var i=s("."+t.classContainer,a),c=e.outerWidth(!0),d=i.height(),g=a.outerHeight(!0);i.css({height:d+"px",marginTop:-g+"px",zIndex:"1000",width:c+"px"}).hide()});var h={sensitivity:2,interval:100,over:a,timeout:0,out:i};s("li",e).hoverIntent(h)})}}(jQuery);