(function(a){a.fn.hoverIntent=function(b,c){var d={sensitivity:7,interval:100,timeout:0};d=a.extend(d,c?{over:b,out:c}:b);var e,f,g,h;var i=function(a){e=a.pageX;f=a.pageY};var j=function(b,c){c.hoverIntent_t=clearTimeout(c.hoverIntent_t);if(Math.abs(g-e)+Math.abs(h-f)<d.sensitivity){a(c).unbind("mousemove",i);c.hoverIntent_s=1;return d.over.apply(c,[b])}else{g=e;h=f;c.hoverIntent_t=setTimeout(function(){j(b,c)},d.interval)}};var k=function(a,b){b.hoverIntent_t=clearTimeout(b.hoverIntent_t);b.hoverIntent_s=0;return d.out.apply(b,[a])};var l=function(b){var c=(b.type=="mouseover"?b.fromElement:b.toElement)||b.relatedTarget;while(c&&c!=this){try{c=c.parentNode}catch(b){c=this}}if(c==this){return false}var e=jQuery.extend({},b);var f=this;if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(b.type=="mouseover"){g=e.pageX;h=e.pageY;a(f).bind("mousemove",i);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){j(e,f)},d.interval)}}else{a(f).unbind("mousemove",i);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){k(e,f)},d.timeout)}}};return this.mouseover(l).mouseout(l)}})(jQuery);(function(a){a.fn.dcVerticalMegaMenu=function(b){var c={classParent:"dc-mega",arrow:true,classArrow:"dc-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"};var b=a.extend(c,b);var d=this;return d.each(function(b){function h(){a(this).removeClass("mega-hover");var b=a(".sub-container",this);b.hide()}function g(){a(this).addClass("mega-hover");var b=a("> a",this);var d=a(".sub",this);var f=a(".sub-container",this);var g=f.width();var h=f.outerHeight();var i=f.height();var j=a(this).outerHeight(true);var k=b.offset();var l=a(window).scrollTop();var k=k.top-l;var m=a(window).height();var n=m-k;var o=n-h;if(o<0){var p=o-j;f.css({marginTop:p+"px"})}var q={right:e};if(c.direction=="right"){q={left:e}}if(c.effect=="fade"){f.css(q).fadeIn(c.speed)}if(c.effect=="show"){f.css(q).show()}if(c.effect=="slide"){f.css({width:0,height:0,opacity:0});if(c.direction=="right"){f.show().css({left:e})}else{f.show().css({right:e})}f.animate({width:g,height:i,opacity:1},c.speed)}}$mega=a(this);if(c.direction=="left"){$mega.addClass("left")}else{$mega.addClass("right")}var e=$mega.width();a("> li",$mega).each(function(){var b=a(this);var d=a("> ul",b);if(d.length>0){a("> a",b).addClass(c.classParent).append('<span class="'+c.classArrow+'"></span>');d.addClass(c.classSubMenu).wrap('<div class="'+c.classContainer+'" />');var e=a("."+c.classContainer,b);if(a("ul",d).length>0){b.addClass(c.classParent+"-li");e.addClass(c.classMega);a("> li",d).each(function(){a(this).addClass("mega-unit");if(a("> ul",this).length){a(this).addClass(c.classSubParent);a("> a",this).addClass(c.classSubParent+"-a")}else{a(this).addClass(c.classSubLink);a("> a",this).addClass(c.classSubLink+"-a")}});var f=a(".mega-unit",b);rowSize=parseInt(c.rowItems);for(var g=0;g<f.length;g+=rowSize){f.slice(g,g+rowSize).wrapAll('<div class="'+c.classRow+'" />')}var h=a(".mega-unit",d).outerWidth(true);var i=a(".row:eq(0) .mega-unit",d).length;var j=h*i;var k=j+n;a(".row",this).each(function(){a(".mega-unit:last",this).addClass("last");var b=undefined;a(".mega-unit > a",this).each(function(){var c=parseInt(a(this).height());if(b===undefined||b<c){b=c}});a(".mega-unit > a",this).css("height",b+"px");a(this).css("width",j+"px")});var l=d.outerWidth(true);var m=e.outerWidth(true);var n=m-l;a(".row",d).each(function(){var b=a(this).height();a(this).parent(".row").css("height",b+"px")});a(".row:last",d).addClass("last");a(".row:first",d).addClass("first")}else{e.addClass("non-"+c.classMega)}}var e=a("."+c.classContainer,b);var l=d.outerWidth(true);var o=e.height();var p=b.outerHeight(true);e.css({height:o+"px",marginTop:-p+"px",zIndex:"1000",width:l+"px"}).hide()});var f={sensitivity:2,interval:100,over:g,timeout:0,out:h};a("li",d).hoverIntent(f)})}})(jQuery)
