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

(function(e){e.fn.verticalDropdown=function(u){u=e.extend({mode:"default",duration:400},u);return this.each(function(){var p=e(this),j=!1,g=!1,k=p.find(".dropdown");"diagonal"==u.mode&&0!=k.length&&(e.support.transform?k.css({"transform-origin":"top "+(k.eq(0).offset().left>p.offset().left?"left":"right")+" 0"}):u.mode="fade");k.hide();p.bind("mouseleave",function(){j=setTimeout(function(){var e=p.find(".dropdown:visible");p.find(" > ul > li").removeClass("hover");e.css("opacity",0).hide();p.trigger("menu:leave");
g=j=!1},500)}).bind("mouseenter",function(){j&&clearTimeout(j)});p.menuAim({activate:function(l){if(!(j&&l==g)){p.find(".dropdown:visible").stop().hide();p.find(" > ul > li").removeClass("hover");var f=e(l),m=f.find(".dropdown");f.addClass("hover");switch(u.mode){case "fade":m.stop().show().animate({opacity:1},u.duration);break;case "diagonal":m.stop().css("transform","scale(0)").show().animate({transform:"scale(1)",opacity:1},u.duration);break;default:m.css("opacity",1).show()}p.trigger("menu:enter",
[e(l)]);g=l}},deactivate:function(j){j=e(j);var f=j.find(".dropdown");j.removeClass("hover");f.css("opacity",0).hide()},rowSelector:"> ul > li",submenuSelector:".parent",tolerance:100})})};e.fn.menuAim=function(u){var p=e(this),j=null,g=null,k=[],l=null,f=null,m=e.extend({rowSelector:"> li",submenuSelector:"*",dropdownSelector:".dropdown",tolerance:75,enter:e.noop,exit:e.noop,activate:e.noop,deactivate:e.noop},u),t=function(e){var d=A();d?f=setTimeout(function(){t(e)},d):e!=g&&(g&&m.deactivate(g),
m.activate(e),g=e)},A=function(){function f(a,b){return(b.y-a.y)/(b.x-a.x)}if(!g||!e(g).is(m.submenuSelector))return 0;j=e(g).find(m.dropdownSelector);var d=p.offset();p.outerWidth();var z=d.left+p.outerWidth(),b=d.top+p.outerHeight()+m.tolerance,a=j.offset(),h={x:a.left,y:a.top-m.tolerance},c={x:a.left,y:a.top+j.outerHeight()+m.tolerance},w=k[k.length-1],q=k[0];if(!w)return 0;q||(q=w);if(q.x<d.left||(q.x>z||q.y<d.top||q.y>b)||l&&w.x==l.x&&w.y==l.y)return 0;if(d.left>a.left){if(c={x:a.left+j.outerWidth(),
y:a.top-m.tolerance},z={x:a.left+j.outerWidth(),y:a.top+j.outerHeight()+m.tolerance},a=f(w,c),d=f(w,z),h=f(q,c),q=f(q,z),a>h&&d<q)return l=w,300}else if(a=f(w,h),d=f(w,c),h=f(q,h),q=f(q,c),a<h&&d>q)return l=w,300;l=null;return 0};p.mouseleave(function(){f&&clearTimeout(f);g=null}).find(m.rowSelector).mouseenter(function(){f&&clearTimeout(f);m.enter(this);t(this)}).mouseleave(function(){m.exit(this)});e(document).mousemove(function(e){k.push({x:e.pageX,y:e.pageY});3<k.length&&k.shift()});return this}})(jQuery);
(function(e){function u(d){d=d.split(")");for(var z=e.trim,b=d.length-1,a,h,c,f=1,q=0,m=0,p=1,g,k,r,l=0,s=0;b--;){a=d[b].split("(");h=z(a[0]);c=a[1];g=a=k=r=0;switch(h){case "translateX":l+=parseInt(c,10);continue;case "translateY":s+=parseInt(c,10);continue;case "translate":c=c.split(",");l+=parseInt(c[0],10);s+=parseInt(c[1]||0,10);continue;case "rotate":c=j(c);g=Math.cos(c);a=Math.sin(c);k=-Math.sin(c);r=Math.cos(c);break;case "scaleX":g=c;r=1;break;case "scaleY":g=1;r=c;break;case "scale":c=c.split(",");
g=c[0];r=1<c.length?c[1]:c[0];break;case "skewX":g=r=1;k=Math.tan(j(c));break;case "skewY":g=r=1;a=Math.tan(j(c));break;case "skew":g=r=1;c=c.split(",");k=Math.tan(j(c[0]));a=Math.tan(j(c[1]||0));break;case "matrix":c=c.split(","),g=+c[0],a=+c[1],k=+c[2],r=+c[3],l+=parseInt(c[4],10),s+=parseInt(c[5],10)}h=f*g+q*k;q=f*a+q*r;g=m*g+p*k;p=m*a+p*r;f=h;m=g}return[f,q,m,p,l,s]}function p(d){var e,b,a,h=d[0],c=d[1],f=d[2],g=d[3];h*g-c*f?(e=Math.sqrt(h*h+c*c),h/=e,c/=e,a=h*f+c*g,f-=h*a,g-=c*a,b=Math.sqrt(f*
f+g*g),a/=b,h*(g/b)<c*(f/b)&&(h=-h,c=-c,a=-a,e=-e)):rotate=e=b=a=0;return{translate:[+d[4],+d[5]],rotate:Math.atan2(c,h),scale:[e,b],skew:[a,0]}}function j(d){return~d.indexOf("deg")?parseInt(d,10)*(2*Math.PI/360):~d.indexOf("grad")?parseInt(d,10)*(Math.PI/200):parseFloat(d)}for(var g=document.createElement("div"),g=g.style,k=["OTransform","msTransform","WebkitTransform","MozTransform","transform"],l=k.length,f,m,t,A,y=/Matrix([^)]*)/;l--;)k[l]in g&&(e.support.transform=f=k[l]);f||(e.support.matrixFilter=
m=""===g.filter);g=g=null;e.cssNumber.transform=!0;f&&"transform"!=f?(e.cssProps.transform=f,"MozTransform"==f?t={get:function(d,g){return g?e.css(d,f).split("px").join(""):d.style[f]},set:function(d,e){d.style[f]=/matrix[^)p]*\)/.test(e)?e.replace(/matrix((?:[^,]*,){4})([^,]*),([^)]*)/,"matrix$1$2px,$3px"):e}}:/^1\.[0-5](?:\.|$)/.test(e.fn.jquery)&&(t={get:function(d,g){return g?e.css(d,f.replace(/^ms/,"Ms")):d.style[f]}})):m&&(t={get:function(d,e){var b=e&&d.currentStyle?d.currentStyle:d.style,
a;b&&y.test(b.filter)?(a=RegExp.$1.split(","),a=[a[0].split("=")[1],a[2].split("=")[1],a[1].split("=")[1],a[3].split("=")[1]]):a=[1,0,0,1];a[4]=b?b.left:0;a[5]=b?b.top:0;return"matrix("+a+")"},set:function(d,f,b){var a=d.style,g,c,j;b||(a.zoom=1);f=u(f);if(!b||b.M)if(c=["Matrix(M11="+f[0],"M12="+f[2],"M21="+f[1],"M22="+f[3],"SizingMethod='auto expand'"].join(),j=(g=d.currentStyle)&&g.filter||a.filter||"",a.filter=y.test(j)?j.replace(y,c):j+" progid:DXImageTransform.Microsoft."+c+")",centerOrigin=
e.transform.centerOrigin)a["margin"==centerOrigin?"marginLeft":"left"]=-(d.offsetWidth/2)+d.clientWidth/2+"px",a["margin"==centerOrigin?"marginTop":"top"]=-(d.offsetHeight/2)+d.clientHeight/2+"px";if(!b||b.T)a.left=f[4]+"px",a.top=f[5]+"px"}});t&&(e.cssHooks.transform=t);A=t&&t.get||e.css;e.fx.step.transform=function(d){var g=d.elem,b=d.start,a=d.end,h,c=d.pos,k,q,l,B,y=!1,C=!1,r;k=q=l=B="";if(!b||"string"===typeof b){b||(b=A(g,f));m&&(g.style.zoom=1);h=a.split(b);2==h.length&&(a=h.join(""),d.origin=
b,b="none");"none"==b?b={translate:[0,0],rotate:0,scale:[1,1],skew:[0,0]}:(b=/\(([^,]*),([^,]*),([^,]*),([^,]*),([^,p]*)(?:px)?,([^)p]*)(?:px)?/.exec(b),b=p([b[1],b[2],b[3],b[4],b[5],b[6]]));d.start=b;if(~a.indexOf("matrix"))a=p(u(a));else{a=a.split(")");h=[0,0];for(var D=0,s=[1,1],x=[0,0],E=a.length-1,F=e.trim,n,v;E--;)n=a[E].split("("),v=F(n[0]),n=n[1],"translateX"==v?h[0]+=parseInt(n,10):"translateY"==v?h[1]+=parseInt(n,10):"translate"==v?(n=n.split(","),h[0]+=parseInt(n[0],10),h[1]+=parseInt(n[1]||
0,10)):"rotate"==v?D+=j(n):"scaleX"==v?s[0]*=n:"scaleY"==v?s[1]*=n:"scale"==v?(n=n.split(","),s[0]*=n[0],s[1]*=1<n.length?n[1]:n[0]):"skewX"==v?x[0]+=j(n):"skewY"==v?x[1]+=j(n):"skew"==v&&(n=n.split(","),x[0]+=j(n[0]),x[1]+=j(n[1]||"0"));a={translate:h,rotate:D,scale:s,skew:x}}d.end=a;for(r in b)("rotate"==r?b[r]==a[r]:b[r][0]==a[r][0]&&b[r][1]==a[r][1])&&delete b[r]}b.translate&&(k=" translate("+(b.translate[0]+(a.translate[0]-b.translate[0])*c+0.5|0)+"px,"+(b.translate[1]+(a.translate[1]-b.translate[1])*
c+0.5|0)+"px)",y=!0);void 0!=b.rotate&&(q=" rotate("+(b.rotate+(a.rotate-b.rotate)*c)+"rad)",C=!0);b.scale&&(l=" scale("+(b.scale[0]+(a.scale[0]-b.scale[0])*c)+","+(b.scale[1]+(a.scale[1]-b.scale[1])*c)+")",C=!0);b.skew&&(B=" skew("+(b.skew[0]+(a.skew[0]-b.skew[0])*c)+"rad,"+(b.skew[1]+(a.skew[1]-b.skew[1])*c)+"rad)",C=!0);d=d.origin?d.origin+k+B+l+q:k+q+l+B;t&&t.set?t.set(g,d,{M:C,T:y}):g.style[f]=d};e.transform={centerOrigin:"margin"}})(jQuery);
