/*
jquery.animate-enhanced plugin v0.96a
---
http://github.com/benbarnett/jQuery-Animate-Enhanced
http://benbarnett.net
@benpbarnett
*/
(function(b,H,I){function M(a,b,j,l,k,d,c,n,p){var o=!1,c=!0===c&&!0===n,b=b||{};b.original||(b.original={},o=!0);b.properties=b.properties||{};b.secondary=b.secondary||{};for(var n=b.meta,m=b.original,g=b.properties,N=b.secondary,A=q.length-1;0<=A;A--){var C=q[A]+"transition-property",D=q[A]+"transition-duration",e=q[A]+"transition-timing-function",j=c?q[A]+"transform":j;o&&(m[C]=a.css(C)||"",m[D]=a.css(D)||"",m[e]=a.css(e)||"");N[j]=c?(!0===p||!0===x&&!1!==p)&&J?"translate3d("+n.left+"px, "+n.top+
"px, 0)":"translate("+n.left+"px,"+n.top+"px)":d;g[C]=(g[C]?g[C]+",":"")+j;g[D]=(g[D]?g[D]+",":"")+l+"ms";g[e]=(g[e]?g[e]+",":"")+k}return b}function y(a){for(var b in a)return!1;return!0}function F(a){return parseFloat(a.replace(a.match(/\D+$/),""))}var O="top right bottom left opacity height width".split(" "),G=["top","right","bottom","left"],q=["-webkit-","-moz-","-o-",""],P=["avoidTransforms","useTranslate3d","leaveTransforms"],Q=/^([+-]=)?([\d+-.]+)(.*)$/,R=/([A-Z])/g,S={secondary:{},meta:{top:0,
right:0,bottom:0,left:0}},K=null,E=!1,z=(document.body||document.documentElement).style,L=void 0!==z.WebkitTransition||void 0!==z.MozTransition||void 0!==z.OTransition||void 0!==z.transition,J="WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix,x=J;b.expr&&b.expr.filters&&(K=b.expr.filters.animated,b.expr.filters.animated=function(a){return b(a).data("events")&&b(a).data("events")["webkitTransitionEnd oTransitionEnd transitionend"]?!0:K.call(this,a)});b.extend({toggle3DByDefault:function(){return x=
!x},toggleDisabledByDefault:function(){return E=!E}});b.fn.translation=function(){if(!this[0])return null;var a=window.getComputedStyle(this[0],null),b={x:0,y:0};if(a)for(var j=q.length-1;j>=0;j--){var l=a.getPropertyValue(q[j]+"transform");if(l&&/matrix/i.test(l)){a=l.replace(/^matrix\(/i,"").split(/, |\)$/g);b={x:parseInt(a[4],10),y:parseInt(a[5],10)};break}}return b};b.fn.animate=function(a,u,j,l){var a=a||{},k=!(typeof a.bottom!=="undefined"||typeof a.right!=="undefined"),d=b.speed(u,j,l),c=this,
n=0,p=function(){n--;n===0&&typeof d.complete==="function"&&d.complete.apply(c,arguments)},o;if(!(o=(typeof a.avoidCSSTransitions!=="undefined"?a.avoidCSSTransitions:E)===true))if(!(o=!L))if(!(o=y(a))){var m;a:{for(m in a)if((m=="width"||m=="height")&&(a[m]=="show"||a[m]=="hide"||a[m]=="toggle")){m=true;break a}m=false}o=m||d.duration<=0||b.fn.animate.defaults.avoidTransforms===true&&a.avoidTransforms!==false}return o?H.apply(this,arguments):this[d.queue===true?"queue":"each"](function(){var g=b(this),
c=b.extend({},d),l=function(c){var f=g.data("jQe")||{original:{}},e={};if(c.eventPhase==2){if(a.leaveTransforms!==true){for(c=q.length-1;c>=0;c--)e[q[c]+"transform"]="";if(k&&typeof f.meta!=="undefined")for(var c=0,d;d=G[c];++c){e[d]=f.meta[d+"_o"]+"px";b(this).css(d,e[d])}}g.unbind("webkitTransitionEnd oTransitionEnd transitionend").css(f.original).css(e).data("jQe",null);a.opacity==="hide"&&g.css({display:"none",opacity:""});p.call(this)}},j={bounce:"cubic-bezier(0.0, 0.35, .5, 1.3)",linear:"linear",
swing:"ease-in-out",easeInQuad:"cubic-bezier(0.550, 0.085, 0.680, 0.530)",easeInCubic:"cubic-bezier(0.550, 0.055, 0.675, 0.190)",easeInQuart:"cubic-bezier(0.895, 0.030, 0.685, 0.220)",easeInQuint:"cubic-bezier(0.755, 0.050, 0.855, 0.060)",easeInSine:"cubic-bezier(0.470, 0.000, 0.745, 0.715)",easeInExpo:"cubic-bezier(0.950, 0.050, 0.795, 0.035)",easeInCirc:"cubic-bezier(0.600, 0.040, 0.980, 0.335)",easeInBack:"cubic-bezier(0.600, -0.280, 0.735, 0.045)",easeOutQuad:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",
easeOutCubic:"cubic-bezier(0.215, 0.610, 0.355, 1.000)",easeOutQuart:"cubic-bezier(0.165, 0.840, 0.440, 1.000)",easeOutQuint:"cubic-bezier(0.230, 1.000, 0.320, 1.000)",easeOutSine:"cubic-bezier(0.390, 0.575, 0.565, 1.000)",easeOutExpo:"cubic-bezier(0.190, 1.000, 0.220, 1.000)",easeOutCirc:"cubic-bezier(0.075, 0.820, 0.165, 1.000)",easeOutBack:"cubic-bezier(0.175, 0.885, 0.320, 1.275)",easeInOutQuad:"cubic-bezier(0.455, 0.030, 0.515, 0.955)",easeInOutCubic:"cubic-bezier(0.645, 0.045, 0.355, 1.000)",
easeInOutQuart:"cubic-bezier(0.770, 0.000, 0.175, 1.000)",easeInOutQuint:"cubic-bezier(0.860, 0.000, 0.070, 1.000)",easeInOutSine:"cubic-bezier(0.445, 0.050, 0.550, 0.950)",easeInOutExpo:"cubic-bezier(1.000, 0.000, 0.000, 1.000)",easeInOutCirc:"cubic-bezier(0.785, 0.135, 0.150, 0.860)",easeInOutBack:"cubic-bezier(0.680, -0.550, 0.265, 1.550)"},m={},j=j[c.easing||"swing"]?j[c.easing||"swing"]:c.easing||"swing",e;for(e in a)if(b.inArray(e,P)===-1){var o=b.inArray(e,G)>-1,h;var i=g,v=a[e],s=e,r=o&&a.avoidTransforms!==
true;if(s=="d")h=void 0;else{var f=Q.exec(v);h=i.css(s)==="auto"?0:i.css(s);h=typeof h=="string"?F(h):h;typeof v=="string"&&F(v);var r=r===true?0:h,u=i.is(":hidden"),t=i.translation();s=="left"&&(r=parseInt(h,10)+t.x);s=="right"&&(r=parseInt(h,10)+t.x);s=="top"&&(r=parseInt(h,10)+t.y);s=="bottom"&&(r=parseInt(h,10)+t.y);if(!f&&v=="show"){r=1;u&&i.css({display:"block",opacity:0})}else!f&&v=="hide"&&(r=0);if(f){i=parseFloat(f[2]);f[1]&&(i=(f[1]==="-="?-1:1)*i+parseInt(r,10));h=i}else h=r}if(f=a.avoidTransforms!==
true){f=e;i=h;v=g;s=b.inArray(f,O)>-1;if((f=="width"||f=="height"||f=="opacity")&&parseFloat(i)===parseFloat(v.css(f)))s=false;f=s}if(f){f=g;i=e;v=c.duration;s=j;h=o&&a.avoidTransforms===true?h+"px":h;var o=o&&a.avoidTransforms!==true,r=k,u=a.useTranslate3d===true,t=(t=f.data("jQe"))&&!y(t)?t:b.extend(true,{},S),w=h;if(b.inArray(i,G)>-1){var B=t.meta,z=F(f.css(i))||0,x=i+"_o",w=h-z;B[i]=w;B[x]=f.css(i)=="auto"?0+w:z+w||0;t.meta=B;if(r&&w===0){w=0-B[x];B[i]=w;B[x]=0}}f.data("jQe",M(f,t,i,v,s,w,o,r,
u))}else m[e]=a[e]}g.unbind("webkitTransitionEnd oTransitionEnd transitionend");if((e=g.data("jQe"))&&!y(e)&&!y(e.secondary)){n++;g.css(e.properties);var E=e.secondary;setTimeout(function(){g.one("webkitTransitionEnd oTransitionEnd transitionend",l).css(E)})}else c.queue=false;if(!y(m)){n++;H.apply(g,[m,{duration:c.duration,easing:b.easing[c.easing]?c.easing:b.easing.swing?"swing":"linear",complete:p,queue:c.queue}])}return true})};b.fn.animate.defaults={};b.fn.stop=function(a,u,j){if(!L)return I.apply(this,
[a,u]);a&&this.queue([]);this.each(function(){var l=b(this),k=l.data("jQe");if(k&&!y(k)){var d,c={};if(u){c=k.secondary;if(!j&&typeof k.meta.left_o!==void 0||typeof k.meta.top_o!==void 0){c.left=typeof k.meta.left_o!==void 0?k.meta.left_o:"auto";c.top=typeof k.meta.top_o!==void 0?k.meta.top_o:"auto";for(d=q.length-1;d>=0;d--)c[q[d]+"transform"]=""}}else if(!y(k.secondary)){var n=window.getComputedStyle(l[0],null);if(n)for(var p in k.secondary)if(k.secondary.hasOwnProperty(p)){p=p.replace(R,"-$1").toLowerCase();
c[p]=n.getPropertyValue(p);if(!j&&/matrix/i.test(c[p])){d=c[p].replace(/^matrix\(/i,"").split(/, |\)$/g);c.left=parseFloat(d[4])+parseFloat(l.css("left"))+"px"||"auto";c.top=parseFloat(d[5])+parseFloat(l.css("top"))+"px"||"auto";for(d=q.length-1;d>=0;d--)c[q[d]+"transform"]=""}}}l.unbind("webkitTransitionEnd oTransitionEnd transitionend");l.css(k.original).css(c).data("jQe",null)}else I.apply(l,[a,u])});return this}})(jQuery,jQuery.fn.animate,jQuery.fn.stop);