/* skel-layers.js v1.0.3 | (c) n33 | getskel.com | MIT licensed */ skel.registerPlugin("layers",function(e){function cn(e,r,i){var o,u;this.id=e,this.index=i,this[n]={breakpoints:x,states:x,position:x,side:x,animation:mt,orientation:mt,width:0,height:0,zIndex:this.index,html:"",hidden:H,exclusive:V,resetScroll:V,resetForms:V,swipeToHide:V,clickToHide:H},t._.extend(this[n],r),this[j]=t._.newDiv(this[n][jt]),this[j].id=e,this[j]._layer=this,this[s]=x,this[bt]=x,this[St]=x,this[z]=H,u=t._.newElement(this.id,this[j],ut,1),u.onAttach=function(){var e=this[$t]._layer;e[Z]()||e.init(),e.resume()},u.onDetach=function(){var e=this[$t]._layer;e.suspend()},this[n].states&&this[n].states!=t._.sd?(t._.cacheElement(u),o=t._[un](this[n].states),t._[Ht](o,function(e){t._.addCachedElementToState(o[e],u)})):this[n].breakpoints?(t._.cacheElement(u),o=t._[un](this[n].breakpoints),t._[Ht](o,function(e){t._.addCachedElementToBreakpoint(o[e],u)})):t._.attachElement(u)}var t,n="config",r="_skel_layers_translateOrigin",i="cache",s="$element",o="_skel_layers_translate",u="visibleWrapper",f="_skel_layers_resetForms",l="_skel_layers_resume",c="_skel_layers_promote",h="exclusiveLayer",p="_skel_layers_demote",d="moveToVisibleWrapper",v="setTimeout",m="moveToHiddenWrapper",g="right",y="bottom",b="position",w="useActive",E="width",S="css",x=null,T="center",N="_skel_layers_suspend",C="prototype",k="left",L="wrapper",A="skel-layers-layer-z-index",O="children",M="_skel_layers_init",_="skel-layers-moved",D="overflow-x",P="hiddenWrapper",H=!1,B="scrollTop",j="element",F=".skel-layers-fixed:not(.skel-layers-moved)",I="transform",q="top",R="height",U="length",z="visible",W="touchstart.lock click.lock scroll.lock",X='
1){for(t=0;t0&&(t[lt](),t[S](E,(t.data(Jt)+r)/12*100+"%"))},e.fn[Lt]=function(){return e(this).parents()[U]>0},e.fn[lt]=function(){var t=e(this);t[At]("class").match(/(\s+|^)([0-9]+)u(\s+|$)/)&&t.data(Jt,parseInt(RegExp.$2))},e.fn[c]=function(r){var i,s,o;if(this[U]>1){for(i=0;i-1*f&&t>l;break;case g:a=n-1*f&&t<-1*l;break;case q:a=t-1*f&&n>l;break;case y:a=t-1*f&&n<-1*l}if(a)return o[bt]=x,o[St]=x,o[It](),H}if(i[B]()==0&&n<0||u>s-2&&u0)return H}),this[s]=i},cn[C][Z]=function(){return this[s]!==x},cn[C][tn]=function(){return this[s].is(":visible")},cn[C][d]=function(){t[i][u][ht](this[s])},cn[C][m]=function(){if(!this[s][Lt]())return;t[i][P][ht](this[s])},cn[C].resume=function(r){if(!this[Z]())return;this[s][Ot](on).each(function(){t.parseResume(e(this))}),this[n][nt]||this[rn](r)},cn[C].suspend=function(){if(!this[Z]())return;this[s][r](),this[s][Ot](on).each(function(){t.parseSuspend(e(this))}),this[z]&&this[It]()},t={cache:{visibleWrapper:x,body:x,exclusiveLayer:x,html:x,htmlbody:x,hiddenWrapper:x,layers:{},window:x,wrapper:x},config:{baseZIndex:1e4,layers:{},speed:250,transform:V,transformBreakpoints:x,transformTest:x},eventType:"click touchend",show:function(e){t._[Pt](function(){t[i][ct][e][rn]()})},hide:function(e){t._[Pt](function(){t[i][ct][e][It]()})},toggle:function(e){t._[Pt](function(){var n=t[i][ct][e];n[tn]()?n[It]():n[rn]()})},getBaseFontSize:function(){return t._.vars.IEVersion<9?16.5:parseFloat(getComputedStyle(t[i][Qt].get(0)).fontSize)},getHalf:function(e){var t=parseInt(e);return typeof e=="string"&&e.charAt(e[U]-1)=="%"?Math.floor(t/2)+"%":Math.floor(t/2)+Gt},lockView:function(e){t[i][wt]._skel_layers_scrollPos=t[i][wt][B](),e==fn&&t[i][ln][S](D,nt),t[i][L].on(W,function(e){e[kt](),e[Et](),t[i][h]&&t[i][h][It]()}),t[i][wt].on(yt,function(e){t[i][h]&&t[i][h][It]()}),t._.vars.isMobile||window[v](function(){t[i][wt].on(pt,function(e){t[i][h]&&t[i][h][It]()})},t[n][dt]+50)},parseInit:function(n){var r,s,o=n.get(0),u=n[At]("data-action"),a=n[At]("data-args"),f,c;u&&a&&(a=a.split(","));switch(u){case"toggleLayer":case"layerToggle":n[S](Y,zt)[S]("cursor","pointer"),r=function(n){n[kt](),n[Et]();if(t[i][h])return t[i][h][It](),H;var r=e(this),s=t[i][ct][a[0]];s[tn]()?s[It]():s[rn]()},n.on(t.eventType,r);break;case"navList":f=e(an+a[0]),r=f[Ot]("a"),s=[],r.each(function(){var t=e(this),n,r;n=Math.max(0,t.parents("li")[U]-1),r=t[At]("href"),s.push(''+t.text()+"")}),s[U]>0&&n[jt]("");break;case"copyText":f=e(an+a[0]),n[jt](f.text());break;case"copyHTML":f=e(an+a[0]),n[jt](f[jt]());break;case"moveElementContents":f=e(an+a[0]),o[l]=function(){f[O]().each(function(){var t=e(this);n[ht](t),t[Dt](_)})},o[N]=function(){n[O]().each(function(){var n=e(this);f[ht](n),n[Xt](_),t.refresh(n)})},o[l]();break;case"moveElement":f=e(an+a[0]),o[l]=function(){e(X+f[At]("id")+'" />').insertBefore(f),n[ht](f),f[Dt](_)},o[N]=function(){e(at+f[At]("id")).replaceWith(f),f[Xt](_),t.refresh(f)},o[l]();break;case"moveCell":f=e(an+a[0]),c=e(an+a[1]),o[l]=function(){e(X+f[At]("id")+'" />').insertBefore(f),n[ht](f),f[S](E,Ft),c&&c[Ct]()},o[N]=function(){e(at+f[At]("id")).replaceWith(f),f[S](E,""),c&&c[S](E,"")},o[l]();break;default:}},parseResume:function(e){var t=e.get(0);t[l]&&t[l]()},parseSuspend:function(e){var t=e.get(0);t[N]&&t[N]()},recalc:function(e,n){var r=t._.parseMeasurement(e),i;switch(r[1]){case"%":i=Math.floor(n*(r[0]/100));break;case"em":i=t.getBaseFontSize()*r[0];break;default:case Gt:i=r[0]}return i},recalcH:function(n){return t.recalc(n,e(window)[R]())},recalcW:function(n){return t.recalc(n,e(window)[E]())},refresh:function(r){var s;t[n][I]&&(r?s=r.filter(F):s=e(F),s[M]()[Vt](t[i][u]))},unlockView:function(e){e==fn&&t[i][ln][S](D,z),t[i][L].off(W),t[i][wt].off(yt),t._.vars.isMobile||t[i][wt].off(pt)},init:function(){n in t[n]&&(t._.extend(t[n],t[n][n]),delete t[n][n]),t._[Ht](t[n],function(e){t[n][e]&&typeof t[n][e]==$t&&b in t[n][e]&&(t[n][ct][e]=t[n][e],delete t[n][e])}),t[n][sn]&&(t[n][I]=t[n][sn]());if(t[n][I]){if(t._.vars[Mt]=="android"&&t._.vars.deviceVersion<4||t._.vars[Mt]=="wp")t[n][I]=H;t._.vars.IEVersion<10&&(t[n][I]=H),t[n][Rt]&&!t._.hasActive(t._[un](t[n][Rt]))&&(t[n][I]=H)}t.initObjects(),t.initTransforms(),t._[Pt](function(){t.initLayers(),t.initIncludes(),t._.updateState(),t.refresh()})},initIncludes:function(){e(".skel-layers-include").each(function(){t.parseInit(e(this))})},initLayers:function(){var r,s,o,u=1;t._[Ht](t[n][ct],function(r){var s;if(!(b in t[n][ct][r]))return;if(!t[n][ct][r][jt]&&(s=e(an+r))[U]==0)return;o=new cn(r,t[n][ct][r],u++),t[i][ct][r]=o,s&&(s[O]()[Vt](o[j]),s.remove())})},initObjects:function(){t[i][wt]=e(window),t._[Pt](function(){t[i][jt]=e(jt),t[i][Qt]=e(Qt),t[i][ln]=e("html,body"),t[i][Qt].wrapInner('
'),t[i][L]=e("#skel-layers-wrapper"),t[i][L][S](b,nn)[S](k,"0")[S](g,"0")[S](q,"0")[M](),t[i][P]=e('
')[Vt](t[i][Qt]),t[i][P][S](R,"100%"),t[i][u]=e('
')[Vt](t[i][Qt]),t[i][u][S](b,nn),t._[vt](ut,t[i][P][0]),t._[vt]("skel_layers_visibleWrapper",t[i][u][0]),t._[vt]("skel_layers_wrapper",t[i][L][0]),e("[autofocus]").focus()})},initTransforms:function(){if(t[n][I])e.fn[r]=function(){return e(this)[o](0,0)},e.fn[o]=function(t,n){return e(this)[S](I,"translate("+t+"px, "+n+"px)")},e.fn[M]=function(){return e(this)[S]("backface-visibility",nt)[S]("perspective","500")[qt]("transition","transform "+t[n][dt]/1e3+"s ease-in-out")};else{var s,u=[];t[i][wt].resize(function(){if(t[n][dt]!=0){var e=t[n][dt];t[n][dt]=0,window[v](function(){t[n][dt]=e,u=[]},e)}}),e.fn[r]=function(){for(var r=0;r