/*! LAB.js (LABjs :: Loading And Blocking JavaScript)
    v1.1.11 (c) Kyle Simpson
    MIT License
*/
(function(p){var q="string",w="head",I="body",J="script",t="readyState",j="preloaddone",x="loadtrigger",K="srcuri",D="preload",Z="complete",y="done",z="which",L="preserve",E="onreadystatechange",ba="onload",M="hasOwnProperty",bb="script/cache",N="[object ",bw=N+"Function]",bx=N+"Array]",e=null,h=true,i=false,k=p.document,by=p.location,bc=p.ActiveXObject,A=p.setTimeout,bd=p.clearTimeout,O=function(a){return k.getElementsByTagName(a)},P=Object.prototype.toString,Q=function(){},r={},R={},be=/^[^?#]*\//.exec(by.href)[0],bf=/^\w+\:\/\/\/?[^\/]+/.exec(be)[0],bz=O(J),bg=p.opera&&P.call(p.opera)==N+"Opera]",bh=("MozAppearance"in k.documentElement.style),bi=(k.createElement(J).async===true),u={cache:!(bh||bg),order:bh||bg||bi,xhr:h,dupe:h,base:"",which:w};u[L]=i;u[D]=h;r[w]=k.head||O(w);r[I]=O(I);function B(a){return P.call(a)===bw}function S(a,b){var c=/^\w+\:\/\//,d;if(typeof a!=q)a="";if(typeof b!=q)b="";d=(c.test(a)?"":b)+a;return((c.test(d)?"":(d.charAt(0)==="/"?bf:be))+d)}function bA(a){return(S(a).indexOf(bf)===0)}function bB(a){var b,c=-1;while(b=bz[++c]){if(typeof b.src==q&&a===S(b.src)&&b.type!==bb)return h}return i}function F(v,l){v=!(!v);if(l==e)l=u;var bj=i,C=v&&l[D],bk=C&&l.cache,G=C&&l.order,bl=C&&l.xhr,bC=l[L],bD=l.which,bE=l.base,bm=Q,T=i,H,s=h,m={},U=[],V=e;C=bk||bl||G;function bn(a,b){if((a[t]&&a[t]!==Z&&a[t]!=="loaded")||b[y]){return i}a[ba]=a[E]=e;return h}function W(a,b,c){c=!(!c);if(!c&&!(bn(a,b)))return;b[y]=h;for(var d in m){if(m[M](d)&&!(m[d][y]))return}bj=h;bm()}function bo(a){if(B(a[x])){a[x]();a[x]=e}}function bF(a,b){if(!bn(a,b))return;b[j]=h;A(function(){r[b[z]].removeChild(a);bo(b)},0)}function bG(a,b){if(a[t]===4){a[E]=Q;b[j]=h;A(function(){bo(b)},0)}}function X(b,c,d,g,f,n){var o=b[z];A(function(){if("item"in r[o]){if(!r[o][0]){A(arguments.callee,25);return}r[o]=r[o][0]}var a=k.createElement(J);if(typeof d==q)a.type=d;if(typeof g==q)a.charset=g;if(B(f)){a[ba]=a[E]=function(){f(a,b)};a.src=c;if(bi){a.async=i}}r[o].insertBefore(a,(o===w?r[o].firstChild:e));if(typeof n==q){a.text=n;W(a,b,h)}},0)}function bp(a,b,c,d){R[a[K]]=h;X(a,b,c,d,W)}function bq(a,b,c,d){var g=arguments;if(s&&a[j]==e){a[j]=i;X(a,b,bb,d,bF)}else if(!s&&a[j]!=e&&!a[j]){a[x]=function(){bq.apply(e,g)}}else if(!s){bp.apply(e,g)}}function br(a,b,c,d){var g=arguments,f;if(s&&a[j]==e){a[j]=i;f=a.xhr=(bc?new bc("Microsoft.XMLHTTP"):new p.XMLHttpRequest());f[E]=function(){bG(f,a)};f.open("GET",b);f.send("")}else if(!s&&a[j]!=e&&!a[j]){a[x]=function(){br.apply(e,g)}}else if(!s){R[a[K]]=h;X(a,b,c,d,e,a.xhr.responseText);a.xhr=e}}function bs(a){if(typeof a=="undefined"||!a)return;if(a.allowDup==e)a.allowDup=l.dupe;var b=a.src,c=a.type,d=a.charset,g=a.allowDup,f=S(b,bE),n,o=bA(f);if(typeof d!=q)d=e;g=!(!g);if(!g&&((R[f]!=e)||(s&&m[f])||bB(f))){if(m[f]!=e&&m[f][j]&&!m[f][y]&&o){W(e,m[f],h)}return}if(m[f]==e)m[f]={};n=m[f];if(n[z]==e)n[z]=bD;n[y]=i;n[K]=f;T=h;if(!G&&bl&&o)br(n,f,c,d);else if(!G&&bk)bq(n,f,c,d);else bp(n,f,c,d)}function bt(a){U.push(a)}function Y(a){if(v&&!G)bt(a);if(!v||C)a()}function bu(a){var b=[],c;for(c=-1;++c<a.length;){if(P.call(a[c])===bx)b=b.concat(bu(a[c]));else b[b.length]=a[c]}return b}H={script:function(){bd(V);var a=bu(arguments),b=H,c;if(bC){for(c=-1;++c<a.length;){if(B(a[c]))a[c]=a[c]();if(c===0){Y(function(){bs((typeof a[0]==q)?{src:a[0]}:a[0])})}else b=b.script(a[c]);b=b.wait()}}else{for(c=-1;++c<a.length;){if(B(a[c]))a[c]=a[c]()}Y(function(){for(c=-1;++c<a.length;){bs((typeof a[c]==q)?{src:a[c]}:a[c])}})}V=A(function(){s=i},5);return b},wait:function(a){bd(V);s=i;if(!B(a))a=Q;var b=F(h,l),c=b.trigger,d=function(){try{a()}catch(err){}c()};delete b.trigger;var g=function(){if(T&&!bj)bm=d;else d()};if(v&&!T)bt(g);else Y(g);return b}};if(v){H.trigger=function(){var a,b=-1;while(a=U[++b])a();U=[]}}return H}function bv(a){var b,c={},d={"UseCachePreload":"cache","UseLocalXHR":"xhr","UsePreloading":D,"AlwaysPreserveOrder":L,"AllowDuplicates":"dupe"},g={"AppendTo":z,"BasePath":"base"};for(b in d)g[b]=d[b];c.order=!(!u.order);for(b in g){if(g[M](b)&&u[g[b]]!=e)c[g[b]]=(a[b]!=e)?a[b]:u[g[b]]}for(b in d){if(d[M](b))c[d[b]]=!(!c[d[b]])}if(!c[D])c.cache=c.order=c.xhr=i;c.which=(c.which===w||c.which===I)?c.which:w;return c}p.$LAB={setGlobalDefaults:function(a){u=bv(a)},setOptions:function(a){return F(i,bv(a))},script:function(){return F().script.apply(e,arguments)},wait:function(){return F().wait.apply(e,arguments)}};(function(a,b,c){if(k[t]==e&&k[a]){k[t]="loading";k[a](b,c=function(){k.removeEventListener(b,c,i);k[t]=Z},i)}})("addEventListener","DOMContentLoaded")})(window);
