File: //old_home_backup/climatecampscotland.org.uk/public_html/js/skel-layers.min.js
/* skel-layers.js v1.0 | (c) n33 | n33.co | MIT licensed */
skel.registerPlugin("layers",function(e){function vn(e,r,i){var s,u;this.id=e,this.index=i,this[n]={breakpoints:O,states:O,position:O,side:O,animation:Mt,orientation:Mt,width:0,height:0,zIndex:this.index,html:"",hidden:j,exclusive:Jt,resetScroll:Jt,resetForms:Jt,swipeToClose:Jt,clickToClose:j},t._.extend(this[n],r),this[ot]=t._.newDiv(this[n][fn]),this[ot].id=e,this[ot]._layer=this,this[o]=O,this[bt]=O,this[St]=O,this[Rt]=j,u=t._.cacheElement(this.id,this[ot],nt,1),u.onAttach=function(){var e=this[Wt]._layer;e[Y]()||e.init(),e.resume()},u.onDetach=function(){var e=this[Wt]._layer;e.suspend()},this[n].states&&this[n].states!=t._.sd?(s=t._[dn](this[n].states),t._[Lt](s,function(e){t._.addCachedElementToState(s[e],u)})):(this[n].breakpoints?s=t._[dn](this[n].breakpoints):s=t._.breakpointList,t._[Lt](s,function(e){t._.addCachedElementToBreakpoint(s[e],u)}))}var t,n="config",r="cache",i="_skel_layers_translateOrigin",s="_skel_layers_translate",o="$element",u="_skel_layers_resetForms",f="activeWrapper",l="exclusiveLayer",c="_skel_layers_resume",h="moveToInactiveWrapper",p="right",d="_skel_layers_promote",v="setTimeout",m="moveToActiveWrapper",g="_skel_layers_demote",y="bottom",b="position",w="useActive",E="deactivate",S="scrollTop",x="left",T="center",N="prototype",C="wrapper",k="_skel_layers_suspend",L="width",A="css",O=null,M="_skel_layers_init",_="skel-layers-moved",D="skel-layers-layer-z-index",P="children",H="inactiveWrapper",B="transform",j=!1,F=".skel-layers-fixed:not(.skel-layers-moved)",I="top",q="deviceType",R="length",U="height",z="touchstart.lock click.lock scroll.lock",W='<div id="skel-layers-placeholder-',X="stopPropagation",V="resetForms",$="preventDefault",J="window",K="overflow-x",Q="recalcW",G="padding-bottom",Y="isInitialized",Z="originalEvent",et="-webkit-tap-highlight-color",tt="hidden",nt="skel_layers_inactiveWrapper",rt="skel-layers-exclusiveActive",it="animation",st="skel-layers-layer-position",ot="element",ut="#skel-layers-placeholder-",at="animations",ft="unlockView",lt="-webkit-",ct="layers",ht="skel-layers-layer-index",pt="registerLocation",dt="resize.lock scroll.lock",vt="orientationchange.lock",mt="activate",gt="_skel_layers_initializeCell",yt="z-index",bt="touchPosX",wt="speed",Et="positions",St="touchPosY",xt="undefined",Tt="append",Nt="_skel_layers_expandCell",Ct="isTouch",kt="lockView",Lt="iterate",At="addClass",Ot="DOMReady",Mt="none",_t="_skel_layers_hasParent",Dt="auto",Pt="_skel_layers_scrollPos",Ht="-moz-",Bt="transformBreakpoints",jt="visible",Ft="rgba(0,0,0,0)",It="removeClass",qt="-ms-",Rt="active",Ut="vars",zt="appendTo",Wt="object",Xt="_skel_layers_xcss",Vt="body",$t="px",Jt=!0,Kt="click",Qt="-",Gt="cell-size",Yt="side",Zt="-o-",en="touches",tn="overflow-",nn="recalcH",rn="isVisible",sn="find",on="relative",un="transformTest",an="attr",fn="html",ln="htmlbody",cn="#",hn="*",pn="android",dn="getArray";return typeof e==xt?j:(e.fn[g]=function(){var t,n;if(this[R]>1){for(t=0;t<this[R];t++)e(this[t])[g]();return e(this)}return n=e(this),n[A](yt,n.data(D)).data(D,""),n},e.fn[Nt]=function(){var t=e(this),n=t.parent(),r=12;n[P]().each(function(){var t=e(this),n=t[an]("class");n&&n.match(/(\s+|^)([0-9]+)u(\s+|$)/)&&(r-=parseInt(RegExp.$2))}),r>0&&(t[gt](),t[A](L,(t.data(Gt)+r)/12*100+"%"))},e.fn[_t]=function(){return e(this).parents()[R]>0},e.fn[gt]=function(){var t=e(this);t[an]("class").match(/(\s+|^)([0-9]+)u(\s+|$)/)&&t.data(Gt,parseInt(RegExp.$2))},e.fn[d]=function(r){var i,s,o;if(this[R]>1){for(i=0;i<this[R];i++)e(this[i])[d](r);return e(this)}return s=e(this),isNaN(o=parseInt(s.data(ht)))&&(o=0),s.data(D,s[A](yt))[A](yt,t[n].baseZIndex+o+(r?r:1)),s},e.fn[u]=function(){var t=e(this);return e(this)[sn]("form").each(function(){this.reset()}),t},e.fn[Xt]=function(t,n){return e(this)[A](t,n)[A](Ht+t,Ht+n)[A](lt+t,lt+n)[A](Zt+t,Zt+n)[A](qt+t,qt+n)},e.fn._skel_layers_xcssProperty=function(t,n){return e(this)[A](t,n)[A](Ht+t,n)[A](lt+t,n)[A](Zt+t,n)[A](qt+t,n)},e.fn._skel_layers_xcssValue=function(t,n){return e(this)[A](t,n)[A](t,Ht+n)[A](t,lt+n)[A](t,Zt+n)[A](t,qt+n)},vn[N][at]={none:{activate:function(e){var t=e[n],r=e[o];r[S](0)[d](t.zIndex).show(),t[V]&&r[u](),e[m]()},deactivate:function(e){var t=e[n],r=e[o];r.hide()[g](),e[h]()}},overlayX:{activate:function(e){var r=e[n],i=e[o];i[S](0)[d](r.zIndex)[A](r[Yt],Qt+t[Q](t._[w](r[L]))+$t).show(),r[V]&&i[u](),t[kt]("x"),e[m](),window[v](function(){i[s]((r[Yt]==p?Qt:"")+t[Q](t._[w](r[L])),0)},50)},deactivate:function(e){var r=e[n],s=e[o];s[sn](hn).blur(),s[i](),window[v](function(){t[ft]("x"),e[h](),s[g]().hide()},t[n][wt]+50)}},overlayY:{activate:function(e){var r=e[n],i=e[o];i[S](0)[d](r.zIndex)[A](r[Yt],Qt+t[Q](t._[w](r[U]))+$t).show(),r[V]&&i[u](),t[kt]("y"),e[m](),window[v](function(){i[s](0,(r[Yt]==y?Qt:"")+t[Q](t._[w](r[U])))},50)},deactivate:function(e){var r=e[n],s=e[o];s[sn](hn).blur(),s[i](),window[v](function(){t[ft]("y"),e[h](),s[g]().hide()},t[n][wt]+50)}},pushX:{activate:function(e){var i=e[n],a=e[o],l=t[r][C].add(t[r][f][P]());a[S](0)[A](i[Yt],Qt+t[Q](t._[w](i[L]))+$t).show(),i[V]&&a[u](),l[d](),t[kt]("x"),e[m](),window[v](function(){a.add(l)[s]((i[Yt]==p?Qt:"")+t[Q](t._[w](i[L])),0)},50)},deactivate:function(e){var s=e[n],u=e[o],a=t[r][C].add(t[r][f][P]());u[sn](hn).blur(),u.add(a)[i](),window[v](function(){t[ft]("x"),u.hide(),e[h](),a[g]()},t[n][wt]+50)}},pushY:{activate:function(e){var i=e[n],a=e[o],l=t[r][C].add(t[r][f][P]());a[S](0)[A](i[Yt],Qt+t[nn](t._[w](i[U]))+$t).show(),i[V]&&a[u](),t[kt]("y"),e[m](),window[v](function(){a.add(l)[s](0,(i[Yt]==y?Qt:"")+t[nn](t._[w](i[U])))},50)},deactivate:function(e){var s=e[n],u=e[o],a=t[r][C].add(t[r][f][P]());u[sn](hn).blur(),u.add(a)[i](),window[v](function(){t[ft]("y"),u.hide(),e[h]()},t[n][wt]+50)}},revealX:{activate:function(e){var i=e[n],a=e[o],l=t[r][C].add(t[r][f][P]());a[S](0).show(),i[V]&&a[u](),l[d](),t[kt]("x"),e[m](),window[v](function(){l[s]((i[Yt]==p?Qt:"")+t[Q](t._[w](i[L])),0)},50)},deactivate:function(e){var s=e[n],u=e[o],a=t[r][C].add(t[r][f][P]());u[sn](hn).blur(),a[i](),window[v](function(){t[ft]("x"),u.hide(),a[g](),e[h]()},t[n][wt]+50)}}},vn[N][Et]={"top-left":{v:I,h:x,side:x},"top-right":{v:I,h:p,side:p},top:{v:I,h:T,side:I},"top-center":{v:I,h:T,side:I},"bottom-left":{v:y,h:x,side:x},"bottom-right":{v:y,h:p,side:p},bottom:{v:y,h:T,side:y},"bottom-center":{v:y,h:T,side:y},left:{v:T,h:x,side:x},"center-left":{v:T,h:x,side:x},right:{v:T,h:p,side:p},"center-right":{v:T,h:p,side:p}},vn[N][mt]=function(){var e,i,s,u;if(this[Rt]){t[r][f][Tt](this[ot]);return}e=this[n],i=t._[w](e[it]),s=this[o],s[A](L,t._[w](e[L]))[A](U,t._[w](e[U])),t._[Ut][q]=="ios"&&e[U]=="100%"&&!e[tt]&&s[A](U,"-webkit-calc("+t._[w](e[U])+" + 70px)"),u=this[Et][e[b]],s[At]("skel-layer-"+e[b]).data(st,e[b]);switch(u.v){case I:s[A](I,0);break;case y:s[A](y,0);break;case T:s[A](I,"50%")[A]("margin-top",Qt+t.getHalf(e[U]))}switch(u.h){case x:s[A](x,0);break;case p:s[A](p,0);break;case T:s[A](x,"50%")[A]("margin-left",Qt+t.getHalf(e[L]))}this[at][i][mt](this),e[tt]&&e.exclusive&&(t[r][Vt][At](rt),t[r][l]=this),this[Rt]=Jt},vn[N][E]=function(){var e,i;if(!this[Rt]){t[r][H][Tt](this[ot]);return}e=this[n],i=t._[w](e[it]),i in this[at]||(i=Mt),this[at][i][E](this),e[tt]&&e.exclusive&&t[r][l]===this&&(t[r][Vt][It](rt),t[r][l]=O),this[Rt]=j},vn[N].init=function(){var i=this[n],s=e(this[ot]),u=this;s[M](),s[sn](hn).each(function(){t.parseInit(e(this))}),s[At]("skel-layer").data(ht,this.index)[A](yt,t[n].baseZIndex)[A](b,"fixed")[A]("-ms-overflow-style","-ms-autohiding-scrollbar")[A]("-webkit-overflow-scrolling","touch").hide();switch(i.orientation){case"vertical":s[A]("overflow-y",Dt);break;case"horizontal":s[A](K,Dt);break;case Mt:default:}if(!i[b]||!(i[b]in this[Et]))i[b]="top-left";i[Yt]||(i[Yt]=this[Et][i[b]][Yt]);if(!i[it]||typeof i[it]!==Wt&&!(i[it]in this[at]))i[it]=Mt;i.clickToClose&&s[sn]("a")[A](et,Ft).on("click.skel-layers",function(r){var i,s,o=e(this);if(o.hasClass("skel-layers-ignore"))return;r[$](),r[X](),u[E]();if(o.hasClass("skel-layers-ignoreHref"))return;i=o[an]("href"),s=o[an]("target"),typeof i!==xt&&i!=""&&window[v](function(){s=="_blank"&&t._[Ut][q]!="wp"?window.open(i):window.location.href=i},t[n][wt]+10)}),t._[Ut][q]=="ios"&&s[sn]("input,select,textarea").on("focus",function(n){var i=e(this);n[$](),n[X](),window[v](function(){var e=t[r][J][Pt],n=t[r][J][S]()-e;t[r][J][S](e),s[S](s[S]()+n),i.hide(),window[v](function(){i.show()},0)},100)}),t._[Ut][Ct]&&s.on("touchstart",function(e){u[bt]=e[Z][en][0].pageX,u[St]=e[Z][en][0].pageY}).on("touchmove",function(e){var t,n,r,o,a,f,l;if(u[bt]===O||u[St]===O)return;t=u[bt]-e[Z][en][0].pageX,n=u[St]-e[Z][en][0].pageY,r=s.outerHeight(),o=s.get(0).scrollHeight-s[S]();if(i[tt]&&i.swipeToClose){a=j,f=20,l=50;switch(i[Yt]){case x:a=n<f&&n>-1*f&&t>l;break;case p:a=n<f&&n>-1*f&&t<-1*l;break;case I:a=t<f&&t>-1*f&&n>l;break;case y:a=t<f&&t>-1*f&&n<-1*l}if(a)return u[bt]=O,u[St]=O,u[E](),j}if(s[S]()==0&&n<0||o>r-2&&o<r+2&&n>0)return j}),this[o]=s},vn[N][Y]=function(){return this[o]!==O},vn[N][rn]=function(){return this[o].is(":visible")},vn[N][m]=function(){t[r][f][Tt](this[o])},vn[N][h]=function(){if(!this[o][_t]())return;t[r][H][Tt](this[o])},vn[N].resume=function(r){if(!this[Y]())return;this[o][sn](hn).each(function(){t.parseResume(e(this))}),this[n][tt]||this[mt](r)},vn[N].suspend=function(){if(!this[Y]())return;this[o][i](),this[o][sn](hn).each(function(){t.parseSuspend(e(this))}),this[Rt]&&this[E]()},t={cache:{activeWrapper:O,body:O,exclusiveLayer:O,html:O,htmlbody:O,inactiveWrapper:O,layers:{},window:O,wrapper:O},config:{baseZIndex:1e4,layers:{},speed:250,transform:Jt,transformBreakpoints:O,transformTest:O},eventType:Kt,activate:function(e){t._[Ot](function(){t[r][ct][e][mt]()})},deactivate:function(e){t._[Ot](function(){t[r][ct][e][E]()})},toggle:function(e){t._[Ot](function(){var n=t[r][ct][e];n[rn]()?n[E]():n[mt]()})},getBaseFontSize:function(){return t._[Ut].IEVersion<9?16.5:parseFloat(getComputedStyle(t[r][Vt].get(0)).fontSize)},getHalf:function(e){var t=parseInt(e);return typeof e=="string"&&e.charAt(e[R]-1)=="%"?Math.floor(t/2)+"%":Math.floor(t/2)+$t},lockView:function(e){t[r][J][Pt]=t[r][J][S](),t._[Ut][Ct]&&t[r][ln][A](tn+e,tt),t[r][C].on(z,function(e){e[$](),e[X](),t[r][l]&&t[r][l][E]()}),t[r][J].on(vt,function(e){t[r][l]&&t[r][l][E]()}),t._[Ut][Ct]||t[r][J].on(dt,function(e){t[r][l]&&t[r][l][E]()})},parseInit:function(n){var i,s,o=n.get(0),u=n[an]("data-action"),a=n[an]("data-args"),f,h;u&&a&&(a=a.split(","));switch(u){case"toggleLayer":case"layerToggle":n[A](et,Ft)[A]("cursor","pointer"),i=function(n){n[$](),n[X]();if(t[r][l])return t[r][l][E](),j;var i=e(this),s=t[r][ct][a[0]];s[rn]()?s[E]():s[mt]()},t._[Ut][q]==pn||t._[Ut][q]=="wp"?n.on(Kt,i):n.on(t.eventType,i);break;case"navList":f=e(cn+a[0]),i=f[sn]("a"),s=[],i.each(function(){var t=e(this),n,r;n=Math.max(0,t.parents("li")[R]-1),r=t[an]("href"),s.push('<a class="link depth-'+n+'"'+(typeof r!==xt&&r!=""?' href="'+r+'"':"")+'><span class="indent-'+n+'"></span>'+t.text()+"</a>")}),s[R]>0&&n[fn]("<nav>"+s.join("")+"</nav>");break;case"copyText":f=e(cn+a[0]),n[fn](f.text());break;case"copyHTML":f=e(cn+a[0]),n[fn](f[fn]());break;case"moveElementContents":f=e(cn+a[0]),o[c]=function(){f[P]().each(function(){var t=e(this);n[Tt](t),t[At](_)})},o[k]=function(){n[P]().each(function(){var n=e(this);f[Tt](n),n[It](_),t.refresh(n)})},o[c]();break;case"moveElement":f=e(cn+a[0]),o[c]=function(){e(W+f[an]("id")+'" />').insertBefore(f),n[Tt](f),f[At](_)},o[k]=function(){e(ut+f[an]("id")).replaceWith(f),f[It](_),t.refresh(f)},o[c]();break;case"moveCell":f=e(cn+a[0]),h=e(cn+a[1]),o[c]=function(){e(W+f[an]("id")+'" />').insertBefore(f),n[Tt](f),f[A](L,Dt),h&&h[Nt]()},o[k]=function(){e(ut+f[an]("id")).replaceWith(f),f[A](L,""),h&&h[A](L,"")},o[c]();break;default:}},parseResume:function(e){var t=e.get(0);t[c]&&t[c]()},parseSuspend:function(e){var t=e.get(0);t[k]&&t[k]()},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 $t:i=r[0]}return i},recalcH:function(n){return t.recalc(n,e(window)[U]())},recalcW:function(n){return t.recalc(n,e(window)[L]())},refresh:function(i){var s;t[n][B]&&(i?s=i.filter(F):s=e(F),s[M]()[zt](t[r][f]))},unlockView:function(e){t._[Ut][Ct]&&t[r][ln][A](tn+e,jt),t[r][C].off(z),t[r][J].off(vt),t._[Ut][Ct]||t[r][J].off(dt)},init:function(){n in t[n]&&(t._.extend(t[n],t[n][n]),delete t[n][n]),t._[Lt](t[n],function(e){t[n][e]&&typeof t[n][e]==Wt&&b in t[n][e]&&(t[n][ct][e]=t[n][e],delete t[n][e])}),t[n][un]&&(t[n][B]=t[n][un]());if(t[n][B]){if(t._[Ut][q]==pn&&t._[Ut].deviceVersion<4||t._[Ut][q]=="wp")t[n][B]=j;t._[Ut].IEVersion<10&&(t[n][B]=j),t[n][Bt]&&!t._.hasActive(t._[dn](t[n][Bt]))&&(t[n][B]=j)}t.eventType=t._[Ut][Ct]?"touchend":Kt,t.initObjects(),t.initTransforms(),t._[Ot](function(){t.initLayers(),t.initIncludes(),t._.updateState(),t.refresh()})},initIncludes:function(){e(".skel-layers-include").each(function(){t.parseInit(e(this))})},initLayers:function(){var i,s,o,u=1;t._[Lt](t[n][ct],function(i){var s;if(!(b in t[n][ct][i]))return;if(!t[n][ct][i][fn]&&(s=e(cn+i))[R]==0)return;o=new vn(i,t[n][ct][i],u++),t[r][ct][i]=o,s&&(s[P]()[zt](o[ot]),s.remove())})},initObjects:function(){t[r][J]=e(window),t._[Ot](function(){t[r][fn]=e(fn),t[r][Vt]=e(Vt),t[r][ln]=e("html,body"),t[r][Vt].wrapInner('<div id="skel-layers-wrapper" />'),t[r][C]=e("#skel-layers-wrapper"),t[r][C][A](b,on)[A](x,"0")[A](p,"0")[A](I,"0")[M](),t[r][H]=e('<div id="skel-layers-inactiveWrapper" />')[zt](t[r][Vt]),t[r][H][A](U,"100%"),t[r][f]=e('<div id="skel-layers-activeWrapper" />')[zt](t[r][Vt]),t[r][f][A](b,on),t._[pt](nt,t[r][H][0]),t._[pt]("skel_layers_activeWrapper",t[r][f][0]),t._[pt]("skel_layers_wrapper",t[r][C][0]),e("[autofocus]").focus()})},initTransforms:function(){if(t[n][B])e.fn[i]=function(){return e(this)[s](0,0)},e.fn[s]=function(t,n){return e(this)[A](B,"translate("+t+"px, "+n+"px)")},e.fn[M]=function(){return e(this)[A]("backface-visibility",tt)[A]("perspective","500")[Xt]("transition","transform "+t[n][wt]/1e3+"s ease-in-out")};else{var o,u=[];t[r][J].resize(function(){if(t[n][wt]!=0){var e=t[n][wt];t[n][wt]=0,window[v](function(){t[n][wt]=e,u=[]},e)}}),e.fn[i]=function(){for(var i=0;i<this[R];i++){var s=this[i],o=e(s);u[s.id]&&o.animate(u[s.id],t[n][wt],"swing",function(){t._[Lt](u[s.id],function(e){o[A](e,u[s.id][e])}),t[r][Vt][A](K,jt),t[r][C][A](L,Dt)[A](G,0)})}return e(this)},e.fn[s]=function(i,s){var o,f,l,c;i=parseInt(i),s=parseInt(s),i!=0?(t[r][Vt][A](K,tt),t[r][C][A](L,t[r][J][L]())):l=function(){t[r][Vt][A](K,jt),t[r][C][A](L,Dt)},s<0?t[r][C][A](G,Math.abs(s)):c=function(){t[r][C][A](G,0)};for(o=0;o<this[R];o++){var h=this[o],d=e(h),v;if(!u[h.id])if(v=vn[N][Et][d.data(st)]){u[h.id]={};switch(v.v){case T:case I:u[h.id][I]=parseInt(d[A](I));break;case y:u[h.id][y]=parseInt(d[A](y))}switch(v.h){case T:case x:u[h.id][x]=parseInt(d[A](x));break;case p:u[h.id][p]=parseInt(d[A](p))}}else v=d[b](),u[h.id]={top:v[I],left:v[x]};a={},t._[Lt](u[h.id],function(e){var n;switch(e){case I:n=t[nn](u[h.id][e])+s;break;case y:n=t[nn](u[h.id][e])-s;break;case x:n=t[Q](u[h.id][e])+i;break;case p:n=t[Q](u[h.id][e])-i}a[e]=n}),d.animate(a,t[n][wt],"swing",function(){l&&l(),c&&c()})}return e(this)},e.fn[M]=function(){return e(this)[A](b,"absolute")}}}},t)}(jQuery));