/*
 * jQuery 1.2.6 - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008)
 * Rev: 5685
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(H(){J w=1b.4M,3m$=1b.$;J D=1b.4M=1b.$=H(a,b){I 2B D.17.5j(a,b)};J u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/,62=/^.[^:#\\[\\.]*$/,12;D.17=D.44={5j:H(d,b){d=d||S;G(d.16){7[0]=d;7.K=1;I 7}G(1j d=="23"){J c=u.2D(d);G(c&&(c[1]||!b)){G(c[1])d=D.4h([c[1]],b);N{J a=S.61(c[3]);G(a){G(a.2v!=c[3])I D().2q(d);I D(a)}d=[]}}N I D(b).2q(d)}N G(D.1D(d))I D(S)[D.17.27?"27":"43"](d);I 7.6Y(D.2d(d))},5w:"1.2.6",8G:H(){I 7.K},K:0,3p:H(a){I a==12?D.2d(7):7[a]},2I:H(b){J a=D(b);a.5n=7;I a},6Y:H(a){7.K=0;2p.44.1p.1w(7,a);I 7},P:H(a,b){I D.P(7,a,b)},5i:H(b){J a=-1;I D.2L(b&&b.5w?b[0]:b,7)},1K:H(c,a,b){J d=c;G(c.1q==56)G(a===12)I 7[0]&&D[b||"1K"](7[0],c);N{d={};d[c]=a}I 7.P(H(i){R(c 1n d)D.1K(b?7.V:7,c,D.1i(7,d[c],b,i,c))})},1g:H(b,a){G((b==\'2h\'||b==\'1Z\')&&3d(a)<0)a=12;I 7.1K(b,a,"2a")},1r:H(b){G(1j b!="49"&&b!=U)I 7.4E().3v((7[0]&&7[0].2z||S).5F(b));J a="";D.P(b||7,H(){D.P(7.3t,H(){G(7.16!=8)a+=7.16!=1?7.76:D.17.1r([7])})});I a},5z:H(b){G(7[0])D(b,7[0].2z).5y().39(7[0]).2l(H(){J a=7;1B(a.1x)a=a.1x;I a}).3v(7);I 7},8Y:H(a){I 7.P(H(){D(7).6Q().5z(a)})},8R:H(a){I 7.P(H(){D(7).5z(a)})},3v:H(){I 7.3W(19,M,Q,H(a){G(7.16==1)7.3U(a)})},6F:H(){I 7.3W(19,M,M,H(a){G(7.16==1)7.39(a,7.1x)})},6E:H(){I 7.3W(19,Q,Q,H(a){7.1d.39(a,7)})},5q:H(){I 7.3W(19,Q,M,H(a){7.1d.39(a,7.2H)})},3l:H(){I 7.5n||D([])},2q:H(b){J c=D.2l(7,H(a){I D.2q(b,a)});I 7.2I(/[^+>] [^+>]/.11(b)||b.1h("..")>-1?D.4r(c):c)},5y:H(e){J f=7.2l(H(){G(D.14.1f&&!D.4n(7)){J a=7.6o(M),5h=S.3h("1v");5h.3U(a);I D.4h([5h.4H])[0]}N I 7.6o(M)});J d=f.2q("*").5c().P(H(){G(7[E]!=12)7[E]=U});G(e===M)7.2q("*").5c().P(H(i){G(7.16==3)I;J c=D.L(7,"3w");R(J a 1n c)R(J b 1n c[a])D.W.1e(d[i],a,c[a][b],c[a][b].L)});I f},1E:H(b){I 7.2I(D.1D(b)&&D.3C(7,H(a,i){I b.1k(a,i)})||D.3g(b,7))},4Y:H(b){G(b.1q==56)G(62.11(b))I 7.2I(D.3g(b,7,M));N b=D.3g(b,7);J a=b.K&&b[b.K-1]!==12&&!b.16;I 7.1E(H(){I a?D.2L(7,b)<0:7!=b})},1e:H(a){I 7.2I(D.4r(D.2R(7.3p(),1j a==\'23\'?D(a):D.2d(a))))},3F:H(a){I!!a&&D.3g(a,7).K>0},7T:H(a){I 7.3F("."+a)},6e:H(b){G(b==12){G(7.K){J c=7[0];G(D.Y(c,"2A")){J e=c.64,63=[],15=c.15,2V=c.O=="2A-2V";G(e<0)I U;R(J i=2V?e:0,2f=2V?e+1:15.K;i<2f;i++){J d=15[i];G(d.2W){b=D.14.1f&&!d.at.2x.an?d.1r:d.2x;G(2V)I b;63.1p(b)}}I 63}N I(7[0].2x||"").1o(/\\r/g,"")}I 12}G(b.1q==4L)b+=\'\';I 7.P(H(){G(7.16!=1)I;G(b.1q==2p&&/5O|5L/.11(7.O))7.4J=(D.2L(7.2x,b)>=0||D.2L(7.34,b)>=0);N G(D.Y(7,"2A")){J a=D.2d(b);D("9R",7).P(H(){7.2W=(D.2L(7.2x,a)>=0||D.2L(7.1r,a)>=0)});G(!a.K)7.64=-1}N 7.2x=b})},2K:H(a){I a==12?(7[0]?7[0].4H:U):7.4E().3v(a)},7b:H(a){I 7.5q(a).21()},79:H(i){I 7.3s(i,i+1)},3s:H(){I 7.2I(2p.44.3s.1w(7,19))},2l:H(b){I 7.2I(D.2l(7,H(a,i){I b.1k(a,i,a)}))},5c:H(){I 7.1e(7.5n)},L:H(d,b){J a=d.1R(".");a[1]=a[1]?"."+a[1]:"";G(b===12){J c=7.5C("9z"+a[1]+"!",[a[0]]);G(c===12&&7.K)c=D.L(7[0],d);I c===12&&a[1]?7.L(a[0]):c}N I 7.1P("9u"+a[1]+"!",[a[0],b]).P(H(){D.L(7,d,b)})},3b:H(a){I 7.P(H(){D.3b(7,a)})},3W:H(g,f,h,d){J e=7.K>1,3x;I 7.P(H(){G(!3x){3x=D.4h(g,7.2z);G(h)3x.9o()}J b=7;G(f&&D.Y(7,"1T")&&D.Y(3x[0],"4F"))b=7.3H("22")[0]||7.3U(7.2z.3h("22"));J c=D([]);D.P(3x,H(){J a=e?D(7).5y(M)[0]:7;G(D.Y(a,"1m"))c=c.1e(a);N{G(a.16==1)c=c.1e(D("1m",a).21());d.1k(b,a)}});c.P(6T)})}};D.17.5j.44=D.17;H 6T(i,a){G(a.4d)D.3Y({1a:a.4d,31:Q,1O:"1m"});N D.5u(a.1r||a.6O||a.4H||"");G(a.1d)a.1d.37(a)}H 1z(){I+2B 8J}D.1l=D.17.1l=H(){J b=19[0]||{},i=1,K=19.K,4x=Q,15;G(b.1q==8I){4x=b;b=19[1]||{};i=2}G(1j b!="49"&&1j b!="H")b={};G(K==i){b=7;--i}R(;i<K;i++)G((15=19[i])!=U)R(J c 1n 15){J a=b[c],2w=15[c];G(b===2w)6M;G(4x&&2w&&1j 2w=="49"&&!2w.16)b[c]=D.1l(4x,a||(2w.K!=U?[]:{}),2w);N G(2w!==12)b[c]=2w}I b};J E="4M"+1z(),6K=0,5r={},6G=/z-?5i|8B-?8A|1y|6B|8v-?1Z/i,3P=S.3P||{};D.1l({8u:H(a){1b.$=3m$;G(a)1b.4M=w;I D},1D:H(a){I!!a&&1j a!="23"&&!a.Y&&a.1q!=2p&&/^[\\s[]?H/.11(a+"")},4n:H(a){I a.1C&&!a.1c||a.2j&&a.2z&&!a.2z.1c},5u:H(a){a=D.3k(a);G(a){J b=S.3H("6w")[0]||S.1C,1m=S.3h("1m");1m.O="1r/4t";G(D.14.1f)1m.1r=a;N 1m.3U(S.5F(a));b.39(1m,b.1x);b.37(1m)}},Y:H(b,a){I b.Y&&b.Y.2r()==a.2r()},1Y:{},L:H(c,d,b){c=c==1b?5r:c;J a=c[E];G(!a)a=c[E]=++6K;G(d&&!D.1Y[a])D.1Y[a]={};G(b!==12)D.1Y[a][d]=b;I d?D.1Y[a][d]:a},3b:H(c,b){c=c==1b?5r:c;J a=c[E];G(b){G(D.1Y[a]){2U D.1Y[a][b];b="";R(b 1n D.1Y[a])1X;G(!b)D.3b(c)}}N{1U{2U c[E]}1V(e){G(c.5l)c.5l(E)}2U D.1Y[a]}},P:H(d,a,c){J e,i=0,K=d.K;G(c){G(K==12){R(e 1n d)G(a.1w(d[e],c)===Q)1X}N R(;i<K;)G(a.1w(d[i++],c)===Q)1X}N{G(K==12){R(e 1n d)G(a.1k(d[e],e,d[e])===Q)1X}N R(J b=d[0];i<K&&a.1k(b,i,b)!==Q;b=d[++i]){}}I d},1i:H(b,a,c,i,d){G(D.1D(a))a=a.1k(b,i);I a&&a.1q==4L&&c=="2a"&&!6G.11(d)?a+"2X":a},1F:{1e:H(c,b){D.P((b||"").1R(/\\s+/),H(i,a){G(c.16==1&&!D.1F.3T(c.1F,a))c.1F+=(c.1F?" ":"")+a})},21:H(c,b){G(c.16==1)c.1F=b!=12?D.3C(c.1F.1R(/\\s+/),H(a){I!D.1F.3T(b,a)}).6s(" "):""},3T:H(b,a){I D.2L(a,(b.1F||b).6r().1R(/\\s+/))>-1}},6q:H(b,c,a){J e={};R(J d 1n c){e[d]=b.V[d];b.V[d]=c[d]}a.1k(b);R(J d 1n c)b.V[d]=e[d]},1g:H(d,e,c){G(e=="2h"||e=="1Z"){J b,3X={30:"5x",5g:"1G",18:"3I"},35=e=="2h"?["5e","6k"]:["5G","6i"];H 5b(){b=e=="2h"?d.8f:d.8c;J a=0,2C=0;D.P(35,H(){a+=3d(D.2a(d,"57"+7,M))||0;2C+=3d(D.2a(d,"2C"+7+"4b",M))||0});b-=29.83(a+2C)}G(D(d).3F(":4j"))5b();N D.6q(d,3X,5b);I 29.2f(0,b)}I D.2a(d,e,c)},2a:H(f,l,k){J e,V=f.V;H 3E(b){G(!D.14.2k)I Q;J a=3P.54(b,U);I!a||a.52("3E")==""}G(l=="1y"&&D.14.1f){e=D.1K(V,"1y");I e==""?"1":e}G(D.14.2G&&l=="18"){J d=V.50;V.50="0 7Y 7W";V.50=d}G(l.1I(/4i/i))l=y;G(!k&&V&&V[l])e=V[l];N G(3P.54){G(l.1I(/4i/i))l="4i";l=l.1o(/([A-Z])/g,"-$1").3y();J c=3P.54(f,U);G(c&&!3E(f))e=c.52(l);N{J g=[],2E=[],a=f,i=0;R(;a&&3E(a);a=a.1d)2E.6h(a);R(;i<2E.K;i++)G(3E(2E[i])){g[i]=2E[i].V.18;2E[i].V.18="3I"}e=l=="18"&&g[2E.K-1]!=U?"2F":(c&&c.52(l))||"";R(i=0;i<g.K;i++)G(g[i]!=U)2E[i].V.18=g[i]}G(l=="1y"&&e=="")e="1"}N G(f.4g){J h=l.1o(/\\-(\\w)/g,H(a,b){I b.2r()});e=f.4g[l]||f.4g[h];G(!/^\\d+(2X)?$/i.11(e)&&/^\\d/.11(e)){J j=V.1A,66=f.65.1A;f.65.1A=f.4g.1A;V.1A=e||0;e=V.aM+"2X";V.1A=j;f.65.1A=66}}I e},4h:H(l,h){J k=[];h=h||S;G(1j h.3h==\'12\')h=h.2z||h[0]&&h[0].2z||S;D.P(l,H(i,d){G(!d)I;G(d.1q==4L)d+=\'\';G(1j d=="23"){d=d.1o(/(<(\\w+)[^>]*?)\\/>/g,H(b,a,c){I c.1I(/^(aK|4f|7E|aG|4T|7A|aB|3n|az|ay|av)$/i)?b:a+"></"+c+">"});J f=D.3k(d).3y(),1v=h.3h("1v");J e=!f.1h("<au")&&[1,"<2A 7w=\'7w\'>","</2A>"]||!f.1h("<ar")&&[1,"<7v>","</7v>"]||f.1I(/^<(aq|22|am|ak|ai)/)&&[1,"<1T>","</1T>"]||!f.1h("<4F")&&[2,"<1T><22>","</22></1T>"]||(!f.1h("<af")||!f.1h("<ad"))&&[3,"<1T><22><4F>","</4F></22></1T>"]||!f.1h("<7E")&&[2,"<1T><22></22><7q>","</7q></1T>"]||D.14.1f&&[1,"1v<1v>","</1v>"]||[0,"",""];1v.4H=e[1]+d+e[2];1B(e[0]--)1v=1v.5T;G(D.14.1f){J g=!f.1h("<1T")&&f.1h("<22")<0?1v.1x&&1v.1x.3t:e[1]=="<1T>"&&f.1h("<22")<0?1v.3t:[];R(J j=g.K-1;j>=0;--j)G(D.Y(g[j],"22")&&!g[j].3t.K)g[j].1d.37(g[j]);G(/^\\s/.11(d))1v.39(h.5F(d.1I(/^\\s*/)[0]),1v.1x)}d=D.2d(1v.3t)}G(d.K===0&&(!D.Y(d,"3V")&&!D.Y(d,"2A")))I;G(d[0]==12||D.Y(d,"3V")||d.15)k.1p(d);N k=D.2R(k,d)});I k},1K:H(d,f,c){G(!d||d.16==3||d.16==8)I 12;J e=!D.4n(d),40=c!==12,1f=D.14.1f;f=e&&D.3X[f]||f;G(d.2j){J g=/5Q|4d|V/.11(f);G(f=="2W"&&D.14.2k)d.1d.64;G(f 1n d&&e&&!g){G(40){G(f=="O"&&D.Y(d,"4T")&&d.1d)7p"O a3 a1\'t 9V 9U";d[f]=c}G(D.Y(d,"3V")&&d.7i(f))I d.7i(f).76;I d[f]}G(1f&&e&&f=="V")I D.1K(d.V,"9T",c);G(40)d.9Q(f,""+c);J h=1f&&e&&g?d.4G(f,2):d.4G(f);I h===U?12:h}G(1f&&f=="1y"){G(40){d.6B=1;d.1E=(d.1E||"").1o(/7f\\([^)]*\\)/,"")+(3r(c)+\'\'=="9L"?"":"7f(1y="+c*7a+")")}I d.1E&&d.1E.1h("1y=")>=0?(3d(d.1E.1I(/1y=([^)]*)/)[1])/7a)+\'\':""}f=f.1o(/-([a-z])/9H,H(a,b){I b.2r()});G(40)d[f]=c;I d[f]},3k:H(a){I(a||"").1o(/^\\s+|\\s+$/g,"")},2d:H(b){J a=[];G(b!=U){J i=b.K;G(i==U||b.1R||b.4I||b.1k)a[0]=b;N 1B(i)a[--i]=b[i]}I a},2L:H(b,a){R(J i=0,K=a.K;i<K;i++)G(a[i]===b)I i;I-1},2R:H(a,b){J i=0,T,2S=a.K;G(D.14.1f){1B(T=b[i++])G(T.16!=8)a[2S++]=T}N 1B(T=b[i++])a[2S++]=T;I a},4r:H(a){J c=[],2o={};1U{R(J i=0,K=a.K;i<K;i++){J b=D.L(a[i]);G(!2o[b]){2o[b]=M;c.1p(a[i])}}}1V(e){c=a}I c},3C:H(c,a,d){J b=[];R(J i=0,K=c.K;i<K;i++)G(!d!=!a(c[i],i))b.1p(c[i]);I b},2l:H(d,a){J c=[];R(J i=0,K=d.K;i<K;i++){J b=a(d[i],i);G(b!=U)c[c.K]=b}I c.7d.1w([],c)}});J v=9B.9A.3y();D.14={5B:(v.1I(/.+(?:9y|9x|9w|9v)[\\/: ]([\\d.]+)/)||[])[1],2k:/75/.11(v),2G:/2G/.11(v),1f:/1f/.11(v)&&!/2G/.11(v),42:/42/.11(v)&&!/(9s|75)/.11(v)};J y=D.14.1f?"7o":"72";D.1l({71:!D.14.1f||S.70=="6Z",3X:{"R":"9n","9k":"1F","4i":y,72:y,7o:y,9h:"9f",9e:"9d",9b:"99"}});D.P({6W:H(a){I a.1d},97:H(a){I D.4S(a,"1d")},95:H(a){I D.3a(a,2,"2H")},91:H(a){I D.3a(a,2,"4l")},8Z:H(a){I D.4S(a,"2H")},8X:H(a){I D.4S(a,"4l")},8W:H(a){I D.5v(a.1d.1x,a)},8V:H(a){I D.5v(a.1x)},6Q:H(a){I D.Y(a,"8U")?a.8T||a.8S.S:D.2d(a.3t)}},H(c,d){D.17[c]=H(b){J a=D.2l(7,d);G(b&&1j b=="23")a=D.3g(b,a);I 7.2I(D.4r(a))}});D.P({6P:"3v",8Q:"6F",39:"6E",8P:"5q",8O:"7b"},H(c,b){D.17[c]=H(){J a=19;I 7.P(H(){R(J i=0,K=a.K;i<K;i++)D(a[i])[b](7)})}});D.P({8N:H(a){D.1K(7,a,"");G(7.16==1)7.5l(a)},8M:H(a){D.1F.1e(7,a)},8L:H(a){D.1F.21(7,a)},8K:H(a){D.1F[D.1F.3T(7,a)?"21":"1e"](7,a)},21:H(a){G(!a||D.1E(a,[7]).r.K){D("*",7).1e(7).P(H(){D.W.21(7);D.3b(7)});G(7.1d)7.1d.37(7)}},4E:H(){D(">*",7).21();1B(7.1x)7.37(7.1x)}},H(a,b){D.17[a]=H(){I 7.P(b,19)}});D.P(["6N","4b"],H(i,c){J b=c.3y();D.17[b]=H(a){I 7[0]==1b?D.14.2G&&S.1c["5t"+c]||D.14.2k&&1b["5s"+c]||S.70=="6Z"&&S.1C["5t"+c]||S.1c["5t"+c]:7[0]==S?29.2f(29.2f(S.1c["4y"+c],S.1C["4y"+c]),29.2f(S.1c["2i"+c],S.1C["2i"+c])):a==12?(7.K?D.1g(7[0],b):U):7.1g(b,a.1q==56?a:a+"2X")}});H 25(a,b){I a[0]&&3r(D.2a(a[0],b,M),10)||0}J C=D.14.2k&&3r(D.14.5B)<8H?"(?:[\\\\w*3m-]|\\\\\\\\.)":"(?:[\\\\w\\8F-\\8E*3m-]|\\\\\\\\.)",6L=2B 4v("^>\\\\s*("+C+"+)"),6J=2B 4v("^("+C+"+)(#)("+C+"+)"),6I=2B 4v("^([#.]?)("+C+"*)");D.1l({6H:{"":H(a,i,m){I m[2]=="*"||D.Y(a,m[2])},"#":H(a,i,m){I a.4G("2v")==m[2]},":":{8D:H(a,i,m){I i<m[3]-0},8C:H(a,i,m){I i>m[3]-0},3a:H(a,i,m){I m[3]-0==i},79:H(a,i,m){I m[3]-0==i},3o:H(a,i){I i==0},3S:H(a,i,m,r){I i==r.K-1},6D:H(a,i){I i%2==0},6C:H(a,i){I i%2},"3o-4u":H(a){I a.1d.3H("*")[0]==a},"3S-4u":H(a){I D.3a(a.1d.5T,1,"4l")==a},"8z-4u":H(a){I!D.3a(a.1d.5T,2,"4l")},6W:H(a){I a.1x},4E:H(a){I!a.1x},8y:H(a,i,m){I(a.6O||a.8x||D(a).1r()||"").1h(m[3])>=0},4j:H(a){I"1G"!=a.O&&D.1g(a,"18")!="2F"&&D.1g(a,"5g")!="1G"},1G:H(a){I"1G"==a.O||D.1g(a,"18")=="2F"||D.1g(a,"5g")=="1G"},8w:H(a){I!a.3R},3R:H(a){I a.3R},4J:H(a){I a.4J},2W:H(a){I a.2W||D.1K(a,"2W")},1r:H(a){I"1r"==a.O},5O:H(a){I"5O"==a.O},5L:H(a){I"5L"==a.O},5p:H(a){I"5p"==a.O},3Q:H(a){I"3Q"==a.O},5o:H(a){I"5o"==a.O},6A:H(a){I"6A"==a.O},6z:H(a){I"6z"==a.O},2s:H(a){I"2s"==a.O||D.Y(a,"2s")},4T:H(a){I/4T|2A|6y|2s/i.11(a.Y)},3T:H(a,i,m){I D.2q(m[3],a).K},8t:H(a){I/h\\d/i.11(a.Y)},8s:H(a){I D.3C(D.3O,H(b){I a==b.T}).K}}},6x:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,2B 4v("^([:.#]*)("+C+"+)")],3g:H(a,c,b){J d,1t=[];1B(a&&a!=d){d=a;J f=D.1E(a,c,b);a=f.t.1o(/^\\s*,\\s*/,"");1t=b?c=f.r:D.2R(1t,f.r)}I 1t},2q:H(t,o){G(1j t!="23")I[t];G(o&&o.16!=1&&o.16!=9)I[];o=o||S;J d=[o],2o=[],3S,Y;1B(t&&3S!=t){J r=[];3S=t;t=D.3k(t);J l=Q,3j=6L,m=3j.2D(t);G(m){Y=m[1].2r();R(J i=0;d[i];i++)R(J c=d[i].1x;c;c=c.2H)G(c.16==1&&(Y=="*"||c.Y.2r()==Y))r.1p(c);d=r;t=t.1o(3j,"");G(t.1h(" ")==0)6M;l=M}N{3j=/^([>+~])\\s*(\\w*)/i;G((m=3j.2D(t))!=U){r=[];J k={};Y=m[2].2r();m=m[1];R(J j=0,3i=d.K;j<3i;j++){J n=m=="~"||m=="+"?d[j].2H:d[j].1x;R(;n;n=n.2H)G(n.16==1){J g=D.L(n);G(m=="~"&&k[g])1X;G(!Y||n.Y.2r()==Y){G(m=="~")k[g]=M;r.1p(n)}G(m=="+")1X}}d=r;t=D.3k(t.1o(3j,""));l=M}}G(t&&!l){G(!t.1h(",")){G(o==d[0])d.4s();2o=D.2R(2o,d);r=d=[o];t=" "+t.6v(1,t.K)}N{J h=6J;J m=h.2D(t);G(m){m=[0,m[2],m[3],m[1]]}N{h=6I;m=h.2D(t)}m[2]=m[2].1o(/\\\\/g,"");J f=d[d.K-1];G(m[1]=="#"&&f&&f.61&&!D.4n(f)){J p=f.61(m[2]);G((D.14.1f||D.14.2G)&&p&&1j p.2v=="23"&&p.2v!=m[2])p=D(\'[@2v="\'+m[2]+\'"]\',f)[0];d=r=p&&(!m[3]||D.Y(p,m[3]))?[p]:[]}N{R(J i=0;d[i];i++){J a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];G(a=="*"&&d[i].Y.3y()=="49")a="3n";r=D.2R(r,d[i].3H(a))}G(m[1]==".")r=D.5m(r,m[2]);G(m[1]=="#"){J e=[];R(J i=0;r[i];i++)G(r[i].4G("2v")==m[2]){e=[r[i]];1X}r=e}d=r}t=t.1o(h,"")}}G(t){J b=D.1E(t,r);d=r=b.r;t=D.3k(b.t)}}G(t)d=[];G(d&&o==d[0])d.4s();2o=D.2R(2o,d);I 2o},5m:H(r,m,a){m=" "+m+" ";J c=[];R(J i=0;r[i];i++){J b=(" "+r[i].1F+" ").1h(m)>=0;G(!a&&b||a&&!b)c.1p(r[i])}I c},1E:H(t,r,h){J d;1B(t&&t!=d){d=t;J p=D.6x,m;R(J i=0;p[i];i++){m=p[i].2D(t);G(m){t=t.8r(m[0].K);m[2]=m[2].1o(/\\\\/g,"");1X}}G(!m)1X;G(m[1]==":"&&m[2]=="4Y")r=62.11(m[3])?D.1E(m[3],r,M).r:D(r).4Y(m[3]);N G(m[1]==".")r=D.5m(r,m[2],h);N G(m[1]=="["){J g=[],O=m[3];R(J i=0,3i=r.K;i<3i;i++){J a=r[i],z=a[D.3X[m[2]]||m[2]];G(z==U||/5Q|4d|2W/.11(m[2]))z=D.1K(a,m[2])||\'\';G((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1h(m[5])||O=="$="&&z.6v(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1h(m[5])>=0)^h)g.1p(a)}r=g}N G(m[1]==":"&&m[2]=="3a-4u"){J e={},g=[],11=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2D(m[3]=="6D"&&"2n"||m[3]=="6C"&&"2n+1"||!/\\D/.11(m[3])&&"8q+"+m[3]||m[3]),3o=(11[1]+(11[2]||1))-0,d=11[3]-0;R(J i=0,3i=r.K;i<3i;i++){J j=r[i],1d=j.1d,2v=D.L(1d);G(!e[2v]){J c=1;R(J n=1d.1x;n;n=n.2H)G(n.16==1)n.4q=c++;e[2v]=M}J b=Q;G(3o==0){G(j.4q==d)b=M}N G((j.4q-d)%3o==0&&(j.4q-d)/3o>=0)b=M;G(b^h)g.1p(j)}r=g}N{J f=D.6H[m[1]];G(1j f=="49")f=f[m[2]];G(1j f=="23")f=6u("Q||H(a,i){I "+f+";}");r=D.3C(r,H(a,i){I f(a,i,m,r)},h)}}I{r:r,t:t}},4S:H(b,c){J a=[],1t=b[c];1B(1t&&1t!=S){G(1t.16==1)a.1p(1t);1t=1t[c]}I a},3a:H(a,e,c,b){e=e||1;J d=0;R(;a;a=a[c])G(a.16==1&&++d==e)1X;I a},5v:H(n,a){J r=[];R(;n;n=n.2H){G(n.16==1&&n!=a)r.1p(n)}I r}});D.W={1e:H(f,i,g,e){G(f.16==3||f.16==8)I;G(D.14.1f&&f.4I)f=1b;G(!g.24)g.24=7.24++;G(e!=12){J h=g;g=7.3M(h,H(){I h.1w(7,19)});g.L=e}J j=D.L(f,"3w")||D.L(f,"3w",{}),1H=D.L(f,"1H")||D.L(f,"1H",H(){G(1j D!="12"&&!D.W.5k)I D.W.1H.1w(19.3L.T,19)});1H.T=f;D.P(i.1R(/\\s+/),H(c,b){J a=b.1R(".");b=a[0];g.O=a[1];J d=j[b];G(!d){d=j[b]={};G(!D.W.2t[b]||D.W.2t[b].4p.1k(f)===Q){G(f.3K)f.3K(b,1H,Q);N G(f.6t)f.6t("4o"+b,1H)}}d[g.24]=g;D.W.26[b]=M});f=U},24:1,26:{},21:H(e,h,f){G(e.16==3||e.16==8)I;J i=D.L(e,"3w"),1L,5i;G(i){G(h==12||(1j h=="23"&&h.8p(0)=="."))R(J g 1n i)7.21(e,g+(h||""));N{G(h.O){f=h.2y;h=h.O}D.P(h.1R(/\\s+/),H(b,a){J c=a.1R(".");a=c[0];G(i[a]){G(f)2U i[a][f.24];N R(f 1n i[a])G(!c[1]||i[a][f].O==c[1])2U i[a][f];R(1L 1n i[a])1X;G(!1L){G(!D.W.2t[a]||D.W.2t[a].4A.1k(e)===Q){G(e.6p)e.6p(a,D.L(e,"1H"),Q);N G(e.6n)e.6n("4o"+a,D.L(e,"1H"))}1L=U;2U i[a]}}})}R(1L 1n i)1X;G(!1L){J d=D.L(e,"1H");G(d)d.T=U;D.3b(e,"3w");D.3b(e,"1H")}}},1P:H(h,c,f,g,i){c=D.2d(c);G(h.1h("!")>=0){h=h.3s(0,-1);J a=M}G(!f){G(7.26[h])D("*").1e([1b,S]).1P(h,c)}N{G(f.16==3||f.16==8)I 12;J b,1L,17=D.1D(f[h]||U),W=!c[0]||!c[0].32;G(W){c.6h({O:h,2J:f,32:H(){},3J:H(){},4C:1z()});c[0][E]=M}c[0].O=h;G(a)c[0].6m=M;J d=D.L(f,"1H");G(d)b=d.1w(f,c);G((!17||(D.Y(f,\'a\')&&h=="4V"))&&f["4o"+h]&&f["4o"+h].1w(f,c)===Q)b=Q;G(W)c.4s();G(i&&D.1D(i)){1L=i.1w(f,b==U?c:c.7d(b));G(1L!==12)b=1L}G(17&&g!==Q&&b!==Q&&!(D.Y(f,\'a\')&&h=="4V")){7.5k=M;1U{f[h]()}1V(e){}}7.5k=Q}I b},1H:H(b){J a,1L,38,5f,4m;b=19[0]=D.W.6l(b||1b.W);38=b.O.1R(".");b.O=38[0];38=38[1];5f=!38&&!b.6m;4m=(D.L(7,"3w")||{})[b.O];R(J j 1n 4m){J c=4m[j];G(5f||c.O==38){b.2y=c;b.L=c.L;1L=c.1w(7,19);G(a!==Q)a=1L;G(1L===Q){b.32();b.3J()}}}I a},6l:H(b){G(b[E]==M)I b;J d=b;b={8o:d};J c="8n 8m 8l 8k 2s 8j 47 5d 6j 5E 8i L 8h 8g 4K 2y 5a 59 8e 8b 58 6f 8a 88 4k 87 86 84 6d 2J 4C 6c O 82 81 35".1R(" ");R(J i=c.K;i;i--)b[c[i]]=d[c[i]];b[E]=M;b.32=H(){G(d.32)d.32();d.80=Q};b.3J=H(){G(d.3J)d.3J();d.7Z=M};b.4C=b.4C||1z();G(!b.2J)b.2J=b.6d||S;G(b.2J.16==3)b.2J=b.2J.1d;G(!b.4k&&b.4K)b.4k=b.4K==b.2J?b.6c:b.4K;G(b.58==U&&b.5d!=U){J a=S.1C,1c=S.1c;b.58=b.5d+(a&&a.2e||1c&&1c.2e||0)-(a.6b||0);b.6f=b.6j+(a&&a.2c||1c&&1c.2c||0)-(a.6a||0)}G(!b.35&&((b.47||b.47===0)?b.47:b.5a))b.35=b.47||b.5a;G(!b.59&&b.5E)b.59=b.5E;G(!b.35&&b.2s)b.35=(b.2s&1?1:(b.2s&2?3:(b.2s&4?2:0)));I b},3M:H(a,b){b.24=a.24=a.24||b.24||7.24++;I b},2t:{27:{4p:H(){55();I},4A:H(){I}},3D:{4p:H(){G(D.14.1f)I Q;D(7).2O("53",D.W.2t.3D.2y);I M},4A:H(){G(D.14.1f)I Q;D(7).4e("53",D.W.2t.3D.2y);I M},2y:H(a){G(F(a,7))I M;a.O="3D";I D.W.1H.1w(7,19)}},3N:{4p:H(){G(D.14.1f)I Q;D(7).2O("51",D.W.2t.3N.2y);I M},4A:H(){G(D.14.1f)I Q;D(7).4e("51",D.W.2t.3N.2y);I M},2y:H(a){G(F(a,7))I M;a.O="3N";I D.W.1H.1w(7,19)}}}};D.17.1l({2O:H(c,a,b){I c=="4X"?7.2V(c,a,b):7.P(H(){D.W.1e(7,c,b||a,b&&a)})},2V:H(d,b,c){J e=D.W.3M(c||b,H(a){D(7).4e(a,e);I(c||b).1w(7,19)});I 7.P(H(){D.W.1e(7,d,e,c&&b)})},4e:H(a,b){I 7.P(H(){D.W.21(7,a,b)})},1P:H(c,a,b){I 7.P(H(){D.W.1P(c,a,7,M,b)})},5C:H(c,a,b){I 7[0]&&D.W.1P(c,a,7[0],Q,b)},2m:H(b){J c=19,i=1;1B(i<c.K)D.W.3M(b,c[i++]);I 7.4V(D.W.3M(b,H(a){7.4Z=(7.4Z||0)%i;a.32();I c[7.4Z++].1w(7,19)||Q}))},7X:H(a,b){I 7.2O(\'3D\',a).2O(\'3N\',b)},27:H(a){55();G(D.2Q)a.1k(S,D);N D.3A.1p(H(){I a.1k(7,D)});I 7}});D.1l({2Q:Q,3A:[],27:H(){G(!D.2Q){D.2Q=M;G(D.3A){D.P(D.3A,H(){7.1k(S)});D.3A=U}D(S).5C("27")}}});J x=Q;H 55(){G(x)I;x=M;G(S.3K&&!D.14.2G)S.3K("69",D.27,Q);G(D.14.1f&&1b==1S)(H(){G(D.2Q)I;1U{S.1C.7V("1A")}1V(3e){3B(19.3L,0);I}D.27()})();G(D.14.2G)S.3K("69",H(){G(D.2Q)I;R(J i=0;i<S.4W.K;i++)G(S.4W[i].3R){3B(19.3L,0);I}D.27()},Q);G(D.14.2k){J a;(H(){G(D.2Q)I;G(S.3f!="68"&&S.3f!="1J"){3B(19.3L,0);I}G(a===12)a=D("V, 7A[7U=7S]").K;G(S.4W.K!=a){3B(19.3L,0);I}D.27()})()}D.W.1e(1b,"43",D.27)}D.P(("7R,7Q,43,85,4y,4X,4V,7P,"+"7O,7N,89,53,51,7M,2A,"+"5o,7L,7K,8d,3e").1R(","),H(i,b){D.17[b]=H(a){I a?7.2O(b,a):7.1P(b)}});J F=H(a,c){J b=a.4k;1B(b&&b!=c)1U{b=b.1d}1V(3e){b=c}I b==c};D(1b).2O("4X",H(){D("*").1e(S).4e()});D.17.1l({67:D.17.43,43:H(g,d,c){G(1j g!=\'23\')I 7.67(g);J e=g.1h(" ");G(e>=0){J i=g.3s(e,g.K);g=g.3s(0,e)}c=c||H(){};J f="2P";G(d)G(D.1D(d)){c=d;d=U}N{d=D.3n(d);f="6g"}J h=7;D.3Y({1a:g,O:f,1O:"2K",L:d,1J:H(a,b){G(b=="1W"||b=="7J")h.2K(i?D("<1v/>").3v(a.4U.1o(/<1m(.|\\s)*?\\/1m>/g,"")).2q(i):a.4U);h.P(c,[a.4U,b,a])}});I 7},aL:H(){I D.3n(7.7I())},7I:H(){I 7.2l(H(){I D.Y(7,"3V")?D.2d(7.aH):7}).1E(H(){I 7.34&&!7.3R&&(7.4J||/2A|6y/i.11(7.Y)||/1r|1G|3Q/i.11(7.O))}).2l(H(i,c){J b=D(7).6e();I b==U?U:b.1q==2p?D.2l(b,H(a,i){I{34:c.34,2x:a}}):{34:c.34,2x:b}}).3p()}});D.P("7H,7G,7F,7D,7C,7B".1R(","),H(i,o){D.17[o]=H(f){I 7.2O(o,f)}});J B=1z();D.1l({3p:H(d,b,a,c){G(D.1D(b)){a=b;b=U}I D.3Y({O:"2P",1a:d,L:b,1W:a,1O:c})},aE:H(b,a){I D.3p(b,U,a,"1m")},aD:H(c,b,a){I D.3p(c,b,a,"3z")},aC:H(d,b,a,c){G(D.1D(b)){a=b;b={}}I D.3Y({O:"6g",1a:d,L:b,1W:a,1O:c})},aA:H(a){D.1l(D.60,a)},60:{1a:5Z.5Q,26:M,O:"2P",2T:0,7z:"4R/x-ax-3V-aw",7x:M,31:M,L:U,5Y:U,3Q:U,4Q:{2N:"4R/2N, 1r/2N",2K:"1r/2K",1m:"1r/4t, 4R/4t",3z:"4R/3z, 1r/4t",1r:"1r/as",4w:"*/*"}},4z:{},3Y:H(s){s=D.1l(M,s,D.1l(M,{},D.60,s));J g,2Z=/=\\?(&|$)/g,1u,L,O=s.O.2r();G(s.L&&s.7x&&1j s.L!="23")s.L=D.3n(s.L);G(s.1O=="4P"){G(O=="2P"){G(!s.1a.1I(2Z))s.1a+=(s.1a.1I(/\\?/)?"&":"?")+(s.4P||"7u")+"=?"}N G(!s.L||!s.L.1I(2Z))s.L=(s.L?s.L+"&":"")+(s.4P||"7u")+"=?";s.1O="3z"}G(s.1O=="3z"&&(s.L&&s.L.1I(2Z)||s.1a.1I(2Z))){g="4P"+B++;G(s.L)s.L=(s.L+"").1o(2Z,"="+g+"$1");s.1a=s.1a.1o(2Z,"="+g+"$1");s.1O="1m";1b[g]=H(a){L=a;1W();1J();1b[g]=12;1U{2U 1b[g]}1V(e){}G(i)i.37(h)}}G(s.1O=="1m"&&s.1Y==U)s.1Y=Q;G(s.1Y===Q&&O=="2P"){J j=1z();J k=s.1a.1o(/(\\?|&)3m=.*?(&|$)/,"$ap="+j+"$2");s.1a=k+((k==s.1a)?(s.1a.1I(/\\?/)?"&":"?")+"3m="+j:"")}G(s.L&&O=="2P"){s.1a+=(s.1a.1I(/\\?/)?"&":"?")+s.L;s.L=U}G(s.26&&!D.4O++)D.W.1P("7H");J n=/^(?:\\w+:)?\\/\\/([^\\/?#]+)/;G(s.1O=="1m"&&O=="2P"&&n.11(s.1a)&&n.2D(s.1a)[1]!=5Z.al){J i=S.3H("6w")[0];J h=S.3h("1m");h.4d=s.1a;G(s.7t)h.aj=s.7t;G(!g){J l=Q;h.ah=h.ag=H(){G(!l&&(!7.3f||7.3f=="68"||7.3f=="1J")){l=M;1W();1J();i.37(h)}}}i.3U(h);I 12}J m=Q;J c=1b.7s?2B 7s("ae.ac"):2B 7r();G(s.5Y)c.6R(O,s.1a,s.31,s.5Y,s.3Q);N c.6R(O,s.1a,s.31);1U{G(s.L)c.4B("ab-aa",s.7z);G(s.5S)c.4B("a9-5R-a8",D.4z[s.1a]||"a7, a6 a5 a4 5N:5N:5N a2");c.4B("X-9Z-9Y","7r");c.4B("9W",s.1O&&s.4Q[s.1O]?s.4Q[s.1O]+", */*":s.4Q.4w)}1V(e){}G(s.7m&&s.7m(c,s)===Q){s.26&&D.4O--;c.7l();I Q}G(s.26)D.W.1P("7B",[c,s]);J d=H(a){G(!m&&c&&(c.3f==4||a=="2T")){m=M;G(f){7k(f);f=U}1u=a=="2T"&&"2T"||!D.7j(c)&&"3e"||s.5S&&D.7h(c,s.1a)&&"7J"||"1W";G(1u=="1W"){1U{L=D.6X(c,s.1O,s.9S)}1V(e){1u="5J"}}G(1u=="1W"){J b;1U{b=c.5I("7g-5R")}1V(e){}G(s.5S&&b)D.4z[s.1a]=b;G(!g)1W()}N D.5H(s,c,1u);1J();G(s.31)c=U}};G(s.31){J f=4I(d,13);G(s.2T>0)3B(H(){G(c){c.7l();G(!m)d("2T")}},s.2T)}1U{c.9P(s.L)}1V(e){D.5H(s,c,U,e)}G(!s.31)d();H 1W(){G(s.1W)s.1W(L,1u);G(s.26)D.W.1P("7C",[c,s])}H 1J(){G(s.1J)s.1J(c,1u);G(s.26)D.W.1P("7F",[c,s]);G(s.26&&!--D.4O)D.W.1P("7G")}I c},5H:H(s,a,b,e){G(s.3e)s.3e(a,b,e);G(s.26)D.W.1P("7D",[a,s,e])},4O:0,7j:H(a){1U{I!a.1u&&5Z.9O=="5p:"||(a.1u>=7e&&a.1u<9N)||a.1u==7c||a.1u==9K||D.14.2k&&a.1u==12}1V(e){}I Q},7h:H(a,c){1U{J b=a.5I("7g-5R");I a.1u==7c||b==D.4z[c]||D.14.2k&&a.1u==12}1V(e){}I Q},6X:H(a,c,b){J d=a.5I("9J-O"),2N=c=="2N"||!c&&d&&d.1h("2N")>=0,L=2N?a.9I:a.4U;G(2N&&L.1C.2j=="5J")7p"5J";G(b)L=b(L,c);G(c=="1m")D.5u(L);G(c=="3z")L=6u("("+L+")");I L},3n:H(a){J s=[];G(a.1q==2p||a.5w)D.P(a,H(){s.1p(3u(7.34)+"="+3u(7.2x))});N R(J j 1n a)G(a[j]&&a[j].1q==2p)D.P(a[j],H(){s.1p(3u(j)+"="+3u(7))});N s.1p(3u(j)+"="+3u(D.1D(a[j])?a[j]():a[j]));I s.6s("&").1o(/%20/g,"+")}});D.17.1l({1N:H(c,b){I c?7.2g({1Z:"1N",2h:"1N",1y:"1N"},c,b):7.1E(":1G").P(H(){7.V.18=7.5D||"";G(D.1g(7,"18")=="2F"){J a=D("<"+7.2j+" />").6P("1c");7.V.18=a.1g("18");G(7.V.18=="2F")7.V.18="3I";a.21()}}).3l()},1M:H(b,a){I b?7.2g({1Z:"1M",2h:"1M",1y:"1M"},b,a):7.1E(":4j").P(H(){7.5D=7.5D||D.1g(7,"18");7.V.18="2F"}).3l()},78:D.17.2m,2m:H(a,b){I D.1D(a)&&D.1D(b)?7.78.1w(7,19):a?7.2g({1Z:"2m",2h:"2m",1y:"2m"},a,b):7.P(H(){D(7)[D(7).3F(":1G")?"1N":"1M"]()})},9G:H(b,a){I 7.2g({1Z:"1N"},b,a)},9F:H(b,a){I 7.2g({1Z:"1M"},b,a)},9E:H(b,a){I 7.2g({1Z:"2m"},b,a)},9D:H(b,a){I 7.2g({1y:"1N"},b,a)},9M:H(b,a){I 7.2g({1y:"1M"},b,a)},9C:H(c,a,b){I 7.2g({1y:a},c,b)},2g:H(k,j,i,g){J h=D.77(j,i,g);I 7[h.36===Q?"P":"36"](H(){G(7.16!=1)I Q;J f=D.1l({},h),p,1G=D(7).3F(":1G"),46=7;R(p 1n k){G(k[p]=="1M"&&1G||k[p]=="1N"&&!1G)I f.1J.1k(7);G(p=="1Z"||p=="2h"){f.18=D.1g(7,"18");f.33=7.V.33}}G(f.33!=U)7.V.33="1G";f.45=D.1l({},k);D.P(k,H(c,a){J e=2B D.28(46,f,c);G(/2m|1N|1M/.11(a))e[a=="2m"?1G?"1N":"1M":a](k);N{J b=a.6r().1I(/^([+-]=)?([\\d+-.]+)(.*)$/),2b=e.1t(M)||0;G(b){J d=3d(b[2]),2M=b[3]||"2X";G(2M!="2X"){46.V[c]=(d||1)+2M;2b=((d||1)/e.1t(M))*2b;46.V[c]=2b+2M}G(b[1])d=((b[1]=="-="?-1:1)*d)+2b;e.3G(2b,d,2M)}N e.3G(2b,a,"")}});I M})},36:H(a,b){G(D.1D(a)||(a&&a.1q==2p)){b=a;a="28"}G(!a||(1j a=="23"&&!b))I A(7[0],a);I 7.P(H(){G(b.1q==2p)A(7,a,b);N{A(7,a).1p(b);G(A(7,a).K==1)b.1k(7)}})},9X:H(b,c){J a=D.3O;G(b)7.36([]);7.P(H(){R(J i=a.K-1;i>=0;i--)G(a[i].T==7){G(c)a[i](M);a.7n(i,1)}});G(!c)7.5A();I 7}});J A=H(b,c,a){G(b){c=c||"28";J q=D.L(b,c+"36");G(!q||a)q=D.L(b,c+"36",D.2d(a))}I q};D.17.5A=H(a){a=a||"28";I 7.P(H(){J q=A(7,a);q.4s();G(q.K)q[0].1k(7)})};D.1l({77:H(b,a,c){J d=b&&b.1q==a0?b:{1J:c||!c&&a||D.1D(b)&&b,2u:b,41:c&&a||a&&a.1q!=9t&&a};d.2u=(d.2u&&d.2u.1q==4L?d.2u:D.28.5K[d.2u])||D.28.5K.74;d.5M=d.1J;d.1J=H(){G(d.36!==Q)D(7).5A();G(D.1D(d.5M))d.5M.1k(7)};I d},41:{73:H(p,n,b,a){I b+a*p},5P:H(p,n,b,a){I((-29.9r(p*29.9q)/2)+0.5)*a+b}},3O:[],48:U,28:H(b,c,a){7.15=c;7.T=b;7.1i=a;G(!c.3Z)c.3Z={}}});D.28.44={4D:H(){G(7.15.2Y)7.15.2Y.1k(7.T,7.1z,7);(D.28.2Y[7.1i]||D.28.2Y.4w)(7);G(7.1i=="1Z"||7.1i=="2h")7.T.V.18="3I"},1t:H(a){G(7.T[7.1i]!=U&&7.T.V[7.1i]==U)I 7.T[7.1i];J r=3d(D.1g(7.T,7.1i,a));I r&&r>-9p?r:3d(D.2a(7.T,7.1i))||0},3G:H(c,b,d){7.5V=1z();7.2b=c;7.3l=b;7.2M=d||7.2M||"2X";7.1z=7.2b;7.2S=7.4N=0;7.4D();J e=7;H t(a){I e.2Y(a)}t.T=7.T;D.3O.1p(t);G(D.48==U){D.48=4I(H(){J a=D.3O;R(J i=0;i<a.K;i++)G(!a[i]())a.7n(i--,1);G(!a.K){7k(D.48);D.48=U}},13)}},1N:H(){7.15.3Z[7.1i]=D.1K(7.T.V,7.1i);7.15.1N=M;7.3G(0,7.1t());G(7.1i=="2h"||7.1i=="1Z")7.T.V[7.1i]="9m";D(7.T).1N()},1M:H(){7.15.3Z[7.1i]=D.1K(7.T.V,7.1i);7.15.1M=M;7.3G(7.1t(),0)},2Y:H(a){J t=1z();G(a||t>7.15.2u+7.5V){7.1z=7.3l;7.2S=7.4N=1;7.4D();7.15.45[7.1i]=M;J b=M;R(J i 1n 7.15.45)G(7.15.45[i]!==M)b=Q;G(b){G(7.15.18!=U){7.T.V.33=7.15.33;7.T.V.18=7.15.18;G(D.1g(7.T,"18")=="2F")7.T.V.18="3I"}G(7.15.1M)7.T.V.18="2F";G(7.15.1M||7.15.1N)R(J p 1n 7.15.45)D.1K(7.T.V,p,7.15.3Z[p])}G(b)7.15.1J.1k(7.T);I Q}N{J n=t-7.5V;7.4N=n/7.15.2u;7.2S=D.41[7.15.41||(D.41.5P?"5P":"73")](7.4N,n,0,1,7.15.2u);7.1z=7.2b+((7.3l-7.2b)*7.2S);7.4D()}I M}};D.1l(D.28,{5K:{9l:9j,9i:7e,74:9g},2Y:{2e:H(a){a.T.2e=a.1z},2c:H(a){a.T.2c=a.1z},1y:H(a){D.1K(a.T.V,"1y",a.1z)},4w:H(a){a.T.V[a.1i]=a.1z+a.2M}}});D.17.2i=H(){J b=0,1S=0,T=7[0],3q;G(T)ao(D.14){J d=T.1d,4a=T,1s=T.1s,1Q=T.2z,5U=2k&&3r(5B)<9c&&!/9a/i.11(v),1g=D.2a,3c=1g(T,"30")=="3c";G(T.7y){J c=T.7y();1e(c.1A+29.2f(1Q.1C.2e,1Q.1c.2e),c.1S+29.2f(1Q.1C.2c,1Q.1c.2c));1e(-1Q.1C.6b,-1Q.1C.6a)}N{1e(T.5X,T.5W);1B(1s){1e(1s.5X,1s.5W);G(42&&!/^t(98|d|h)$/i.11(1s.2j)||2k&&!5U)2C(1s);G(!3c&&1g(1s,"30")=="3c")3c=M;4a=/^1c$/i.11(1s.2j)?4a:1s;1s=1s.1s}1B(d&&d.2j&&!/^1c|2K$/i.11(d.2j)){G(!/^96|1T.*$/i.11(1g(d,"18")))1e(-d.2e,-d.2c);G(42&&1g(d,"33")!="4j")2C(d);d=d.1d}G((5U&&(3c||1g(4a,"30")=="5x"))||(42&&1g(4a,"30")!="5x"))1e(-1Q.1c.5X,-1Q.1c.5W);G(3c)1e(29.2f(1Q.1C.2e,1Q.1c.2e),29.2f(1Q.1C.2c,1Q.1c.2c))}3q={1S:1S,1A:b}}H 2C(a){1e(D.2a(a,"6V",M),D.2a(a,"6U",M))}H 1e(l,t){b+=3r(l,10)||0;1S+=3r(t,10)||0}I 3q};D.17.1l({30:H(){J a=0,1S=0,3q;G(7[0]){J b=7.1s(),2i=7.2i(),4c=/^1c|2K$/i.11(b[0].2j)?{1S:0,1A:0}:b.2i();2i.1S-=25(7,\'94\');2i.1A-=25(7,\'aF\');4c.1S+=25(b,\'6U\');4c.1A+=25(b,\'6V\');3q={1S:2i.1S-4c.1S,1A:2i.1A-4c.1A}}I 3q},1s:H(){J a=7[0].1s;1B(a&&(!/^1c|2K$/i.11(a.2j)&&D.1g(a,\'30\')==\'93\'))a=a.1s;I D(a)}});D.P([\'5e\',\'5G\'],H(i,b){J c=\'4y\'+b;D.17[c]=H(a){G(!7[0])I;I a!=12?7.P(H(){7==1b||7==S?1b.92(!i?a:D(1b).2e(),i?a:D(1b).2c()):7[c]=a}):7[0]==1b||7[0]==S?46[i?\'aI\':\'aJ\']||D.71&&S.1C[c]||S.1c[c]:7[0][c]}});D.P(["6N","4b"],H(i,b){J c=i?"5e":"5G",4f=i?"6k":"6i";D.17["5s"+b]=H(){I 7[b.3y()]()+25(7,"57"+c)+25(7,"57"+4f)};D.17["90"+b]=H(a){I 7["5s"+b]()+25(7,"2C"+c+"4b")+25(7,"2C"+4f+"4b")+(a?25(7,"6S"+c)+25(7,"6S"+4f):0)}})})();',62,669,'|||||||this|||||||||||||||||||||||||||||||||||if|function|return|var|length|data|true|else|type|each|false|for|document|elem|null|style|event||nodeName|||test|undefined||browser|options|nodeType|fn|display|arguments|url|window|body|parentNode|add|msie|css|indexOf|prop|typeof|call|extend|script|in|replace|push|constructor|text|offsetParent|cur|status|div|apply|firstChild|opacity|now|left|while|documentElement|isFunction|filter|className|hidden|handle|match|complete|attr|ret|hide|show|dataType|trigger|doc|split|top|table|try|catch|success|break|cache|height||remove|tbody|string|guid|num|global|ready|fx|Math|curCSS|start|scrollTop|makeArray|scrollLeft|max|animate|width|offset|tagName|safari|map|toggle||done|Array|find|toUpperCase|button|special|duration|id|copy|value|handler|ownerDocument|select|new|border|exec|stack|none|opera|nextSibling|pushStack|target|html|inArray|unit|xml|bind|GET|isReady|merge|pos|timeout|delete|one|selected|px|step|jsre|position|async|preventDefault|overflow|name|which|queue|removeChild|namespace|insertBefore|nth|removeData|fixed|parseFloat|error|readyState|multiFilter|createElement|rl|re|trim|end|_|param|first|get|results|parseInt|slice|childNodes|encodeURIComponent|append|events|elems|toLowerCase|json|readyList|setTimeout|grep|mouseenter|color|is|custom|getElementsByTagName|block|stopPropagation|addEventListener|callee|proxy|mouseleave|timers|defaultView|password|disabled|last|has|appendChild|form|domManip|props|ajax|orig|set|easing|mozilla|load|prototype|curAnim|self|charCode|timerId|object|offsetChild|Width|parentOffset|src|unbind|br|currentStyle|clean|float|visible|relatedTarget|previousSibling|handlers|isXMLDoc|on|setup|nodeIndex|unique|shift|javascript|child|RegExp|_default|deep|scroll|lastModified|teardown|setRequestHeader|timeStamp|update|empty|tr|getAttribute|innerHTML|setInterval|checked|fromElement|Number|jQuery|state|active|jsonp|accepts|application|dir|input|responseText|click|styleSheets|unload|not|lastToggle|outline|mouseout|getPropertyValue|mouseover|getComputedStyle|bindReady|String|padding|pageX|metaKey|keyCode|getWH|andSelf|clientX|Left|all|visibility|container|index|init|triggered|removeAttribute|classFilter|prevObject|submit|file|after|windowData|inner|client|globalEval|sibling|jquery|absolute|clone|wrapAll|dequeue|version|triggerHandler|oldblock|ctrlKey|createTextNode|Top|handleError|getResponseHeader|parsererror|speeds|checkbox|old|00|radio|swing|href|Modified|ifModified|lastChild|safari2|startTime|offsetTop|offsetLeft|username|location|ajaxSettings|getElementById|isSimple|values|selectedIndex|runtimeStyle|rsLeft|_load|loaded|DOMContentLoaded|clientTop|clientLeft|toElement|srcElement|val|pageY|POST|unshift|Bottom|clientY|Right|fix|exclusive|detachEvent|cloneNode|removeEventListener|swap|toString|join|attachEvent|eval|substr|head|parse|textarea|reset|image|zoom|odd|even|before|prepend|exclude|expr|quickClass|quickID|uuid|quickChild|continue|Height|textContent|appendTo|contents|open|margin|evalScript|borderTopWidth|borderLeftWidth|parent|httpData|setArray|CSS1Compat|compatMode|boxModel|cssFloat|linear|def|webkit|nodeValue|speed|_toggle|eq|100|replaceWith|304|concat|200|alpha|Last|httpNotModified|getAttributeNode|httpSuccess|clearInterval|abort|beforeSend|splice|styleFloat|throw|colgroup|XMLHttpRequest|ActiveXObject|scriptCharset|callback|fieldset|multiple|processData|getBoundingClientRect|contentType|link|ajaxSend|ajaxSuccess|ajaxError|col|ajaxComplete|ajaxStop|ajaxStart|serializeArray|notmodified|keypress|keydown|change|mouseup|mousedown|dblclick|focus|blur|stylesheet|hasClass|rel|doScroll|black|hover|solid|cancelBubble|returnValue|wheelDelta|view|round|shiftKey|resize|screenY|screenX|relatedNode|mousemove|prevValue|originalTarget|offsetHeight|keyup|newValue|offsetWidth|eventPhase|detail|currentTarget|cancelable|bubbles|attrName|attrChange|altKey|originalEvent|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|font|gt|lt|uFFFF|u0128|size|417|Boolean|Date|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|wrap|contentWindow|contentDocument|iframe|children|siblings|prevAll|wrapInner|nextAll|outer|prev|scrollTo|static|marginTop|next|inline|parents|able|cellSpacing|adobeair|cellspacing|522|maxLength|maxlength|readOnly|400|readonly|fast|600|class|slow|1px|htmlFor|reverse|10000|PI|cos|compatible|Function|setData|ie|ra|it|rv|getData|userAgent|navigator|fadeTo|fadeIn|slideToggle|slideUp|slideDown|ig|responseXML|content|1223|NaN|fadeOut|300|protocol|send|setAttribute|option|dataFilter|cssText|changed|be|Accept|stop|With|Requested|Object|can|GMT|property|1970|Jan|01|Thu|Since|If|Type|Content|XMLHTTP|th|Microsoft|td|onreadystatechange|onload|cap|charset|colg|host|tfoot|specified|with|1_|thead|leg|plain|attributes|opt|embed|urlencoded|www|area|hr|ajaxSetup|meta|post|getJSON|getScript|marginLeft|img|elements|pageYOffset|pageXOffset|abbr|serialize|pixelLeft'.split('|'),0,{}));

var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes': {}, 'locale': {} };

/**
 * Set the variable that indicates if JavaScript behaviors should be applied
 */
Drupal.jsEnabled = document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById;

/**
 * Attach all registered behaviors to a page element.
 *
 * Behaviors are event-triggered actions that attach to page elements, enhancing
 * default non-Javascript UIs. Behaviors are registered in the Drupal.behaviors
 * object as follows:
 * @code
 *    Drupal.behaviors.behaviorName = function () {
 *      ...
 *    };
 * @endcode
 *
 * Drupal.attachBehaviors is added below to the jQuery ready event and so
 * runs on initial page load. Developers implementing AHAH/AJAX in their
 * solutions should also call this function after new page content has been
 * loaded, feeding in an element to be processed, in order to attach all
 * behaviors to the new content.
 *
 * Behaviors should use a class in the form behaviorName-processed to ensure
 * the behavior is attached only once to a given element. (Doing so enables
 * the reprocessing of given elements, which may be needed on occasion despite
 * the ability to limit behavior attachment to a particular element.)
 *
 * @param context
 *   An element to attach behaviors to. If none is given, the document element
 *   is used.
 */
Drupal.attachBehaviors = function(context) {
  context = context || document;
  if (Drupal.jsEnabled) {
    // Execute all of them.
    jQuery.each(Drupal.behaviors, function() {
      this(context);
    });
  }
};

/**
 * Encode special characters in a plain-text string for display as HTML.
 */
Drupal.checkPlain = function(str) {
  str = String(str);
  var replace = { '&': '&amp;', '"': '&quot;', '<': '&lt;', '>': '&gt;' };
  for (var character in replace) {
    var regex = new RegExp(character, 'g');
    str = str.replace(regex, replace[character]);
  }
  return str;
};

/**
 * Translate strings to the page language or a given language.
 *
 * See the documentation of the server-side t() function for further details.
 *
 * @param str
 *   A string containing the English string to translate.
 * @param args
 *   An object of replacements pairs to make after translation. Incidences
 *   of any key in this array are replaced with the corresponding value.
 *   Based on the first character of the key, the value is escaped and/or themed:
 *    - !variable: inserted as is
 *    - @variable: escape plain text to HTML (Drupal.checkPlain)
 *    - %variable: escape text and theme as a placeholder for user-submitted
 *      content (checkPlain + Drupal.theme('placeholder'))
 * @return
 *   The translated string.
 */
Drupal.t = function(str, args) {
  // Fetch the localized version of the string.
  if (Drupal.locale.strings && Drupal.locale.strings[str]) {
    str = Drupal.locale.strings[str];
  }

  if (args) {
    // Transform arguments before inserting them
    for (var key in args) {
      switch (key.charAt(0)) {
        // Escaped only
        case '@':
          args[key] = Drupal.checkPlain(args[key]);
        break;
        // Pass-through
        case '!':
          break;
        // Escaped and placeholder
        case '%':
        default:
          args[key] = Drupal.theme('placeholder', args[key]);
          break;
      }
      str = str.replace(key, args[key]);
    }
  }
  return str;
};

/**
 * Format a string containing a count of items.
 *
 * This function ensures that the string is pluralized correctly. Since Drupal.t() is
 * called by this function, make sure not to pass already-localized strings to it.
 *
 * See the documentation of the server-side format_plural() function for further details.
 *
 * @param count
 *   The item count to display.
 * @param singular
 *   The string for the singular case. Please make sure it is clear this is
 *   singular, to ease translation (e.g. use "1 new comment" instead of "1 new").
 *   Do not use @count in the singular string.
 * @param plural
 *   The string for the plural case. Please make sure it is clear this is plural,
 *   to ease translation. Use @count in place of the item count, as in "@count
 *   new comments".
 * @param args
 *   An object of replacements pairs to make after translation. Incidences
 *   of any key in this array are replaced with the corresponding value.
 *   Based on the first character of the key, the value is escaped and/or themed:
 *    - !variable: inserted as is
 *    - @variable: escape plain text to HTML (Drupal.checkPlain)
 *    - %variable: escape text and theme as a placeholder for user-submitted
 *      content (checkPlain + Drupal.theme('placeholder'))
 *   Note that you do not need to include @count in this array.
 *   This replacement is done automatically for the plural case.
 * @return
 *   A translated string.
 */
Drupal.formatPlural = function(count, singular, plural, args) {
  var args = args || {};
  args['@count'] = count;
  // Determine the index of the plural form.
  var index = Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : ((args['@count'] == 1) ? 0 : 1);

  if (index == 0) {
    return Drupal.t(singular, args);
  }
  else if (index == 1) {
    return Drupal.t(plural, args);
  }
  else {
    args['@count['+ index +']'] = args['@count'];
    delete args['@count'];
    return Drupal.t(plural.replace('@count', '@count['+ index +']'));
  }
};

/**
 * Generate the themed representation of a Drupal object.
 *
 * All requests for themed output must go through this function. It examines
 * the request and routes it to the appropriate theme function. If the current
 * theme does not provide an override function, the generic theme function is
 * called.
 *
 * For example, to retrieve the HTML that is output by theme_placeholder(text),
 * call Drupal.theme('placeholder', text).
 *
 * @param func
 *   The name of the theme function to call.
 * @param ...
 *   Additional arguments to pass along to the theme function.
 * @return
 *   Any data the theme function returns. This could be a plain HTML string,
 *   but also a complex object.
 */
Drupal.theme = function(func) {
  for (var i = 1, args = []; i < arguments.length; i++) {
    args.push(arguments[i]);
  }

  return (Drupal.theme[func] || Drupal.theme.prototype[func]).apply(this, args);
};

/**
 * Parse a JSON response.
 *
 * The result is either the JSON object, or an object with 'status' 0 and 'data' an error message.
 */
Drupal.parseJson = function (data) {
  if ((data.substring(0, 1) != '{') && (data.substring(0, 1) != '[')) {
    return { status: 0, data: data.length ? data : Drupal.t('Unspecified error') };
  }
  return eval('(' + data + ');');
};

/**
 * Freeze the current body height (as minimum height). Used to prevent
 * unnecessary upwards scrolling when doing DOM manipulations.
 */
Drupal.freezeHeight = function () {
  Drupal.unfreezeHeight();
  var div = document.createElement('div');
  $(div).css({
    position: 'absolute',
    top: '0px',
    left: '0px',
    width: '1px',
    height: $('body').css('height')
  }).attr('id', 'freeze-height');
  $('body').append(div);
};

/**
 * Unfreeze the body height
 */
Drupal.unfreezeHeight = function () {
  $('#freeze-height').remove();
};

/**
 * Wrapper around encodeURIComponent() which avoids Apache quirks (equivalent of
 * drupal_urlencode() in PHP). This function should only be used on paths, not
 * on query string arguments.
 */
Drupal.encodeURIComponent = function (item, uri) {
  uri = uri || location.href;
  item = encodeURIComponent(item).replace(/%2F/g, '/');
  return (uri.indexOf('?q=') != -1) ? item : item.replace(/%26/g, '%2526').replace(/%23/g, '%2523').replace(/\/\//g, '/%252F');
};

/**
 * Get the text selection in a textarea.
 */
Drupal.getSelection = function (element) {
  if (typeof(element.selectionStart) != 'number' && document.selection) {
    // The current selection
    var range1 = document.selection.createRange();
    var range2 = range1.duplicate();
    // Select all text.
    range2.moveToElementText(element);
    // Now move 'dummy' end point to end point of original range.
    range2.setEndPoint('EndToEnd', range1);
    // Now we can calculate start and end points.
    var start = range2.text.length - range1.text.length;
    var end = start + range1.text.length;
    return { 'start': start, 'end': end };
  }
  return { 'start': element.selectionStart, 'end': element.selectionEnd };
};

/**
 * Build an error message from ahah response.
 */
Drupal.ahahError = function(xmlhttp, uri) {
  if (xmlhttp.status == 200) {
    if (jQuery.trim($(xmlhttp.responseText).text())) {
      var message = Drupal.t("An error occurred. \n@uri\n@text", {'@uri': uri, '@text': xmlhttp.responseText });
    }
    else {
      var message = Drupal.t("An error occurred. \n@uri\n(no information available).", {'@uri': uri, '@text': xmlhttp.responseText });
    }
  }
  else {
    var message = Drupal.t("An HTTP error @status occurred. \n@uri", {'@uri': uri, '@status': xmlhttp.status });
  }
  return message;
}

// Global Killswitch on the <html> element
if (Drupal.jsEnabled) {
  // Global Killswitch on the <html> element
  $(document.documentElement).addClass('js');
  // 'js enabled' cookie
  document.cookie = 'has_js=1; path=/';
  // Attach all behaviors.
  $(document).ready(function() {
    Drupal.attachBehaviors(this);
  });
}

/**
 * The default themes.
 */
Drupal.theme.prototype = {

  /**
   * Formats text for emphasized display in a placeholder inside a sentence.
   *
   * @param str
   *   The text to format (plain-text).
   * @return
   *   The formatted text (html).
   */
  placeholder: function(str) {
    return '<em>' + Drupal.checkPlain(str) + '</em>';
  }
};
;

/**
 * Adds the custom autocomplete widget behavior.
 */
Drupal.behaviors.apachesolr_autocomplete = function(context) {
  $(".apachesolr-autocomplete.unprocessed", context).autocomplete(Drupal.settings.apachesolr_autocomplete.path,
  {
    // Classnames for the widget.
    inputClass: "",
    loadingClass: "throbbing",
    // Do not select first suggestion by default.
    selectFirst: false,
    // Specify no matching as it wil be done on server-side.
    matchContains: false,
    matchSubset: false,
    // Maximum number of items to show in widget.
    max: 50,
    scroll: true,
    scrollHeight: 360,
    // Data returned from server is JSON-encoded.
    dataType: "json",
    // Function to parse returned json into elements.
    parse: function(data) {
      return $.map(data, function(item) {
        return {
          data: item,          // Echo the input data.
          value: item.display, // This will be shown in the options widget.
          result: item.key     // The actual value to put into the form element.
        }
      });
    },
    // Return the HTML to display in the options widget.
    formatItem: function(item) {
      return item.display;
    }
  }).result(function(item, element) {
    // Handle selection of an element in the autocomplete widget.
    // We should submit the widget's parent form.
    $(this).get(0).form.submit();
  }).addClass('form-autocomplete'); // Add Drupal autocomplete widget's style.
};
;
/*
 * jQuery Autocomplete plugin 1.1
 *
 * Copyright (c) 2009 Jörn Zaefferer
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 */

;(function($) {
	
$.fn.extend({
	autocomplete: function(urlOrData, options) {
		var isUrl = typeof urlOrData == "string";
		options = $.extend({}, $.Autocompleter.defaults, {
			url: isUrl ? urlOrData : null,
			data: isUrl ? null : urlOrData,
			delay: isUrl ? $.Autocompleter.defaults.delay : 10,
			max: options && !options.scroll ? 10 : 150
		}, options);
		
		// if highlight is set to false, replace it with a do-nothing function
		options.highlight = options.highlight || function(value) { return value; };
		
		// if the formatMatch option is not specified, then use formatItem for backwards compatibility
		options.formatMatch = options.formatMatch || options.formatItem;
		
		return this.each(function() {
			new $.Autocompleter(this, options);
		});
	},
	result: function(handler) {
		return this.bind("result", handler);
	},
	search: function(handler) {
		return this.trigger("search", [handler]);
	},
	flushCache: function() {
		return this.trigger("flushCache");
	},
	setOptions: function(options){
		return this.trigger("setOptions", [options]);
	},
	unautocomplete: function() {
		return this.trigger("unautocomplete");
	}
});

$.Autocompleter = function(input, options) {

	var KEY = {
		UP: 38,
		DOWN: 40,
		DEL: 46,
		TAB: 9,
		RETURN: 13,
		ESC: 27,
		COMMA: 188,
		PAGEUP: 33,
		PAGEDOWN: 34,
		BACKSPACE: 8
	};

	// Create $ object for input element
	var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);

	var timeout;
	var previousValue = "";
	var cache = $.Autocompleter.Cache(options);
	var hasFocus = 0;
	var lastKeyPressCode;
	var config = {
		mouseDownOnSelect: false
	};
	var select = $.Autocompleter.Select(options, input, selectCurrent, config);
	
	var blockSubmit;
	
	// prevent form submit in opera when selecting with return key
	$.browser.opera && $(input.form).bind("submit.autocomplete", function() {
		if (blockSubmit) {
			blockSubmit = false;
			return false;
		}
	});
	
	// only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
	$input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
		// a keypress means the input has focus
		// avoids issue where input had focus before the autocomplete was applied
		hasFocus = 1;
		// track last key pressed
		lastKeyPressCode = event.keyCode;
		switch(event.keyCode) {
		
			case KEY.UP:
				event.preventDefault();
				if ( select.visible() ) {
					select.prev();
				} else {
					onChange(0, true);
				}
				break;
				
			case KEY.DOWN:
				event.preventDefault();
				if ( select.visible() ) {
					select.next();
				} else {
					onChange(0, true);
				}
				break;
				
			case KEY.PAGEUP:
				event.preventDefault();
				if ( select.visible() ) {
					select.pageUp();
				} else {
					onChange(0, true);
				}
				break;
				
			case KEY.PAGEDOWN:
				event.preventDefault();
				if ( select.visible() ) {
					select.pageDown();
				} else {
					onChange(0, true);
				}
				break;
			
			// matches also semicolon
			case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
			case KEY.TAB:
			case KEY.RETURN:
				if( selectCurrent() ) {
					// stop default to prevent a form submit, Opera needs special handling
					event.preventDefault();
					blockSubmit = true;
					return false;
				}
				break;
				
			case KEY.ESC:
				select.hide();
				break;
				
			default:
				clearTimeout(timeout);
				timeout = setTimeout(onChange, options.delay);
				break;
		}
	}).focus(function(){
		// track whether the field has focus, we shouldn't process any
		// results if the field no longer has focus
		hasFocus++;
	}).blur(function() {
		hasFocus = 0;
		if (!config.mouseDownOnSelect) {
			hideResults();
		}
	}).click(function() {
		// show select when clicking in a focused field
		if ( hasFocus++ > 1 && !select.visible() ) {
			onChange(0, true);
		}
	}).bind("search", function() {
		// TODO why not just specifying both arguments?
		var fn = (arguments.length > 1) ? arguments[1] : null;
		function findValueCallback(q, data) {
			var result;
			if( data && data.length ) {
				for (var i=0; i < data.length; i++) {
					if( data[i].result.toLowerCase() == q.toLowerCase() ) {
						result = data[i];
						break;
					}
				}
			}
			if( typeof fn == "function" ) fn(result);
			else $input.trigger("result", result && [result.data, result.value]);
		}
		$.each(trimWords($input.val()), function(i, value) {
			request(value, findValueCallback, findValueCallback);
		});
	}).bind("flushCache", function() {
		cache.flush();
	}).bind("setOptions", function() {
		$.extend(options, arguments[1]);
		// if we've updated the data, repopulate
		if ( "data" in arguments[1] )
			cache.populate();
	}).bind("unautocomplete", function() {
		select.unbind();
		$input.unbind();
		$(input.form).unbind(".autocomplete");
	});
	
	
	function selectCurrent() {
		var selected = select.selected();
		if( !selected )
			return false;
		
		var v = selected.result;
		previousValue = v;
		
		if ( options.multiple ) {
			var words = trimWords($input.val());
			if ( words.length > 1 ) {
				var seperator = options.multipleSeparator.length;
				var cursorAt = $(input).selection().start;
				var wordAt, progress = 0;
				$.each(words, function(i, word) {
					progress += word.length;
					if (cursorAt <= progress) {
						wordAt = i;
						return false;
					}
					progress += seperator;
				});
				words[wordAt] = v;
				// TODO this should set the cursor to the right position, but it gets overriden somewhere
				//$.Autocompleter.Selection(input, progress + seperator, progress + seperator);
				v = words.join( options.multipleSeparator );
			}
			v += options.multipleSeparator;
		}
		
		$input.val(v);
		hideResultsNow();
		$input.trigger("result", [selected.data, selected.value]);
		return true;
	}
	
	function onChange(crap, skipPrevCheck) {
		if( lastKeyPressCode == KEY.DEL ) {
			select.hide();
			return;
		}
		
		var currentValue = $input.val();
		
		if ( !skipPrevCheck && currentValue == previousValue )
			return;
		
		previousValue = currentValue;
		
		currentValue = lastWord(currentValue);
		if ( currentValue.length >= options.minChars) {
			$input.addClass(options.loadingClass);
			if (!options.matchCase)
				currentValue = currentValue.toLowerCase();
			request(currentValue, receiveData, hideResultsNow);
		} else {
			stopLoading();
			select.hide();
		}
	};
	
	function trimWords(value) {
		if (!value)
			return [""];
		if (!options.multiple)
			return [$.trim(value)];
		return $.map(value.split(options.multipleSeparator), function(word) {
			return $.trim(value).length ? $.trim(word) : null;
		});
	}
	
	function lastWord(value) {
		if ( !options.multiple )
			return value;
		var words = trimWords(value);
		if (words.length == 1) 
			return words[0];
		var cursorAt = $(input).selection().start;
		if (cursorAt == value.length) {
			words = trimWords(value)
		} else {
			words = trimWords(value.replace(value.substring(cursorAt), ""));
		}
		return words[words.length - 1];
	}
	
	// fills in the input box w/the first match (assumed to be the best match)
	// q: the term entered
	// sValue: the first matching result
	function autoFill(q, sValue){
		// autofill in the complete box w/the first match as long as the user hasn't entered in more data
		// if the last user key pressed was backspace, don't autofill
		if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
			// fill in the value (keep the case the user has typed)
			$input.val($input.val() + sValue.substring(lastWord(previousValue).length));
			// select the portion of the value not typed by the user (so the next character will erase)
			$(input).selection(previousValue.length, previousValue.length + sValue.length);
		}
	};

	function hideResults() {
		clearTimeout(timeout);
		timeout = setTimeout(hideResultsNow, 200);
	};

	function hideResultsNow() {
		var wasVisible = select.visible();
		select.hide();
		clearTimeout(timeout);
		stopLoading();
		if (options.mustMatch) {
			// call search and run callback
			$input.search(
				function (result){
					// if no value found, clear the input box
					if( !result ) {
						if (options.multiple) {
							var words = trimWords($input.val()).slice(0, -1);
							$input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") );
						}
						else {
							$input.val( "" );
							$input.trigger("result", null);
						}
					}
				}
			);
		}
	};

	function receiveData(q, data) {
		if ( data && data.length && hasFocus ) {
			stopLoading();
			select.display(data, q);
			autoFill(q, data[0].value);
			select.show();
		} else {
			hideResultsNow();
		}
	};

	function request(term, success, failure) {
		if (!options.matchCase)
			term = term.toLowerCase();
		var data = cache.load(term);
		// recieve the cached data
		if (data && data.length) {
			success(term, data);
		// if an AJAX url has been supplied, try loading the data now
		} else if( (typeof options.url == "string") && (options.url.length > 0) ){
			
			var extraParams = {
				timestamp: +new Date()
			};
			$.each(options.extraParams, function(key, param) {
				extraParams[key] = typeof param == "function" ? param() : param;
			});
			
			$.ajax({
				// try to leverage ajaxQueue plugin to abort previous requests
				mode: "abort",
				// limit abortion to this input
				port: "autocomplete" + input.name,
				dataType: options.dataType,
				url: options.url,
				data: $.extend({
					query: lastWord(term),
					limit: options.max
				}, extraParams),
				success: function(data) {
					var parsed = options.parse && options.parse(data) || parse(data);
					cache.add(term, parsed);
					success(term, parsed);
				}
			});
		} else {
			// if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
			select.emptyList();
			failure(term);
		}
	};
	
	function parse(data) {
		var parsed = [];
		var rows = data.split("\n");
		for (var i=0; i < rows.length; i++) {
			var row = $.trim(rows[i]);
			if (row) {
				row = row.split("|");
				parsed[parsed.length] = {
					data: row,
					value: row[0],
					result: options.formatResult && options.formatResult(row, row[0]) || row[0]
				};
			}
		}
		return parsed;
	};

	function stopLoading() {
		$input.removeClass(options.loadingClass);
	};

};

$.Autocompleter.defaults = {
	inputClass: "ac_input",
	resultsClass: "ac_results",
	loadingClass: "ac_loading",
	minChars: 1,
	delay: 400,
	matchCase: false,
	matchSubset: true,
	matchContains: false,
	cacheLength: 10,
	max: 100,
	mustMatch: false,
	extraParams: {},
	selectFirst: true,
	formatItem: function(row) { return row[0]; },
	formatMatch: null,
	autoFill: false,
	width: 0,
	multiple: false,
	multipleSeparator: ", ",
	highlight: function(value, term) {
		return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
	},
    scroll: true,
    scrollHeight: 180
};

$.Autocompleter.Cache = function(options) {

	var data = {};
	var length = 0;
	
	function matchSubset(s, sub) {
		if (!options.matchCase) 
			s = s.toLowerCase();
		var i = s.indexOf(sub);
		if (options.matchContains == "word"){
			i = s.toLowerCase().search("\\b" + sub.toLowerCase());
		}
		if (i == -1) return false;
		return i == 0 || options.matchContains;
	};
	
	function add(q, value) {
		if (length > options.cacheLength){
			flush();
		}
		if (!data[q]){ 
			length++;
		}
		data[q] = value;
	}
	
	function populate(){
		if( !options.data ) return false;
		// track the matches
		var stMatchSets = {},
			nullData = 0;

		// no url was specified, we need to adjust the cache length to make sure it fits the local data store
		if( !options.url ) options.cacheLength = 1;
		
		// track all options for minChars = 0
		stMatchSets[""] = [];
		
		// loop through the array and create a lookup structure
		for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
			var rawValue = options.data[i];
			// if rawValue is a string, make an array otherwise just reference the array
			rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
			
			var value = options.formatMatch(rawValue, i+1, options.data.length);
			if ( value === false )
				continue;
				
			var firstChar = value.charAt(0).toLowerCase();
			// if no lookup array for this character exists, look it up now
			if( !stMatchSets[firstChar] ) 
				stMatchSets[firstChar] = [];

			// if the match is a string
			var row = {
				value: value,
				data: rawValue,
				result: options.formatResult && options.formatResult(rawValue) || value
			};
			
			// push the current match into the set list
			stMatchSets[firstChar].push(row);

			// keep track of minChars zero items
			if ( nullData++ < options.max ) {
				stMatchSets[""].push(row);
			}
		};

		// add the data items to the cache
		$.each(stMatchSets, function(i, value) {
			// increase the cache size
			options.cacheLength++;
			// add to the cache
			add(i, value);
		});
	}
	
	// populate any existing data
	setTimeout(populate, 25);
	
	function flush(){
		data = {};
		length = 0;
	}
	
	return {
		flush: flush,
		add: add,
		populate: populate,
		load: function(q) {
			if (!options.cacheLength || !length)
				return null;
			/* 
			 * if dealing w/local data and matchContains than we must make sure
			 * to loop through all the data collections looking for matches
			 */
			if( !options.url && options.matchContains ){
				// track all matches
				var csub = [];
				// loop through all the data grids for matches
				for( var k in data ){
					// don't search through the stMatchSets[""] (minChars: 0) cache
					// this prevents duplicates
					if( k.length > 0 ){
						var c = data[k];
						$.each(c, function(i, x) {
							// if we've got a match, add it to the array
							if (matchSubset(x.value, q)) {
								csub.push(x);
							}
						});
					}
				}				
				return csub;
			} else 
			// if the exact item exists, use it
			if (data[q]){
				return data[q];
			} else
			if (options.matchSubset) {
				for (var i = q.length - 1; i >= options.minChars; i--) {
					var c = data[q.substr(0, i)];
					if (c) {
						var csub = [];
						$.each(c, function(i, x) {
							if (matchSubset(x.value, q)) {
								csub[csub.length] = x;
							}
						});
						return csub;
					}
				}
			}
			return null;
		}
	};
};

$.Autocompleter.Select = function (options, input, select, config) {
	var CLASSES = {
		ACTIVE: "ac_over"
	};
	
	var listItems,
		active = -1,
		data,
		term = "",
		needsInit = true,
		element,
		list;
	
	// Create results
	function init() {
		if (!needsInit)
			return;
		element = $("<div/>")
		.hide()
		.addClass(options.resultsClass)
		.css("position", "absolute")
		.appendTo(document.body);
	
		list = $("<ul/>").appendTo(element).mouseover( function(event) {
			if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
	            active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
			    $(target(event)).addClass(CLASSES.ACTIVE);            
	        }
		}).click(function(event) {
			$(target(event)).addClass(CLASSES.ACTIVE);
			select();
			// TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
			input.focus();
			return false;
		}).mousedown(function() {
			config.mouseDownOnSelect = true;
		}).mouseup(function() {
			config.mouseDownOnSelect = false;
		});
		
		if( options.width > 0 )
			element.css("width", options.width);
			
		needsInit = false;
	} 
	
	function target(event) {
		var element = event.target;
		while(element && element.tagName != "LI")
			element = element.parentNode;
		// more fun with IE, sometimes event.target is empty, just ignore it then
		if(!element)
			return [];
		return element;
	}

	function moveSelect(step) {
		listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
		movePosition(step);
        var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
        if(options.scroll) {
            var offset = 0;
            listItems.slice(0, active).each(function() {
				offset += this.offsetHeight;
			});
            if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
                list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
            } else if(offset < list.scrollTop()) {
                list.scrollTop(offset);
            }
        }
	};
	
	function movePosition(step) {
		active += step;
		if (active < 0) {
			active = listItems.size() - 1;
		} else if (active >= listItems.size()) {
			active = 0;
		}
	}
	
	function limitNumberOfItems(available) {
		return options.max && options.max < available
			? options.max
			: available;
	}
	
	function fillList() {
		list.empty();
		var max = limitNumberOfItems(data.length);
		for (var i=0; i < max; i++) {
			if (!data[i])
				continue;
			var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
			if ( formatted === false )
				continue;
			var li = $("<li/>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
			$.data(li, "ac_data", data[i]);
		}
		listItems = list.find("li");
		if ( options.selectFirst ) {
			listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
			active = 0;
		}
		// apply bgiframe if available
		if ( $.fn.bgiframe )
			list.bgiframe();
	}
	
	return {
		display: function(d, q) {
			init();
			data = d;
			term = q;
			fillList();
		},
		next: function() {
			moveSelect(1);
		},
		prev: function() {
			moveSelect(-1);
		},
		pageUp: function() {
			if (active != 0 && active - 8 < 0) {
				moveSelect( -active );
			} else {
				moveSelect(-8);
			}
		},
		pageDown: function() {
			if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
				moveSelect( listItems.size() - 1 - active );
			} else {
				moveSelect(8);
			}
		},
		hide: function() {
			element && element.hide();
			listItems && listItems.removeClass(CLASSES.ACTIVE);
			active = -1;
		},
		visible : function() {
			return element && element.is(":visible");
		},
		current: function() {
			return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
		},
		show: function() {
			var offset = $(input).offset();
			element.css({
				width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
				top: offset.top + input.offsetHeight,
				left: offset.left
			}).show();
            if(options.scroll) {
                list.scrollTop(0);
                list.css({
					maxHeight: options.scrollHeight,
					overflow: 'auto'
				});
				
                if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
					var listHeight = 0;
					listItems.each(function() {
						listHeight += this.offsetHeight;
					});
					var scrollbarsVisible = listHeight > options.scrollHeight;
                    list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
					if (!scrollbarsVisible) {
						// IE doesn't recalculate width when scrollbar disappears
						listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
					}
                }
                
            }
		},
		selected: function() {
			var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
			return selected && selected.length && $.data(selected[0], "ac_data");
		},
		emptyList: function (){
			list && list.empty();
		},
		unbind: function() {
			element && element.remove();
		}
	};
};

$.fn.selection = function(start, end) {
	if (start !== undefined) {
		return this.each(function() {
			if( this.createTextRange ){
				var selRange = this.createTextRange();
				if (end === undefined || start == end) {
					selRange.move("character", start);
					selRange.select();
				} else {
					selRange.collapse(true);
					selRange.moveStart("character", start);
					selRange.moveEnd("character", end);
					selRange.select();
				}
			} else if( this.setSelectionRange ){
				this.setSelectionRange(start, end);
			} else if( this.selectionStart ){
				this.selectionStart = start;
				this.selectionEnd = end;
			}
		});
	}
	var field = this[0];
	if ( field.createTextRange ) {
		var range = document.selection.createRange(),
			orig = field.value,
			teststring = "<->",
			textLength = range.text.length;
		range.text = teststring;
		var caretAt = field.value.indexOf(teststring);
		field.value = orig;
		this.selection(caretAt, caretAt + textLength);
		return {
			start: caretAt,
			end: caretAt + textLength
		}
	} else if( field.selectionStart !== undefined ){
		return {
			start: field.selectionStart,
			end: field.selectionEnd
		}
	}
};

})(jQuery);
;

$(document).ready(function() {

  // Attach onclick event to document only and catch clicks on all elements.
  $(document.body).click(function(event) {
    // Catch only the first parent link of a clicked element.
    $(event.target).parents("a:first,area:first").andSelf().filter("a,area").each(function() {

      var ga = Drupal.settings.googleanalytics;
      // Expression to check for absolute internal links.
      var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i");
      // Expression to check for special links like gotwo.module /go/* links.
      var isInternalSpecial = new RegExp("(\/go\/.*)$", "i");
      // Expression to check for download links.
      var isDownload = new RegExp("\\.(" + ga.trackDownloadExtensions + ")$", "i");

      // Is the clicked URL internal?
      if (isInternal.test(this.href)) {
        // Is download tracking activated and the file extension configured for download tracking?
        if (ga.trackDownload && isDownload.test(this.href)) {
          // Download link clicked.
          var extension = isDownload.exec(this.href);
          _gaq.push(["_trackEvent", "Downloads", extension[1].toUpperCase(), this.href.replace(isInternal, '')]);
        }
        else if (isInternalSpecial.test(this.href)) {
          // Keep the internal URL for Google Analytics website overlay intact.
          _gaq.push(["_trackPageview", this.href.replace(isInternal, '')]);
        }
      }
      else {
        if (ga.trackMailto && $(this).is("a[href^=mailto:],area[href^=mailto:]")) {
          // Mailto link clicked.
          _gaq.push(["_trackEvent", "Mails", "Click", this.href.substring(7)]);
        }
        else if (ga.trackOutgoing && this.href) {
          if (ga.trackOutboundAsPageview) {
            // Track all external links as page views after URL cleanup.
            // Currently required, if click should be tracked as goal.
            _gaq.push(["_trackPageview", '/outbound/' + this.href.replace(/^(https?|ftp|news|nntp|telnet|irc|ssh|sftp|webcal):\/\//i, '').split('/').join('--')]);
          }
          else {
            // External link clicked.
            _gaq.push(["_trackEvent", "Outbound links", "Click", this.href]);
          }
        }
      }
    });
  });
});
;
/* $Id: lightbox.js,v 1.5.2.6.2.136 2010/09/24 08:39:40 snpower Exp $ */

/**
 * jQuery Lightbox
 * @author
 *   Stella Power, <http://drupal.org/user/66894>
 *
 * Based on Lightbox v2.03.3 by Lokesh Dhakar
 * <http://www.huddletogether.com/projects/lightbox2/>
 * Also partially based on the jQuery Lightbox by Warren Krewenki
 *   <http://warren.mesozen.com>
 *
 * Permission has been granted to Mark Ashmead & other Drupal Lightbox2 module
 * maintainers to distribute this file via Drupal.org
 * Under GPL license.
 *
 * Slideshow, iframe and video functionality added by Stella Power.
 */

var Lightbox = {
  auto_modal : false,
  overlayOpacity : 0.8, // Controls transparency of shadow overlay.
  overlayColor : '000', // Controls colour of shadow overlay.
  disableCloseClick : true,
  // Controls the order of the lightbox resizing animation sequence.
  resizeSequence: 0, // 0: simultaneous, 1: width then height, 2: height then width.
  resizeSpeed: 'normal', // Controls the speed of the lightbox resizing animation.
  fadeInSpeed: 'normal', // Controls the speed of the image appearance.
  slideDownSpeed: 'slow', // Controls the speed of the image details appearance.
  minWidth: 240,
  borderSize : 10,
  boxColor : 'fff',
  fontColor : '000',
  topPosition : '',
  infoHeight: 20,
  alternative_layout : false,
  imageArray : [],
  imageNum : null,
  total : 0,
  activeImage : null,
  inprogress : false,
  disableResize : false,
  disableZoom : false,
  isZoomedIn : false,
  rtl : false,
  loopItems : false,
  keysClose : ['c', 'x', 27],
  keysPrevious : ['p', 37],
  keysNext : ['n', 39],
  keysZoom : ['z'],
  keysPlayPause : [32],

  // Slideshow options.
  slideInterval : 5000, // In milliseconds.
  showPlayPause : true,
  autoStart : true,
  autoExit : true,
  pauseOnNextClick : false, // True to pause the slideshow when the "Next" button is clicked.
  pauseOnPrevClick : true, // True to pause the slideshow when the "Prev" button is clicked.
  slideIdArray : [],
  slideIdCount : 0,
  isSlideshow : false,
  isPaused : false,
  loopSlides : false,

  // Iframe options.
  isLightframe : false,
  iframe_width : 600,
  iframe_height : 400,
  iframe_border : 1,

  // Video and modal options.
  enableVideo : false,
  flvPlayer : '/flvplayer.swf',
  flvFlashvars : '',
  isModal : false,
  isVideo : false,
  videoId : false,
  modalWidth : 400,
  modalHeight : 400,
  modalHTML : null,


  // initialize()
  // Constructor runs on completion of the DOM loading.
  // The function inserts html at the bottom of the page which is used
  // to display the shadow overlay and the image container.
  initialize: function() {

    var s = Drupal.settings.lightbox2;
    Lightbox.overlayOpacity = s.overlay_opacity;
    Lightbox.overlayColor = s.overlay_color;
    Lightbox.disableCloseClick = s.disable_close_click;
    Lightbox.resizeSequence = s.resize_sequence;
    Lightbox.resizeSpeed = s.resize_speed;
    Lightbox.fadeInSpeed = s.fade_in_speed;
    Lightbox.slideDownSpeed = s.slide_down_speed;
    Lightbox.borderSize = s.border_size;
    Lightbox.boxColor = s.box_color;
    Lightbox.fontColor = s.font_color;
    Lightbox.topPosition = s.top_position;
    Lightbox.rtl = s.rtl;
    Lightbox.loopItems = s.loop_items;
    Lightbox.keysClose = s.keys_close.split(" ");
    Lightbox.keysPrevious = s.keys_previous.split(" ");
    Lightbox.keysNext = s.keys_next.split(" ");
    Lightbox.keysZoom = s.keys_zoom.split(" ");
    Lightbox.keysPlayPause = s.keys_play_pause.split(" ");
    Lightbox.disableResize = s.disable_resize;
    Lightbox.disableZoom = s.disable_zoom;
    Lightbox.slideInterval = s.slideshow_interval;
    Lightbox.showPlayPause = s.show_play_pause;
    Lightbox.showCaption = s.show_caption;
    Lightbox.autoStart = s.slideshow_automatic_start;
    Lightbox.autoExit = s.slideshow_automatic_exit;
    Lightbox.pauseOnNextClick = s.pause_on_next_click;
    Lightbox.pauseOnPrevClick = s.pause_on_previous_click;
    Lightbox.loopSlides = s.loop_slides;
    Lightbox.alternative_layout = s.use_alt_layout;
    Lightbox.iframe_width = s.iframe_width;
    Lightbox.iframe_height = s.iframe_height;
    Lightbox.iframe_border = s.iframe_border;
    Lightbox.enableVideo = s.enable_video;
    if (s.enable_video) {
      Lightbox.flvPlayer = s.flvPlayer;
      Lightbox.flvFlashvars = s.flvFlashvars;
    }

    // Make the lightbox divs.
    var layout_class = (s.use_alt_layout ? 'lightbox2-alt-layout' : 'lightbox2-orig-layout');
    var output = '<div id="lightbox2-overlay" style="display: none;"></div>\
      <div id="lightbox" style="display: none;" class="' + layout_class + '">\
        <div id="outerImageContainer"></div>\
        <div id="imageDataContainer" class="clearfix">\
          <div id="imageData"></div>\
        </div>\
      </div>';
    var loading = '<div id="loading"><a href="#" id="loadingLink"></a></div>';
    var modal = '<div id="modalContainer" style="display: none;"></div>';
    var frame = '<div id="frameContainer" style="display: none;"></div>';
    var imageContainer = '<div id="imageContainer" style="display: none;"></div>';
    var details = '<div id="imageDetails"></div>';
    var bottomNav = '<div id="bottomNav"></div>';
    var image = '<img id="lightboxImage" alt="" />';
    var hoverNav = '<div id="hoverNav"><a id="prevLink" href="#"></a><a id="nextLink" href="#"></a></div>';
    var frameNav = '<div id="frameHoverNav"><a id="framePrevLink" href="#"></a><a id="frameNextLink" href="#"></a></div>';
    var hoverNav = '<div id="hoverNav"><a id="prevLink" title="' + Drupal.t('Previous') + '" href="#"></a><a id="nextLink" title="' + Drupal.t('Next') + '" href="#"></a></div>';
    var frameNav = '<div id="frameHoverNav"><a id="framePrevLink" title="' + Drupal.t('Previous') + '" href="#"></a><a id="frameNextLink" title="' + Drupal.t('Next') + '" href="#"></a></div>';
    var caption = '<span id="caption"></span>';
    var numberDisplay = '<span id="numberDisplay"></span>';
    var close = '<a id="bottomNavClose" title="' + Drupal.t('Close') + '" href="#"></a>';
    var zoom = '<a id="bottomNavZoom" href="#"></a>';
    var zoomOut = '<a id="bottomNavZoomOut" href="#"></a>';
    var pause = '<a id="lightshowPause" title="' + Drupal.t('Pause Slideshow') + '" href="#" style="display: none;"></a>';
    var play = '<a id="lightshowPlay" title="' + Drupal.t('Play Slideshow') + '" href="#" style="display: none;"></a>';

    $("body").append(output);
    $('#outerImageContainer').append(modal + frame + imageContainer + loading);
    if (!s.use_alt_layout) {
      $('#imageContainer').append(image + hoverNav);
      $('#imageData').append(details + bottomNav);
      $('#imageDetails').append(caption + numberDisplay);
      $('#bottomNav').append(frameNav + close + zoom + zoomOut + pause + play);
    }
    else {
      $('#outerImageContainer').append(bottomNav);
      $('#imageContainer').append(image);
      $('#bottomNav').append(close + zoom + zoomOut);
      $('#imageData').append(hoverNav + details);
      $('#imageDetails').append(caption + numberDisplay + pause + play);
    }

    // Setup onclick handlers.
    if (Lightbox.disableCloseClick) {
      $('#lightbox2-overlay').click(function() { Lightbox.end(); return false; } ).hide();
    }
    $('#loadingLink, #bottomNavClose').click(function() { Lightbox.end('forceClose'); return false; } );
    $('#prevLink, #framePrevLink').click(function() { Lightbox.changeData(Lightbox.activeImage - 1); return false; } );
    $('#nextLink, #frameNextLink').click(function() { Lightbox.changeData(Lightbox.activeImage + 1); return false; } );
    $('#bottomNavZoom').click(function() { Lightbox.changeData(Lightbox.activeImage, true); return false; } );
    $('#bottomNavZoomOut').click(function() { Lightbox.changeData(Lightbox.activeImage, false); return false; } );
    $('#lightshowPause').click(function() { Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); return false; } );
    $('#lightshowPlay').click(function() { Lightbox.togglePlayPause("lightshowPlay", "lightshowPause"); return false; } );

    // Fix positioning.
    $('#prevLink, #nextLink, #framePrevLink, #frameNextLink').css({ 'paddingTop': Lightbox.borderSize + 'px'});
    $('#imageContainer, #frameContainer, #modalContainer').css({ 'padding': Lightbox.borderSize + 'px'});
    $('#outerImageContainer, #imageDataContainer, #bottomNavClose').css({'backgroundColor': '#' + Lightbox.boxColor, 'color': '#'+Lightbox.fontColor});
    if (Lightbox.alternative_layout) {
      $('#bottomNavZoom, #bottomNavZoomOut').css({'bottom': Lightbox.borderSize + 'px', 'right': Lightbox.borderSize + 'px'});
    }
    else if (Lightbox.rtl == 1 && $.browser.msie) {
      $('#bottomNavZoom, #bottomNavZoomOut').css({'left': '0px'});
    }

    // Force navigation links to always be displayed
    if (s.force_show_nav) {
      $('#prevLink, #nextLink').addClass("force_show_nav");
    }

  },

  // initList()
  // Loops through anchor tags looking for 'lightbox', 'lightshow' and
  // 'lightframe', etc, references and applies onclick events to appropriate
  // links. You can rerun after dynamically adding images w/ajax.
  initList : function(context) {

    if (context == undefined || context == null) {
      context = document;
    }

    // Attach lightbox to any links with rel 'lightbox', 'lightshow' or
    // 'lightframe', etc.
    $("a[rel^='lightbox']:not(.lightbox-processed), area[rel^='lightbox']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
      if (Lightbox.disableCloseClick) {
        $('#lightbox').unbind('click');
        $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
      }
      Lightbox.start(this, false, false, false, false);
      if (e.preventDefault) { e.preventDefault(); }
      return false;
    });
    $("a[rel^='lightshow']:not(.lightbox-processed), area[rel^='lightshow']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
      if (Lightbox.disableCloseClick) {
        $('#lightbox').unbind('click');
        $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
      }
      Lightbox.start(this, true, false, false, false);
      if (e.preventDefault) { e.preventDefault(); }
      return false;
    });
    $("a[rel^='lightframe']:not(.lightbox-processed), area[rel^='lightframe']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
      if (Lightbox.disableCloseClick) {
        $('#lightbox').unbind('click');
        $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
      }
      Lightbox.start(this, false, true, false, false);
      if (e.preventDefault) { e.preventDefault(); }
      return false;
    });
    if (Lightbox.enableVideo) {
      $("a[rel^='lightvideo']:not(.lightbox-processed), area[rel^='lightvideo']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
        if (Lightbox.disableCloseClick) {
          $('#lightbox').unbind('click');
          $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
        }
        Lightbox.start(this, false, false, true, false);
        if (e.preventDefault) { e.preventDefault(); }
        return false;
      });
    }
    $("a[rel^='lightmodal']:not(.lightbox-processed), area[rel^='lightmodal']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
      $('#lightbox').unbind('click');
      // Add classes from the link to the lightbox div - don't include lightbox-processed
      $('#lightbox').addClass($(this).attr('class'));
      $('#lightbox').removeClass('lightbox-processed');
      Lightbox.start(this, false, false, false, true);
      if (e.preventDefault) { e.preventDefault(); }
      return false;
    });
    $("#lightboxAutoModal:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
      Lightbox.auto_modal = true;
      $('#lightbox').unbind('click');
      Lightbox.start(this, false, false, false, true);
      if (e.preventDefault) { e.preventDefault(); }
      return false;
    });
  },

  // start()
  // Display overlay and lightbox. If image is part of a set, add siblings to
  // imageArray.
  start: function(imageLink, slideshow, lightframe, lightvideo, lightmodal) {

    Lightbox.isPaused = !Lightbox.autoStart;

    // Replaces hideSelectBoxes() and hideFlash() calls in original lightbox2.
    Lightbox.toggleSelectsFlash('hide');

    // Stretch overlay to fill page and fade in.
    var arrayPageSize = Lightbox.getPageSize();
    $("#lightbox2-overlay").hide().css({
      'width': '100%',
      'zIndex': '10090',
      'height': arrayPageSize[1] + 'px',
      'backgroundColor' : '#' + Lightbox.overlayColor
    });
    // Detect OS X FF2 opacity + flash issue.
    if (lightvideo && this.detectMacFF2()) {
      $("#lightbox2-overlay").removeClass("overlay_default");
      $("#lightbox2-overlay").addClass("overlay_macff2");
      $("#lightbox2-overlay").css({'opacity' : null});
    }
    else {
      $("#lightbox2-overlay").removeClass("overlay_macff2");
      $("#lightbox2-overlay").addClass("overlay_default");
      $("#lightbox2-overlay").css({'opacity' : Lightbox.overlayOpacity});
    }
    $("#lightbox2-overlay").fadeIn(Lightbox.fadeInSpeed);


    Lightbox.isSlideshow = slideshow;
    Lightbox.isLightframe = lightframe;
    Lightbox.isVideo = lightvideo;
    Lightbox.isModal = lightmodal;
    Lightbox.imageArray = [];
    Lightbox.imageNum = 0;

    var anchors = $(imageLink.tagName);
    var anchor = null;
    var rel_parts = Lightbox.parseRel(imageLink);
    var rel = rel_parts["rel"];
    var rel_group = rel_parts["group"];
    var title = (rel_parts["title"] ? rel_parts["title"] : imageLink.title);
    var rel_style = null;
    var i = 0;

    if (rel_parts["flashvars"]) {
      Lightbox.flvFlashvars = Lightbox.flvFlashvars + '&' + rel_parts["flashvars"];
    }

    // Set the title for image alternative text.
    var alt = imageLink.title;
    if (!alt) {
      var img = $(imageLink).find("img");
      if (img && $(img).attr("alt")) {
        alt = $(img).attr("alt");
      }
      else {
        alt = title;
      }
    }

    if ($(imageLink).attr('id') == 'lightboxAutoModal') {
      rel_style = rel_parts["style"];
      Lightbox.imageArray.push(['#lightboxAutoModal > *', title, alt, rel_style, 1]);
    }
    else {
      // Handle lightbox images with no grouping.
      if ((rel == 'lightbox' || rel == 'lightshow') && !rel_group) {
        Lightbox.imageArray.push([imageLink.href, title, alt]);
      }

      // Handle other items with no grouping.
      else if (!rel_group) {
        rel_style = rel_parts["style"];
        Lightbox.imageArray.push([imageLink.href, title, alt, rel_style]);
      }

      // Handle grouped items.
      else {

        // Loop through anchors and add them to imageArray.
        for (i = 0; i < anchors.length; i++) {
          anchor = anchors[i];
          if (anchor.href && typeof(anchor.href) == "string" && $(anchor).attr('rel')) {
            var rel_data = Lightbox.parseRel(anchor);
            var anchor_title = (rel_data["title"] ? rel_data["title"] : anchor.title);
            img_alt = anchor.title;
            if (!img_alt) {
              var anchor_img = $(anchor).find("img");
              if (anchor_img && $(anchor_img).attr("alt")) {
                img_alt = $(anchor_img).attr("alt");
              }
              else {
                img_alt = title;
              }
            }
            if (rel_data["rel"] == rel) {
              if (rel_data["group"] == rel_group) {
                if (Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) {
                  rel_style = rel_data["style"];
                }
                Lightbox.imageArray.push([anchor.href, anchor_title, img_alt, rel_style]);
              }
            }
          }
        }

        // Remove duplicates.
        for (i = 0; i < Lightbox.imageArray.length; i++) {
          for (j = Lightbox.imageArray.length-1; j > i; j--) {
            if (Lightbox.imageArray[i][0] == Lightbox.imageArray[j][0]) {
              Lightbox.imageArray.splice(j,1);
            }
          }
        }
        while (Lightbox.imageArray[Lightbox.imageNum][0] != imageLink.href) {
          Lightbox.imageNum++;
        }
      }
    }

    if (Lightbox.isSlideshow && Lightbox.showPlayPause && Lightbox.isPaused) {
      $('#lightshowPlay').show();
      $('#lightshowPause').hide();
    }

    // Calculate top and left offset for the lightbox.
    var arrayPageScroll = Lightbox.getPageScroll();
    var lightboxTop = arrayPageScroll[1] + (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1;
    var lightboxLeft = arrayPageScroll[0];
    $('#frameContainer, #modalContainer, #lightboxImage').hide();
    $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide();
    $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide();
    $('#outerImageContainer').css({'width': '250px', 'height': '250px'});
    $('#lightbox').css({
      'zIndex': '10500',
      'top': lightboxTop + 'px',
      'left': lightboxLeft + 'px'
    }).show();

    Lightbox.total = Lightbox.imageArray.length;
    Lightbox.changeData(Lightbox.imageNum);
  },

  // changeData()
  // Hide most elements and preload image in preparation for resizing image
  // container.
  changeData: function(imageNum, zoomIn) {

    if (Lightbox.inprogress === false) {
      if (Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) {
        if (imageNum >= Lightbox.total) imageNum = 0;
        if (imageNum < 0) imageNum = Lightbox.total - 1;
      }

      if (Lightbox.isSlideshow) {
        for (var i = 0; i < Lightbox.slideIdCount; i++) {
          window.clearTimeout(Lightbox.slideIdArray[i]);
        }
      }
      Lightbox.inprogress = true;
      Lightbox.activeImage = imageNum;

      if (Lightbox.disableResize && !Lightbox.isSlideshow) {
        zoomIn = true;
      }
      Lightbox.isZoomedIn = zoomIn;


      // Hide elements during transition.
      $('#loading').css({'zIndex': '10500'}).show();
      if (!Lightbox.alternative_layout) {
        $('#imageContainer').hide();
      }
      $('#frameContainer, #modalContainer, #lightboxImage').hide();
      $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide();
      $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide();

      // Preload image content, but not iframe pages.
      if (!Lightbox.isLightframe && !Lightbox.isVideo && !Lightbox.isModal) {
        $("#lightbox #imageDataContainer").removeClass('lightbox2-alt-layout-data');
        imgPreloader = new Image();
        imgPreloader.onerror = function() { Lightbox.imgNodeLoadingError(this); };

        imgPreloader.onload = function() {
          var photo = document.getElementById('lightboxImage');
          photo.src = Lightbox.imageArray[Lightbox.activeImage][0];
          photo.alt = Lightbox.imageArray[Lightbox.activeImage][2];

          var imageWidth = imgPreloader.width;
          var imageHeight = imgPreloader.height;

          // Resize code.
          var arrayPageSize = Lightbox.getPageSize();
          var targ = { w:arrayPageSize[2] - (Lightbox.borderSize * 2), h:arrayPageSize[3] - (Lightbox.borderSize * 6) - (Lightbox.infoHeight * 4) - (arrayPageSize[3] / 10) };
          var orig = { w:imgPreloader.width, h:imgPreloader.height };

          // Image is very large, so show a smaller version of the larger image
          // with zoom button.
          if (zoomIn !== true) {
            var ratio = 1.0; // Shrink image with the same aspect.
            $('#bottomNavZoomOut, #bottomNavZoom').hide();
            if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) {
              ratio = ((targ.w / orig.w) < (targ.h / orig.h)) ? targ.w / orig.w : targ.h / orig.h;
              if (!Lightbox.disableZoom && !Lightbox.isSlideshow) {
                $('#bottomNavZoom').css({'zIndex': '10500'}).show();
              }
            }

            imageWidth  = Math.floor(orig.w * ratio);
            imageHeight = Math.floor(orig.h * ratio);
          }

          else {
            $('#bottomNavZoom').hide();
            // Only display zoom out button if the image is zoomed in already.
            if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) {
              // Only display zoom out button if not a slideshow and if the
              // buttons aren't disabled.
              if (!Lightbox.disableResize && Lightbox.isSlideshow === false && !Lightbox.disableZoom) {
                $('#bottomNavZoomOut').css({'zIndex': '10500'}).show();
              }
            }
          }

          photo.style.width = (imageWidth) + 'px';
          photo.style.height = (imageHeight) + 'px';
          Lightbox.resizeContainer(imageWidth, imageHeight);

          // Clear onLoad, IE behaves irratically with animated gifs otherwise.
          imgPreloader.onload = function() {};
        };

        imgPreloader.src = Lightbox.imageArray[Lightbox.activeImage][0];
        imgPreloader.alt = Lightbox.imageArray[Lightbox.activeImage][2];
      }

      // Set up frame size, etc.
      else if (Lightbox.isLightframe) {
        $("#lightbox #imageDataContainer").addClass('lightbox2-alt-layout-data');
        var src = Lightbox.imageArray[Lightbox.activeImage][0];
        $('#frameContainer').html('<iframe id="lightboxFrame" style="display: none;" src="'+src+'"></iframe>');

        // Enable swf support in Gecko browsers.
        if ($.browser.mozilla && src.indexOf('.swf') != -1) {
          setTimeout(function () {
            document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0];
          }, 1000);
        }

        if (!Lightbox.iframe_border) {
          $('#lightboxFrame').css({'border': 'none'});
          $('#lightboxFrame').attr('frameborder', '0');
        }
        var iframe = document.getElementById('lightboxFrame');
        var iframeStyles = Lightbox.imageArray[Lightbox.activeImage][3];
        iframe = Lightbox.setStyles(iframe, iframeStyles);
        Lightbox.resizeContainer(parseInt(iframe.width, 10), parseInt(iframe.height, 10));
      }
      else if (Lightbox.isVideo || Lightbox.isModal) {
        $("#lightbox #imageDataContainer").addClass('lightbox2-alt-layout-data');
        var container = document.getElementById('modalContainer');
        var modalStyles = Lightbox.imageArray[Lightbox.activeImage][3];
        container = Lightbox.setStyles(container, modalStyles);
        if (Lightbox.isVideo) {
          Lightbox.modalHeight =  parseInt(container.height, 10) - 10;
          Lightbox.modalWidth =  parseInt(container.width, 10) - 10;
          Lightvideo.startVideo(Lightbox.imageArray[Lightbox.activeImage][0]);
        }
        Lightbox.resizeContainer(parseInt(container.width, 10), parseInt(container.height, 10));
      }
    }
  },

  // imgNodeLoadingError()
  imgNodeLoadingError: function(image) {
    var s = Drupal.settings.lightbox2;
    var original_image = Lightbox.imageArray[Lightbox.activeImage][0];
    if (s.display_image_size !== "") {
      original_image = original_image.replace(new RegExp("."+s.display_image_size), "");
    }
    Lightbox.imageArray[Lightbox.activeImage][0] = original_image;
    image.onerror = function() { Lightbox.imgLoadingError(image); };
    image.src = original_image;
  },

  // imgLoadingError()
  imgLoadingError: function(image) {
    var s = Drupal.settings.lightbox2;
    Lightbox.imageArray[Lightbox.activeImage][0] = s.default_image;
    image.src = s.default_image;
  },

  // resizeContainer()
  resizeContainer: function(imgWidth, imgHeight) {

    imgWidth = (imgWidth < Lightbox.minWidth ? Lightbox.minWidth : imgWidth);

    this.widthCurrent = $('#outerImageContainer').width();
    this.heightCurrent = $('#outerImageContainer').height();

    var widthNew = (imgWidth  + (Lightbox.borderSize * 2));
    var heightNew = (imgHeight  + (Lightbox.borderSize * 2));

    // Scalars based on change from old to new.
    this.xScale = ( widthNew / this.widthCurrent) * 100;
    this.yScale = ( heightNew / this.heightCurrent) * 100;

    // Calculate size difference between new and old image, and resize if
    // necessary.
    wDiff = this.widthCurrent - widthNew;
    hDiff = this.heightCurrent - heightNew;

    $('#modalContainer').css({'width': imgWidth, 'height': imgHeight});
    // Detect animation sequence.
    if (Lightbox.resizeSequence) {
      var animate1 = {width: widthNew};
      var animate2 = {height: heightNew};
      if (Lightbox.resizeSequence == 2) {
        animate1 = {height: heightNew};
        animate2 = {width: widthNew};
      }
      $('#outerImageContainer').animate(animate1, Lightbox.resizeSpeed).animate(animate2, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); });
    }
    // Simultaneous.
    else {
      $('#outerImageContainer').animate({'width': widthNew, 'height': heightNew}, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); });
    }

    // If new and old image are same size and no scaling transition is necessary
    // do a quick pause to prevent image flicker.
    if ((hDiff === 0) && (wDiff === 0)) {
      if ($.browser.msie) {
        Lightbox.pause(250);
      }
      else {
        Lightbox.pause(100);
      }
    }

    var s = Drupal.settings.lightbox2;
    if (!s.use_alt_layout) {
      $('#prevLink, #nextLink').css({'height': imgHeight + 'px'});
    }
    $('#imageDataContainer').css({'width': widthNew + 'px'});
  },

  // showData()
  // Display image and begin preloading neighbors.
  showData: function() {
    $('#loading').hide();

    if (Lightbox.isLightframe || Lightbox.isVideo || Lightbox.isModal) {
      Lightbox.updateDetails();
      if (Lightbox.isLightframe) {
        $('#frameContainer').show();
        if ($.browser.safari || Lightbox.fadeInSpeed === 0) {
          $('#lightboxFrame').css({'zIndex': '10500'}).show();
        }
        else {
          $('#lightboxFrame').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed);
        }
      }
      else {
        if (Lightbox.isVideo) {
          $("#modalContainer").html(Lightbox.modalHTML).click(function(){return false;}).css('zIndex', '10500').show();
        }
        else {
          var src = unescape(Lightbox.imageArray[Lightbox.activeImage][0]);
          if (Lightbox.imageArray[Lightbox.activeImage][4]) {
            $(src).appendTo("#modalContainer");
            $('#modalContainer').css({'zIndex': '10500'}).show();
          }
          else {
            // Use a callback to show the new image, otherwise you get flicker.
            $("#modalContainer").hide().load(src, function () {$('#modalContainer').css({'zIndex': '10500'}).show();});
          }
          $('#modalContainer').unbind('click');
        }
        // This might be needed in the Lightframe section above.
        //$('#modalContainer').css({'zIndex': '10500'}).show();
      }
    }

    // Handle display of image content.
    else {
      $('#imageContainer').show();
      if ($.browser.safari || Lightbox.fadeInSpeed === 0) {
        $('#lightboxImage').css({'zIndex': '10500'}).show();
      }
      else {
        $('#lightboxImage').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed);
      }
      Lightbox.updateDetails();
      this.preloadNeighborImages();
    }
    Lightbox.inprogress = false;

    // Slideshow specific stuff.
    if (Lightbox.isSlideshow) {
      if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) {
        if (Lightbox.autoExit) {
          Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.end('slideshow');}, Lightbox.slideInterval);
        }
      }
      else {
        if (!Lightbox.isPaused && Lightbox.total > 1) {
          Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.changeData(Lightbox.activeImage + 1);}, Lightbox.slideInterval);
        }
      }
      if (Lightbox.showPlayPause && Lightbox.total > 1 && !Lightbox.isPaused) {
        $('#lightshowPause').show();
        $('#lightshowPlay').hide();
      }
      else if (Lightbox.showPlayPause && Lightbox.total > 1) {
        $('#lightshowPause').hide();
        $('#lightshowPlay').show();
      }
    }

    // Adjust the page overlay size.
    var arrayPageSize = Lightbox.getPageSize();
    var arrayPageScroll = Lightbox.getPageScroll();
    var pageHeight = arrayPageSize[1];
    if (Lightbox.isZoomedIn && arrayPageSize[1] > arrayPageSize[3]) {
      var lightboxTop = (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1;
      pageHeight = pageHeight + arrayPageScroll[1] + lightboxTop;
    }
    $('#lightbox2-overlay').css({'height': pageHeight + 'px', 'width': arrayPageSize[0] + 'px'});

    // Gecko browsers (e.g. Firefox, SeaMonkey, etc) don't handle pdfs as
    // expected.
    if ($.browser.mozilla) {
      if (Lightbox.imageArray[Lightbox.activeImage][0].indexOf(".pdf") != -1) {
        setTimeout(function () {
          document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0];
        }, 1000);
      }
    }
  },

  // updateDetails()
  // Display caption, image number, and bottom nav.
  updateDetails: function() {

    $("#imageDataContainer").hide();

    var s = Drupal.settings.lightbox2;

    if (s.show_caption) {
      var caption = Lightbox.filterXSS(Lightbox.imageArray[Lightbox.activeImage][1]);
      if (!caption) caption = '';
      $('#caption').html(caption).css({'zIndex': '10500'}).show();
    }

    // If image is part of set display 'Image x of x'.
    var numberDisplay = null;
    if (s.image_count && Lightbox.total > 1) {
      var currentImage = Lightbox.activeImage + 1;
      if (!Lightbox.isLightframe && !Lightbox.isModal && !Lightbox.isVideo) {
        numberDisplay = s.image_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total);
      }
      else if (Lightbox.isVideo) {
        numberDisplay = s.video_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total);
      }
      else {
        numberDisplay = s.page_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total);
      }
      $('#numberDisplay').html(numberDisplay).css({'zIndex': '10500'}).show();
    }
    else {
      $('#numberDisplay').hide();
    }

    $("#imageDataContainer").hide().slideDown(Lightbox.slideDownSpeed, function() {
      $("#bottomNav").show();
    });
    if (Lightbox.rtl == 1) {
      $("#bottomNav").css({'float': 'left'});
    }
    Lightbox.updateNav();
  },

  // updateNav()
  // Display appropriate previous and next hover navigation.
  updateNav: function() {

    $('#hoverNav').css({'zIndex': '10500'}).show();
    var prevLink = '#prevLink';
    var nextLink = '#nextLink';

    // Slideshow is separated as we need to show play / pause button.
    if (Lightbox.isSlideshow) {
      if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage !== 0) {
        $(prevLink).css({'zIndex': '10500'}).show().click(function() {
          if (Lightbox.pauseOnPrevClick) {
            Lightbox.togglePlayPause("lightshowPause", "lightshowPlay");
          }
          Lightbox.changeData(Lightbox.activeImage - 1); return false;
        });
      }
      else {
        $(prevLink).hide();
      }

      // If not last image in set, display next image button.
      if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage != (Lightbox.total - 1)) {
        $(nextLink).css({'zIndex': '10500'}).show().click(function() {
          if (Lightbox.pauseOnNextClick) {
            Lightbox.togglePlayPause("lightshowPause", "lightshowPlay");
          }
          Lightbox.changeData(Lightbox.activeImage + 1); return false;
        });
      }
      // Safari browsers need to have hide() called again.
      else {
        $(nextLink).hide();
      }
    }

    // All other types of content.
    else {

      if ((Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) && !Lightbox.alternative_layout) {
        $('#frameHoverNav').css({'zIndex': '10500'}).show();
        $('#hoverNav').css({'zIndex': '10500'}).hide();
        prevLink = '#framePrevLink';
        nextLink = '#frameNextLink';
      }

      // If not first image in set, display prev image button.
      if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage !== 0) {
        // Unbind any other click handlers, otherwise this adds a new click handler
        // each time the arrow is clicked.
        $(prevLink).css({'zIndex': '10500'}).show().unbind().click(function() {
          Lightbox.changeData(Lightbox.activeImage - 1); return false;
        });
      }
      // Safari browsers need to have hide() called again.
      else {
        $(prevLink).hide();
      }

      // If not last image in set, display next image button.
      if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage != (Lightbox.total - 1)) {
        // Unbind any other click handlers, otherwise this adds a new click handler
        // each time the arrow is clicked.
        $(nextLink).css({'zIndex': '10500'}).show().unbind().click(function() {
          Lightbox.changeData(Lightbox.activeImage + 1); return false;
        });
      }
      // Safari browsers need to have hide() called again.
      else {
        $(nextLink).hide();
      }
    }

    // Don't enable keyboard shortcuts so forms will work.
    if (!Lightbox.isModal) {
      this.enableKeyboardNav();
    }
  },


  // enableKeyboardNav()
  enableKeyboardNav: function() {
    $(document).bind("keydown", this.keyboardAction);
  },

  // disableKeyboardNav()
  disableKeyboardNav: function() {
    $(document).unbind("keydown", this.keyboardAction);
  },

  // keyboardAction()
  keyboardAction: function(e) {
    if (e === null) { // IE.
      keycode = event.keyCode;
      escapeKey = 27;
    }
    else { // Mozilla.
      keycode = e.keyCode;
      escapeKey = e.DOM_VK_ESCAPE;
    }

    key = String.fromCharCode(keycode).toLowerCase();

    // Close lightbox.
    if (Lightbox.checkKey(Lightbox.keysClose, key, keycode)) {
      Lightbox.end('forceClose');
    }
    // Display previous image (p, <-).
    else if (Lightbox.checkKey(Lightbox.keysPrevious, key, keycode)) {
      if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage !== 0) {
        Lightbox.changeData(Lightbox.activeImage - 1);
      }

    }
    // Display next image (n, ->).
    else if (Lightbox.checkKey(Lightbox.keysNext, key, keycode)) {
      if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage != (Lightbox.total - 1)) {
        Lightbox.changeData(Lightbox.activeImage + 1);
      }
    }
    // Zoom in.
    else if (Lightbox.checkKey(Lightbox.keysZoom, key, keycode) && !Lightbox.disableResize && !Lightbox.disableZoom && !Lightbox.isSlideshow && !Lightbox.isLightframe) {
      if (Lightbox.isZoomedIn) {
        Lightbox.changeData(Lightbox.activeImage, false);
      }
      else if (!Lightbox.isZoomedIn) {
        Lightbox.changeData(Lightbox.activeImage, true);
      }
      return false;
    }
    // Toggle play / pause (space).
    else if (Lightbox.checkKey(Lightbox.keysPlayPause, key, keycode) && Lightbox.isSlideshow) {

      if (Lightbox.isPaused) {
        Lightbox.togglePlayPause("lightshowPlay", "lightshowPause");
      }
      else {
        Lightbox.togglePlayPause("lightshowPause", "lightshowPlay");
      }
      return false;
    }
  },

  preloadNeighborImages: function() {

    if ((Lightbox.total - 1) > Lightbox.activeImage) {
      preloadNextImage = new Image();
      preloadNextImage.src = Lightbox.imageArray[Lightbox.activeImage + 1][0];
    }
    if (Lightbox.activeImage > 0) {
      preloadPrevImage = new Image();
      preloadPrevImage.src = Lightbox.imageArray[Lightbox.activeImage - 1][0];
    }

  },

  end: function(caller) {
    var closeClick = (caller == 'slideshow' ? false : true);
    if (Lightbox.isSlideshow && Lightbox.isPaused && !closeClick) {
      return;
    }
    // To prevent double clicks on navigation links.
    if (Lightbox.inprogress === true && caller != 'forceClose') {
      return;
    }
    Lightbox.disableKeyboardNav();
    $('#lightbox').hide();
    $("#lightbox2-overlay").fadeOut();
    Lightbox.isPaused = true;
    Lightbox.inprogress = false;
    // Replaces calls to showSelectBoxes() and showFlash() in original
    // lightbox2.
    Lightbox.toggleSelectsFlash('visible');
    if (Lightbox.isSlideshow) {
      for (var i = 0; i < Lightbox.slideIdCount; i++) {
        window.clearTimeout(Lightbox.slideIdArray[i]);
      }
      $('#lightshowPause, #lightshowPlay').hide();
    }
    else if (Lightbox.isLightframe) {
      $('#frameContainer').empty().hide();
    }
    else if (Lightbox.isVideo || Lightbox.isModal) {
      if (!Lightbox.auto_modal) {
        $('#modalContainer').hide().html("");
      }
      Lightbox.auto_modal = false;
    }
  },


  // getPageScroll()
  // Returns array with x,y page scroll values.
  // Core code from - quirksmode.com.
  getPageScroll : function() {

    var xScroll, yScroll;

    if (self.pageYOffset || self.pageXOffset) {
      yScroll = self.pageYOffset;
      xScroll = self.pageXOffset;
    }
    else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) {  // Explorer 6 Strict.
      yScroll = document.documentElement.scrollTop;
      xScroll = document.documentElement.scrollLeft;
    }
    else if (document.body) {// All other Explorers.
      yScroll = document.body.scrollTop;
      xScroll = document.body.scrollLeft;
    }

    arrayPageScroll = [xScroll,yScroll];
    return arrayPageScroll;
  },

  // getPageSize()
  // Returns array with page width, height and window width, height.
  // Core code from - quirksmode.com.
  // Edit for Firefox by pHaez.

  getPageSize : function() {

    var xScroll, yScroll;

    if (window.innerHeight && window.scrollMaxY) {
      xScroll = window.innerWidth + window.scrollMaxX;
      yScroll = window.innerHeight + window.scrollMaxY;
    }
    else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac.
      xScroll = document.body.scrollWidth;
      yScroll = document.body.scrollHeight;
    }
    else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari.
      xScroll = document.body.offsetWidth;
      yScroll = document.body.offsetHeight;
    }

    var windowWidth, windowHeight;

    if (self.innerHeight) { // All except Explorer.
      if (document.documentElement.clientWidth) {
        windowWidth = document.documentElement.clientWidth;
      }
      else {
        windowWidth = self.innerWidth;
      }
      windowHeight = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode.
      windowWidth = document.documentElement.clientWidth;
      windowHeight = document.documentElement.clientHeight;
    }
    else if (document.body) { // Other Explorers.
      windowWidth = document.body.clientWidth;
      windowHeight = document.body.clientHeight;
    }
    // For small pages with total height less than height of the viewport.
    if (yScroll < windowHeight) {
      pageHeight = windowHeight;
    }
    else {
      pageHeight = yScroll;
    }
    // For small pages with total width less than width of the viewport.
    if (xScroll < windowWidth) {
      pageWidth = xScroll;
    }
    else {
      pageWidth = windowWidth;
    }
    arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
    return arrayPageSize;
  },


  // pause(numberMillis)
  pause : function(ms) {
    var date = new Date();
    var curDate = null;
    do { curDate = new Date(); }
    while (curDate - date < ms);
  },


  // toggleSelectsFlash()
  // Hide / unhide select lists and flash objects as they appear above the
  // lightbox in some browsers.
  toggleSelectsFlash: function (state) {
    if (state == 'visible') {
      $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").show();
    }
    else if (state == 'hide') {
      $("select:visible, embed:visible, object:visible").not('#lightboxAutoModal select, #lightboxAutoModal embed, #lightboxAutoModal object').addClass("lightbox_hidden");
      $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").hide();
    }
  },


  // parseRel()
  parseRel: function (link) {
    var parts = [];
    parts["rel"] = parts["title"] = parts["group"] = parts["style"] = parts["flashvars"] = null;
    if (!$(link).attr('rel')) return parts;
    parts["rel"] = $(link).attr('rel').match(/\w+/)[0];

    if ($(link).attr('rel').match(/\[(.*)\]/)) {
      var info = $(link).attr('rel').match(/\[(.*?)\]/)[1].split('|');
      parts["group"] = info[0];
      parts["style"] = info[1];
      if (parts["style"] != undefined && parts["style"].match(/flashvars:\s?(.*?);/)) {
        parts["flashvars"] = parts["style"].match(/flashvars:\s?(.*?);/)[1];
      }
    }
    if ($(link).attr('rel').match(/\[.*\]\[(.*)\]/)) {
      parts["title"] = $(link).attr('rel').match(/\[.*\]\[(.*)\]/)[1];
    }
    return parts;
  },

  // setStyles()
  setStyles: function(item, styles) {
    item.width = Lightbox.iframe_width;
    item.height = Lightbox.iframe_height;
    item.scrolling = "auto";

    if (!styles) return item;
    var stylesArray = styles.split(';');
    for (var i = 0; i< stylesArray.length; i++) {
      if (stylesArray[i].indexOf('width:') >= 0) {
        var w = stylesArray[i].replace('width:', '');
        item.width = jQuery.trim(w);
      }
      else if (stylesArray[i].indexOf('height:') >= 0) {
        var h = stylesArray[i].replace('height:', '');
        item.height = jQuery.trim(h);
      }
      else if (stylesArray[i].indexOf('scrolling:') >= 0) {
        var scrolling = stylesArray[i].replace('scrolling:', '');
        item.scrolling = jQuery.trim(scrolling);
      }
      else if (stylesArray[i].indexOf('overflow:') >= 0) {
        var overflow = stylesArray[i].replace('overflow:', '');
        item.overflow = jQuery.trim(overflow);
      }
    }
    return item;
  },


  // togglePlayPause()
  // Hide the pause / play button as appropriate.  If pausing the slideshow also
  // clear the timers, otherwise move onto the next image.
  togglePlayPause: function(hideId, showId) {
    if (Lightbox.isSlideshow && hideId == "lightshowPause") {
      for (var i = 0; i < Lightbox.slideIdCount; i++) {
        window.clearTimeout(Lightbox.slideIdArray[i]);
      }
    }
    $('#' + hideId).hide();
    $('#' + showId).show();

    if (hideId == "lightshowPlay") {
      Lightbox.isPaused = false;
      if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) {
        Lightbox.end();
      }
      else if (Lightbox.total > 1) {
        Lightbox.changeData(Lightbox.activeImage + 1);
      }
    }
    else {
      Lightbox.isPaused = true;
    }
  },

  triggerLightbox: function (rel_type, rel_group) {
    if (rel_type.length) {
      if (rel_group && rel_group.length) {
        $("a[rel^='" + rel_type +"\[" + rel_group + "\]'], area[rel^='" + rel_type +"\[" + rel_group + "\]']").eq(0).trigger("click");
      }
      else {
        $("a[rel^='" + rel_type +"'], area[rel^='" + rel_type +"']").eq(0).trigger("click");
      }
    }
  },

  detectMacFF2: function() {
    var ua = navigator.userAgent.toLowerCase();
    if (/firefox[\/\s](\d+\.\d+)/.test(ua)) {
      var ffversion = new Number(RegExp.$1);
      if (ffversion < 3 && ua.indexOf('mac') != -1) {
        return true;
      }
    }
    return false;
  },

  checkKey: function(keys, key, code) {
    return (jQuery.inArray(key, keys) != -1 || jQuery.inArray(String(code), keys) != -1);
  },

  filterXSS: function(str, allowed_tags) {
    var output = "";
    $.ajax({
      url: Drupal.settings.basePath + 'system/lightbox2/filter-xss',
      data: {
        'string' : str,
        'allowed_tags' : allowed_tags
      },
      type: "POST",
      async: false,
      dataType:  "json",
      success: function(data) {
        output = data;
      }
    });
    return output;
  }

};

// Initialize the lightbox.
Drupal.behaviors.initLightbox = function (context) {
  $('body:not(.lightbox-processed)', context).addClass('lightbox-processed').each(function() {
    Lightbox.initialize();
    return false; // Break the each loop.
  });

  // Attach lightbox to any links with lightbox rels.
  Lightbox.initList(context);
  $('#lightboxAutoModal', context).triggerHandler('click');
};

;
(function ($) {

/**
 * Open Mollom privacy policy link in a new window.
 *
 * Required for valid XHTML Strict markup.
 */
Drupal.behaviors.mollomPrivacy = function (context) {
  $('.mollom-privacy a', context).click(function () {
    this.target = '_blank';
  });
};

/**
 * Attach click event handlers for CAPTCHA links.
 */
Drupal.behaviors.mollomCaptcha = function (context) {
  $('a.mollom-switch-captcha', context).click(getMollomCaptcha);
};

/**
 * Fetch a Mollom CAPTCHA and output the image or audio into the form.
 */
function getMollomCaptcha() {
  // Get the current requested CAPTCHA type from the clicked link.
  var newCaptchaType = $(this).hasClass('mollom-audio-captcha') ? 'audio' : 'image';

  var context = $(this).parents('form');

  // Extract the Mollom session id from the form.
  var mollomSessionId = $('input.mollom-session-id', context).val();

  // Retrieve a CAPTCHA:
  $.getJSON(Drupal.settings.basePath + 'mollom/captcha/' + newCaptchaType + '/' + mollomSessionId,
    function (data) {
      if (!(data && data.content)) {
        return;
      }
      // Inject new CAPTCHA.
      $('.mollom-captcha-content', context).parent().html(data.content);
      // Update session id.
      $('input.mollom-session-id', context).val(data.session_id);
      // Add an onclick-event handler for the new link.
      Drupal.attachBehaviors(context);
      // Focus on the CATPCHA input.
      $('input[name="mollom[captcha]"]', context).focus();
    }
  );
  return false;
}

})(jQuery);
;
/***

    P R O C E S S I N G . J S - 1.2.3
    a port of the Processing visualization language

    Processing.js is licensed under the MIT License, see LICENSE.
    For a list of copyright holders, please refer to AUTHORS.

    http://processingjs.org

***/

(function(X,A,g,p){function wa(c,f){if(c in X)return X[c];return typeof X[f]==="function"?X[f]:function(c){if(c instanceof Array)return c;else if(typeof c==="number"){var i=[];i.length=c;return i}}}function xc(c){if(c.constructor===String){for(var f=0,Q=0;Q<c.length;++Q)f=f*31+c.charCodeAt(Q)&4294967295;return f}else if(typeof c!=="object")return c&4294967295;else if(c.hashCode instanceof Function)return c.hashCode();else{if(c.$id===p)c.$id=g.floor(g.random()*65536)-32768<<16|g.floor(g.random()*65536);
return c.$id}}function qa(c,f){return c===null||f===null?c===null&&f===null:c.constructor===String?c===f:typeof c!=="object"?c===f:c.equals instanceof Function?c.equals(f):c===f}function Wb(){}function xb(c,f){function g(Q){la.defineProperty(c,Q,{get:function(){return f[Q]},set:function(c){f[Q]=c},enumerable:!0})}var v=[],p;for(p in f)typeof f[p]==="function"?c.hasOwnProperty(p)||(c[p]=f[p]):p.charAt(0)!=="$"&&!(p in c)&&v.push(p);for(;v.length>0;)g(v.shift())}function yc(){var c=["abs","acos","alpha",
"ambient","ambientLight","append","applyMatrix","arc","arrayCopy","asin","atan","atan2","background","beginCamera","beginDraw","beginShape","bezier","bezierDetail","bezierPoint","bezierTangent","bezierVertex","binary","blend","blendColor","blit_resize","blue","box","breakShape","brightness","camera","ceil","Character","color","colorMode","concat","console","constrain","copy","cos","createFont","createGraphics","createImage","cursor","curve","curveDetail","curvePoint","curveTangent","curveTightness",
"curveVertex","day","degrees","directionalLight","disableContextMenu","dist","draw","ellipse","ellipseMode","emissive","enableContextMenu","endCamera","endDraw","endShape","exit","exp","expand","externals","fill","filter","filter_bilinear","filter_new_scanline","floor","focused","frameCount","frameRate","frustum","get","glyphLook","glyphTable","green","height","hex","hint","hour","hue","image","imageMode","Import","intersect","join","key","keyCode","keyPressed","keyReleased","keyTyped","lerp","lerpColor",
"lightFalloff","lights","lightSpecular","line","link","loadBytes","loadFont","loadGlyphs","loadImage","loadPixels","loadShape","loadStrings","log","loop","mag","map","match","matchAll","max","millis","min","minute","mix","modelX","modelY","modelZ","modes","month","mouseButton","mouseClicked","mouseDragged","mouseMoved","mouseOut","mouseOver","mousePressed","mouseReleased","mouseScroll","mouseScrolled","mouseX","mouseY","name","nf","nfc","nfp","nfs","noCursor","noFill","noise","noiseDetail","noiseSeed",
"noLights","noLoop","norm","normal","noSmooth","noStroke","noTint","ortho","param","parseBoolean","parseByte","parseChar","parseFloat","parseInt","peg","perspective","PFont","PImage","pixels","PMatrix2D","PMatrix3D","PMatrixStack","pmouseX","pmouseY","point","pointLight","popMatrix","popStyle","pow","print","printCamera","println","printMatrix","printProjection","PShape","PShapeSVG","pushMatrix","pushStyle","quad","radians","random","Random","randomSeed","rect","rectMode","red","redraw","requestImage",
"resetMatrix","reverse","rotate","rotateX","rotateY","rotateZ","round","saturation","save","saveFrame","saveStrings","scale","screenX","screenY","screenZ","second","set","setup","shape","shapeMode","shared","shininess","shorten","sin","size","smooth","sort","specular","sphere","sphereDetail","splice","split","splitTokens","spotLight","sq","sqrt","status","str","stroke","strokeCap","strokeJoin","strokeWeight","subset","tan","text","textAlign","textAscent","textDescent","textFont","textLeading","textMode",
"textSize","texture","textureMode","textWidth","tint","touchCancel","touchEnd","touchMove","touchStart","translate","triangle","trim","unbinary","unhex","updatePixels","use3DContext","vertex","width","XMLElement","year","__contains","__equals","__frameRate","__hashCode","__int_cast","__instanceof","__keyPressed","__mousePressed","__printStackTrace","__replace","__replaceAll","__replaceFirst","__toCharArray","__split"],f={},g,p;g=0;for(p=c.length;g<p;++g)f[c[g]]=null;for(var q in z.lib)if(z.lib.hasOwnProperty(q)&&
z.lib[q].exports){c=z.lib[q].exports;g=0;for(p=c.length;g<p;++g)f[c[g]]=null}return f}function zc(i){function f(a){var c=/^\s*/.exec(a);if(c[0].length===a.length)a={left:c[0],middle:"",right:""};else var d=/\s*$/.exec(a),a={left:c[0],middle:a.substring(c[0].length,d.index),right:d[0]};a.untrim=function(a){return this.left+a+this.right};return a}function g(a){return a.replace(/^\s+/,"").replace(/\s+$/,"")}function v(a,c){for(var d=0,B=c.length;d<B;++d)a[c[d]]=null;return a}function q(a){for(var c in a)if(a.hasOwnProperty(c))return!1;
return!0}function s(a){return a.substring(2,a.length-1)}function J(a,c){var d=N.length;N.push(a);return'"'+c+d+'"'}function w(a){a=a.replace(W,function(a){return J(a,"E")});a=a.replace(Ya,function(a){return J(a,"D")});return a=a.replace(yb,function(a){return J(a,"H")})}function x(a,c){return a.replace(Jb,function(a,Z,d){return d!==c?a:J(a,"G")})}function z(a){this.name=a}function G(a){this.params=a}function ca(a){var c=g(a.substring(1,a.length-1)),a=[];if(c!=="")for(var c=c.split(","),d=0;d<c.length;++d){var B=
/\b([A-Za-z_$][\w$]*\b)(\s*"[ABC][\d]*")*\s*$/.exec(c[d]);a.push(new z(B[1]))}return new G(a)}function da(a){function c(a,d,Z,ia){a=N[ia];B=!0;a=f(a.substring(1,a.length-1));return"__"+Z+(a.middle===""?J("("+d.replace(/\.\s*$/,"")+")","B"):J("("+d.replace(/\.\s*$/,"")+","+a.middle+")","B"))}function d(a,c,Z){B=!0;return"__instanceof"+J("("+c+", "+Z+")","B")}var a=a.replace(/\bnew\s+([A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)(?:\s*"C\d+")+\s*("A\d+")/g,function(a,c,d){return d}),a=a.replace(/\bnew\s+([A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)(?:\s*"B\d+")\s*("A\d+")/g,
function(a){return J(a,"F")}),a=a.replace(yb,function(a){return J(a,"H")}),a=a.replace(/\bnew\s+([A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)\s*("C\d+"(?:\s*"C\d+")*)/g,function(a,c,d){a=d.replace(/"C(\d+)"/g,function(a,c){return N[c]}).replace(/\[\s*\]/g,"[null]").replace(/\s*\]\s*\[\s*/g,", ");a="{"+a.substring(1,a.length-1)+"}";c="('"+c+"', "+J(a,"A")+")";return"$p.createJavaArray"+J(c,"B")}),a=a.replace(/(\.\s*length)\s*"B\d+"/g,"$1"),a=a.replace(/#([0-9A-Fa-f]{6})\b/g,function(a,c){return"0xFF"+
c}),a=a.replace(/"B(\d+)"(\s*(?:[\w$']|"B))/g,function(a,c,d){c=N[c];if(/^\(\s*[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*\s*(?:"C\d+"\s*)*\)$/.test(c))if(/^\(\s*int\s*\)$/.test(c))return"(int)"+d;else{c=c.split(/"C(\d+)"/g);if(c.length>1&&!/^\[\s*\]$/.test(N[c[1]]))return a;return""+d}else return a}),a=a.replace(/\(int\)([^,\]\)\}\?\:\*\+\-\/\^\|\%\&\~<\>\=]+)/g,function(a,c){var d=f(c);return d.untrim("__int_cast("+d.middle+")")}),a=a.replace(/\bsuper(\s*"B\d+")/g,"$$superCstr$1").replace(/\bsuper(\s*\.)/g,
"$$super$1"),a=a.replace(/\b0+((\d*)(?:\.[\d*])?(?:[eE][\-\+]?\d+)?[fF]?)\b/,function(a,c,d){if(c===d)return a;return d===""?"0"+c:c}),a=a.replace(/\b(\.?\d+\.?)[fF]\b/g,"$1"),a=a.replace(/([^\s])%([^=\s])/g,"$1 % $2"),a=a.replace(/\b(frameRate|keyPressed|mousePressed)\b(?!\s*"B)/g,"__$1"),a=a.replace(/\b(boolean|byte|char|float|int)\s*"B/g,function(a,c){return"parse"+c.substring(0,1).toUpperCase()+c.substring(1)+'"B'}),a=a.replace(/\bpixels\s*(("C(\d+)")|\.length)?(\s*=(?!=)([^,\]\)\}]+))?/g,function(a,
c,d,Z,ia,xa){return d?(a=N[Z],ia?"pixels.setPixel"+J("("+a.substring(1,a.length-1)+","+xa+")","B"):"pixels.getPixel"+J("("+a.substring(1,a.length-1)+")","B")):c?"pixels.getLength"+J("()","B"):ia?"pixels.set"+J("("+xa+")","B"):"pixels.toArray"+J("()","B")}),B;do B=!1,a=a.replace(/((?:'\d+'|\b[A-Za-z_$][\w$]*\s*(?:"[BC]\d+")*)\s*\.\s*(?:[A-Za-z_$][\w$]*\s*(?:"[BC]\d+"\s*)*\.\s*)*)(replace|replaceAll|replaceFirst|contains|equals|hashCode|toCharArray|printStackTrace|split)\s*"B(\d+)"/g,c);while(B);do B=
!1,a=a.replace(/((?:'\d+'|\b[A-Za-z_$][\w$]*\s*(?:"[BC]\d+")*)\s*(?:\.\s*[A-Za-z_$][\w$]*\s*(?:"[BC]\d+"\s*)*)*)instanceof\s+([A-Za-z_$][\w$]*\s*(?:\.\s*[A-Za-z_$][\w$]*)*)/g,d);while(B);return a=a.replace(/\bthis(\s*"B\d+")/g,"$$constr$1")}function Xc(a,c){this.baseInterfaceName=a;this.body=c;c.owner=this}function fa(a){var c=RegExp(/\bnew\s*([A-Za-z_$][\w$]*\s*(?:\.\s*[A-Za-z_$][\w$]*)*)\s*"B\d+"\s*"A(\d+)"/).exec(a),a=za,d="class"+ ++ob;za=d;var B=c[1]+"$"+d,c=new Xc(B,fb(N[c[2]],B,"","implements "+
c[1]));c.classId=d;c.scopeId=a;ba[d]=c;za=a;return c}function A(a,c,d){this.name=a;this.params=c;this.body=d}function L(a){a=RegExp(/\b([A-Za-z_$][\w$]*)\s*"B(\d+)"\s*"A(\d+)"/).exec(a);return new A(a[1]!=="function"?a[1]:null,ca(N[a[2]]),Oa(N[a[3]]))}function Xb(a){this.members=a}function X(a){for(var a=a.split(","),c=0;c<a.length;++c){var d=a[c].indexOf(":");a[c]=d<0?{value:Aa(a[c])}:{label:g(a[c].substring(0,d)),value:Aa(g(a[c].substring(d+1)))}}return new Xb(a)}function pb(a){if(a.charAt(0)===
"("||a.charAt(0)==="[")return a.charAt(0)+pb(a.substring(1,a.length-1))+a.charAt(a.length-1);else if(a.charAt(0)==="{")return/^\{\s*(?:[A-Za-z_$][\w$]*|'\d+')\s*:/.test(a)?"{"+J(a.substring(1,a.length-1),"I")+"}":"["+pb(a.substring(1,a.length-1))+"]";else{var a=f(a),c=da(a.middle),c=c.replace(/"[ABC](\d+)"/g,function(a,c){return pb(N[c])});return a.untrim(c)}}function ha(a){return a.replace(/(\.\s*)?(\b[A-Za-z_$][\w$]*\b)(\s*\.\s*(\b[A-Za-z_$][\w$]*\b)(\s*\()?)?/g,function(a,c,d,Z,f,g){return c?a:
T({name:d,member:f,callSign:!!g})+(Z===p?"":Z)})}function aa(a,c){this.expr=a;this.transforms=c}function ea(a,c,d){this.name=a;this.value=c;this.isDefault=d}function Y(a,c){var d=a.indexOf("="),B,f;d<0?(B=a,d=c,f=!0):(B=a.substring(0,d),d=Aa(a.substring(d+1)),f=!1);return new ea(g(B.replace(/(\s*"C\d+")+/g,"")),d,f)}function hc(a){return a==="int"||a==="float"?"0":a==="boolean"?"false":a==="color"?"0x00000000":"null"}function ma(a,c){this.definitions=a;this.varType=c}function Ba(a){this.expression=
a}function La(a){if(Yb.test(a)){for(var c=Za.exec(a),a=a.substring(c[0].length).split(","),d=hc(c[2]),B=0;B<a.length;++B)a[B]=Y(a[B],d);return new ma(a,c[2])}else return new Ba(Aa(a))}function Pa(a,c,d){this.initStatement=a;this.condition=c;this.step=d}function Ea(a,c){this.initStatement=a;this.container=c}function Qa(a,c){this.initStatement=a;this.container=c}function ic(a){return/\bin\b/.test(a)?(a=a.substring(1,a.length-1).split(/\bin\b/g),new Ea(La(g(a[0])),Aa(a[1]))):a.indexOf(":")>=0&&a.indexOf(";")<
0?(a=a.substring(1,a.length-1).split(":"),new Qa(La(g(a[0])),Aa(a[1]))):(a=a.substring(1,a.length-1).split(";"),new Pa(La(g(a[0])),Aa(a[1]),Aa(a[2])))}function Ab(a){a.sort(function(a,c){return c.weight-a.weight})}function Ra(a,c,d){this.name=a;this.body=c;this.isStatic=d;c.owner=this}function H(a,c,d){this.name=a;this.body=c;this.isStatic=d;c.owner=this}function qa(a){var c=W.exec(a);W.lastIndex=0;var d=c[1].indexOf("static")>=0,B=N[s(c[6])],a=za,f="class"+ ++ob;za=f;c=c[2]==="interface"?new Ra(c[3],
hb(B,c[3],c[4]),d):new H(c[3],fb(B,c[3],c[4],c[5]),d);c.classId=f;c.scopeId=a;ba[f]=c;za=a;return c}function qb(a,c,d,B){this.name=a;this.params=c;this.body=d;this.isStatic=B}function rb(a){a=Ya.exec(a);Ya.lastIndex=0;var c=a[1].indexOf("static")>=0,d=a[6]!==";"?N[s(a[6])]:"{}";return new qb(a[3],ca(N[s(a[4])]),Oa(d),c)}function Ca(a,c,d){this.definitions=a;this.fieldType=c;this.isStatic=d}function Ia(a){for(var c=Za.exec(a),d=c[1].indexOf("static")>=0,a=a.substring(c[0].length).split(/,\s*/g),B=
hc(c[2]),f=0;f<a.length;++f)a[f]=Y(a[f],B);return new Ca(a,c[2],d)}function Bb(a,c){this.params=a;this.body=c}function wa(a){var a=RegExp(/"B(\d+)"\s*"A(\d+)"/).exec(a),c=ca(N[a[1]]);return new Bb(c,Oa(N[a[2]]))}function Zb(a,c,d,B,f,g){this.name=a;this.interfacesNames=c;this.methodsNames=d;this.fields=B;this.innerClasses=f;this.misc=g;a=0;for(c=B.length;a<c;++a)B[a].owner=this}function $b(a,c,d,B,f,g,i,p,s){this.name=a;this.baseClassName=c;this.interfacesNames=d;this.functions=B;this.methods=f;this.fields=
g;this.cstrs=i;this.innerClasses=p;this.misc=s;a=0;for(c=g.length;a<c;++a)g[a].owner=this}function Cb(a,c){this.name=a;this.body=c;c.owner=this}function a(a,c){this.name=a;this.body=c;c.owner=this}function ib(c){var d=W.exec(c);W.lastIndex=0;var f=N[s(d[6])],c=za,B="class"+ ++ob;za=B;d=d[2]==="interface"?new Cb(d[3],hb(f,d[3],d[4])):new a(d[3],fb(f,d[3],d[4],d[5]));d.classId=B;d.scopeId=c;ba[B]=d;za=c;return d}function d(a,c,d){this.name=a;this.params=c;this.body=d}function $(a){a=Ya.exec(a);Ya.lastIndex=
0;return new d(a[3],ca(N[s(a[4])]),Oa(N[s(a[6])]))}function ga(a,c){this.argument=a;this.misc=c}function U(a,c){this.argument=a;this.misc=c}function na(a,c,d){this.name=a;this.argument=c;this.misc=d}function Fa(a){this.expr=a}function Ga(a){this.label=a}function O(c){for(var f=[],g=0,B=c.length;g<B;++g){var i=c[g];i instanceof ma?f=f.concat(i.getNames()):i instanceof ga&&i.argument.initStatement instanceof ma?f=f.concat(i.argument.initStatement.getNames()):(i instanceof Ra||i instanceof H||i instanceof
Cb||i instanceof a||i instanceof d||i instanceof A)&&f.push(i.name)}return v({},f)}function oa(a){this.statements=a}function ka(a){this.statements=a}var Db=yc(),pa=[],jb,i=i.replace(/\r\n?|\n\r/g,"\n").replace(/("(?:[^"\\\n]|\\.)*")|('(?:[^'\\\n]|\\.)*')|(([\[\(=|&!\^:?]\s*)(\/(?![*\/])(?:[^\/\\\n]|\\.)*\/[gim]*)\b)|(\/\/[^\n]*\n)|(\/\*(?:(?!\*\/)(?:.|\n))*\*\/)/g,function(a,c,d,f,g,i,p,s){return c||d?(c=pa.length,pa.push(a),"'"+c+"'"):f?(c=pa.length,pa.push(i),g+"'"+c+"'"):s!==""?" ":"\n"}),$a=function(a,
c,d,f){if(c||f)return a;jb=!0;return""};do jb=!1,i=i.replace(/([<]?)<\s*((?:\?|[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)(?:\s+(?:extends|super)\s+[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)?(?:\s*,\s*(?:\?|[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)(?:\s+(?:extends|super)\s+[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)?)*)\s*>([=]?)/g,$a);while(jb);var N=function(a){for(var c=[],a=a.split(/([\{\[\(\)\]\}])/),d=a[0],f=[],g=1;g<a.length;g+=2){var i=a[g];if(i==="["||i==="{"||
i==="(")f.push(d),d=i;else if(i==="]"||i==="}"||i===")"){var p=i==="}"?"A":i===")"?"B":"C",s=c.length;c.push(d+i);d=f.pop()+'"'+p+(s+1)+'"'}d+=a[g+1]}c.unshift(d);return c}(i),T,ba={},za,ob=0,fb,hb,Oa,Eb,Aa,W=/\b((?:(?:public|private|final|protected|static|abstract)\s+)*)(class|interface)\s+([A-Za-z_$][\w$]*\b)(\s+extends\s+[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*(?:\s*,\s*[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*\b)*)?(\s+implements\s+[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*(?:\s*,\s*[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*\b)*)?\s*("A\d+")/g,
Ya=/\b((?:(?:public|private|final|protected|static|abstract|synchronized)\s+)*)((?!(?:else|new|return|throw|function|public|private|protected)\b)[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*(?:\s*"C\d+")*)\s*([A-Za-z_$][\w$]*\b)\s*("B\d+")(\s*throws\s+[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*(?:\s*,\s*[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)*)?\s*("A\d+"|;)/g,Yb=/^((?:(?:public|private|final|protected|static)\s+)*)((?!(?:else|new|return|throw)\b)[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*(?:\s*"C\d+")*)\s*([A-Za-z_$][\w$]*\b)\s*(?:"C\d+"\s*)*([=,]|$)/,
Jb=/\b((?:(?:public|private|final|protected|static|abstract)\s+)*)((?!(?:new|return|throw)\b)[A-Za-z_$][\w$]*\b)\s*("B\d+")(\s*throws\s+[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*(?:\s*,\s*[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)*)?\s*("A\d+")/g,Za=/^((?:(?:public|private|final|protected|static)\s+)*)((?!(?:new|return|throw)\b)[A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*(?:\s*"C\d+")*)\s*/,yb=/\bfunction(?:\s+([A-Za-z_$][\w$]*))?\s*("B\d+")\s*("A\d+")/g;z.prototype.toString=function(){return this.name};
G.prototype.getNames=function(){for(var a=[],c=0,d=this.params.length;c<d;++c)a.push(this.params[c].name);return a};G.prototype.toString=function(){if(this.params.length===0)return"()";for(var a="(",c=0,d=this.params.length;c<d;++c)a+=this.params[c]+", ";return a.substring(0,a.length-2)+")"};Xc.prototype.toString=function(){return"new ("+this.body+")"};A.prototype.toString=function(){var a=T,c=v({"this":null},this.params.getNames());T=function(d){return c.hasOwnProperty(d.name)?d.name:a(d)};var d=
"function";this.name&&(d+=" "+this.name);d+=this.params+" "+this.body;T=a;return d};Xb.prototype.toString=function(){var a=T;T=function(c){return c.name==="this"?"this":a(c)};for(var c="",d=0,f=this.members.length;d<f;++d)this.members[d].label&&(c+=this.members[d].label+": "),c+=this.members[d].value.toString()+", ";T=a;return c.substring(0,c.length-2)};aa.prototype.toString=function(){var a=this.transforms;return ha(this.expr).replace(/"!(\d+)"/g,function(c,d){return a[d].toString()})};Aa=function(a){var c=
[],a=pb(a),a=a.replace(/"H(\d+)"/g,function(a,d){c.push(L(N[d]));return'"!'+(c.length-1)+'"'}),a=a.replace(/"F(\d+)"/g,function(a,d){c.push(fa(N[d]));return'"!'+(c.length-1)+'"'}),a=a.replace(/"I(\d+)"/g,function(a,d){c.push(X(N[d]));return'"!'+(c.length-1)+'"'});return new aa(a,c)};ea.prototype.toString=function(){return this.name+" = "+this.value};ma.prototype.getNames=function(){for(var a=[],c=0,d=this.definitions.length;c<d;++c)a.push(this.definitions[c].name);return a};ma.prototype.toString=
function(){return"var "+this.definitions.join(",")};Ba.prototype.toString=function(){return this.expression.toString()};Pa.prototype.toString=function(){return"("+this.initStatement+"; "+this.condition+"; "+this.step+")"};Ea.prototype.toString=function(){var a=this.initStatement.toString();a.indexOf("=")>=0&&(a=a.substring(0,a.indexOf("=")));return"("+a+" in "+this.container+")"};Qa.iteratorId=0;Qa.prototype.toString=function(){var a=this.initStatement.toString(),c="$it"+Qa.iteratorId++,a=a.replace(/^\s*var\s*/,
"").split("=")[0];return"("+("var "+c+" = new $p.ObjectIterator("+this.container+"), "+a+" = void(0)")+"; "+(c+".hasNext() && (("+a+" = "+c+".next()) || true)")+";)"};Ra.prototype.toString=function(){return""+this.body};H.prototype.toString=function(){return""+this.body};qb.prototype.toString=function(){var a=v({},this.params.getNames()),c=T;T=function(d){return a.hasOwnProperty(d.name)?d.name:c(d)};var d="function "+this.methodId+this.params+" "+this.body+"\n";T=c;return d};Ca.prototype.getNames=
function(){for(var a=[],c=0,d=this.definitions.length;c<d;++c)a.push(this.definitions[c].name);return a};Ca.prototype.toString=function(){var a=T({name:"[this]"});if(this.isStatic){for(var c=this.owner.name,d=[],f=0,i=this.definitions.length;f<i;++f){var g=this.definitions[f],p=g.name,s=c+"."+p;d.push("if("+s+" === void(0)) {\n "+s+" = "+g.value+"; }\n$p.defineProperty("+a+", '"+p+"', { get: function(){return "+s+";}, set: function(val){"+s+" = val;} });\n")}return d.join("")}else return a+"."+this.definitions.join("; "+
a+".")};Bb.prototype.toString=function(){var a=v({},this.params.getNames()),c=T;T=function(d){return a.hasOwnProperty(d.name)?d.name:c(d)};var d="function $constr_"+this.params.params.length+this.params.toString(),f=this.body.toString();/\$(superCstr|constr)\b/.test(f)||(f="{\n$superCstr();\n"+f.substring(1));T=c;return d+f+"\n"};Zb.prototype.getMembers=function(a,c,d){this.owner.base&&this.owner.base.body.getMembers(a,c,d);var f,i,g,p;f=0;for(g=this.fields.length;f<g;++f){var s=this.fields[f].getNames();
i=0;for(p=s.length;i<p;++i)a[s[i]]=this.fields[f]}f=0;for(g=this.methodsNames.length;f<g;++f)c[this.methodsNames[f]]=!0;f=0;for(g=this.innerClasses.length;f<g;++f)a=this.innerClasses[f],d[a.name]=a};Zb.prototype.toString=function(){(function(a){for(var c=0;a;)++c,a=a.scope;return c})(this.owner);var a=this.name,c="",d="";this.getMembers({},{},{});var f,g;if(this.owner.interfaces){var i=[],p;f=0;for(g=this.interfacesNames.length;f<g;++f)this.owner.interfaces[f]&&(p=T({name:this.interfacesNames[f]}),
i.push(p),c+="$p.extendInterfaceMembers("+a+", "+p+");\n");d+=a+".$interfaces = ["+i.join(", ")+"];\n"}d+=a+".$isInterface = true;\n";d+=a+".$methods = ['"+this.methodsNames.join("', '")+"'];\n";Ab(this.innerClasses);f=0;for(g=this.innerClasses.length;f<g;++f)i=this.innerClasses[f],i.isStatic&&(c+=a+"."+i.name+" = "+i+";\n");f=0;for(g=this.fields.length;f<g;++f)i=this.fields[f],i.isStatic&&(c+=a+"."+i.definitions.join(";\n"+a+".")+";\n");return"(function() {\nfunction "+a+"() { throw 'Unable to create the interface'; }\n"+
c+d+"return "+a+";\n})()"};hb=function(a,c,d){var a=a.substring(1,a.length-1),a=w(a),a=x(a,c),i=[],g=[],a=a.replace(/"([DE])(\d+)"/g,function(a,c,d){c==="D"?i.push(d):c==="E"&&g.push(d);return""}),a=a.split(/;(?:\s*;)*/g),s,Q;d!==p&&(s=d.replace(/^\s*extends\s+(.+?)\s*$/g,"$1").split(/\s*,\s*/g));d=0;for(Q=i.length;d<Q;++d){var v=rb(N[i[d]]);i[d]=v.name}d=0;for(Q=a.length-1;d<Q;++d)v=f(a[d]),a[d]=Ia(v.middle);v=a.pop();d=0;for(Q=g.length;d<Q;++d)g[d]=qa(N[g[d]]);return new Zb(c,s,i,a,g,{tail:v})};
$b.prototype.getMembers=function(a,c,d){this.owner.base&&this.owner.base.body.getMembers(a,c,d);var f,i,g,p;f=0;for(g=this.fields.length;f<g;++f){var s=this.fields[f].getNames();i=0;for(p=s.length;i<p;++i)a[s[i]]=this.fields[f]}f=0;for(g=this.methods.length;f<g;++f)a=this.methods[f],c[a.name]=a;f=0;for(g=this.innerClasses.length;f<g;++f)c=this.innerClasses[f],d[c.name]=c};$b.prototype.toString=function(){var a="$this_"+function(a){for(var c=0;a;)++c,a=a.scope;return c}(this.owner),c=this.name,d="var "+
a+" = this;\n",f="",i="",p={},s={},v={};this.getMembers(p,s,v);var ca=T;T=function(d){var f=d.name;if(f==="this")return d.callSign||!d.member?a+".$self":a;else if(p.hasOwnProperty(f))return p[f].isStatic?c+"."+f:a+"."+f;else if(v.hasOwnProperty(f))return a+"."+f;else if(s.hasOwnProperty(f))return s[f].isStatic?c+"."+f:a+".$self."+f;return ca(d)};var q;this.baseClassName?(q=ca({name:this.baseClassName}),d+="var $super = { $upcast: "+a+" };\n",d+="function $superCstr(){"+q+".apply($super,arguments);if(!('$self' in $super)) $p.extendClassChain($super)}\n",
i+=c+".$base = "+q+";\n"):d+="function $superCstr(){$p.extendClassChain("+a+")}\n";this.owner.base&&(f+="$p.extendStaticMembers("+c+", "+q+");\n");var da,w,x;if(this.owner.interfaces){w=[];q=0;for(da=this.interfacesNames.length;q<da;++q)this.owner.interfaces[q]&&(x=ca({name:this.interfacesNames[q]}),w.push(x),f+="$p.extendInterfaceMembers("+c+", "+x+");\n");i+=c+".$interfaces = ["+w.join(", ")+"];\n"}this.functions.length>0&&(d+=this.functions.join("\n")+"\n");Ab(this.innerClasses);q=0;for(da=this.innerClasses.length;q<
da;++q)w=this.innerClasses[q],w.isStatic?(f+=c+"."+w.name+" = "+w+";\n",d+=a+"."+w.name+" = "+c+"."+w.name+";\n"):d+=a+"."+w.name+" = "+w+";\n";q=0;for(da=this.fields.length;q<da;++q){var fa=this.fields[q];if(fa.isStatic){f+=c+"."+fa.definitions.join(";\n"+c+".")+";\n";w=0;for(x=fa.definitions.length;w<x;++w){var J=fa.definitions[w].name,z=c+"."+J;d+="$p.defineProperty("+a+", '"+J+"', {get: function(){return "+z+"}, set: function(val){"+z+" = val}});\n"}}else d+=a+"."+fa.definitions.join(";\n"+a+
".")+";\n"}w={};q=0;for(da=this.methods.length;q<da;++q)x=this.methods[q],fa=w[x.name],J=x.name+"$"+x.params.params.length,fa?(++fa,J+="_"+fa):fa=1,x.methodId=J,w[x.name]=fa,x.isStatic?(f+=x,f+="$p.addMethod("+c+", '"+x.name+"', "+J+");\n"):d+=x,d+="$p.addMethod("+a+", '"+x.name+"', "+J+");\n";d+=g(this.misc.tail);this.cstrs.length>0&&(d+=this.cstrs.join("\n")+"\n");d+="function $constr() {\n";w=[];q=0;for(da=this.cstrs.length;q<da;++q)x=this.cstrs[q].params.params.length,w.push("if(arguments.length === "+
x+") { $constr_"+x+".apply("+a+", arguments); }");w.length>0&&(d+=w.join(" else ")+" else ");d+="$superCstr();\n}\n";d+="$constr.apply(null, arguments);\n";T=ca;return"(function() {\nfunction "+c+"() {\n"+d+"}\n"+f+i+"return "+c+";\n})()"};fb=function(a,c,d,i){var a=a.substring(1,a.length-1),a=w(a),a=x(a,c),g=[],s=[],Q=[],v=[],a=a.replace(/"([DEGH])(\d+)"/g,function(a,c,d){c==="D"?g.push(d):c==="E"?s.push(d):c==="H"?v.push(d):Q.push(d);return""}),a=a.replace(/^(?:\s*;)+/,"").split(/;(?:\s*;)*/g),
q,ca;d!==p&&(q=d.replace(/^\s*extends\s+([A-Za-z_$][\w$]*\b(?:\s*\.\s*[A-Za-z_$][\w$]*\b)*)\s*$/g,"$1"));i!==p&&(ca=i.replace(/^\s*implements\s+(.+?)\s*$/g,"$1").split(/\s*,\s*/g));for(d=0;d<v.length;++d)v[d]=L(N[v[d]]);for(d=0;d<g.length;++d)g[d]=rb(N[g[d]]);for(d=0;d<a.length-1;++d)i=f(a[d]),a[d]=Ia(i.middle);i=a.pop();for(d=0;d<Q.length;++d)Q[d]=wa(N[Q[d]]);for(d=0;d<s.length;++d)s[d]=qa(N[s[d]]);return new $b(c,q,ca,v,g,a,Q,s,{tail:i})};Cb.prototype.toString=function(){return"var "+this.name+
" = "+this.body+";\n$p."+this.name+" = "+this.name+";\n"};a.prototype.toString=function(){return"var "+this.name+" = "+this.body+";\n$p."+this.name+" = "+this.name+";\n"};d.prototype.toString=function(){var a=v({},this.params.getNames()),c=T;T=function(d){return a.hasOwnProperty(d.name)?d.name:c(d)};var d="function "+this.name+this.params+" "+this.body+"\n$p."+this.name+" = "+this.name+";";T=c;return d};ga.prototype.toString=function(){return this.misc.prefix+this.argument.toString()};U.prototype.toString=
function(){return this.misc.prefix+this.argument.toString()};na.prototype.toString=function(){var a=this.misc.prefix;this.argument!==p&&(a+=this.argument.toString());return a};Fa.prototype.toString=function(){return"case "+this.expr+":"};Ga.prototype.toString=function(){return this.label};Eb=function(a,c,d){for(var i=RegExp(/\b(catch|for|if|switch|while|with)\s*"B(\d+)"|\b(do|else|finally|return|throw|try|break|continue)\b|("[ADEH](\d+)")|\b(case)\s+([^:]+):|\b([A-Za-z_$][\w$]*\s*:)|(;)/g),s=[],a=
a.replace(/\b(catch\s*"B\d+"\s*"A\d+")(\s*catch\s*"B\d+"\s*"A\d+")+/g,"$1"),v=0,q,w;(q=i.exec(a))!==null;){if(q[1]!==p)w=a.lastIndexOf('"B',i.lastIndex),v=a.substring(v,w),q[1]==="for"?s.push(new ga(ic(N[q[2]]),{prefix:v})):q[1]==="catch"?s.push(new U(ca(N[q[2]]),{prefix:v})):s.push(new na(q[1],Aa(N[q[2]]),{prefix:v}));else if(q[3]!==p)s.push(new na(q[3],p,{prefix:a.substring(v,i.lastIndex)}));else if(q[4]!==p){w=a.substring(v,i.lastIndex-q[4].length);if(g(w).length!==0)continue;s.push(w);v=q[4].charAt(1);
q=q[5];v==="D"?s.push(c(N[q])):v==="E"?s.push(d(N[q])):v==="H"?s.push(L(N[q])):s.push(Oa(N[q]))}else if(q[6]!==p)s.push(new Fa(Aa(g(q[7]))));else if(q[8]!==p){w=a.substring(v,i.lastIndex-q[8].length);if(g(w).length!==0)continue;s.push(new Ga(a.substring(v,i.lastIndex)))}else q=f(a.substring(v,i.lastIndex-1)),s.push(q.left),s.push(La(q.middle)),s.push(q.right+";");v=i.lastIndex}c=f(a.substring(v));s.push(c.left);c.middle!==""&&(s.push(La(c.middle)),s.push(";"+c.right));return s};oa.prototype.toString=
function(){var a=O(this.statements),c=T;q(a)||(T=function(d){return a.hasOwnProperty(d.name)?d.name:c(d)});var d="{\n"+this.statements.join("")+"\n}";T=c;return d};Oa=function(a){a=f(a.substring(1,a.length-1));return new oa(Eb(a.middle))};ka.prototype.toString=function(){for(var d=[],f=[],i,g=0,s=this.statements.length;g<s;++g)i=this.statements[g],i instanceof a||i instanceof Cb?d.push(i):f.push(i);Ab(d);var p=O(this.statements);T=function(a){a=a.name;if(!p.hasOwnProperty(a)&&(Db.hasOwnProperty(a)||
c.hasOwnProperty(a)||la.hasOwnProperty(a)))return"$p."+a;return a};d="// this code was autogenerated from PJS\n(function($p) {\n"+d.join("")+"\n"+f.join("")+"\n})";T=null;return d};i=function(){var a=w(N[0]),a=a.replace(/\bimport\s+[^;]+;/g,"");return new ka(Eb(a,$,ib))}();(function(){function a(d,f){for(var i=f.split("."),g=d.scope,s;g;){if(g.hasOwnProperty(i[0])){s=g[i[0]];break}g=g.scope}s===p&&(s=c[i[0]]);for(var g=1,v=i.length;g<v&&s;++g)s=s.inScope[i[g]];return s}var c={},d,f;for(d in ba)if(ba.hasOwnProperty(d)){f=
ba[d];var i=f.scopeId,g=f.name;if(i){i=ba[i];f.scope=i;if(i.inScope===p)i.inScope={};i.inScope[g]=f}else c[g]=f}for(d in ba)if(ba.hasOwnProperty(d)){f=ba[d];if(g=f.body.baseClassName)if(g=a(f,g)){f.base=g;if(!g.derived)g.derived=[];g.derived.push(f)}var g=f.body.interfacesNames,i=[],s,v;if(g&&g.length>0){s=0;for(v=g.length;s<v;++s){var q=a(f,g[s]);i.push(q);if(q){if(!q.derived)q.derived=[];q.derived.push(f)}}if(i.length>0)f.interfaces=i}}})(i);(function(){function a(c,f){var g=d[c];if(!g)return!1;
var i=g.indexOf(f);if(i<0)return!1;g.splice(i,1);if(g.length>0)return!1;delete d[c];return!0}var c=[],d={},f,i,g;for(f in ba)if(ba.hasOwnProperty(f))if(g=ba[f],!g.inScope&&!g.derived)c.push(f),g.weight=0;else{var s=[];if(g.inScope)for(i in g.inScope)g.inScope.hasOwnProperty(i)&&s.push(g.inScope[i]);g.derived&&(s=s.concat(g.derived));d[f]=s}for(;c.length>0;){f=c.shift();g=ba[f];if(g.scopeId&&a(g.scopeId,g))c.push(g.scopeId),ba[g.scopeId].weight=g.weight+1;if(g.base&&a(g.base.classId,g))c.push(g.base.classId),
g.base.weight=g.weight+1;if(g.interfaces){f=0;for(i=g.interfaces.length;f<i;++f)if(g.interfaces[f]&&a(g.interfaces[f].classId,g))c.push(g.interfaces[f].classId),g.interfaces[f].weight=g.weight+1}}})(i);i=i.toString();i=i.replace(/\s*\n(?:[\t ]*\n)+/g,"\n\n");return function(a,c){return a.replace(/'(\d+)'/g,function(a,d){var f=c[d];return f.charAt(0)==="/"?f:/^'((?:[^'\\\n])|(?:\\.[0-9A-Fa-f]*))'$/.test(f)?"(new $p.Character("+f+"))":f})}(i,pa)}function Cc(c,f){var g=RegExp(/\/\*\s*@pjs\s+((?:[^\*]|\*+[^\*\/])*)\*\//g).exec(c);
if(g&&g.length===2)for(var p=[],g=g.splice(1,2)[0].replace(/\{([\s\S]*?)\}/g,function(){return function(c,f){p.push(f);return"{"+(p.length-1)+"}"}}()).replace("\n","").replace("\r","").split(";"),q=function(c){return c.replace(/^\s*["']?/,"").replace(/["']?\s*$/,"")},s=0,J=g.length;s<J;s++){var w=g[s].split("=");if(w&&w.length===2){var x=q(w[0]),z=q(w[1]),w=[];if(x==="preload"){w=z.split(",");x=0;for(z=w.length;x<z;x++){var G=q(w[x]);f.imageCache.add(G)}}else if(x==="font"){w=z.split(",");x=0;for(z=
w.length;x<z;x++){var G=q(w[x]),ca=/^\{(\d*?)\}$/.exec(G);f.fonts.add(ca?JSON.parse("{"+p[ca[1]]+"}"):G)}}else x==="crisp"?f.options.crispLines=z==="true":x==="pauseOnBlur"?f.options.pauseOnBlur=z==="true":x==="globalKeyEvents"?f.options.globalKeyEvents=z==="true":x.substring(0,6)==="param-"?f.params[x.substring(6)]=z:f.options[x]=z}}return c}var Dc=function(){},Hb=function(){return"console"in X?function(c){X.console.log("Processing.js: "+c)}:void 0}(),Ec=function(c){var f=new XMLHttpRequest;f.open("GET",
c,!1);f.overrideMimeType&&f.overrideMimeType("text/plain");f.setRequestHeader("If-Modified-Since","Fri, 01 Jan 1960 00:00:00 GMT");f.send(null);if(f.status!==200&&f.status!==0)throw"XMLHttpRequest failed, status code "+f.status;return f.responseText},Ia="document"in this&&!("fake"in this.document),L=wa("Float32Array","WebGLFloatArray"),Cd=wa("Int32Array","WebGLIntArray"),Dd=wa("Uint16Array","WebGLUnsignedShortArray"),$c=wa("Uint8Array","WebGLUnsignedByteArray"),c={X:0,Y:1,Z:2,R:3,G:4,B:5,A:6,U:7,
V:8,NX:9,NY:10,NZ:11,EDGE:12,SR:13,SG:14,SB:15,SA:16,SW:17,TX:18,TY:19,TZ:20,VX:21,VY:22,VZ:23,VW:24,AR:25,AG:26,AB:27,DR:3,DG:4,DB:5,DA:6,SPR:28,SPG:29,SPB:30,SHINE:31,ER:32,EG:33,EB:34,BEEN_LIT:35,VERTEX_FIELD_COUNT:36,P2D:1,JAVA2D:1,WEBGL:2,P3D:2,OPENGL:2,PDF:0,DXF:0,OTHER:0,WINDOWS:1,MAXOSX:2,LINUX:3,EPSILON:1.0E-4,MAX_FLOAT:3.4028235E38,MIN_FLOAT:-3.4028235E38,MAX_INT:2147483647,MIN_INT:-2147483648,PI:g.PI,TWO_PI:2*g.PI,HALF_PI:g.PI/2,THIRD_PI:g.PI/3,QUARTER_PI:g.PI/4,DEG_TO_RAD:g.PI/180,RAD_TO_DEG:180/
g.PI,WHITESPACE:" \t\n\r\u000c\u00a0",RGB:1,ARGB:2,HSB:3,ALPHA:4,CMYK:5,TIFF:0,TARGA:1,JPEG:2,GIF:3,BLUR:11,GRAY:12,INVERT:13,OPAQUE:14,POSTERIZE:15,THRESHOLD:16,ERODE:17,DILATE:18,REPLACE:0,BLEND:1,ADD:2,SUBTRACT:4,LIGHTEST:8,DARKEST:16,DIFFERENCE:32,EXCLUSION:64,MULTIPLY:128,SCREEN:256,OVERLAY:512,HARD_LIGHT:1024,SOFT_LIGHT:2048,DODGE:4096,BURN:8192,ALPHA_MASK:4278190080,RED_MASK:16711680,GREEN_MASK:65280,BLUE_MASK:255,CUSTOM:0,ORTHOGRAPHIC:2,PERSPECTIVE:3,POINT:2,POINTS:2,LINE:4,LINES:4,TRIANGLE:8,
TRIANGLES:9,TRIANGLE_STRIP:10,TRIANGLE_FAN:11,QUAD:16,QUADS:16,QUAD_STRIP:17,POLYGON:20,PATH:21,RECT:30,ELLIPSE:31,ARC:32,SPHERE:40,BOX:41,GROUP:0,PRIMITIVE:1,GEOMETRY:3,VERTEX:0,BEZIER_VERTEX:1,CURVE_VERTEX:2,BREAK:3,CLOSESHAPE:4,OPEN:1,CLOSE:2,CORNER:0,CORNERS:1,RADIUS:2,CENTER_RADIUS:2,CENTER:3,DIAMETER:3,CENTER_DIAMETER:3,BASELINE:0,TOP:101,BOTTOM:102,NORMAL:1,NORMALIZED:1,IMAGE:2,MODEL:4,SHAPE:5,SQUARE:"butt",ROUND:"round",PROJECT:"square",MITER:"miter",BEVEL:"bevel",AMBIENT:0,DIRECTIONAL:1,
SPOT:3,BACKSPACE:8,TAB:9,ENTER:10,RETURN:13,ESC:27,DELETE:127,CODED:65535,SHIFT:16,CONTROL:17,ALT:18,CAPSLK:20,PGUP:33,PGDN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLK:144,META:157,INSERT:155,ARROW:"default",CROSS:"crosshair",HAND:"pointer",MOVE:"move",TEXT:"text",WAIT:"wait",NOCURSOR:"url('data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='), auto",DISABLE_OPENGL_2X_SMOOTH:1,
ENABLE_OPENGL_2X_SMOOTH:-1,ENABLE_OPENGL_4X_SMOOTH:2,ENABLE_NATIVE_FONTS:3,DISABLE_DEPTH_TEST:4,ENABLE_DEPTH_TEST:-4,ENABLE_DEPTH_SORT:5,DISABLE_DEPTH_SORT:-5,DISABLE_OPENGL_ERROR_REPORT:6,ENABLE_OPENGL_ERROR_REPORT:-6,ENABLE_ACCURATE_TEXTURES:7,DISABLE_ACCURATE_TEXTURES:-7,HINT_COUNT:10,SINCOS_LENGTH:parseInt(720,10),PRECISIONB:15,PRECISIONF:32768,PREC_MAXVAL:32767,PREC_ALPHA_SHIFT:9,PREC_RED_SHIFT:1,NORMAL_MODE_AUTO:0,NORMAL_MODE_SHAPE:1,NORMAL_MODE_VERTEX:2,MAX_LIGHTS:8},Ib=function(c){if(c.iterator instanceof
Function)return c.iterator();else if(c instanceof Array){var f=-1;this.hasNext=function(){return++f<c.length};this.next=function(){return c[f]}}else throw"Unable to iterate: "+c;},Fc=function(){function c(f){var g=0;this.hasNext=function(){return g<f.length};this.next=function(){return f[g++]};this.remove=function(){f.splice(g,1)}}function f(){var g;arguments.length===0?g=[]:arguments.length>0&&typeof arguments[0]!=="number"?g=arguments[0].toArray():(g=[],g.length=0|arguments[0]);this.get=function(c){return g[c]};
this.contains=function(c){return this.indexOf(c)>-1};this.indexOf=function(c){for(var f=0,i=g.length;f<i;++f)if(qa(c,g[f]))return f;return-1};this.add=function(){if(arguments.length===1)g.push(arguments[0]);else if(arguments.length===2){var c=arguments[0];if(typeof c==="number")if(c>=0&&c<=g.length)g.splice(c,0,arguments[1]);else throw c+" is not a valid index";else throw typeof c+" is not a number";}else throw"Please use the proper number of parameters.";};this.addAll=function(c,f){var i;if(typeof c===
"number"){if(c<0||c>g.length)throw"Index out of bounds for addAll: "+c+" greater or equal than "+g.length;for(i=new Ib(f);i.hasNext();)g.splice(c++,0,i.next())}else for(i=new Ib(c);i.hasNext();)g.push(i.next())};this.set=function(){if(arguments.length===2){var c=arguments[0];if(typeof c==="number")if(c>=0&&c<g.length)g.splice(c,1,arguments[1]);else throw c+" is not a valid index.";else throw typeof c+" is not a number";}else throw"Please use the proper number of parameters.";};this.size=function(){return g.length};
this.clear=function(){g.length=0};this.remove=function(c){if(typeof c==="number")return g.splice(c,1)[0];else{c=this.indexOf(c);if(c>-1)return g.splice(c,1),!0;return!1}};this.isEmpty=function(){return!g.length};this.clone=function(){return new f(this)};this.toArray=function(){return g.slice(0)};this.iterator=function(){return new c(g)}}return f}(),Gc=function(){function c(){function f(c){c=xc(c)%x.length;return c<0?x.length+c:c}function g(){if(!(A<=w*x.length)){for(var c=[],i=0;i<x.length;++i)x[i]!==
p&&(c=c.concat(x[i]));i=x.length*2;x=[];x.length=i;for(i=0;i<c.length;++i){var s=f(c[i].key),q=x[s];q===p&&(x[s]=q=[]);q.push(c[i])}}}function v(c,f){function g(){for(;!q;)if(++s,i>=x.length)q=!0;else if(x[i]===p||s>=x[i].length)s=-1,++i;else break}var i=0,s=-1,q=!1;this.hasNext=function(){return!q};this.next=function(){var f=c(x[i][s]);g();return f};this.remove=function(){f(this.next());--s};g()}function q(c,f,g){this.clear=function(){G.clear()};this.contains=function(c){return f(c)};this.containsAll=
function(c){for(c=c.iterator();c.hasNext();)if(!this.contains(c.next()))return!1;return!0};this.isEmpty=function(){return G.isEmpty()};this.iterator=function(){return new v(c,g)};this.remove=function(c){if(this.contains(c))return g(c),!0;return!1};this.removeAll=function(c){for(c=c.iterator();c.hasNext();){var f=c.next();this.contains(f)&&g(f)}return!0};this.retainAll=function(c){for(var f=this.iterator(),i=[];f.hasNext();){var s=f.next();c.contains(s)||i.push(s)}for(c=0;c<i.length;++c)g(i[c]);return i.length>
0};this.size=function(){return G.size()};this.toArray=function(){for(var c=[],f=this.iterator();f.hasNext();)c.push(f.next());return c}}function s(c){this._isIn=function(f){return f===G&&c.removed===p};this.equals=function(f){return qa(c.key,f.getKey())};this.getKey=function(){return c.key};this.getValue=function(){return c.value};this.hashCode=function(){return xc(c.key)};this.setValue=function(f){var g=c.value;c.value=f;return g}}if(arguments.length===1&&arguments[0].constructor===c)return arguments[0].clone();
var z=arguments.length>0?arguments[0]:16,w=arguments.length>1?arguments[1]:0.75,x=[];x.length=z;var A=0,G=this;this.clear=function(){A=0;x=[];x.length=z};this.clone=function(){var f=new c;f.putAll(this);return f};this.containsKey=function(c){var g=f(c),g=x[g];if(g===p)return!1;for(var i=0;i<g.length;++i)if(qa(g[i].key,c))return!0;return!1};this.containsValue=function(c){for(var f=0;f<x.length;++f){var g=x[f];if(g!==p)for(var i=0;i<g.length;++i)if(qa(g[i].value,c))return!0}return!1};this.entrySet=
function(){return new q(function(c){return new s(c)},function(c){return c.constructor===s&&c._isIn(G)},function(c){return G.remove(c.getKey())})};this.get=function(c){var g=f(c),g=x[g];if(g===p)return null;for(var i=0;i<g.length;++i)if(qa(g[i].key,c))return g[i].value;return null};this.isEmpty=function(){return A===0};this.keySet=function(){return new q(function(c){return c.key},function(c){return G.containsKey(c)},function(c){return G.remove(c)})};this.put=function(c,i){var s=f(c),q=x[s];if(q===
p)return++A,x[s]=[{key:c,value:i}],g(),null;for(s=0;s<q.length;++s)if(qa(q[s].key,c)){var v=q[s].value;q[s].value=i;return v}++A;q.push({key:c,value:i});g();return null};this.putAll=function(c){for(c=c.entrySet().iterator();c.hasNext();){var f=c.next();this.put(f.getKey(),f.getValue())}};this.remove=function(c){var g=f(c),i=x[g];if(i===p)return null;for(var s=0;s<i.length;++s)if(qa(i[s].key,c))return--A,c=i[s].value,i[s].removed=!0,i.length>1?i.splice(s,1):x[g]=p,c;return null};this.size=function(){return A};
this.values=function(){for(var c=[],f=this.entrySet().iterator();f.hasNext();){var g=f.next();c.push(g.getValue())}return c}}return c}(),aa=function(){function c(f,g,i){this.x=f||0;this.y=g||0;this.z=i||0}function f(c){return function(f,g){var i=f.get();i[c](g);return i}}function p(c){return function(f,g){return f[c](g)}}var v="dist dot cross".split(" "),q=v.length;c.angleBetween=function(c,f){return g.acos(c.dot(f)/(c.mag()*f.mag()))};for(c.prototype={set:function(c,f,g){arguments.length===1?this.set(c.x||
c[0]||0,c.y||c[1]||0,c.z||c[2]||0):(this.x=c,this.y=f,this.z=g)},get:function(){return new c(this.x,this.y,this.z)},mag:function(){return g.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},add:function(c,f,g){arguments.length===3?(this.x+=c,this.y+=f,this.z+=g):arguments.length===1&&(this.x+=c.x,this.y+=c.y,this.z+=c.z)},sub:function(c,f,g){arguments.length===3?(this.x-=c,this.y-=f,this.z-=g):arguments.length===1&&(this.x-=c.x,this.y-=c.y,this.z-=c.z)},mult:function(c){typeof c==="number"?(this.x*=
c,this.y*=c,this.z*=c):typeof c==="object"&&(this.x*=c.x,this.y*=c.y,this.z*=c.z)},div:function(c){typeof c==="number"?(this.x/=c,this.y/=c,this.z/=c):typeof c==="object"&&(this.x/=c.x,this.y/=c.y,this.z/=c.z)},dist:function(c){var f=this.x-c.x,i=this.y-c.y,c=this.z-c.z;return g.sqrt(f*f+i*i+c*c)},dot:function(c,f,g){if(arguments.length===3)return this.x*c+this.y*f+this.z*g;else if(arguments.length===1)return this.x*c.x+this.y*c.y+this.z*c.z},cross:function(f){return new c(this.y*f.z-f.y*this.z,this.z*
f.x-f.z*this.x,this.x*f.y-f.x*this.y)},normalize:function(){var c=this.mag();c>0&&this.div(c)},limit:function(c){this.mag()>c&&(this.normalize(),this.mult(c))},heading2D:function(){return-g.atan2(-this.y,this.x)},toString:function(){return"["+this.x+", "+this.y+", "+this.z+"]"},array:function(){return[this.x,this.y,this.z]}};q--;)c[v[q]]=p(v[q]);for(q in c.prototype)c.prototype.hasOwnProperty(q)&&!c.hasOwnProperty(q)&&(c[q]=f(q));return c}();Wb.prototype=c;var la=new Wb;la.ArrayList=Fc;la.HashMap=
Gc;la.PVector=aa;la.ObjectIterator=Ib;la.defineProperty=function(c,f,g){"defineProperty"in Object?Object.defineProperty(c,f,g):(g.hasOwnProperty("get")&&c.__defineGetter__(f,g.get),g.hasOwnProperty("set")&&c.__defineSetter__(f,g.set))};la.extendClassChain=function(c){for(var f=[c],g=c.$upcast;g;g=g.$upcast)xb(g,c),f.push(g),c=g;for(;f.length>0;)f.pop().$self=c};la.extendStaticMembers=function(c,f){xb(c,f)};la.extendInterfaceMembers=function(c,f){xb(c,f)};la.addMethod=function(c,f,g){if(c[f]){var p=
g.length,q=c[f];c[f]=function(){return arguments.length===p?g.apply(this,arguments):q.apply(this,arguments)}}else c[f]=g};la.createJavaArray=function(c,f){var g=null;if(typeof f[0]==="number"){var p=0|f[0];if(f.length<=1){g=[];g.length=p;for(var q=0;q<p;++q)g[q]=0}else for(var g=[],q=f.slice(1),s=0;s<p;++s)g.push(la.createJavaArray(c,q))}return g};var Jb={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",
blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",
darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",
lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",
mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",
peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",
white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Ca=[],lc={},z=this.Processing=function(i,f){function Q(b){z.debug("Unimplemented - "+b)}function v(b,k,a,c){var h=Ma.locations[b];h===p&&(h=d.getUniformLocation(k,a),Ma.locations[b]=h);h!==-1&&(c.length===4?d.uniform4fv(h,c):c.length===3?d.uniform3fv(h,c):c.length===2?d.uniform2fv(h,c):d.uniform1f(h,c))}function q(b,k,a,c){var h=Ma.locations[b];h===p&&(h=d.getUniformLocation(k,a),Ma.locations[b]=h);h!==-1&&(c.length===4?
d.uniform4iv(h,c):c.length===3?d.uniform3iv(h,c):c.length===2?d.uniform2iv(h,c):d.uniform1i(h,c))}function s(b,k,a,c,h){var r=Ma.attributes[b];r===p&&(r=d.getAttribLocation(k,a),Ma.attributes[b]=r);r!==-1&&(d.bindBuffer(d.ARRAY_BUFFER,h),d.vertexAttribPointer(r,c,d.FLOAT,!1,0,0),d.enableVertexAttribArray(r))}function J(b,k,a){var c=Ma.attributes[b];c===p&&(c=d.getAttribLocation(k,a),Ma.attributes[b]=c);c!==-1&&d.disableVertexAttribArray(c)}function w(b,k,a,c,h){var r=Ma.locations[b];r===p&&(r=d.getUniformLocation(k,
a),Ma.locations[b]=r);r!==-1&&(h.length===16?d.uniformMatrix4fv(r,c,h):h.length===9?d.uniformMatrix3fv(r,c,h):d.uniformMatrix2fv(r,c,h))}function x(b,k,m,e){db===c.HSB?(m=a.color.toRGB(b,k,m),b=m[0],k=m[1],m=m[2]):(b=g.round(255*(b/ia)),k=g.round(255*(k/xa)),m=g.round(255*(m/B)));e=g.round(255*(e/Z));return(e>255?255:e)<<24&c.ALPHA_MASK|(b>255?255:b)<<16&c.RED_MASK|(k>255?255:k)<<8&c.GREEN_MASK|(m>255?255:m)&c.BLUE_MASK}function zb(){d.restore();Ga=Db=!0}function G(b,k,a){b.addEventListener?b.addEventListener(k,
a,!1):b.attachEvent("on"+k,a);Kb.push({elem:b,type:k,fn:a})}function ca(b){var k=b.elem,a=b.type,b=b.fn;k.removeEventListener?k.removeEventListener(a,b,!1):k.detachEvent&&k.detachEvent("on"+a,b)}function da(b,k){var a=1;a<<=k-1;for(var c="",h=0;h<k;h++)c+=a&b?"1":"0",a>>>=1;return c}function qa(b,k,a,c,h,d){k=b<0?a:k;a=h===0;h=h===p||h<0?0:h;b=g.abs(b);if(a){h=1;for(b*=10;g.abs(g.round(b)-b)>1.0E-6&&h<7;)++h,b*=10}else h!==0&&(b*=g.pow(10,h));a=b*2;g.floor(b)===b?a=b:g.floor(a)===a?(b=g.floor(b),
a=b+b%2):a=g.round(b);b="";for(c+=h;c>0||a>0;)c--,b=""+a%10+b,a=g.floor(a/10);if(d!==p)for(c=b.length-3-h;c>0;)b=b.substring(0,c)+d+b.substring(c),c-=3;return h>0?k+b.substring(0,b.length-h)+"."+b.substring(b.length-h,b.length):k+b}function fa(b,k,a,c,h,d){if(b instanceof Array){for(var j=[],l=0,y=b.length;l<y;l++)j.push(qa(b[l],k,a,c,h,d));return j}else return qa(b,k,a,c,h,d)}function Yc(b){b=parseInt("0x"+b,16);b>2147483647&&(b-=4294967296);return b}function gb(b){return Array.prototype.slice.call(b,
1)}function Xb(b){if(typeof b==="number")return b!==0;else if(typeof b==="boolean")return b;else if(typeof b==="string")return b.toLowerCase()==="true";else if(b instanceof ya)return b.code===49||b.code===84||b.code===116}function Zc(b){if(typeof b==="number")return b;else if(typeof b==="boolean")return b?1:0;else if(typeof b==="string")return parseFloat(b);else if(b instanceof ya)return b.code}function pb(b,k){if(typeof b==="number")return b&4294967295;else if(typeof b==="boolean")return b?1:0;else if(typeof b===
"string")return parseInt(b,k||10)&4294967295;else if(b instanceof ya)return b.code}function ha(b,k){var a=b||362436069,c=k||521288629,h=function(){a=36969*(a&65535)+(a>>>16)&4294967295;c=18E3*(c&65535)+(c>>>16)&4294967295;return((a&65535)<<16|c&65535)&4294967295};this.nextDouble=function(){var b=h()/4294967296;return b<0?1+b:b};this.nextInt=h}function Ia(b){function k(b,k,a,m){b&=15;var c=b<8?k:a,k=b<4?a:b===12||b===14?k:m;return((b&1)===0?c:-c)+((b&2)===0?k:-k)}function a(b,k,m){k=(b&1)===0?k:m;
return(b&2)===0?-k:k}function c(b,k,a){return k+b*(a-k)}var b=b!==p?new ha(b):ha.createRandomized(),h,d,j=new $c(512);for(h=0;h<256;++h)j[h]=h;for(h=0;h<256;++h){var l=j[d=b.nextInt()&255];j[d]=j[h];j[h]=l}for(h=0;h<256;++h)j[h+256]=j[h];this.noise3d=function(b,a,m){var h=g.floor(b)&255,d=g.floor(a)&255,r=g.floor(m)&255;b-=g.floor(b);a-=g.floor(a);m-=g.floor(m);var l=(3-2*b)*b*b,f=(3-2*a)*a*a,i=j[h]+d,o=j[i]+r,i=j[i+1]+r,d=j[h+1]+d,h=j[d]+r,r=j[d+1]+r;return c((3-2*m)*m*m,c(f,c(l,k(j[o],b,a,m),k(j[h],
b-1,a,m)),c(l,k(j[i],b,a-1,m),k(j[r],b-1,a-1,m))),c(f,c(l,k(j[o+1],b,a,m-1),k(j[h+1],b-1,a,m-1)),c(l,k(j[i+1],b,a-1,m-1),k(j[r+1],b-1,a-1,m-1))))};this.noise2d=function(b,k){var h=g.floor(b)&255,d=g.floor(k)&255;b-=g.floor(b);k-=g.floor(k);var r=(3-2*b)*b*b,l=j[h]+d,h=j[h+1]+d;return c((3-2*k)*k*k,c(r,a(j[l],b,k),a(j[h],b-1,k)),c(r,a(j[l+1],b,k-1),a(j[h+1],b-1,k-1)))};this.noise1d=function(b){var k=g.floor(b)&255;b-=g.floor(b);return c((3-2*b)*b*b,(j[k]&1)===0?-b:b,(j[k+1]&1)===0?-(b-1):b-1)}}function ea(){if(U){if(Ga)d.fillStyle=
a.color.toString(Fa),Ga=!1;d.fill()}}function Y(){if(O){if(Db)d.strokeStyle=a.color.toString(ka),Db=!1;d.stroke()}}function hc(b,k,m){m=0|m*((k&c.ALPHA_MASK)>>>24);return g.min(((b&c.ALPHA_MASK)>>>24)+m,255)<<24|a.mix(b&c.RED_MASK,k&c.RED_MASK,m)&c.RED_MASK|a.mix(b&c.GREEN_MASK,k&c.GREEN_MASK,m)&c.GREEN_MASK|a.mix(b&c.BLUE_MASK,k&c.BLUE_MASK,m)}function ma(b,k,a){var c=ad.shift();if(c===p)c={},c.canvas=A.createElement("canvas"),c.context=c.canvas.getContext("2d");ad.push(c);var h=c.canvas,d=c.context,
k=k||b.width,a=a||b.height;h.width=k;h.height=a;b?"data"in b?d.putImageData(b,0,0):(d.clearRect(0,0,k,a),d.drawImage(b,0,0,k,a)):d.clearRect(0,0,k,a);return c}function Ba(){bc&&(d=bd,bc=!1,a.updatePixels())}function La(){function b(b,k){b[k]=function(){Ba();d[k].apply(d,arguments)}}function k(b,k){a.defineProperty(b,k,{get:function(){Ba();return d[k]},set:function(b){Ba();d[k]=b}})}for(var m in d)typeof d[m]==="function"?b(this,m):k(this,m)}function Pa(b){this.name="sans-serif";if(b!==p)switch(b){case "sans-serif":case "serif":case "monospace":case "fantasy":case "cursive":this.name=
b;break;default:this.name='"'+b+'", sans-serif'}this.origName=b}function Ea(b){return b instanceof String?b:typeof b==="number"?b===(0|b)?b.toString():a.nf(b,0,3):b===null||b===p?"":b.toString()}function Qa(b,k,a,c){this.canvas=A.createElement("canvas");this.canvas.setAttribute("width",k+"px");this.canvas.setAttribute("height",k+"px");this.ctx=this.canvas.getContext("2d");this.ctx.font=k+"pt "+b;this.ctx.fillStyle="black";this.ctx.fillRect(0,0,k,k);this.ctx.fillStyle="white";this.ctx.fillText(c,0,
a);this.imageData=this.ctx.getImageData(0,0,k,k);this.get=function(b,k){return this.imageData.data[k*this.imageData.width*4+b*4]}}function ic(b,k,a,e){var h;b.indexOf("\n")<0?(b=[b],h=1):(b=b.split(/\r?\n/g),h=b.length);var d;d=Lb===c.TOP?(1-mc)*eb:Lb===c.CENTER?(1-mc-h/2)*eb:Lb===c.BOTTOM?(1-mc-h)*eb:0;for(var j=0;j<h;++j)ga.text$line(b[j],k,a+d,e,Mb),d+=eb}function Ab(b,k,a,e,h,r){if(!(b.length===0||e===0||h===0)&&!(S>h)){var j=-1,l=0,y=0,f=0;d.font=S+"px "+ja.name;for(var g=[],i=0,n=b.length;i<
n;i++){var o=b[i],p=o===" ",q=d.measureText(o).width;if(o!=="\n"&&y+q<e)p&&(j=i),y+=q;else{if(j+1===l)if(i>0)j=i;else return;o==="\n"?(g.push({text:b.substring(l,i),width:y,offset:f}),l=i+1):(g.push({text:b.substring(l,j),width:y,offset:f}),l=j+1);f+=eb;y=0;i=l-1}}l<n&&g.push({text:b.substring(l),width:y,offset:f});b=0;Mb===c.CENTER?b=e/2:Mb===c.RIGHT&&(b=e);e=(1-mc)*S;j=0;Lb===c.BOTTOM?j=h-g.length*eb:Lb===c.CENTER&&(j=(h-g.length*eb)/2);l=0;for(y=g.length;l<y;l++)if(f=g[l],!(f.offset+j<0)){if(f.offset+
j+S>h)break;ga.text$line(f.text,k+b,a+f.offset+e+j,r,Mb)}}}function Ra(b){ga=b==="3D"?new I:b==="2D"?new E:new D;for(var k in D.prototype)D.prototype.hasOwnProperty(k)&&k.indexOf("$")<0&&(a[k]=ga[k]);ga.$init()}function H(b){return function(){Ra("2D");return ga[b].apply(this,arguments)}}function wa(b){var k=b,m=0,c=0;a.pmouseX=a.mouseX;a.pmouseY=a.mouseY;if(k.offsetParent){do m+=k.offsetLeft,c+=k.offsetTop;while(k=k.offsetParent)}k=b;do m-=k.scrollLeft||0,c-=k.scrollTop||0;while(k=k.parentNode);m+=
cd;c+=dd;m+=ed;c+=fd;m+=X.pageXOffset;c+=X.pageYOffset;return{X:m,Y:c}}function qb(b,k){var m=wa(b,k);a.mouseX=k.pageX-m.X;a.mouseY=k.pageY-m.Y}function rb(b){var k=wa(b.changedTouches[0].target,b.changedTouches[0]),a;for(a=0;a<b.touches.length;a++){var c=b.touches[a];c.offsetX=c.pageX-k.X;c.offsetY=c.pageY-k.Y}for(a=0;a<b.targetTouches.length;a++)c=b.targetTouches[a],c.offsetX=c.pageX-k.X,c.offsetY=c.pageY-k.Y;for(a=0;a<b.changedTouches.length;a++)c=b.changedTouches[a],c.offsetX=c.pageX-k.X,c.offsetY=
c.pageY-k.Y;return b}function xb(b){b=b.which||b.keyCode;switch(b){case 13:return 10;case 91:case 93:case 224:return 157;case 57392:return 17;case 46:return 127;case 45:return 155}return b}function Hb(b){typeof b.preventDefault==="function"?b.preventDefault():typeof b.stopPropagation==="function"&&b.stopPropagation();return!1}function Bb(){for(var b in kb)if(kb.hasOwnProperty(b)){a.__keyPressed=!0;return}a.__keyPressed=!1}function Ib(b,k){kb[b]=k;sb=null;a.key=k;a.keyCode=b;a.keyPressed();a.keyCode=
0;a.keyTyped();Bb()}function Zb(b){var k=xb(b);if(k===c.DELETE)Ib(k,new ya(127));else if(yc.indexOf(k)<0)sb=k;else{var m=new ya(c.CODED);a.key=m;a.keyCode=k;kb[k]=m;a.keyPressed();sb=null;Bb();return Hb(b)}}function $b(b){if(sb!==null){var k=sb,a;a=b.which||b.keyCode;var c=b.shiftKey||b.ctrlKey||b.altKey||b.metaKey;switch(a){case 13:a=c?13:10;break;case 8:a=c?127:8}a=new ya(a);Ib(k,a);return Hb(b)}}function Cb(b){var b=xb(b),k=kb[b];if(k!==p)a.key=k,a.keyCode=b,a.keyReleased(),delete kb[b],Bb()}if(!(this instanceof
z))throw"called Processing constructor as if it were a function: missing 'new'.";var a=this,ib=arguments.length===0;ib&&(i=A.createElement("canvas"));a.externals={canvas:i,context:p,sketch:p};a.name="Processing.js Instance";a.use3DContext=!1;a.focused=!1;a.breakShape=!1;a.glyphTable={};a.pmouseX=0;a.pmouseY=0;a.mouseX=0;a.mouseY=0;a.mouseButton=0;a.mouseScroll=0;a.mouseClicked=p;a.mouseDragged=p;a.mouseMoved=p;a.mousePressed=p;a.mouseReleased=p;a.mouseScrolled=p;a.mouseOver=p;a.mouseOut=p;a.touchStart=
p;a.touchEnd=p;a.touchMove=p;a.touchCancel=p;a.key=p;a.keyCode=p;a.keyPressed=function(){};a.keyReleased=function(){};a.keyTyped=function(){};a.draw=p;a.setup=p;a.__mousePressed=!1;a.__keyPressed=!1;a.__frameRate=60;a.frameCount=0;a.width=100;a.height=100;var d,$,ga,U=!0,na=[1,1,1,1],Fa=4294967295,Ga=!0,O=!0,oa=[0.8,0.8,0.8,1],ka=4294835709,Db=!0,pa=1,jb=!1,$a=!0,N=0,T=c.CORNER,ba=c.CENTER,za=0,ob=0,fb=0,hb=c.NORMAL_MODE_AUTO,Oa=60,Eb=1E3/Oa,Aa=i.style.cursor,W=c.POLYGON,Ya=0,Yb=20,Ub=!1,Za=-3355444,
yb=20,Z=255,ia=255,xa=255,B=255,db=c.RGB,nb=null,S=12,ja={name:'"Arial", sans-serif',origName:"Arial"},eb=14,Vb=(new Date).getTime(),Ac=Vb,jc=0,Ha,ac,kc,Gb,Fb,Bc,Hc,Ma={attributes:{},locations:{}},u,F,ua,Ic,Jc,Kc,nc,Lc,cc,Mc,Wb,Nc,gd,oc,hd,id,jd,pc={width:0,height:0},kd=c.IMAGE,Da=!1,Oc,Pc,Qc,Mb=c.LEFT,Lb=c.BASELINE,mc=0.2,Rc=c.MODEL,bd,Sc=null,bc=!1,ld,md=1E3,kb=[],sb=null,yc=[c.SHIFT,c.CONTROL,c.ALT,c.CAPSLK,c.PGUP,c.PGDN,c.END,c.HOME,c.LEFT,c.UP,c.RIGHT,c.DOWN,c.NUMLK,c.INSERT,c.F1,c.F2,c.F3,c.F4,
c.F5,c.F6,c.F7,c.F8,c.F9,c.F10,c.F11,c.F12,c.META],cd,dd,ed,fd;A.defaultView&&A.defaultView.getComputedStyle&&(cd=parseInt(A.defaultView.getComputedStyle(i,null).paddingLeft,10)||0,dd=parseInt(A.defaultView.getComputedStyle(i,null).paddingTop,10)||0,ed=parseInt(A.defaultView.getComputedStyle(i,null).borderLeftWidth,10)||0,fd=parseInt(A.defaultView.getComputedStyle(i,null).borderTopWidth,10)||0);var K=0,qc=0,tb=0,Sa=[],Ta=[],Ua=[],Nb=new L(c.SINCOS_LENGTH),Ob=new L(c.SINCOS_LENGTH),P,ub,Va,ra,sa,V,
Wa,Pb,Qb,dc,Na,rc=!1,sc=60*(g.PI/180),Tc=a.width/2,vb=a.height/2,wb=vb/g.tan(sc/2),nd=wb/10,od=wb*10,pd=a.width/a.height,o=[],va=[],ta=0,Rb=!1,Sb=!1,lb=!0,ec=c.CORNER,qd=[],rd=new L([0.5,0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,0.5,0.5,0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,-0.5,0.5,-0.5,
-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,0.5]),sd=new L([0.5,0.5,0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5]),
zc=new L([0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0]),Uc=new L([0,0,0,0,1,0,1,1,0,1,0,0]),Cc=new L([0,0,1,0,0,1,0,0,1,0,0,1]),Fc="varying vec4 frontColor;attribute vec3 Vertex;attribute vec3 Normal;attribute vec4 aColor;attribute vec2 aTexture;varying   vec2 vTexture;uniform vec4 color;uniform bool usingMat;uniform vec3 specular;uniform vec3 mat_emissive;uniform vec3 mat_ambient;uniform vec3 mat_specular;uniform float shininess;uniform mat4 model;uniform mat4 view;uniform mat4 projection;uniform mat4 normalTransform;uniform int lightCount;uniform vec3 falloff;struct Light {  int type;  vec3 color;  vec3 position;  vec3 direction;  float angle;  vec3 halfVector;  float concentration;};uniform Light lights0;uniform Light lights1;uniform Light lights2;uniform Light lights3;uniform Light lights4;uniform Light lights5;uniform Light lights6;uniform Light lights7;Light getLight(int index){  if(index == 0) return lights0;  if(index == 1) return lights1;  if(index == 2) return lights2;  if(index == 3) return lights3;  if(index == 4) return lights4;  if(index == 5) return lights5;  if(index == 6) return lights6;  return lights7;}void AmbientLight( inout vec3 totalAmbient, in vec3 ecPos, in Light light ) {  float d = length( light.position - ecPos );  float attenuation = 1.0 / ( falloff[0] + ( falloff[1] * d ) + ( falloff[2] * d * d ));  totalAmbient += light.color * attenuation;}void DirectionalLight( inout vec3 col, inout vec3 spec, in vec3 vertNormal, in vec3 ecPos, in Light light ) {  float powerfactor = 0.0;  float nDotVP = max(0.0, dot( vertNormal, normalize(-light.position) ));  float nDotVH = max(0.0, dot( vertNormal, normalize(-light.position-normalize(ecPos) )));  if( nDotVP != 0.0 ){    powerfactor = pow( nDotVH, shininess );  }  col += light.color * nDotVP;  spec += specular * powerfactor;}void PointLight( inout vec3 col, inout vec3 spec, in vec3 vertNormal, in vec3 ecPos, in Light light ) {  float powerfactor;   vec3 VP = light.position - ecPos;  float d = length( VP );   VP = normalize( VP );  float attenuation = 1.0 / ( falloff[0] + ( falloff[1] * d ) + ( falloff[2] * d * d ));  float nDotVP = max( 0.0, dot( vertNormal, VP ));  vec3 halfVector = normalize( VP - normalize(ecPos) );  float nDotHV = max( 0.0, dot( vertNormal, halfVector ));  if( nDotVP == 0.0) {    powerfactor = 0.0;  }  else{    powerfactor = pow( nDotHV, shininess );  }  spec += specular * powerfactor * attenuation;  col += light.color * nDotVP * attenuation;}void SpotLight( inout vec3 col, inout vec3 spec, in vec3 vertNormal, in vec3 ecPos, in Light light ) {  float spotAttenuation;  float powerfactor;  vec3 VP = light.position - ecPos;   vec3 ldir = normalize( -light.direction );  float d = length( VP );  VP = normalize( VP );  float attenuation = 1.0 / ( falloff[0] + ( falloff[1] * d ) + ( falloff[2] * d * d ) );  float spotDot = dot( VP, ldir );"+
(/Windows/.test(navigator.userAgent)?"  spotAttenuation = 1.0; ":"  if( spotDot > cos( light.angle ) ) {    spotAttenuation = pow( spotDot, light.concentration );  }  else{    spotAttenuation = 0.0;  }  attenuation *= spotAttenuation;")+"  float nDotVP = max( 0.0, dot( vertNormal, VP ));  vec3 halfVector = normalize( VP - normalize(ecPos) );  float nDotHV = max( 0.0, dot( vertNormal, halfVector ));  if( nDotVP == 0.0 ) {    powerfactor = 0.0;  }  else {    powerfactor = pow( nDotHV, shininess );  }  spec += specular * powerfactor * attenuation;  col += light.color * nDotVP * attenuation;}void main(void) {  vec3 finalAmbient = vec3( 0.0, 0.0, 0.0 );  vec3 finalDiffuse = vec3( 0.0, 0.0, 0.0 );  vec3 finalSpecular = vec3( 0.0, 0.0, 0.0 );  vec4 col = color;  if(color[0] == -1.0){    col = aColor;  }  vec3 norm = normalize(vec3( normalTransform * vec4( Normal, 0.0 ) ));  vec4 ecPos4 = view * model * vec4(Vertex,1.0);  vec3 ecPos = (vec3(ecPos4))/ecPos4.w;  if( lightCount == 0 ) {    frontColor = col + vec4(mat_specular,1.0);  }  else {    for( int i = 0; i < 8; i++ ) {      Light l = getLight(i);      if( i >= lightCount ){        break;      }      if( l.type == 0 ) {        AmbientLight( finalAmbient, ecPos, l );      }      else if( l.type == 1 ) {        DirectionalLight( finalDiffuse, finalSpecular, norm, ecPos, l );      }      else if( l.type == 2 ) {        PointLight( finalDiffuse, finalSpecular, norm, ecPos, l );      }      else {        SpotLight( finalDiffuse, finalSpecular, norm, ecPos, l );      }    }   if( usingMat == false ) {     frontColor = vec4(       vec3(col) * finalAmbient +       vec3(col) * finalDiffuse +       vec3(col) * finalSpecular,       col[3] );   }   else{     frontColor = vec4(        mat_emissive +        (vec3(col) * mat_ambient * finalAmbient) +        (vec3(col) * finalDiffuse) +        (mat_specular * finalSpecular),        col[3] );    }  }  vTexture.xy = aTexture.xy;  gl_Position = projection * view * model * vec4( Vertex, 1.0 );}",
td=function(b,k,a,c){return{x:b,y:k,w:a,h:c}},tc=td,Gc=function(b,k,a,c,h){return{x:b,y:k,w:h?a:a-b,h:h?c:c-k}},Ed=function(b,k,a,c){return{x:b-a/2,y:k-c/2,w:a,h:c}},Vc=function(b,k,a){var c=b.createShader(b.VERTEX_SHADER);b.shaderSource(c,k);b.compileShader(c);if(!b.getShaderParameter(c,b.COMPILE_STATUS))throw b.getShaderInfoLog(c);k=b.createShader(b.FRAGMENT_SHADER);b.shaderSource(k,a);b.compileShader(k);if(!b.getShaderParameter(k,b.COMPILE_STATUS))throw b.getShaderInfoLog(k);a=b.createProgram();
b.attachShader(a,c);b.attachShader(a,k);b.linkProgram(a);if(!b.getProgramParameter(a,b.LINK_STATUS))throw"Error linking shaders.";return a},M=function(){},E=function(){},I=function(){},D=function(){};E.prototype=new M;E.prototype.constructor=E;I.prototype=new M;I.prototype.constructor=I;D.prototype=new M;D.prototype.constructor=D;M.prototype.a3DOnlyFunction=function(){};var Wc={},ya=a.Character=function(b){this.code=typeof b==="string"&&b.length===1?b.charCodeAt(0):typeof b==="number"?b:b instanceof
ya?b:NaN;return Wc[this.code]===p?Wc[this.code]=this:Wc[this.code]};ya.prototype.toString=function(){return String.fromCharCode(this.code)};ya.prototype.valueOf=function(){return this.code};var fc=a.PShape=function(b){this.family=b||c.GROUP;this.style=this.visible=!0;this.children=[];this.nameTable=[];this.params=[];this.name="";this.parent=this.height=this.width=this.close=this.kind=this.matrix=this.image=null};fc.prototype={isVisible:function(){return this.visible},setVisible:function(b){this.visible=
b},disableStyle:function(){this.style=!1;for(var b=0,k=this.children.length;b<k;b++)this.children[b].disableStyle()},enableStyle:function(){this.style=!0;for(var b=0,k=this.children.length;b<k;b++)this.children[b].enableStyle()},getFamily:function(){return this.family},getWidth:function(){return this.width},getHeight:function(){return this.height},setName:function(b){this.name=b},getName:function(){return this.name},draw:function(){this.visible&&(this.pre(),this.drawImpl(),this.post())},drawImpl:function(){this.family===
c.GROUP?this.drawGroup():this.family===c.PRIMITIVE?this.drawPrimitive():this.family===c.GEOMETRY?this.drawGeometry():this.family===c.PATH&&this.drawPath()},drawPath:function(){var b,k;if(this.vertices.length!==0){a.beginShape();if(this.vertexCodes.length===0)if(this.vertices[0].length===2){b=0;for(k=this.vertices.length;b<k;b++)a.vertex(this.vertices[b][0],this.vertices[b][1])}else{b=0;for(k=this.vertices.length;b<k;b++)a.vertex(this.vertices[b][0],this.vertices[b][1],this.vertices[b][2])}else{var m=
0;if(this.vertices[0].length===2){b=0;for(k=this.vertexCodes.length;b<k;b++)if(this.vertexCodes[b]===c.VERTEX)a.vertex(this.vertices[m][0],this.vertices[m][1]),this.vertices[m].moveTo===!0?o[o.length-1].moveTo=!0:this.vertices[m].moveTo===!1&&(o[o.length-1].moveTo=!1),a.breakShape=!1,m++;else if(this.vertexCodes[b]===c.BEZIER_VERTEX)a.bezierVertex(this.vertices[m+0][0],this.vertices[m+0][1],this.vertices[m+1][0],this.vertices[m+1][1],this.vertices[m+2][0],this.vertices[m+2][1]),m+=3;else if(this.vertexCodes[b]===
c.CURVE_VERTEX)a.curveVertex(this.vertices[m][0],this.vertices[m][1]),m++;else if(this.vertexCodes[b]===c.BREAK)a.breakShape=!0}else{b=0;for(k=this.vertexCodes.length;b<k;b++)if(this.vertexCodes[b]===c.VERTEX)a.vertex(this.vertices[m][0],this.vertices[m][1],this.vertices[m][2]),this.vertices[m].moveTo===!0?o[o.length-1].moveTo=!0:this.vertices[m].moveTo===!1&&(o[o.length-1].moveTo=!1),a.breakShape=!1;else if(this.vertexCodes[b]===c.BEZIER_VERTEX)a.bezierVertex(this.vertices[m+0][0],this.vertices[m+
0][1],this.vertices[m+0][2],this.vertices[m+1][0],this.vertices[m+1][1],this.vertices[m+1][2],this.vertices[m+2][0],this.vertices[m+2][1],this.vertices[m+2][2]),m+=3;else if(this.vertexCodes[b]===c.CURVE_VERTEX)a.curveVertex(this.vertices[m][0],this.vertices[m][1],this.vertices[m][2]),m++;else if(this.vertexCodes[b]===c.BREAK)a.breakShape=!0}}a.endShape(this.close?c.CLOSE:c.OPEN)}},drawGeometry:function(){var b,k;a.beginShape(this.kind);if(this.style){b=0;for(k=this.vertices.length;b<k;b++)a.vertex(this.vertices[b])}else{b=
0;for(k=this.vertices.length;b<k;b++){var c=this.vertices[b];c[2]===0?a.vertex(c[0],c[1]):a.vertex(c[0],c[1],c[2])}}a.endShape()},drawGroup:function(){for(var b=0,k=this.children.length;b<k;b++)this.children[b].draw()},drawPrimitive:function(){this.kind===c.POINT?a.point(this.params[0],this.params[1]):this.kind===c.LINE?this.params.length===4?a.line(this.params[0],this.params[1],this.params[2],this.params[3]):a.line(this.params[0],this.params[1],this.params[2],this.params[3],this.params[4],this.params[5]):
this.kind===c.TRIANGLE?a.triangle(this.params[0],this.params[1],this.params[2],this.params[3],this.params[4],this.params[5]):this.kind===c.QUAD?a.quad(this.params[0],this.params[1],this.params[2],this.params[3],this.params[4],this.params[5],this.params[6],this.params[7]):this.kind===c.RECT?this.image!==null?(a.imageMode(c.CORNER),a.image(this.image,this.params[0],this.params[1],this.params[2],this.params[3])):(a.rectMode(c.CORNER),a.rect(this.params[0],this.params[1],this.params[2],this.params[3])):
this.kind===c.ELLIPSE?(a.ellipseMode(c.CORNER),a.ellipse(this.params[0],this.params[1],this.params[2],this.params[3])):this.kind===c.ARC?(a.ellipseMode(c.CORNER),a.arc(this.params[0],this.params[1],this.params[2],this.params[3],this.params[4],this.params[5])):this.kind===c.BOX?this.params.length===1?a.box(this.params[0]):a.box(this.params[0],this.params[1],this.params[2]):this.kind===c.SPHERE&&a.sphere(this.params[0])},pre:function(){this.matrix&&(a.pushMatrix(),d.transform(this.matrix.elements[0],
this.matrix.elements[3],this.matrix.elements[1],this.matrix.elements[4],this.matrix.elements[2],this.matrix.elements[5]));this.style&&(a.pushStyle(),this.styles())},post:function(){this.matrix&&a.popMatrix();this.style&&a.popStyle()},styles:function(){this.stroke?(a.stroke(this.strokeColor),a.strokeWeight(this.strokeWeight),a.strokeCap(this.strokeCap),a.strokeJoin(this.strokeJoin)):a.noStroke();this.fill?a.fill(this.fillColor):a.noFill()},getChild:function(b){var k,a;if(typeof b==="number")return this.children[b];
else{var c;if(b===""||this.name===b)return this;else{if(this.nameTable.length>0){k=0;for(a=this.nameTable.length;k<a||c;k++)this.nameTable[k].getName===b&&(c=this.nameTable[k]);if(c)return c}k=0;for(a=this.children.length;k<a;k++)if(c=this.children[k].getChild(b))return c}return null}},getChildCount:function(){return this.children.length},addChild:function(b){this.children.push(b);b.parent=this;b.getName()!==null&&this.addName(b.getName(),b)},addName:function(b,k){this.parent!==null?this.parent.addName(b,
k):this.nameTable.push([b,k])},translate:function(){arguments.length===2?(this.checkMatrix(2),this.matrix.translate(arguments[0],arguments[1])):(this.checkMatrix(3),this.matrix.translate(arguments[0],arguments[1],0))},checkMatrix:function(b){if(this.matrix===null)this.matrix=b===2?new a.PMatrix2D:new a.PMatrix3D;else if(b===3&&this.matrix instanceof a.PMatrix2D)this.matrix=new a.PMatrix3D},rotateX:function(b){this.rotate(b,1,0,0)},rotateY:function(b){this.rotate(b,0,1,0)},rotateZ:function(b){this.rotate(b,
0,0,1)},rotate:function(){arguments.length===1?(this.checkMatrix(2),this.matrix.rotate(arguments[0])):(this.checkMatrix(3),this.matrix.rotate(arguments[0],arguments[1],arguments[2],arguments[3]))},scale:function(){arguments.length===2?(this.checkMatrix(2),this.matrix.scale(arguments[0],arguments[1])):arguments.length===3?(this.checkMatrix(2),this.matrix.scale(arguments[0],arguments[1],arguments[2])):(this.checkMatrix(2),this.matrix.scale(arguments[0]))},resetMatrix:function(){this.checkMatrix(2);
this.matrix.reset()},applyMatrix:function(b){arguments.length===1?this.applyMatrix(b.elements[0],b.elements[1],0,b.elements[2],b.elements[3],b.elements[4],0,b.elements[5],0,0,1,0,0,0,0,1):arguments.length===6?(this.checkMatrix(2),this.matrix.apply(arguments[0],arguments[1],arguments[2],0,arguments[3],arguments[4],arguments[5],0,0,0,1,0,0,0,0,1)):arguments.length===16&&(this.checkMatrix(3),this.matrix.apply(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],
arguments[7],arguments[8],arguments[9],arguments[10],arguments[11],arguments[12],arguments[13],arguments[14],arguments[15]))}};var R=a.PShapeSVG=function(){a.PShape.call(this);if(arguments.length===1){if(this.element=arguments[0],this.vertexCodes=[],this.vertices=[],this.opacity=1,this.stroke=!1,this.strokeColor=c.ALPHA_MASK,this.strokeWeight=1,this.strokeCap=c.SQUARE,this.strokeJoin=c.MITER,this.strokeName=this.strokeGradientPaint=this.strokeGradient=null,this.strokeOpacity=1,this.fill=!0,this.fillColor=
c.ALPHA_MASK,this.fillName=this.fillGradientPaint=this.fillGradient=null,this.fillOpacity=1,this.element.getName()!=="svg")throw"root is not <svg>, it's <"+this.element.getName()+">";}else if(arguments.length===2)if(typeof arguments[1]==="string"){if(arguments[1].indexOf(".svg")>-1)this.element=new a.XMLElement(null,arguments[1]),this.vertexCodes=[],this.vertices=[],this.opacity=1,this.stroke=!1,this.strokeColor=c.ALPHA_MASK,this.strokeWeight=1,this.strokeCap=c.SQUARE,this.strokeJoin=c.MITER,this.strokeName=
this.strokeGradientPaint=this.strokeGradient="",this.strokeOpacity=1,this.fill=!0,this.fillColor=c.ALPHA_MASK,this.fillGradientPaint=this.fillGradient=null,this.fillOpacity=1}else if(arguments[0])this.element=arguments[1],this.vertexCodes=arguments[0].vertexCodes.slice(),this.vertices=arguments[0].vertices.slice(),this.stroke=arguments[0].stroke,this.strokeColor=arguments[0].strokeColor,this.strokeWeight=arguments[0].strokeWeight,this.strokeCap=arguments[0].strokeCap,this.strokeJoin=arguments[0].strokeJoin,
this.strokeGradient=arguments[0].strokeGradient,this.strokeGradientPaint=arguments[0].strokeGradientPaint,this.strokeName=arguments[0].strokeName,this.fill=arguments[0].fill,this.fillColor=arguments[0].fillColor,this.fillGradient=arguments[0].fillGradient,this.fillGradientPaint=arguments[0].fillGradientPaint,this.fillName=arguments[0].fillName,this.strokeOpacity=arguments[0].strokeOpacity,this.fillOpacity=arguments[0].fillOpacity,this.opacity=arguments[0].opacity;this.name=this.element.getStringAttribute("id");
this.visible=this.element.getStringAttribute("display","inline")!=="none";var b=this.element.getAttribute("transform");if(b)this.matrix=this.parseMatrix(b);b=this.element.getStringAttribute("viewBox");if(b!==null)b=b.split(" "),this.width=b[2],this.height=b[3];var b=this.element.getStringAttribute("width"),k=this.element.getStringAttribute("height");if(b!==null)this.width=this.parseUnitSize(b),this.height=this.parseUnitSize(k);else if(this.width===0||this.height===0)throw this.height=this.width=1,
"The width and/or height is not readable in the <svg> tag of this file.";this.parseColors(this.element);this.parseChildren(this.element)};R.prototype=new fc;R.prototype.parseMatrix=function(){function b(b){var a=[];b.replace(/\((.*?)\)/,function(){return function(b,k){a=k.replace(/,+/g," ").split(/\s+/)}}());return a}return function(k){this.checkMatrix(2);var c=[];k.replace(/\s*(\w+)\((.*?)\)/g,function(b){c.push(a.trim(b))});if(c.length===0)return null;for(var k=0,e=c.length;k<e;k++){var h=b(c[k]);
if(c[k].indexOf("matrix")!==-1)this.matrix.set(h[0],h[2],h[4],h[1],h[3],h[5]);else if(c[k].indexOf("translate")!==-1)this.matrix.translate(h[0],h.length===2?h[1]:0);else if(c[k].indexOf("scale")!==-1)this.matrix.scale(h[0],h.length===2?h[1]:h[0]);else if(c[k].indexOf("rotate")!==-1){var d=h[0];h.length===1?this.matrix.rotate(a.radians(d)):h.length===3&&(this.matrix.translate(h[1],h[2]),this.matrix.rotate(a.radians(h[0])),this.matrix.translate(-h[1],-h[2]))}else c[k].indexOf("skewX")!==-1?this.matrix.skewX(parseFloat(h[0])):
c[k].indexOf("skewY")!==-1&&this.matrix.skewY(h[0])}return this.matrix}}();R.prototype.parseChildren=function(b){for(var b=b.getChildren(),k=new a.PShape,c=0,e=b.length;c<e;c++){var h=this.parseChild(b[c]);h&&k.addChild(h)}this.children.push(k)};R.prototype.getName=function(){return this.name};R.prototype.parseChild=function(b){var k=b.getName(),a;k==="g"?a=new R(this,b):k==="defs"?a=new R(this,b):k==="line"?(a=new R(this,b),a.parseLine()):k==="circle"?(a=new R(this,b),a.parseEllipse(!0)):k==="ellipse"?
(a=new R(this,b),a.parseEllipse(!1)):k==="rect"?(a=new R(this,b),a.parseRect()):k==="polygon"?(a=new R(this,b),a.parsePoly(!0)):k==="polyline"?(a=new R(this,b),a.parsePoly(!1)):k==="path"?(a=new R(this,b),a.parsePath()):k==="radialGradient"?Q("PShapeSVG.prototype.parseChild, name = radialGradient"):k==="linearGradient"?Q("PShapeSVG.prototype.parseChild, name = linearGradient"):k==="text"?Q("PShapeSVG.prototype.parseChild, name = text"):k==="filter"?Q("PShapeSVG.prototype.parseChild, name = filter"):
k==="mask"&&Q("PShapeSVG.prototype.parseChild, name = mask");return a};R.prototype.parsePath=function(){this.family=c.PATH;this.kind=0;var b=a.trim(this.element.getStringAttribute("d").replace(/[\s,]+/g," "));if(b!==null)for(var b=a.__toCharArray(b),k=0,m=0,e=0,h=0,d=h=e=0,j=0,l=0,y=0,f=y=h=l=e=0,g=0,i="",n=[],o=!1,p,q,t;f<b.length;)if(g=b[f].valueOf(),g>=65&&g<=90||g>=97&&g<=122){t=f;f++;if(f<b.length){n=[];for(g=b[f].valueOf();!(g>=65&&g<=90||g>=97&&g<=100||g>=102&&g<=122)&&o===!1;)g===32?i!==""&&
(n.push(parseFloat(i)),i=""):g===45?b[f-1].valueOf()===101?i+=b[f].toString():(i!==""&&n.push(parseFloat(i)),i=b[f].toString()):i+=b[f].toString(),f++,f===b.length?o=!0:g=b[f].valueOf()}i!==""&&(n.push(parseFloat(i)),i="");q=b[t];g=q.valueOf();if(g===77){if(n.length>=2&&n.length%2===0&&(k=n[0],m=n[1],this.parsePathMoveto(k,m),n.length>2)){t=2;for(g=n.length;t<g;t+=2)k=n[t],m=n[t+1],this.parsePathLineto(k,m)}}else if(g===109){if(n.length>=2&&n.length%2===0&&(k+=n[0],m+=n[1],this.parsePathMoveto(k,
m),n.length>2)){t=2;for(g=n.length;t<g;t+=2)k+=n[t],m+=n[t+1],this.parsePathLineto(k,m)}}else if(g===76){if(n.length>=2&&n.length%2===0){t=0;for(g=n.length;t<g;t+=2)k=n[t],m=n[t+1],this.parsePathLineto(k,m)}}else if(g===108){if(n.length>=2&&n.length%2===0){t=0;for(g=n.length;t<g;t+=2)k+=n[t],m+=n[t+1],this.parsePathLineto(k,m)}}else if(g===72){t=0;for(g=n.length;t<g;t++)k=n[t],this.parsePathLineto(k,m)}else if(g===104){t=0;for(g=n.length;t<g;t++)k+=n[t],this.parsePathLineto(k,m)}else if(g===86){t=
0;for(g=n.length;t<g;t++)m=n[t],this.parsePathLineto(k,m)}else if(g===118){t=0;for(g=n.length;t<g;t++)m+=n[t],this.parsePathLineto(k,m)}else if(g===67){if(n.length>=6&&n.length%6===0){t=0;for(g=n.length;t<g;t+=6)e=n[t],d=n[t+1],h=n[t+2],j=n[t+3],l=n[t+4],y=n[t+5],this.parsePathCurveto(e,d,h,j,l,y),k=l,m=y}}else if(g===99){if(n.length>=6&&n.length%6===0){t=0;for(g=n.length;t<g;t+=6)e=k+n[t],d=m+n[t+1],h=k+n[t+2],j=m+n[t+3],l=k+n[t+4],y=m+n[t+5],this.parsePathCurveto(e,d,h,j,l,y),k=l,m=y}}else if(g===
83){if(n.length>=4&&n.length%4===0){t=0;for(g=n.length;t<g;t+=4)p.toLowerCase()==="c"||p.toLowerCase()==="s"?(e=this.vertices[this.vertices.length-2][0],l=this.vertices[this.vertices.length-2][1],h=this.vertices[this.vertices.length-1][0],y=this.vertices[this.vertices.length-1][1],e=h+(h-e),d=y+(y-l)):(e=this.vertices[this.vertices.length-1][0],d=this.vertices[this.vertices.length-1][1]),h=n[t],j=n[t+1],l=n[t+2],y=n[t+3],this.parsePathCurveto(e,d,h,j,l,y),k=l,m=y}}else if(g===115){if(n.length>=4&&
n.length%4===0){t=0;for(g=n.length;t<g;t+=4)p.toLowerCase()==="c"||p.toLowerCase()==="s"?(e=this.vertices[this.vertices.length-2][0],l=this.vertices[this.vertices.length-2][1],h=this.vertices[this.vertices.length-1][0],y=this.vertices[this.vertices.length-1][1],e=h+(h-e),d=y+(y-l)):(e=this.vertices[this.vertices.length-1][0],d=this.vertices[this.vertices.length-1][1]),h=k+n[t],j=m+n[t+1],l=k+n[t+2],y=m+n[t+3],this.parsePathCurveto(e,d,h,j,l,y),k=l,m=y}}else if(g===81){if(n.length>=4&&n.length%4===
0){t=0;for(g=n.length;t<g;t+=4)e=n[t],h=n[t+1],l=n[t+2],y=n[t+3],this.parsePathQuadto(k,m,e,h,l,y),k=l,m=y}}else if(g===113){if(n.length>=4&&n.length%4===0){t=0;for(g=n.length;t<g;t+=4)e=k+n[t],h=m+n[t+1],l=k+n[t+2],y=m+n[t+3],this.parsePathQuadto(k,m,e,h,l,y),k=l,m=y}}else if(g===84){if(n.length>=2&&n.length%2===0){t=0;for(g=n.length;t<g;t+=2)p.toLowerCase()==="q"||p.toLowerCase()==="t"?(e=this.vertices[this.vertices.length-2][0],l=this.vertices[this.vertices.length-2][1],h=this.vertices[this.vertices.length-
1][0],y=this.vertices[this.vertices.length-1][1],e=h+(h-e),h=y+(y-l)):(e=k,h=m),l=n[t],y=n[t+1],this.parsePathQuadto(k,m,e,h,l,y),k=l,m=y}}else if(g===116){if(n.length>=2&&n.length%2===0){t=0;for(g=n.length;t<g;t+=2)p.toLowerCase()==="q"||p.toLowerCase()==="t"?(e=this.vertices[this.vertices.length-2][0],l=this.vertices[this.vertices.length-2][1],h=this.vertices[this.vertices.length-1][0],y=this.vertices[this.vertices.length-1][1],e=h+(h-e),h=y+(y-l)):(e=k,h=m),l=k+n[t],y=m+n[t+1],this.parsePathQuadto(k,
m,e,h,l,y),k=l,m=y}}else if(g!==90&&g===122)this.close=!0;p=q.toString()}else f++};R.prototype.parsePathQuadto=function(b,k,a,e,h,d){if(this.vertices.length>0)this.parsePathCode(c.BEZIER_VERTEX),this.parsePathVertex(b+(a-b)*2/3,k+(e-k)*2/3),this.parsePathVertex(h+(a-h)*2/3,d+(e-d)*2/3),this.parsePathVertex(h,d);else throw"Path must start with M/m";};R.prototype.parsePathCurveto=function(b,a,m,e,h,d){if(this.vertices.length>0)this.parsePathCode(c.BEZIER_VERTEX),this.parsePathVertex(b,a),this.parsePathVertex(m,
e),this.parsePathVertex(h,d);else throw"Path must start with M/m";};R.prototype.parsePathLineto=function(b,a){if(this.vertices.length>0)this.parsePathCode(c.VERTEX),this.parsePathVertex(b,a),this.vertices[this.vertices.length-1].moveTo=!1;else throw"Path must start with M/m";};R.prototype.parsePathMoveto=function(b,a){this.vertices.length>0&&this.parsePathCode(c.BREAK);this.parsePathCode(c.VERTEX);this.parsePathVertex(b,a);this.vertices[this.vertices.length-1].moveTo=!0};R.prototype.parsePathVertex=
function(b,a){var c=[];c[0]=b;c[1]=a;this.vertices.push(c)};R.prototype.parsePathCode=function(b){this.vertexCodes.push(b)};R.prototype.parsePoly=function(b){this.family=c.PATH;this.close=b;b=a.trim(this.element.getStringAttribute("points").replace(/[,\s]+/g," "));if(b!==null)if(b=b.split(" "),b.length%2===0)for(var k=0,m=b.length;k<m;k++){var e=[];e[0]=b[k];e[1]=b[++k];this.vertices.push(e)}else throw"Error parsing polygon points: odd number of coordinates provided";};R.prototype.parseRect=function(){this.kind=
c.RECT;this.family=c.PRIMITIVE;this.params=[];this.params[0]=this.element.getFloatAttribute("x");this.params[1]=this.element.getFloatAttribute("y");this.params[2]=this.element.getFloatAttribute("width");this.params[3]=this.element.getFloatAttribute("height");if(this.params[2]<0||this.params[3]<0)throw"svg error: negative width or height found while parsing <rect>";};R.prototype.parseEllipse=function(b){this.kind=c.ELLIPSE;this.family=c.PRIMITIVE;this.params=[];this.params[0]=this.element.getFloatAttribute("cx")|
0;this.params[1]=this.element.getFloatAttribute("cy")|0;var a;if(b){if(b=a=this.element.getFloatAttribute("r"),b<0)throw"svg error: negative radius found while parsing <circle>";}else if(b=this.element.getFloatAttribute("rx"),a=this.element.getFloatAttribute("ry"),b<0||a<0)throw"svg error: negative x-axis radius or y-axis radius found while parsing <ellipse>";this.params[0]-=b;this.params[1]-=a;this.params[2]=b*2;this.params[3]=a*2};R.prototype.parseLine=function(){this.kind=c.LINE;this.family=c.PRIMITIVE;
this.params=[];this.params[0]=this.element.getFloatAttribute("x1");this.params[1]=this.element.getFloatAttribute("y1");this.params[2]=this.element.getFloatAttribute("x2");this.params[3]=this.element.getFloatAttribute("y2")};R.prototype.parseColors=function(b){b.hasAttribute("opacity")&&this.setOpacity(b.getAttribute("opacity"));b.hasAttribute("stroke")&&this.setStroke(b.getAttribute("stroke"));b.hasAttribute("stroke-width")&&this.setStrokeWeight(b.getAttribute("stroke-width"));b.hasAttribute("stroke-linejoin")&&
this.setStrokeJoin(b.getAttribute("stroke-linejoin"));b.hasAttribute("stroke-linecap")&&this.setStrokeCap(b.getStringAttribute("stroke-linecap"));b.hasAttribute("fill")&&this.setFill(b.getStringAttribute("fill"));if(b.hasAttribute("style"))for(var b=b.getStringAttribute("style").toString().split(";"),k=0,c=b.length;k<c;k++){var e=a.trim(b[k].split(":"));e[0]==="fill"?this.setFill(e[1]):e[0]==="fill-opacity"?this.setFillOpacity(e[1]):e[0]==="stroke"?this.setStroke(e[1]):e[0]==="stroke-width"?this.setStrokeWeight(e[1]):
e[0]==="stroke-linecap"?this.setStrokeCap(e[1]):e[0]==="stroke-linejoin"?this.setStrokeJoin(e[1]):e[0]==="stroke-opacity"?this.setStrokeOpacity(e[1]):e[0]==="opacity"&&this.setOpacity(e[1])}};R.prototype.setFillOpacity=function(b){this.fillOpacity=parseFloat(b);this.fillColor=this.fillOpacity*255<<24|this.fillColor&16777215};R.prototype.setFill=function(b){var a=this.fillColor&4278190080;if(b==="none")this.fill=!1;else if(b.indexOf("#")===0)this.fill=!0,b.length===4&&(b=b.replace(/#(.)(.)(.)/,"#$1$1$2$2$3$3")),
this.fillColor=a|parseInt(b.substring(1),16)&16777215;else if(b.indexOf("rgb")===0)this.fill=!0,this.fillColor=a|this.parseRGB(b);else if(b.indexOf("url(#")===0)this.fillName=b.substring(5,b.length-1);else if(Jb[b])this.fill=!0,this.fillColor=a|parseInt(Jb[b].substring(1),16)&16777215};R.prototype.setOpacity=function(b){this.strokeColor=parseFloat(b)*255<<24|this.strokeColor&16777215;this.fillColor=parseFloat(b)*255<<24|this.fillColor&16777215};R.prototype.setStroke=function(b){var a=this.strokeColor&
4278190080;if(b==="none")this.stroke=!1;else if(b.charAt(0)==="#")this.stroke=!0,b.length===4&&(b=b.replace(/#(.)(.)(.)/,"#$1$1$2$2$3$3")),this.strokeColor=a|parseInt(b.substring(1),16)&16777215;else if(b.indexOf("rgb")===0)this.stroke=!0,this.strokeColor=a|this.parseRGB(b);else if(b.indexOf("url(#")===0)this.strokeName=b.substring(5,b.length-1);else if(Jb[b])this.stroke=!0,this.strokeColor=a|parseInt(Jb[b].substring(1),16)&16777215};R.prototype.setStrokeWeight=function(b){this.strokeWeight=this.parseUnitSize(b)};
R.prototype.setStrokeJoin=function(b){if(b==="miter")this.strokeJoin=c.MITER;else if(b==="round")this.strokeJoin=c.ROUND;else if(b==="bevel")this.strokeJoin=c.BEVEL};R.prototype.setStrokeCap=function(b){if(b==="butt")this.strokeCap=c.SQUARE;else if(b==="round")this.strokeCap=c.ROUND;else if(b==="square")this.strokeCap=c.PROJECT};R.prototype.setStrokeOpacity=function(b){this.strokeOpacity=parseFloat(b);this.strokeColor=this.strokeOpacity*255<<24|this.strokeColor&16777215};R.prototype.parseRGB=function(b){b=
b.substring(b.indexOf("(")+1,b.indexOf(")")).split(", ");return b[0]<<16|b[1]<<8|b[2]};R.prototype.parseUnitSize=function(b){var a=b.length-2;if(a<0)return b;return b.indexOf("pt")===a?parseFloat(b.substring(0,a))*1.25:b.indexOf("pc")===a?parseFloat(b.substring(0,a))*15:b.indexOf("mm")===a?parseFloat(b.substring(0,a))*3.543307:b.indexOf("cm")===a?parseFloat(b.substring(0,a))*35.43307:b.indexOf("in")===a?parseFloat(b.substring(0,a))*90:b.indexOf("px")===a?parseFloat(b.substring(0,a)):parseFloat(b)};
a.shape=function(b,k,m,e,h){arguments.length>=1&&arguments[0]!==null&&b.isVisible()&&(a.pushMatrix(),ec===c.CENTER?arguments.length===5?(a.translate(k-e/2,m-h/2),a.scale(e/b.getWidth(),h/b.getHeight())):arguments.length===3?a.translate(k-b.getWidth()/2,-b.getHeight()/2):a.translate(-b.getWidth()/2,-b.getHeight()/2):ec===c.CORNER?arguments.length===5?(a.translate(k,m),a.scale(e/b.getWidth(),h/b.getHeight())):arguments.length===3&&a.translate(k,m):ec===c.CORNERS&&(arguments.length===5?(e-=k,h-=m,a.translate(k,
m),a.scale(e/b.getWidth(),h/b.getHeight())):arguments.length===3&&a.translate(k,m)),b.draw(),(arguments.length===1&&ec===c.CENTER||arguments.length>1)&&a.popMatrix())};a.shapeMode=function(b){ec=b};a.loadShape=function(b){if(arguments.length===1&&b.indexOf(".svg")>-1)return new R(null,b);return null};var uc=function(b,a,c,e,h){this.fullName=b||"";this.name=a||"";this.namespace=c||"";this.value=e;this.type=h};uc.prototype={getName:function(){return this.name},getFullName:function(){return this.fullName},
getNamespace:function(){return this.namespace},getValue:function(){return this.value},getType:function(){return this.type},setValue:function(b){this.value=b}};var mb=a.XMLElement=function(){this.attributes=[];this.children=[];this.name=this.fullName=null;this.namespace="";this.parent=this.content=null;this.systemID=this.lineNr="";this.type="ELEMENT";if(arguments.length===4){this.fullName=arguments[0]||"";if(arguments[1])this.name=arguments[1];else{var b=this.fullName.indexOf(":");this.name=b>=0?this.fullName.substring(b+
1):this.fullName}this.namespace=arguments[1];this.lineNr=arguments[3];this.systemID=arguments[2]}else arguments.length===2&&arguments[1].indexOf(".")>-1?this.parse(arguments[arguments.length-1]):arguments.length===1&&typeof arguments[0]==="string"&&this.parse(arguments[0])};mb.prototype={parse:function(b){var a;try{if(b.indexOf(".xml")>-1||b.indexOf(".svg")>-1)b=Ec(b);a=(new DOMParser).parseFromString(b,"text/xml");var c=a.documentElement;if(c)this.parseChildrenRecursive(null,c);else throw"Error loading document";
return this}catch(e){throw e;}},parseChildrenRecursive:function(b,a){var c,e,h,d;b?(c=new mb(a.localName,a.nodeName,"",""),c.parent=b):(this.fullName=a.localName,this.name=a.nodeName,c=this);if(a.nodeType===3&&a.textContent!=="")return this.createPCDataElement(a.textContent);h=0;for(d=a.attributes.length;h<d;h++)e=a.attributes[h],e=new uc(e.getname,e.nodeName,e.namespaceURI,e.nodeValue,e.nodeType),c.attributes.push(e);h=0;for(d=a.childNodes.length;h<d;h++)if(e=a.childNodes[h],e.nodeType===1||e.nodeType===
3)e=c.parseChildrenRecursive(c,e),e!==null&&c.children.push(e);return c},createElement:function(){return arguments.length===2?new mb(arguments[0],arguments[1],null,null):new mb(arguments[0],arguments[1],arguments[2],arguments[3])},createPCDataElement:function(b){if(b.replace(/^\s+$/g,"")==="")return null;var a=new mb;a.content=b;a.type="TEXT";return a},hasAttribute:function(){if(arguments.length===1)return this.getAttribute(arguments[0])!==null;else if(arguments.length===2)return this.getAttribute(arguments[0],
arguments[1])!==null},equals:function(b){if(!(b instanceof mb))return!1;var a,c;if(this.name!==b.getLocalName())return!1;if(this.attributes.length!==b.getAttributeCount())return!1;if(this.attributes.length!==b.attributes.length)return!1;var e,h;a=0;for(c=this.attributes.length;a<c;a++){e=this.attributes[a].getName();h=this.attributes[a].getNamespace();e=b.findAttribute(e,h);if(e===null)return!1;if(this.attributes[a].getValue()!==e.getValue())return!1;if(this.attributes[a].getType()!==e.getType())return!1}if(this.children.length!==
b.getChildCount())return!1;if(this.children.length>0){a=0;for(c=this.children.length;a<c;a++)if(e=this.getChild(a),h=b.getChild(a),!e.equals(h))return!1;return!0}else return this.content===b.content},getContent:function(){if(this.type==="TEXT")return this.content;else if(this.children.length===1&&this.children[0].type==="TEXT")return this.children[0].content;return null},getAttribute:function(){var b;if(arguments.length===2)return(b=this.findAttribute(arguments[0]))?b.getValue():arguments[1];else if(arguments.length===
1)return(b=this.findAttribute(arguments[0]))?b.getValue():null;else if(arguments.length===3)return(b=this.findAttribute(arguments[0],arguments[1]))?b.getValue():arguments[2]},getStringAttribute:function(){return arguments.length===1?this.getAttribute(arguments[0]):arguments.length===2?this.getAttribute(arguments[0],arguments[1]):this.getAttribute(arguments[0],arguments[1],arguments[2])},getString:function(b){return this.getStringAttribute(b)},getFloatAttribute:function(){return arguments.length===
1?parseFloat(this.getAttribute(arguments[0],0)):arguments.length===2?this.getAttribute(arguments[0],arguments[1]):this.getAttribute(arguments[0],arguments[1],arguments[2])},getFloat:function(b){return this.getFloatAttribute(b)},getIntAttribute:function(){return arguments.length===1?this.getAttribute(arguments[0],0):arguments.length===2?this.getAttribute(arguments[0],arguments[1]):this.getAttribute(arguments[0],arguments[1],arguments[2])},getInt:function(b){return this.getIntAttribute(b)},hasChildren:function(){return this.children.length>
0},addChild:function(b){if(b!==null)b.parent=this,this.children.push(b)},insertChild:function(b,a){if(b){if(b.getLocalName()===null&&!this.hasChildren()){var c=this.children[this.children.length-1];if(c.getLocalName()===null){c.setContent(c.getContent()+b.getContent());return}}b.parent=this;this.children.splice(a,0,b)}},getChild:function(b){if(typeof b==="number")return this.children[b];else if(b.indexOf("/")!==-1)this.getChildRecursive(b.split("/"),0);else{for(var a,c,e=0,h=this.getChildCount();e<
h;e++)if(a=this.getChild(e),c=a.getName(),c!==null&&c===b)return a;return null}},getChildren:function(){if(arguments.length===1)if(typeof arguments[0]==="number")return this.getChild(arguments[0]);else if(arguments[0].indexOf("/")!==-1)return this.getChildrenRecursive(arguments[0].split("/"),0);else{for(var b=[],a,c,e=0,h=this.getChildCount();e<h;e++)a=this.getChild(e),c=a.getName(),c!==null&&c===arguments[0]&&b.push(a);return b}else return this.children},getChildCount:function(){return this.children.length},
getChildRecursive:function(b,a){for(var c,e,h=0,d=this.getChildCount();h<d;h++)if(c=this.getChild(h),e=c.getName(),e!==null&&e===b[a])return a===b.length-1?c:(a+=1,c.getChildRecursive(b,a));return null},getChildrenRecursive:function(b,a){if(a===b.length-1)return this.getChildren(b[a]);for(var c=this.getChildren(b[a]),e=[],h=0;h<c.length;h++)e=e.concat(c[h].getChildrenRecursive(b,a+1));return e},isLeaf:function(){return!this.hasChildren()},listChildren:function(){for(var b=[],a=0,c=this.children.length;a<
c;a++)b.push(this.getChild(a).getName());return b},removeAttribute:function(b,a){this.namespace=a||"";for(var c=0,e=this.attributes.length;c<e;c++)if(this.attributes[c].getName()===b&&this.attributes[c].getNamespace()===this.namespace){this.attributes.splice(c,1);break}},removeChild:function(b){if(b)for(var a=0,c=this.children.length;a<c;a++)if(this.children[a].equals(b)){this.children.splice(a,1);break}},removeChildAtIndex:function(b){this.children.length>b&&this.children.splice(b,1)},findAttribute:function(b,
a){this.namespace=a||"";for(var c=0,e=this.attributes.length;c<e;c++)if(this.attributes[c].getName()===b&&this.attributes[c].getNamespace()===this.namespace)return this.attributes[c];return null},setAttribute:function(){var b;if(arguments.length===3){b=arguments[0].indexOf(":");var a=arguments[0].substring(b+1);(b=this.findAttribute(a,arguments[1]))?b.setValue(arguments[2]):(b=new uc(arguments[0],a,arguments[1],arguments[2],"CDATA"),this.attributes.push(b))}else(b=this.findAttribute(arguments[0]))?
b.setValue(arguments[1]):(b=new uc(arguments[0],arguments[0],null,arguments[1],"CDATA"),this.attributes.push(b))},setString:function(b,a){this.setAttribute(b,a)},setInt:function(b,a){this.setAttribute(b,a)},setFloat:function(b,a){this.setAttribute(b,a)},setContent:function(b){this.children.length>0&&z.debug("Tried to set content for XMLElement with children");this.content=b},setName:function(){if(arguments.length===1)this.name=arguments[0],this.fullName=arguments[0],this.namespace=null;else{var b=
arguments[0].indexOf(":");this.name=arguments[1]===null||b<0?arguments[0]:arguments[0].substring(b+1);this.fullName=arguments[0];this.namespace=arguments[1]}},getName:function(){return this.fullName},getLocalName:function(){return this.name},getAttributeCount:function(){return this.attributes.length},toString:function(){if(this.type==="TEXT")return this.content;var b=(this.namespace!==""&&this.namespace!==this.name?this.namespace+":":"")+this.name,a="<"+b,c;for(c=0;c<this.attributes.length;c++){var e=
this.attributes[c];a+=" "+e.getName()+'="'+e.getValue()+'"'}if(this.children.length===0)a+=this.content===""?"/>":">"+this.content+"</"+b+">";else{a+=">";for(c=0;c<this.children.length;c++)a+=this.children[c].toString();a+="</"+b+">"}return a}};mb.parse=function(b){var a=new mb;a.parse(b);return a};var ud=function(b){for(var a=0,c=0;c<b.length;c++)a=c!==0?g.max(a,g.abs(b[c])):g.abs(b[c]);b=(a+"").indexOf(".");if(b===0)b=1;else if(b===-1)b=(a+"").length;return b},ab=a.PMatrix2D=function(){arguments.length===
0?this.reset():arguments.length===1&&arguments[0]instanceof ab?this.set(arguments[0].array()):arguments.length===6&&this.set(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])};ab.prototype={set:function(){if(arguments.length===6){var b=arguments;this.set([b[0],b[1],b[2],b[3],b[4],b[5]])}else if(arguments.length===1&&arguments[0]instanceof ab)this.elements=arguments[0].array();else if(arguments.length===1&&arguments[0]instanceof Array)this.elements=arguments[0].slice()},
get:function(){var b=new ab;b.set(this.elements);return b},reset:function(){this.set([1,0,0,0,1,0])},array:function(){return this.elements.slice()},translate:function(b,a){this.elements[2]=b*this.elements[0]+a*this.elements[1]+this.elements[2];this.elements[5]=b*this.elements[3]+a*this.elements[4]+this.elements[5]},invTranslate:function(b,a){this.translate(-b,-a)},transpose:function(){},mult:function(b,a){var c,e;b instanceof aa?(c=b.x,e=b.y,a||(a=new aa)):b instanceof Array&&(c=b[0],e=b[1],a||(a=
[]));if(a instanceof Array)a[0]=this.elements[0]*c+this.elements[1]*e+this.elements[2],a[1]=this.elements[3]*c+this.elements[4]*e+this.elements[5];else if(a instanceof aa)a.x=this.elements[0]*c+this.elements[1]*e+this.elements[2],a.y=this.elements[3]*c+this.elements[4]*e+this.elements[5],a.z=0;return a},multX:function(b,a){return b*this.elements[0]+a*this.elements[1]+this.elements[2]},multY:function(b,a){return b*this.elements[3]+a*this.elements[4]+this.elements[5]},skewX:function(b){this.apply(1,
0,1,b,0,0)},skewY:function(b){this.apply(1,0,1,0,b,0)},determinant:function(){return this.elements[0]*this.elements[4]-this.elements[1]*this.elements[3]},invert:function(){var b=this.determinant();if(g.abs(b)>c.MIN_INT){var a=this.elements[0],m=this.elements[1],e=this.elements[2],h=this.elements[3],d=this.elements[4],j=this.elements[5];this.elements[0]=d/b;this.elements[3]=-h/b;this.elements[1]=-m/b;this.elements[4]=a/b;this.elements[2]=(m*j-d*e)/b;this.elements[5]=(h*e-a*j)/b;return!0}return!1},
scale:function(b,a){b&&!a&&(a=b);b&&a&&(this.elements[0]*=b,this.elements[1]*=a,this.elements[3]*=b,this.elements[4]*=a)},invScale:function(b,a){b&&!a&&(a=b);this.scale(1/b,1/a)},apply:function(){var b;arguments.length===1&&arguments[0]instanceof ab?b=arguments[0].array():arguments.length===6?b=Array.prototype.slice.call(arguments):arguments.length===1&&arguments[0]instanceof Array&&(b=arguments[0]);for(var a=[0,0,this.elements[2],0,0,this.elements[5]],c=0,e=0;e<2;e++)for(var h=0;h<3;h++,c++)a[c]+=
this.elements[e*3+0]*b[h+0]+this.elements[e*3+1]*b[h+3];this.elements=a.slice()},preApply:function(){var b;arguments.length===1&&arguments[0]instanceof ab?b=arguments[0].array():arguments.length===6?b=Array.prototype.slice.call(arguments):arguments.length===1&&arguments[0]instanceof Array&&(b=arguments[0]);var a=[0,0,b[2],0,0,b[5]];a[2]=b[2]+this.elements[2]*b[0]+this.elements[5]*b[1];a[5]=b[5]+this.elements[2]*b[3]+this.elements[5]*b[4];a[0]=this.elements[0]*b[0]+this.elements[3]*b[1];a[3]=this.elements[0]*
b[3]+this.elements[3]*b[4];a[1]=this.elements[1]*b[0]+this.elements[4]*b[1];a[4]=this.elements[1]*b[3]+this.elements[4]*b[4];this.elements=a.slice()},rotate:function(b){var a=g.cos(b),b=g.sin(b),c=this.elements[0],e=this.elements[1];this.elements[0]=a*c+b*e;this.elements[1]=-b*c+a*e;c=this.elements[3];e=this.elements[4];this.elements[3]=a*c+b*e;this.elements[4]=-b*c+a*e},rotateZ:function(b){this.rotate(b)},invRotateZ:function(b){this.rotateZ(b-g.PI)},print:function(){var b=ud(this.elements),b=""+
a.nfs(this.elements[0],b,4)+" "+a.nfs(this.elements[1],b,4)+" "+a.nfs(this.elements[2],b,4)+"\n"+a.nfs(this.elements[3],b,4)+" "+a.nfs(this.elements[4],b,4)+" "+a.nfs(this.elements[5],b,4)+"\n\n";a.println(b)}};var C=a.PMatrix3D=function(){this.reset()};C.prototype={set:function(){if(arguments.length===16)this.elements=Array.prototype.slice.call(arguments);else if(arguments.length===1&&arguments[0]instanceof C)this.elements=arguments[0].array();else if(arguments.length===1&&arguments[0]instanceof
Array)this.elements=arguments[0].slice()},get:function(){var b=new C;b.set(this.elements);return b},reset:function(){this.set([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},array:function(){return this.elements.slice()},translate:function(b,a,c){c===p&&(c=0);this.elements[3]+=b*this.elements[0]+a*this.elements[1]+c*this.elements[2];this.elements[7]+=b*this.elements[4]+a*this.elements[5]+c*this.elements[6];this.elements[11]+=b*this.elements[8]+a*this.elements[9]+c*this.elements[10];this.elements[15]+=b*this.elements[12]+
a*this.elements[13]+c*this.elements[14]},transpose:function(){var b=this.elements.slice();this.elements[0]=b[0];this.elements[1]=b[4];this.elements[2]=b[8];this.elements[3]=b[12];this.elements[4]=b[1];this.elements[5]=b[5];this.elements[6]=b[9];this.elements[7]=b[13];this.elements[8]=b[2];this.elements[9]=b[6];this.elements[10]=b[10];this.elements[11]=b[14];this.elements[12]=b[3];this.elements[13]=b[7];this.elements[14]=b[11];this.elements[15]=b[15]},mult:function(b,a){var c,e,h,d;if(b instanceof
aa)c=b.x,e=b.y,h=b.z,d=1,a||(a=new aa);else if(b instanceof Array&&(c=b[0],e=b[1],h=b[2],d=b[3]||1,!a||a.length!==3&&a.length!==4))a=[0,0,0];a instanceof Array&&(a.length===3?(a[0]=this.elements[0]*c+this.elements[1]*e+this.elements[2]*h+this.elements[3],a[1]=this.elements[4]*c+this.elements[5]*e+this.elements[6]*h+this.elements[7],a[2]=this.elements[8]*c+this.elements[9]*e+this.elements[10]*h+this.elements[11]):a.length===4&&(a[0]=this.elements[0]*c+this.elements[1]*e+this.elements[2]*h+this.elements[3]*
d,a[1]=this.elements[4]*c+this.elements[5]*e+this.elements[6]*h+this.elements[7]*d,a[2]=this.elements[8]*c+this.elements[9]*e+this.elements[10]*h+this.elements[11]*d,a[3]=this.elements[12]*c+this.elements[13]*e+this.elements[14]*h+this.elements[15]*d));if(a instanceof aa)a.x=this.elements[0]*c+this.elements[1]*e+this.elements[2]*h+this.elements[3],a.y=this.elements[4]*c+this.elements[5]*e+this.elements[6]*h+this.elements[7],a.z=this.elements[8]*c+this.elements[9]*e+this.elements[10]*h+this.elements[11];
return a},preApply:function(){var b;arguments.length===1&&arguments[0]instanceof C?b=arguments[0].array():arguments.length===16?b=Array.prototype.slice.call(arguments):arguments.length===1&&arguments[0]instanceof Array&&(b=arguments[0]);for(var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c=0,e=0;e<4;e++)for(var h=0;h<4;h++,c++)a[c]+=this.elements[h+0]*b[e*4+0]+this.elements[h+4]*b[e*4+1]+this.elements[h+8]*b[e*4+2]+this.elements[h+12]*b[e*4+3];this.elements=a.slice()},apply:function(){var b;arguments.length===
1&&arguments[0]instanceof C?b=arguments[0].array():arguments.length===16?b=Array.prototype.slice.call(arguments):arguments.length===1&&arguments[0]instanceof Array&&(b=arguments[0]);for(var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c=0,e=0;e<4;e++)for(var h=0;h<4;h++,c++)a[c]+=this.elements[e*4+0]*b[h+0]+this.elements[e*4+1]*b[h+4]+this.elements[e*4+2]*b[h+8]+this.elements[e*4+3]*b[h+12];this.elements=a.slice()},rotate:function(b,k,c,e){if(c){var h=a.cos(b),b=a.sin(b),d=1-h;this.apply(d*k*k+h,d*k*c-b*e,
d*k*e+b*c,0,d*k*c+b*e,d*c*c+h,d*c*e-b*k,0,d*k*e-b*c,d*c*e+b*k,d*e*e+h,0,0,0,0,1)}else this.rotateZ(b)},invApply:function(){dc===p&&(dc=new C);var b=arguments;dc.set(b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8],b[9],b[10],b[11],b[12],b[13],b[14],b[15]);if(!dc.invert())return!1;this.preApply(dc);return!0},rotateX:function(b){var k=a.cos(b),b=a.sin(b);this.apply([1,0,0,0,0,k,-b,0,0,b,k,0,0,0,0,1])},rotateY:function(b){var k=a.cos(b),b=a.sin(b);this.apply([k,0,b,0,0,1,0,0,-b,0,k,0,0,0,0,1])},rotateZ:function(b){var a=
g.cos(b),b=g.sin(b);this.apply([a,-b,0,0,b,a,0,0,0,0,1,0,0,0,0,1])},scale:function(b,a,c){b&&!a&&!c?a=c=b:b&&a&&!c&&(c=1);b&&a&&c&&(this.elements[0]*=b,this.elements[1]*=a,this.elements[2]*=c,this.elements[4]*=b,this.elements[5]*=a,this.elements[6]*=c,this.elements[8]*=b,this.elements[9]*=a,this.elements[10]*=c,this.elements[12]*=b,this.elements[13]*=a,this.elements[14]*=c)},skewX:function(b){this.apply(1,g.tan(b),0,0,0,1,0,0,0,0,1,0,0,0,0,1)},skewY:function(b){this.apply(1,0,0,0,g.tan(b),1,0,0,0,
0,1,0,0,0,0,1)},multX:function(b,a,c,e){return c?e?this.elements[0]*b+this.elements[1]*a+this.elements[2]*c+this.elements[3]*e:this.elements[0]*b+this.elements[1]*a+this.elements[2]*c+this.elements[3]:this.elements[0]*b+this.elements[1]*a+this.elements[3]},multY:function(b,a,c,e){return c?e?this.elements[4]*b+this.elements[5]*a+this.elements[6]*c+this.elements[7]*e:this.elements[4]*b+this.elements[5]*a+this.elements[6]*c+this.elements[7]:this.elements[4]*b+this.elements[5]*a+this.elements[7]},multZ:function(b,
a,c,e){return e?this.elements[8]*b+this.elements[9]*a+this.elements[10]*c+this.elements[11]*e:this.elements[8]*b+this.elements[9]*a+this.elements[10]*c+this.elements[11]},multW:function(b,a,c,e){return e?this.elements[12]*b+this.elements[13]*a+this.elements[14]*c+this.elements[15]*e:this.elements[12]*b+this.elements[13]*a+this.elements[14]*c+this.elements[15]},invert:function(){var b=this.elements[0]*this.elements[5]-this.elements[1]*this.elements[4],a=this.elements[0]*this.elements[6]-this.elements[2]*
this.elements[4],c=this.elements[0]*this.elements[7]-this.elements[3]*this.elements[4],e=this.elements[1]*this.elements[6]-this.elements[2]*this.elements[5],h=this.elements[1]*this.elements[7]-this.elements[3]*this.elements[5],d=this.elements[2]*this.elements[7]-this.elements[3]*this.elements[6],j=this.elements[8]*this.elements[13]-this.elements[9]*this.elements[12],l=this.elements[8]*this.elements[14]-this.elements[10]*this.elements[12],y=this.elements[8]*this.elements[15]-this.elements[11]*this.elements[12],
f=this.elements[9]*this.elements[14]-this.elements[10]*this.elements[13],i=this.elements[9]*this.elements[15]-this.elements[11]*this.elements[13],o=this.elements[10]*this.elements[15]-this.elements[11]*this.elements[14],n=b*o-a*i+c*f+e*y-h*l+d*j;if(g.abs(n)<=1.0E-9)return!1;var p=[];p[0]=+this.elements[5]*o-this.elements[6]*i+this.elements[7]*f;p[4]=-this.elements[4]*o+this.elements[6]*y-this.elements[7]*l;p[8]=+this.elements[4]*i-this.elements[5]*y+this.elements[7]*j;p[12]=-this.elements[4]*f+this.elements[5]*
l-this.elements[6]*j;p[1]=-this.elements[1]*o+this.elements[2]*i-this.elements[3]*f;p[5]=+this.elements[0]*o-this.elements[2]*y+this.elements[3]*l;p[9]=-this.elements[0]*i+this.elements[1]*y-this.elements[3]*j;p[13]=+this.elements[0]*f-this.elements[1]*l+this.elements[2]*j;p[2]=+this.elements[13]*d-this.elements[14]*h+this.elements[15]*e;p[6]=-this.elements[12]*d+this.elements[14]*c-this.elements[15]*a;p[10]=+this.elements[12]*h-this.elements[13]*c+this.elements[15]*b;p[14]=-this.elements[12]*e+this.elements[13]*
a-this.elements[14]*b;p[3]=-this.elements[9]*d+this.elements[10]*h-this.elements[11]*e;p[7]=+this.elements[8]*d-this.elements[10]*c+this.elements[11]*a;p[11]=-this.elements[8]*h+this.elements[9]*c-this.elements[11]*b;p[15]=+this.elements[8]*e-this.elements[9]*a+this.elements[10]*b;b=1/n;p[0]*=b;p[1]*=b;p[2]*=b;p[3]*=b;p[4]*=b;p[5]*=b;p[6]*=b;p[7]*=b;p[8]*=b;p[9]*=b;p[10]*=b;p[11]*=b;p[12]*=b;p[13]*=b;p[14]*=b;p[15]*=b;this.elements=p.slice();return!0},toString:function(){for(var b="",a=0;a<15;a++)b+=
this.elements[a]+", ";b+=this.elements[15];return b},print:function(){var b=ud(this.elements),b=""+a.nfs(this.elements[0],b,4)+" "+a.nfs(this.elements[1],b,4)+" "+a.nfs(this.elements[2],b,4)+" "+a.nfs(this.elements[3],b,4)+"\n"+a.nfs(this.elements[4],b,4)+" "+a.nfs(this.elements[5],b,4)+" "+a.nfs(this.elements[6],b,4)+" "+a.nfs(this.elements[7],b,4)+"\n"+a.nfs(this.elements[8],b,4)+" "+a.nfs(this.elements[9],b,4)+" "+a.nfs(this.elements[10],b,4)+" "+a.nfs(this.elements[11],b,4)+"\n"+a.nfs(this.elements[12],
b,4)+" "+a.nfs(this.elements[13],b,4)+" "+a.nfs(this.elements[14],b,4)+" "+a.nfs(this.elements[15],b,4)+"\n\n";a.println(b)},invTranslate:function(b,a,c){this.preApply(1,0,0,-b,0,1,0,-a,0,0,1,-c,0,0,0,1)},invRotateX:function(b){var a=g.cos(-b),b=g.sin(-b);this.preApply([1,0,0,0,0,a,-b,0,0,b,a,0,0,0,0,1])},invRotateY:function(b){var a=g.cos(-b),b=g.sin(-b);this.preApply([a,0,b,0,0,1,0,0,-b,0,a,0,0,0,0,1])},invRotateZ:function(b){var a=g.cos(-b),b=g.sin(-b);this.preApply([a,-b,0,0,b,a,0,0,0,0,1,0,0,
0,0,1])},invScale:function(b,a,c){this.preApply([1/b,0,0,0,0,1/a,0,0,0,0,1/c,0,0,0,0,1])}};var bb=a.PMatrixStack=function(){this.matrixStack=[]};bb.prototype.load=function(){var b=ga.$newPMatrix();arguments.length===1?b.set(arguments[0]):b.set(arguments);this.matrixStack.push(b)};E.prototype.$newPMatrix=function(){return new ab};I.prototype.$newPMatrix=function(){return new C};bb.prototype.push=function(){this.matrixStack.push(this.peek())};bb.prototype.pop=function(){return this.matrixStack.pop()};
bb.prototype.peek=function(){var b=ga.$newPMatrix();b.set(this.matrixStack[this.matrixStack.length-1]);return b};bb.prototype.mult=function(b){this.matrixStack[this.matrixStack.length-1].apply(b)};a.split=function(b,a){return b.split(a)};a.splitTokens=function(b,a){arguments.length===1&&(a="\n\t\r\u000c ");for(var a="["+a+"]",c=[],e=0,h=b.search(a);h>=0;)h===0?b=b.substring(1):(c[e]=b.substring(0,h),e++,b=b.substring(h)),h=b.search(a);b.length>0&&(c[e]=b);c.length===0&&(c=p);return c};a.append=function(b,
a){b[b.length]=a;return b};a.concat=function(b,a){return b.concat(a)};a.sort=function(b,a){var c=[];if(b.length>0){for(var e=a>0?a:b.length,h=0;h<e;h++)c.push(b[h]);typeof b[0]==="string"?c.sort():c.sort(function(b,a){return b-a});if(a>0)for(e=c.length;e<b.length;e++)c.push(b[e])}return c};a.splice=function(b,a,c){if(a.length===0)return b;if(a instanceof Array)for(var e=0;e<a.length;c++,e++)b.splice(c,0,a[e]);else b.splice(c,0,a);return b};a.subset=function(b,a,c){if(arguments.length===2)return b.slice(a,
b.length);else if(arguments.length===3)return b.slice(a,a+c)};a.join=function(b,a){return b.join(a)};a.shorten=function(b){for(var a=[],c=b.length,e=0;e<c;e++)a[e]=b[e];a.pop();return a};a.expand=function(b,a){var c=b.slice(0);if(arguments.length===1)return c.length=b.length*2,c;else if(arguments.length===2)return c.length=a,c};a.arrayCopy=function(){var b,a=0,c,e=0,h;arguments.length===2?(b=arguments[0],c=arguments[1],h=b.length):arguments.length===3?(b=arguments[0],c=arguments[1],h=arguments[2]):
arguments.length===5&&(b=arguments[0],a=arguments[1],c=arguments[2],e=arguments[3],h=arguments[4]);for(var d=a;d<h+a;d++,e++)if(c[e]!==p)c[e]=b[d];else throw"array index out of bounds exception";};a.reverse=function(b){return b.reverse()};a.mix=function(b,a,c){return b+((a-b)*c>>8)};a.peg=function(b){return b<0?0:b>255?255:b};a.modes={replace:function(b,a){return a},blend:function(b,k){var m=(k&c.ALPHA_MASK)>>>24;return g.min(((b&c.ALPHA_MASK)>>>24)+m,255)<<24|a.mix(b&c.RED_MASK,k&c.RED_MASK,m)&c.RED_MASK|
a.mix(b&c.GREEN_MASK,k&c.GREEN_MASK,m)&c.GREEN_MASK|a.mix(b&c.BLUE_MASK,k&c.BLUE_MASK,m)},add:function(b,a){var m=(a&c.ALPHA_MASK)>>>24;return g.min(((b&c.ALPHA_MASK)>>>24)+m,255)<<24|g.min((b&c.RED_MASK)+((a&c.RED_MASK)>>8)*m,c.RED_MASK)&c.RED_MASK|g.min((b&c.GREEN_MASK)+((a&c.GREEN_MASK)>>8)*m,c.GREEN_MASK)&c.GREEN_MASK|g.min((b&c.BLUE_MASK)+((a&c.BLUE_MASK)*m>>8),c.BLUE_MASK)},subtract:function(b,a){var m=(a&c.ALPHA_MASK)>>>24;return g.min(((b&c.ALPHA_MASK)>>>24)+m,255)<<24|g.max((b&c.RED_MASK)-
((a&c.RED_MASK)>>8)*m,c.GREEN_MASK)&c.RED_MASK|g.max((b&c.GREEN_MASK)-((a&c.GREEN_MASK)>>8)*m,c.BLUE_MASK)&c.GREEN_MASK|g.max((b&c.BLUE_MASK)-((a&c.BLUE_MASK)*m>>8),0)},lightest:function(b,a){var m=(a&c.ALPHA_MASK)>>>24;return g.min(((b&c.ALPHA_MASK)>>>24)+m,255)<<24|g.max(b&c.RED_MASK,((a&c.RED_MASK)>>8)*m)&c.RED_MASK|g.max(b&c.GREEN_MASK,((a&c.GREEN_MASK)>>8)*m)&c.GREEN_MASK|g.max(b&c.BLUE_MASK,(a&c.BLUE_MASK)*m>>8)},darkest:function(b,k){var m=(k&c.ALPHA_MASK)>>>24;return g.min(((b&c.ALPHA_MASK)>>>
24)+m,255)<<24|a.mix(b&c.RED_MASK,g.min(b&c.RED_MASK,((k&c.RED_MASK)>>8)*m),m)&c.RED_MASK|a.mix(b&c.GREEN_MASK,g.min(b&c.GREEN_MASK,((k&c.GREEN_MASK)>>8)*m),m)&c.GREEN_MASK|a.mix(b&c.BLUE_MASK,g.min(b&c.BLUE_MASK,(k&c.BLUE_MASK)*m>>8),m)},difference:function(b,k){var m=(k&c.ALPHA_MASK)>>>24,e=(b&c.RED_MASK)>>16,h=(b&c.GREEN_MASK)>>8,d=b&c.BLUE_MASK,j=(k&c.RED_MASK)>>16,l=(k&c.GREEN_MASK)>>8,y=k&c.BLUE_MASK,j=e>j?e-j:j-e,l=h>l?h-l:l-h,y=d>y?d-y:y-d;return g.min(((b&c.ALPHA_MASK)>>>24)+m,255)<<24|a.peg(e+
((j-e)*m>>8))<<16|a.peg(h+((l-h)*m>>8))<<8|a.peg(d+((y-d)*m>>8))},exclusion:function(b,k){var m=(k&c.ALPHA_MASK)>>>24,e=(b&c.RED_MASK)>>16,h=(b&c.GREEN_MASK)>>8,d=b&c.BLUE_MASK,j=(k&c.RED_MASK)>>16,l=(k&c.GREEN_MASK)>>8,y=k&c.BLUE_MASK,j=e+j-(e*j>>7),l=h+l-(h*l>>7),y=d+y-(d*y>>7);return g.min(((b&c.ALPHA_MASK)>>>24)+m,255)<<24|a.peg(e+((j-e)*m>>8))<<16|a.peg(h+((l-h)*m>>8))<<8|a.peg(d+((y-d)*m>>8))},multiply:function(b,k){var m=(k&c.ALPHA_MASK)>>>24,e=(b&c.RED_MASK)>>16,h=(b&c.GREEN_MASK)>>8,d=b&
c.BLUE_MASK,j=e*((k&c.RED_MASK)>>16)>>8,l=h*((k&c.GREEN_MASK)>>8)>>8,y=d*(k&c.BLUE_MASK)>>8;return g.min(((b&c.ALPHA_MASK)>>>24)+m,255)<<24|a.peg(e+((j-e)*m>>8))<<16|a.peg(h+((l-h)*m>>8))<<8|a.peg(d+((y-d)*m>>8))},screen:function(b,k){var m=(k&c.ALPHA_MASK)>>>24,e=(b&c.RED_MASK)>>16,h=(b&c.GREEN_MASK)>>8,d=b&c.BLUE_MASK,j=255-((255-e)*(255-((k&c.RED_MASK)>>16))>>8),l=255-((255-h)*(255-((k&c.GREEN_MASK)>>8))>>8),y=255-((255-d)*(255-(k&c.BLUE_MASK))>>8);return g.min(((b&c.ALPHA_MASK)>>>24)+m,255)<<
24|a.peg(e+((j-e)*m>>8))<<16|a.peg(h+((l-h)*m>>8))<<8|a.peg(d+((y-d)*m>>8))},hard_light:function(b,k){var m=(k&c.ALPHA_MASK)>>>24,e=(b&c.RED_MASK)>>16,h=(b&c.GREEN_MASK)>>8,d=b&c.BLUE_MASK,j=(k&c.RED_MASK)>>16,l=(k&c.GREEN_MASK)>>8,y=k&c.BLUE_MASK,j=j<128?e*j>>7:255-((255-e)*(255-j)>>7),l=l<128?h*l>>7:255-((255-h)*(255-l)>>7),y=y<128?d*y>>7:255-((255-d)*(255-y)>>7);return g.min(((b&c.ALPHA_MASK)>>>24)+m,255)<<24|a.peg(e+((j-e)*m>>8))<<16|a.peg(h+((l-h)*m>>8))<<8|a.peg(d+((y-d)*m>>8))},soft_light:function(b,
k){var m=(k&c.ALPHA_MASK)>>>24,e=(b&c.RED_MASK)>>16,h=(b&c.GREEN_MASK)>>8,d=b&c.BLUE_MASK,j=(k&c.RED_MASK)>>16,l=(k&c.GREEN_MASK)>>8,y=k&c.BLUE_MASK,j=(e*j>>7)+(e*e>>8)-(e*e*j>>15),l=(h*l>>7)+(h*h>>8)-(h*h*l>>15),y=(d*y>>7)+(d*d>>8)-(d*d*y>>15);return g.min(((b&c.ALPHA_MASK)>>>24)+m,255)<<24|a.peg(e+((j-e)*m>>8))<<16|a.peg(h+((l-h)*m>>8))<<8|a.peg(d+((y-d)*m>>8))},overlay:function(b,k){var m=(k&c.ALPHA_MASK)>>>24,e=(b&c.RED_MASK)>>16,h=(b&c.GREEN_MASK)>>8,d=b&c.BLUE_MASK,j=(k&c.RED_MASK)>>16,l=(k&
c.GREEN_MASK)>>8,y=k&c.BLUE_MASK,j=e<128?e*j>>7:255-((255-e)*(255-j)>>7),l=h<128?h*l>>7:255-((255-h)*(255-l)>>7),y=d<128?d*y>>7:255-((255-d)*(255-y)>>7);return g.min(((b&c.ALPHA_MASK)>>>24)+m,255)<<24|a.peg(e+((j-e)*m>>8))<<16|a.peg(h+((l-h)*m>>8))<<8|a.peg(d+((y-d)*m>>8))},dodge:function(b,k){var m=(k&c.ALPHA_MASK)>>>24,e=(b&c.RED_MASK)>>16,h=(b&c.GREEN_MASK)>>8,d=b&c.BLUE_MASK,j=(k&c.RED_MASK)>>16,l=(k&c.GREEN_MASK)>>8,y=k&c.BLUE_MASK,j=j===255?255:a.peg((e<<8)/(255-j)),l=l===255?255:a.peg((h<<
8)/(255-l)),y=y===255?255:a.peg((d<<8)/(255-y));return g.min(((b&c.ALPHA_MASK)>>>24)+m,255)<<24|a.peg(e+((j-e)*m>>8))<<16|a.peg(h+((l-h)*m>>8))<<8|a.peg(d+((y-d)*m>>8))},burn:function(b,k){var m=(k&c.ALPHA_MASK)>>>24,e=(b&c.RED_MASK)>>16,h=(b&c.GREEN_MASK)>>8,d=b&c.BLUE_MASK,j=(k&c.RED_MASK)>>16,l=(k&c.GREEN_MASK)>>8,y=k&c.BLUE_MASK,j=j===0?0:255-a.peg((255-e<<8)/j),l=l===0?0:255-a.peg((255-h<<8)/l),y=y===0?0:255-a.peg((255-d<<8)/y);return g.min(((b&c.ALPHA_MASK)>>>24)+m,255)<<24|a.peg(e+((j-e)*m>>
8))<<16|a.peg(h+((l-h)*m>>8))<<8|a.peg(d+((y-d)*m>>8))}};a.color=function(b,a,m,e){if(b!==p&&a!==p&&m!==p&&e!==p)return x(b,a,m,e);if(b!==p&&a!==p&&m!==p)return x(b,a,m,Z);if(b!==p&&a!==p){var h;b&c.ALPHA_MASK?(a=g.round(255*(a/Z)),h=b-(b&c.ALPHA_MASK)+((a>255?255:a)<<24&c.ALPHA_MASK)):db===c.RGB?h=x(b,b,b,a):db===c.HSB&&(h=x(0,0,b/ia*B,a));return h}if(typeof b==="number"){var d;b<=ia&&b>=0?db===c.RGB?d=x(b,b,b,Z):db===c.HSB&&(d=x(0,0,b/ia*B,Z)):b&&(d=b);return d}return x(ia,xa,B,Z)};a.color.toString=
function(b){return"rgba("+((b&c.RED_MASK)>>>16)+","+((b&c.GREEN_MASK)>>>8)+","+(b&c.BLUE_MASK)+","+((b&c.ALPHA_MASK)>>>24)/255+")"};a.color.toInt=function(b,a,m,e){return e<<24&c.ALPHA_MASK|b<<16&c.RED_MASK|a<<8&c.GREEN_MASK|m&c.BLUE_MASK};a.color.toArray=function(b){return[(b&c.RED_MASK)>>>16,(b&c.GREEN_MASK)>>>8,b&c.BLUE_MASK,(b&c.ALPHA_MASK)>>>24]};a.color.toGLArray=function(b){return[((b&c.RED_MASK)>>>16)/255,((b&c.GREEN_MASK)>>>8)/255,(b&c.BLUE_MASK)/255,((b&c.ALPHA_MASK)>>>24)/255]};a.color.toRGB=
function(b,a,c){var b=b>ia?ia:b,a=a>xa?xa:a,c=c>B?B:c,b=b/ia*360,a=a/xa*100,c=c/B*100,e=g.round(c/100*255);if(a===0)return[e,e,e];else{b%=360;var h=b%60,d=g.round(c*(100-a)/1E4*255),j=g.round(c*(6E3-a*h)/6E5*255),a=g.round(c*(6E3-a*(60-h))/6E5*255);switch(g.floor(b/60)){case 0:return[e,a,d];case 1:return[j,e,d];case 2:return[d,e,a];case 3:return[d,j,e];case 4:return[a,d,e];case 5:return[e,d,j]}}};a.color.toHSB=function(b){var k,m,e;k=((b&c.RED_MASK)>>>16)/255;m=((b&c.GREEN_MASK)>>>8)/255;e=(b&c.BLUE_MASK)/
255;var b=a.max(a.max(k,m),e),h=a.min(a.min(k,m),e);if(h===b)return[0,0,b];else k=k===b?(m-e)/(b-h):m===b?2+(e-k)/(b-h):4+(k-m)/(b-h),k/=6,k<0?k+=1:k>1&&(k-=1);return[k*ia,(b-h)/b*xa,b*B]};a.brightness=function(b){return a.color.toHSB(b)[2]};a.saturation=function(b){return a.color.toHSB(b)[1]};a.hue=function(b){return a.color.toHSB(b)[0]};a.red=function(b){return((b&c.RED_MASK)>>>16)/255*ia};a.green=function(b){return((b&c.GREEN_MASK)>>>8)/255*xa};a.blue=function(b){return(b&c.BLUE_MASK)/255*B};a.alpha=
function(b){return((b&c.ALPHA_MASK)>>>24)/255*Z};a.lerpColor=function(b,k,m){var e=a.color(b),h=(e&c.RED_MASK)>>>16,d=(e&c.GREEN_MASK)>>>8,b=e&c.BLUE_MASK,e=((e&c.ALPHA_MASK)>>>24)/Z,j=a.color(k),l=(j&c.GREEN_MASK)>>>8,g=j&c.BLUE_MASK,k=((j&c.ALPHA_MASK)>>>24)/Z,h=parseInt(a.lerp(h,(j&c.RED_MASK)>>>16,m),10),d=parseInt(a.lerp(d,l,m),10),b=parseInt(a.lerp(b,g,m),10),m=parseFloat(a.lerp(e,k,m)*Z);return a.color.toInt(h,d,b,m)};a.colorMode=function(){db=arguments[0];arguments.length>1&&(ia=arguments[1],
xa=arguments[2]||arguments[1],B=arguments[3]||arguments[1],Z=arguments[4]||arguments[1])};a.blendColor=function(b,k,m){var e=0;switch(m){case c.REPLACE:e=a.modes.replace(b,k);break;case c.BLEND:e=a.modes.blend(b,k);break;case c.ADD:e=a.modes.add(b,k);break;case c.SUBTRACT:e=a.modes.subtract(b,k);break;case c.LIGHTEST:e=a.modes.lightest(b,k);break;case c.DARKEST:e=a.modes.darkest(b,k);break;case c.DIFFERENCE:e=a.modes.difference(b,k);break;case c.EXCLUSION:e=a.modes.exclusion(b,k);break;case c.MULTIPLY:e=
a.modes.multiply(b,k);break;case c.SCREEN:e=a.modes.screen(b,k);break;case c.HARD_LIGHT:e=a.modes.hard_light(b,k);break;case c.SOFT_LIGHT:e=a.modes.soft_light(b,k);break;case c.OVERLAY:e=a.modes.overlay(b,k);break;case c.DODGE:e=a.modes.dodge(b,k);break;case c.BURN:e=a.modes.burn(b,k)}return e};a.printMatrix=function(){V.print()};E.prototype.translate=function(b,a){ra.translate(b,a);sa.invTranslate(b,a);d.translate(b,a)};I.prototype.translate=function(b,a,c){ra.translate(b,a,c);sa.invTranslate(b,
a,c)};E.prototype.scale=function(b,a){ra.scale(b,a);sa.invScale(b,a);d.scale(b,a||b)};I.prototype.scale=function(b,a,c){ra.scale(b,a,c);sa.invScale(b,a,c)};E.prototype.pushMatrix=function(){Pb.load(V);Qb.load(Wa);d.save()};I.prototype.pushMatrix=function(){Pb.load(V);Qb.load(Wa)};E.prototype.popMatrix=function(){V.set(Pb.pop());Wa.set(Qb.pop());zb()};I.prototype.popMatrix=function(){V.set(Pb.pop());Wa.set(Qb.pop())};E.prototype.resetMatrix=function(){ra.reset();sa.reset();d.setTransform(1,0,0,1,0,
0)};I.prototype.resetMatrix=function(){ra.reset();sa.reset()};M.prototype.applyMatrix=function(){var b=arguments;ra.apply(b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8],b[9],b[10],b[11],b[12],b[13],b[14],b[15]);sa.invApply(b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8],b[9],b[10],b[11],b[12],b[13],b[14],b[15])};E.prototype.applyMatrix=function(){for(var b=arguments,a=b.length;a<16;a++)b[a]=0;b[10]=b[15]=1;M.prototype.applyMatrix.apply(this,b)};a.rotateX=function(b){ra.rotateX(b);sa.invRotateX(b)};E.prototype.rotateZ=
function(){throw"rotateZ() is not supported in 2D mode. Use rotate(float) instead.";};I.prototype.rotateZ=function(b){ra.rotateZ(b);sa.invRotateZ(b)};a.rotateY=function(b){ra.rotateY(b);sa.invRotateY(b)};E.prototype.rotate=function(b){ra.rotateZ(b);sa.invRotateZ(b);d.rotate(b)};I.prototype.rotate=function(b){a.rotateZ(b)};a.pushStyle=function(){d.save();a.pushMatrix();qd.push({doFill:U,currentFillColor:Fa,doStroke:O,currentStrokeColor:ka,curTint:nb,curRectMode:T,curColorMode:db,colorModeX:ia,colorModeZ:B,
colorModeY:xa,colorModeA:Z,curTextFont:ja,curTextSize:S})};a.popStyle=function(){var b=qd.pop();if(b)zb(),a.popMatrix(),U=b.doFill,Fa=b.currentFillColor,O=b.doStroke,ka=b.currentStrokeColor,nb=b.curTint,T=b.curRectmode,db=b.curColorMode,ia=b.colorModeX,B=b.colorModeZ,xa=b.colorModeY,Z=b.colorModeA,ja=b.curTextFont,S=b.curTextSize;else throw"Too many popStyle() without enough pushStyle()";};a.year=function(){return(new Date).getFullYear()};a.month=function(){return(new Date).getMonth()+1};a.day=function(){return(new Date).getDate()};
a.hour=function(){return(new Date).getHours()};a.minute=function(){return(new Date).getMinutes()};a.second=function(){return(new Date).getSeconds()};a.millis=function(){return(new Date).getTime()-Vb};M.prototype.redraw=function(){var b=((new Date).getTime()-Ac)/1E3;jc++;var c=jc/b;if(b>0.5)Ac=(new Date).getTime(),jc=0,a.__frameRate=c;a.frameCount++};E.prototype.redraw=function(){M.prototype.redraw.apply(this,arguments);d.lineWidth=pa;d.save();a.draw();zb()};I.prototype.redraw=function(){M.prototype.redraw.apply(this,
arguments);d.clear(d.DEPTH_BUFFER_BIT);Ma={attributes:{},locations:{}};a.noLights();a.lightFalloff(1,0,0);a.shininess(1);a.ambient(255,255,255);a.specular(0,0,0);a.emissive(0,0,0);a.camera();a.draw()};a.noLoop=function(){jb=$a=!1;clearInterval(N);$.onPause()};a.loop=function(){jb||(Ac=(new Date).getTime(),jc=0,N=X.setInterval(function(){try{$.onFrameStart(),a.redraw(),$.onFrameEnd()}catch(b){throw X.clearInterval(N),b;}},Eb),jb=$a=!0,$.onLoop())};a.frameRate=function(b){Oa=b;Eb=1E3/Oa;$a&&(a.noLoop(),
a.loop())};var Kb=[];a.exit=function(){X.clearInterval(N);var b=a.externals.canvas.id;Ca.splice(lc[b],1);delete lc[b];for(var c in z.lib)z.lib.hasOwnProperty(c)&&z.lib[c].hasOwnProperty("detach")&&z.lib[c].detach(a);for(b=Kb.length;b--;)ca(Kb[b]);$.onExit()};a.cursor=function(){if(arguments.length>1||arguments.length===1&&arguments[0]instanceof a.PImage){var b=arguments[0],c,m;if(arguments.length>=3){if(c=arguments[1],m=arguments[2],c<0||m<0||m>=b.height||c>=b.width)throw"x and y must be non-negative and less than the dimensions of the image";
}else c=b.width>>>1,m=b.height>>>1;b='url("'+b.toDataURL()+'") '+c+" "+m+", default";i.style.cursor=b}else i.style.cursor=arguments.length===1?arguments[0]:Aa};a.noCursor=function(){i.style.cursor=c.NOCURSOR};a.link=function(b,a){a!==p?X.open(b,a):X.location=b};a.beginDraw=Dc;a.endDraw=Dc;a.Import=function(){};a.status=function(b){X.status=b};a.binary=function(b,a){var c=32;if(typeof b==="number")return a&&(c=a),da(b,c);b instanceof ya&&(b=b.toString().charCodeAt(0),c=a?32:16);c=da(b,c);a&&(c=c.substr(-a));
return c};a.unbinary=function(b){var c=/^[0|1]{8}$/,m=0;if(b instanceof Array){m=[];for(c=0;c<b.length;c++)m[c]=a.unbinary(b[c]);return m}else if(isNaN(b))throw"NaN_Err";else if(arguments.length===1||b.length===8)if(c.test(b)){for(c=0;c<8;c++)m+=g.pow(2,c)*parseInt(b.charAt(7-c),10);return m+""}else throw"notBinary: the value passed into unbinary was not an 8 bit binary number";else throw"longErr";};a.nf=function(b,a,c){return fa(b,"","-",a,c)};a.nfs=function(b,a,c){return fa(b," ","-",a,c)};a.nfp=
function(b,a,c){return fa(b,"+","-",a,c)};a.nfc=function(b,a,c){return fa(b,"","-",a,c,",")};a.hex=function(b,a){arguments.length===1&&(a=b instanceof ya?4:8);var c=b,e=a,e=e===p||e===null?e=8:e;c<0&&(c=4294967295+c+1);for(c=Number(c).toString(16).toUpperCase();c.length<e;)c="0"+c;c.length>=e&&(c=c.substring(c.length-e,c.length));return c};a.unhex=function(b){if(b instanceof Array){for(var a=[],c=0;c<b.length;c++)a.push(Yc(b[c]));return a}else return Yc(b)};a.loadStrings=function(b){if(localStorage[b])return localStorage[b].split("\n");
b=Ec(b);if(typeof b!=="string"||b==="")return[];b=b.replace(/(\r\n?)/g,"\n").replace(/\n$/,"");return b.split("\n")};a.saveStrings=function(b,a){localStorage[b]=a.join("\n")};a.loadBytes=function(b){for(var b=Ec(b),a=[],c=0;c<b.length;c++)a.push(b.charCodeAt(c));return a};a.matchAll=function(b,a){for(var c=[],e,d=RegExp(a,"g");(e=d.exec(b))!==null;)c.push(e),e[0].length===0&&++d.lastIndex;return c.length>0?c:null};a.__contains=function(b,a){if(typeof b!=="string")return b.contains.apply(b,gb(arguments));
return b!==null&&a!==null&&typeof a==="string"&&b.indexOf(a)>-1};a.__replaceAll=function(b,a,c){if(typeof b!=="string")return b.replaceAll.apply(b,gb(arguments));return b.replace(RegExp(a,"g"),c)};a.__replaceFirst=function(b,a,c){if(typeof b!=="string")return b.replaceFirst.apply(b,gb(arguments));return b.replace(RegExp(a,""),c)};a.__replace=function(b,a,c){if(typeof b!=="string")return b.replace.apply(b,gb(arguments));if(a instanceof RegExp)return b.replace(a,c);typeof a!=="string"&&(a=a.toString());
if(a==="")return b;var e=b.indexOf(a);if(e<0)return b;var d=0,r="";do r+=b.substring(d,e)+c,d=e+a.length;while((e=b.indexOf(a,d))>=0);return r+b.substring(d)};a.__equals=function(b,a){if(b.equals instanceof Function)return b.equals.apply(b,gb(arguments));return b.valueOf()===a.valueOf()};a.__toCharArray=function(b){if(typeof b!=="string")return b.toCharArray.apply(b,gb(arguments));for(var a=[],c=0,e=b.length;c<e;++c)a[c]=new ya(b.charAt(c));return a};a.__split=function(b,a,c){if(typeof b!=="string")return b.split.apply(b,
gb(arguments));var e=RegExp(a);if(c===p||c<1)return b.split(e);for(var d=[],r=b,j;(j=r.search(e))!==-1&&d.length<c-1;){var l=e.exec(r).toString();d.push(r.substring(0,j));r=r.substring(j+l.length)}(j!==-1||r!=="")&&d.push(r);return d};a.match=function(b,a){return b.match(a)};a.__hashCode=function(b){if(b.hashCode instanceof Function)return b.hashCode.apply(b,gb(arguments));return xc(b)};a.__printStackTrace=function(b){a.println("Exception: "+b.toString())};var vc=[];a.console=X.console||z.logger;
a.println=function(b){var a=vc.length;if(a)z.logger.log(vc.join("")),vc.length=0;arguments.length===0&&a===0?z.logger.log(""):arguments.length!==0&&z.logger.log(b)};a.print=function(b){vc.push(b)};a.str=function(b){if(b instanceof Array){for(var a=[],c=0;c<b.length;c++)a.push(b[c].toString()+"");return a}else return b.toString()+""};a.trim=function(b){if(b instanceof Array){for(var a=[],c=0;c<b.length;c++)a.push(b[c].replace(/^\s*/,"").replace(/\s*$/,"").replace(/\r*$/,""));return a}else return b.replace(/^\s*/,
"").replace(/\s*$/,"").replace(/\r*$/,"")};a.parseBoolean=function(b){if(b instanceof Array){for(var a=[],c=0;c<b.length;c++)a.push(Xb(b[c]));return a}else return Xb(b)};a.parseByte=function(b){if(b instanceof Array){for(var a=[],c=0;c<b.length;c++)a.push(0-(b[c]&128)|b[c]&127);return a}else return 0-(b&128)|b&127};a.parseChar=function(b){if(typeof b==="number")return new ya(String.fromCharCode(b&65535));else if(b instanceof Array){for(var a=[],c=0;c<b.length;c++)a.push(new ya(String.fromCharCode(b[c]&
65535)));return a}else throw"char() may receive only one argument of type int, byte, int[], or byte[].";};a.parseFloat=function(b){if(b instanceof Array){for(var a=[],c=0;c<b.length;c++)a.push(Zc(b[c]));return a}else return Zc(b)};a.parseInt=function(b,a){if(b instanceof Array){for(var c=[],e=0;e<b.length;e++)typeof b[e]==="string"&&!/^\s*[+\-]?\d+\s*$/.test(b[e])?c.push(0):c.push(pb(b[e],a));return c}else return pb(b,a)};a.__int_cast=function(b){return 0|b};a.__instanceof=function(b,a){if(typeof a!==
"function")throw"Function is expected as type argument for instanceof operator";if(typeof b==="string")return a===Object||a===String;if(b instanceof a)return!0;if(typeof b!=="object"||b===null)return!1;var c=b.constructor;if(a.$isInterface){for(var e=[];c;)c.$interfaces&&(e=e.concat(c.$interfaces)),c=c.$base;for(;e.length>0;){c=e.shift();if(c===a)return!0;c.$interfaces&&(e=e.concat(c.$interfaces))}return!1}for(;c.hasOwnProperty("$base");)if(c=c.$base,c===a)return!0;return!1};a.abs=g.abs;a.ceil=g.ceil;
a.constrain=function(b,a,c){return b>c?c:b<a?a:b};a.dist=function(){var b,a,c;if(arguments.length===4)return b=arguments[0]-arguments[2],a=arguments[1]-arguments[3],g.sqrt(b*b+a*a);else if(arguments.length===6)return b=arguments[0]-arguments[3],a=arguments[1]-arguments[4],c=arguments[2]-arguments[5],g.sqrt(b*b+a*a+c*c)};a.exp=g.exp;a.floor=g.floor;a.lerp=function(b,a,c){return(a-b)*c+b};a.log=g.log;a.mag=function(b,a,c){if(c)return g.sqrt(b*b+a*a+c*c);return g.sqrt(b*b+a*a)};a.map=function(b,a,c,
e,d){return e+(d-e)*((b-a)/(c-a))};a.max=function(){if(arguments.length===2)return arguments[0]<arguments[1]?arguments[1]:arguments[0];else{var b=arguments.length===1?arguments[0]:arguments;if(!("length"in b&&b.length>0))throw"Non-empty array is expected";for(var a=b[0],c=b.length,e=1;e<c;++e)a<b[e]&&(a=b[e]);return a}};a.min=function(){if(arguments.length===2)return arguments[0]<arguments[1]?arguments[0]:arguments[1];else{var b=arguments.length===1?arguments[0]:arguments;if(!("length"in b&&b.length>
0))throw"Non-empty array is expected";for(var a=b[0],c=b.length,e=1;e<c;++e)a>b[e]&&(a=b[e]);return a}};a.norm=function(b,a,c){return(b-a)/(c-a)};a.pow=g.pow;a.round=g.round;a.sq=function(b){return b*b};a.sqrt=g.sqrt;a.acos=g.acos;a.asin=g.asin;a.atan=g.atan;a.atan2=g.atan2;a.cos=g.cos;a.degrees=function(b){return b*180/g.PI};a.radians=function(b){return b/180*g.PI};a.sin=g.sin;a.tan=g.tan;var wc=g.random;a.random=function(){if(arguments.length===0)return wc();else if(arguments.length===1)return wc()*
arguments[0];else{var b=arguments[0],a=arguments[1];return wc()*(a-b)+b}};ha.createRandomized=function(){var b=new Date;return new ha(b/6E4&4294967295,b&4294967295)};a.randomSeed=function(b){wc=(new ha(b)).nextDouble};a.Random=function(b){var a=!1,c,e;this.nextGaussian=function(){if(a)return a=!1,c;else{var b,d,j;do b=2*e()-1,d=2*e()-1,j=b*b+d*d;while(j>=1||j===0);j=g.sqrt(-2*g.log(j)/j);c=d*j;a=!0;return b*j}};e=b===p?g.random:(new ha(b)).nextDouble};var Xa={generator:p,octaves:4,fallout:0.5,seed:p};
a.noise=function(b,a,c){if(Xa.generator===p)Xa.generator=new Ia(Xa.seed);for(var e=Xa.generator,d=1,r=1,j=0,l=0;l<Xa.octaves;++l){d*=Xa.fallout;switch(arguments.length){case 1:j+=d*(1+e.noise1d(r*b))/2;break;case 2:j+=d*(1+e.noise2d(r*b,r*a))/2;break;case 3:j+=d*(1+e.noise3d(r*b,r*a,r*c))/2}r*=2}return j};a.noiseDetail=function(b,a){Xa.octaves=b;if(a!==p)Xa.fallout=a};a.noiseSeed=function(b){Xa.seed=b;Xa.generator=p};M.prototype.size=function(b,k){a.stroke(0);a.fill(255);var m={fillStyle:d.fillStyle,
strokeStyle:d.strokeStyle,lineCap:d.lineCap,lineJoin:d.lineJoin};i.style.length>0&&(i.style.removeProperty("width"),i.style.removeProperty("height"));i.width=a.width=b||100;i.height=a.height=k||100;for(var e in m)m.hasOwnProperty(e)&&(d[e]=m[e]);a.textSize(S);a.background();md=g.max(1E3,b*k*0.05);a.externals.context=d;for(m=0;m<c.SINCOS_LENGTH;m++)Nb[m]=a.sin(m*(c.PI/180)*0.5),Ob[m]=a.cos(m*(c.PI/180)*0.5)};E.prototype.size=function(){d===p&&(d=i.getContext("2d"),Pb=new bb,Qb=new bb,ra=new ab,sa=
new ab,V=ra,Wa=sa);M.prototype.size.apply(this,arguments)};I.prototype.size=function(){var b=!1;return function(c,m){function e(b){for(var a=["experimental-webgl","webgl","webkit-3d"],c,k=0,e=a.length;k<e;k++)if(c=b.getContext(a[k]))break;return c}if(b)throw"Multiple calls to size() for 3D renders are not allowed.";b=!0;try{if(i.width!==c||i.height!==m)i.setAttribute("width",c),i.setAttribute("height",m);d=e(i);id=d.createTexture();jd=d.createTexture()}catch(h){z.debug(h)}if(!d)throw"WebGL context is not supported on this browser.";
d.viewport(0,0,i.width,i.height);d.enable(d.DEPTH_TEST);d.enable(d.BLEND);d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA);F=Vc(d,"varying vec4 frontColor;attribute vec3 Vertex;attribute vec2 aTextureCoord;uniform vec4 color;uniform mat4 model;uniform mat4 view;uniform mat4 projection;uniform float pointSize;varying vec2 vTextureCoord;void main(void) {  gl_PointSize = pointSize;  frontColor = color;  gl_Position = projection * view * model * vec4(Vertex, 1.0);  vTextureCoord = aTextureCoord;}","#ifdef GL_ES\nprecision highp float;\n#endif\nvarying vec4 frontColor;varying vec2 vTextureCoord;uniform sampler2D uSampler;uniform int picktype;void main(void){  if(picktype == 0){    gl_FragColor = frontColor;  }  else if(picktype == 1){    float alpha = texture2D(uSampler, vTextureCoord).a;    gl_FragColor = vec4(frontColor.rgb*alpha, alpha);\n  }}");
ua=Vc(d,"varying vec4 frontColor;attribute vec3 aVertex;attribute vec4 aColor;uniform mat4 uView;uniform mat4 uProjection;uniform float pointSize;void main(void) {  frontColor = aColor;  gl_PointSize = pointSize;  gl_Position = uProjection * uView * vec4(aVertex, 1.0);}","#ifdef GL_ES\nprecision highp float;\n#endif\nvarying vec4 frontColor;void main(void){  gl_FragColor = frontColor;}");a.strokeWeight(1);u=Vc(d,Fc,"#ifdef GL_ES\nprecision highp float;\n#endif\nvarying vec4 frontColor;uniform sampler2D sampler;uniform bool usingTexture;varying vec2 vTexture;void main(void){  if(usingTexture){    gl_FragColor =  vec4(texture2D(sampler, vTexture.xy));  }  else{    gl_FragColor = frontColor;  }}");
d.useProgram(u);q("usingTexture3d",u,"usingTexture",Da);a.lightFalloff(1,0,0);a.shininess(1);a.ambient(255,255,255);a.specular(0,0,0);a.emissive(0,0,0);Ic=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,Ic);d.bufferData(d.ARRAY_BUFFER,rd,d.STATIC_DRAW);Jc=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,Jc);d.bufferData(d.ARRAY_BUFFER,zc,d.STATIC_DRAW);Kc=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,Kc);d.bufferData(d.ARRAY_BUFFER,sd,d.STATIC_DRAW);nc=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,nc);d.bufferData(d.ARRAY_BUFFER,
Uc,d.STATIC_DRAW);Lc=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,Lc);d.bufferData(d.ARRAY_BUFFER,Cc,d.STATIC_DRAW);cc=d.createBuffer();Mc=d.createBuffer();Wb=d.createBuffer();Nc=d.createBuffer();gd=d.createBuffer();hd=d.createBuffer();oc=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,oc);d.bufferData(d.ARRAY_BUFFER,new L([0,0,0]),d.STATIC_DRAW);Oc=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,Oc);d.bufferData(d.ARRAY_BUFFER,new L([1,1,0,-1,1,0,-1,-1,0,1,-1,0]),d.STATIC_DRAW);Pc=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,
Pc);d.bufferData(d.ARRAY_BUFFER,new L([0,0,1,0,1,1,0,1]),d.STATIC_DRAW);Qc=d.createBuffer();d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,Qc);d.bufferData(d.ELEMENT_ARRAY_BUFFER,new Dd([0,1,2,2,3,0]),d.STATIC_DRAW);ub=new C;Va=new C;V=new C;Wa=new C;Na=new C;a.camera();a.perspective();ra=V;sa=Wa;Pb=new bb;Qb=new bb;ac=new C;kc=new C;Gb=new C;Fb=new C;Bc=new C;Hc=new C;Hc.set(-1,3,-3,1,3,-6,3,0,-3,3,0,0,1,0,0,0);M.prototype.size.apply(this,arguments)}}();E.prototype.ambientLight=M.prototype.a3DOnlyFunction;
I.prototype.ambientLight=function(b,a,m,e,h,r){if(K===c.MAX_LIGHTS)throw"can only create "+c.MAX_LIGHTS+" lights";e=new aa(e,h,r);h=new C;h.scale(1,-1,1);h.apply(V.array());h.mult(e,e);d.useProgram(u);v("lights.color.3d."+K,u,"lights"+K+".color",[b/255,a/255,m/255]);v("lights.position.3d."+K,u,"lights"+K+".position",e.array());q("lights.type.3d."+K,u,"lights"+K+".type",0);q("lightCount3d",u,"lightCount",++K)};E.prototype.directionalLight=M.prototype.a3DOnlyFunction;I.prototype.directionalLight=function(b,
a,m,e,h,r){if(K===c.MAX_LIGHTS)throw"can only create "+c.MAX_LIGHTS+" lights";d.useProgram(u);var j=new C;j.scale(1,-1,1);j.apply(V.array());j=j.array();e=[j[0]*e+j[4]*h+j[8]*r,j[1]*e+j[5]*h+j[9]*r,j[2]*e+j[6]*h+j[10]*r];v("lights.color.3d."+K,u,"lights"+K+".color",[b/255,a/255,m/255]);v("lights.position.3d."+K,u,"lights"+K+".position",e);q("lights.type.3d."+K,u,"lights"+K+".type",1);q("lightCount3d",u,"lightCount",++K)};E.prototype.lightFalloff=M.prototype.a3DOnlyFunction;I.prototype.lightFalloff=
function(b,a,c){d.useProgram(u);v("falloff3d",u,"falloff",[b,a,c])};E.prototype.lightSpecular=M.prototype.a3DOnlyFunction;I.prototype.lightSpecular=function(b,a,c){d.useProgram(u);v("specular3d",u,"specular",[b/255,a/255,c/255])};a.lights=function(){a.ambientLight(128,128,128);a.directionalLight(128,128,128,0,0,-1);a.lightFalloff(1,0,0);a.lightSpecular(0,0,0)};E.prototype.pointLight=M.prototype.a3DOnlyFunction;I.prototype.pointLight=function(b,a,m,e,h,r){if(K===c.MAX_LIGHTS)throw"can only create "+
c.MAX_LIGHTS+" lights";e=new aa(e,h,r);h=new C;h.scale(1,-1,1);h.apply(V.array());h.mult(e,e);d.useProgram(u);v("lights.color.3d."+K,u,"lights"+K+".color",[b/255,a/255,m/255]);v("lights.position.3d."+K,u,"lights"+K+".position",e.array());q("lights.type.3d."+K,u,"lights"+K+".type",2);q("lightCount3d",u,"lightCount",++K)};E.prototype.noLights=M.prototype.a3DOnlyFunction;I.prototype.noLights=function(){K=0;d.useProgram(u);q("lightCount3d",u,"lightCount",K)};E.prototype.spotLight=M.prototype.a3DOnlyFunction;
I.prototype.spotLight=function(b,a,m,e,h,r,j,l,g,f,i){if(K===c.MAX_LIGHTS)throw"can only create "+c.MAX_LIGHTS+" lights";d.useProgram(u);e=new aa(e,h,r);h=new C;h.scale(1,-1,1);h.apply(V.array());h.mult(e,e);h=h.array();j=[h[0]*j+h[4]*l+h[8]*g,h[1]*j+h[5]*l+h[9]*g,h[2]*j+h[6]*l+h[10]*g];v("lights.color.3d."+K,u,"lights"+K+".color",[b/255,a/255,m/255]);v("lights.position.3d."+K,u,"lights"+K+".position",e.array());v("lights.direction.3d."+K,u,"lights"+K+".direction",j);v("lights.concentration.3d."+
K,u,"lights"+K+".concentration",i);v("lights.angle.3d."+K,u,"lights"+K+".angle",f);q("lights.type.3d."+K,u,"lights"+K+".type",3);q("lightCount3d",u,"lightCount",++K)};a.beginCamera=function(){if(rc)throw"You cannot call beginCamera() again before calling endCamera()";else rc=!0,ra=Va,sa=ub};a.endCamera=function(){if(rc)V.set(ub),Wa.set(Va),ra=V,sa=Wa,rc=!1;else throw"You cannot call endCamera() before calling beginCamera()";};a.camera=function(b,a,c,e,d,r,j,l,f){arguments.length===0&&(Tc=i.width/
2,vb=i.height/2,wb=vb/g.tan(sc/2),b=Tc,a=vb,c=wb,e=Tc,d=vb,j=r=0,l=1,f=0);var p=new aa(b-e,a-d,c-r),o=new aa(j,l,f);p.normalize();var q=aa.cross(o,p),o=aa.cross(p,q);q.normalize();o.normalize();ub.set(q.x,q.y,q.z,0,o.x,o.y,o.z,0,p.x,p.y,p.z,0,0,0,0,1);ub.translate(-b,-a,-c);Va.reset();Va.invApply(q.x,q.y,q.z,0,o.x,o.y,o.z,0,p.x,p.y,p.z,0,0,0,0,1);Va.translate(b,a,c);V.set(ub);Wa.set(Va)};a.perspective=function(b,c,d,e){arguments.length===0&&(vb=i.height/2,wb=vb/g.tan(sc/2),nd=wb/10,od=wb*10,pd=i.width/
i.height,b=sc,c=pd,d=nd,e=od);var h,r;h=d*g.tan(b/2);r=-h;a.frustum(r*c,h*c,r,h,d,e)};a.frustum=function(b,a,c,e,h,r){Na=new C;Na.set(2*h/(a-b),0,(a+b)/(a-b),0,0,2*h/(e-c),(e+c)/(e-c),0,0,0,-(r+h)/(r-h),-(2*r*h)/(r-h),0,0,-1,0);b=new C;b.set(Na);b.transpose();d.useProgram(F);w("projection2d",F,"projection",!1,b.array());d.useProgram(u);w("projection3d",u,"projection",!1,b.array());d.useProgram(ua);w("uProjectionUS",ua,"uProjection",!1,b.array())};a.ortho=function(b,c,m,e,h,r){if(arguments.length===
0)b=0,c=a.width,m=0,e=a.height,h=-10,r=10;var j=2/(c-b),l=2/(e-m),g=-2/(r-h),f=-(c+b)/(c-b),i=-(e+m)/(e-m),p=-(r+h)/(r-h);Na=new C;Na.set(j,0,0,f,0,l,0,i,0,0,g,p,0,0,0,1);j=new C;j.set(Na);j.transpose();d.useProgram(F);w("projection2d",F,"projection",!1,j.array());d.useProgram(u);w("projection3d",u,"projection",!1,j.array());d.useProgram(ua);w("uProjectionUS",ua,"uProjection",!1,j.array())};a.printProjection=function(){Na.print()};a.printCamera=function(){ub.print()};E.prototype.box=M.prototype.a3DOnlyFunction;
I.prototype.box=function(b,a,c){if(!a||!c)a=c=b;var e=new C;e.scale(b,a,c);b=new C;b.scale(1,-1,1);b.apply(V.array());b.transpose();U&&(d.useProgram(u),w("model3d",u,"model",!1,e.array()),w("view3d",u,"view",!1,b.array()),d.enable(d.POLYGON_OFFSET_FILL),d.polygonOffset(1,1),v("color3d",u,"color",na),K>0?(a=new C,a.set(b),c=new C,c.set(e),a.mult(c),c=new C,c.set(a),c.invert(),c.transpose(),w("normalTransform3d",u,"normalTransform",!1,c.array()),s("normal3d",u,"Normal",3,Jc)):J("normal3d",u,"Normal"),
s("vertex3d",u,"Vertex",3,Ic),J("aColor3d",u,"aColor"),J("aTexture3d",u,"aTexture"),d.drawArrays(d.TRIANGLES,0,rd.length/3),d.disable(d.POLYGON_OFFSET_FILL));pa>0&&O&&(d.useProgram(F),w("model2d",F,"model",!1,e.array()),w("view2d",F,"view",!1,b.array()),v("color2d",F,"color",oa),q("picktype2d",F,"picktype",0),s("vertex2d",F,"Vertex",3,Kc),J("aTextureCoord2d",F,"aTextureCoord"),d.drawArrays(d.LINES,0,sd.length/3))};a.sphereDetail=function(b,a){var m;arguments.length===1&&(b=a=arguments[0]);b<3&&(b=
3);a<2&&(a=2);if(!(b===tb&&a===qc)){var e=c.SINCOS_LENGTH/b,h=new L(b),r=new L(b);for(m=0;m<b;m++)h[m]=Ob[parseInt(m*e%c.SINCOS_LENGTH,10)],r[m]=Nb[parseInt(m*e%c.SINCOS_LENGTH,10)];m=b*(a-1)+2;e=0;Sa=new L(m);Ta=new L(m);Ua=new L(m);var j=c.SINCOS_LENGTH*0.5/a,l=j;for(m=1;m<a;m++){for(var g=Nb[parseInt(l%c.SINCOS_LENGTH,10)],f=-Ob[parseInt(l%c.SINCOS_LENGTH,10)],i=0;i<b;i++)Sa[e]=h[i]*g,Ta[e]=f,Ua[e++]=r[i]*g;l+=j}tb=b;qc=a;P=[];for(h=0;h<tb;h++)P.push(0),P.push(-1),P.push(0),P.push(Sa[h]),P.push(Ta[h]),
P.push(Ua[h]);P.push(0);P.push(-1);P.push(0);P.push(Sa[0]);P.push(Ta[0]);P.push(Ua[0]);j=0;for(h=2;h<qc;h++){r=m=j;j+=tb;e=j;for(l=0;l<tb;l++)P.push(parseFloat(Sa[r])),P.push(parseFloat(Ta[r])),P.push(parseFloat(Ua[r++])),P.push(parseFloat(Sa[e])),P.push(parseFloat(Ta[e])),P.push(parseFloat(Ua[e++]));r=m;e=j;P.push(parseFloat(Sa[r]));P.push(parseFloat(Ta[r]));P.push(parseFloat(Ua[r]));P.push(parseFloat(Sa[e]));P.push(parseFloat(Ta[e]));P.push(parseFloat(Ua[e]))}for(h=0;h<tb;h++)e=j+h,P.push(parseFloat(Sa[e])),
P.push(parseFloat(Ta[e])),P.push(parseFloat(Ua[e])),P.push(0),P.push(1),P.push(0);P.push(parseFloat(Sa[j]));P.push(parseFloat(Ta[j]));P.push(parseFloat(Ua[j]));P.push(0);P.push(1);P.push(0);d.bindBuffer(d.ARRAY_BUFFER,cc);d.bufferData(d.ARRAY_BUFFER,new L(P),d.STATIC_DRAW)}};E.prototype.sphere=M.prototype.a3DOnlyFunction;I.prototype.sphere=function(b){(tb<3||qc<2)&&a.sphereDetail(30);var c=new C;c.scale(b,b,b);b=new C;b.scale(1,-1,1);b.apply(V.array());b.transpose();if(U){if(K>0){var m=new C;m.set(b);
var e=new C;e.set(c);m.mult(e);e=new C;e.set(m);e.invert();e.transpose();w("normalTransform3d",u,"normalTransform",!1,e.array());s("normal3d",u,"Normal",3,cc)}else J("normal3d",u,"Normal");d.useProgram(u);J("aTexture3d",u,"aTexture");w("model3d",u,"model",!1,c.array());w("view3d",u,"view",!1,b.array());s("vertex3d",u,"Vertex",3,cc);J("aColor3d",u,"aColor");d.enable(d.POLYGON_OFFSET_FILL);d.polygonOffset(1,1);v("color3d",u,"color",na);d.drawArrays(d.TRIANGLE_STRIP,0,P.length/3);d.disable(d.POLYGON_OFFSET_FILL)}pa>
0&&O&&(d.useProgram(F),w("model2d",F,"model",!1,c.array()),w("view2d",F,"view",!1,b.array()),s("vertex2d",F,"Vertex",3,cc),J("aTextureCoord2d",F,"aTextureCoord"),v("color2d",F,"color",oa),q("picktype2d",F,"picktype",0),d.drawArrays(d.LINE_STRIP,0,P.length/3))};a.modelX=function(b,a,c){var e=V.array(),d=Va.array(),r=e[0]*b+e[1]*a+e[2]*c+e[3],j=e[4]*b+e[5]*a+e[6]*c+e[7],l=e[8]*b+e[9]*a+e[10]*c+e[11],a=e[12]*b+e[13]*a+e[14]*c+e[15],b=d[0]*r+d[1]*j+d[2]*l+d[3]*a,d=d[12]*r+d[13]*j+d[14]*l+d[15]*a;return d!==
0?b/d:b};a.modelY=function(b,a,c){var e=V.array(),d=Va.array(),r=e[0]*b+e[1]*a+e[2]*c+e[3],j=e[4]*b+e[5]*a+e[6]*c+e[7],l=e[8]*b+e[9]*a+e[10]*c+e[11],a=e[12]*b+e[13]*a+e[14]*c+e[15],b=d[4]*r+d[5]*j+d[6]*l+d[7]*a,d=d[12]*r+d[13]*j+d[14]*l+d[15]*a;return d!==0?b/d:b};a.modelZ=function(b,a,c){var e=V.array(),d=Va.array(),r=e[0]*b+e[1]*a+e[2]*c+e[3],j=e[4]*b+e[5]*a+e[6]*c+e[7],l=e[8]*b+e[9]*a+e[10]*c+e[11],a=e[12]*b+e[13]*a+e[14]*c+e[15],b=d[8]*r+d[9]*j+d[10]*l+d[11]*a,d=d[12]*r+d[13]*j+d[14]*l+d[15]*
a;return d!==0?b/d:b};E.prototype.ambient=M.prototype.a3DOnlyFunction;I.prototype.ambient=function(){var b=arguments;d.useProgram(u);q("usingMat3d",u,"usingMat",!0);b.length===1?typeof b[0]==="string"?(b=b[0].slice(5,-1).split(","),v("mat_ambient3d",u,"mat_ambient",[b[0]/255,b[1]/255,b[2]/255])):v("mat_ambient3d",u,"mat_ambient",[b[0]/255,b[0]/255,b[0]/255]):v("mat_ambient3d",u,"mat_ambient",[b[0]/255,b[1]/255,b[2]/255])};E.prototype.emissive=M.prototype.a3DOnlyFunction;I.prototype.emissive=function(){var b=
arguments;d.useProgram(u);q("usingMat3d",u,"usingMat",!0);b.length===1?typeof b[0]==="string"?(b=b[0].slice(5,-1).split(","),v("mat_emissive3d",u,"mat_emissive",[b[0]/255,b[1]/255,b[2]/255])):v("mat_emissive3d",u,"mat_emissive",[b[0]/255,b[0]/255,b[0]/255]):v("mat_emissive3d",u,"mat_emissive",[b[0]/255,b[1]/255,b[2]/255])};E.prototype.shininess=M.prototype.a3DOnlyFunction;I.prototype.shininess=function(b){d.useProgram(u);q("usingMat3d",u,"usingMat",!0);v("shininess3d",u,"shininess",b)};E.prototype.specular=
M.prototype.a3DOnlyFunction;I.prototype.specular=function(){var b=a.color.apply(this,arguments);d.useProgram(u);q("usingMat3d",u,"usingMat",!0);v("mat_specular3d",u,"mat_specular",a.color.toGLArray(b).slice(0,3))};a.screenX=function(b,c,d){var e=V.array();if(e.length===16){var h=e[0]*b+e[1]*c+e[2]*d+e[3],r=e[4]*b+e[5]*c+e[6]*d+e[7],j=e[8]*b+e[9]*c+e[10]*d+e[11],c=e[12]*b+e[13]*c+e[14]*d+e[15],d=Na.array(),b=d[0]*h+d[1]*r+d[2]*j+d[3]*c,h=d[12]*h+d[13]*r+d[14]*j+d[15]*c;h!==0&&(b/=h);return a.width*
(1+b)/2}else return V.multX(b,c)};a.screenY=function(b,c,d){var e=V.array();if(e.length===16){var h=e[0]*b+e[1]*c+e[2]*d+e[3],r=e[4]*b+e[5]*c+e[6]*d+e[7],j=e[8]*b+e[9]*c+e[10]*d+e[11],c=e[12]*b+e[13]*c+e[14]*d+e[15],d=Na.array(),b=d[4]*h+d[5]*r+d[6]*j+d[7]*c,h=d[12]*h+d[13]*r+d[14]*j+d[15]*c;h!==0&&(b/=h);return a.height*(1+b)/2}else return V.multY(b,c)};a.screenZ=function(b,a,c){var d=V.array();if(d.length!==16)return 0;var h=Na.array(),r=d[0]*b+d[1]*a+d[2]*c+d[3],j=d[4]*b+d[5]*a+d[6]*c+d[7],l=d[8]*
b+d[9]*a+d[10]*c+d[11],a=d[12]*b+d[13]*a+d[14]*c+d[15],b=h[8]*r+h[9]*j+h[10]*l+h[11]*a,h=h[12]*r+h[13]*j+h[14]*l+h[15]*a;h!==0&&(b/=h);return(b+1)/2};M.prototype.fill=function(b,c,d,e){b=a.color(b,c,d,e);b===Fa&&U||(U=!0,Fa=b)};E.prototype.fill=function(){M.prototype.fill.apply(this,arguments);Ga=!0};I.prototype.fill=function(){M.prototype.fill.apply(this,arguments);na=a.color.toGLArray(Fa)};a.noFill=function(){U=!1};M.prototype.stroke=function(b,c,d,e){b=a.color(b,c,d,e);b===ka&&O||(O=!0,ka=b)};
E.prototype.stroke=function(){M.prototype.stroke.apply(this,arguments);Db=!0};I.prototype.stroke=function(){M.prototype.stroke.apply(this,arguments);oa=a.color.toGLArray(ka)};a.noStroke=function(){O=!1};M.prototype.strokeWeight=function(b){pa=b};E.prototype.strokeWeight=function(b){M.prototype.strokeWeight.apply(this,arguments);d.lineWidth=b};I.prototype.strokeWeight=function(b){M.prototype.strokeWeight.apply(this,arguments);d.useProgram(F);v("pointSize2d",F,"pointSize",b);d.useProgram(ua);v("pointSizeUnlitShape",
ua,"pointSize",b);d.lineWidth(b)};a.strokeCap=function(b){ga.$ensureContext().lineCap=b};a.strokeJoin=function(b){ga.$ensureContext().lineJoin=b};M.prototype.smooth=function(){i.style.setProperty("image-rendering","optimizeQuality","important")};E.prototype.smooth=function(){M.prototype.smooth.apply(this,arguments);if("mozImageSmoothingEnabled"in d)d.mozImageSmoothingEnabled=!0};M.prototype.noSmooth=function(){i.style.setProperty("image-rendering","optimizeSpeed","important")};E.prototype.noSmooth=
function(){M.prototype.noSmooth.apply(this,arguments);if("mozImageSmoothingEnabled"in d)d.mozImageSmoothingEnabled=!1};E.prototype.point=function(b,k){if(O)if($.options.crispLines){var m=g.PI/4,e=a.get(b,k);a.set(b,k,hc(e,ka,m))}else pa>1?(d.fillStyle=a.color.toString(ka),Ga=!0,d.beginPath(),d.arc(b,k,pa/2,0,c.TWO_PI,!1),d.fill(),d.closePath()):(d.fillStyle=a.color.toString(ka),d.fillRect(g.round(b),g.round(k),1,1),Ga=!0)};I.prototype.point=function(b,a,c){var e=new C;e.translate(b,a,c||0);e.transpose();
b=new C;b.scale(1,-1,1);b.apply(V.array());b.transpose();d.useProgram(F);w("model2d",F,"model",!1,e.array());w("view2d",F,"view",!1,b.array());pa>0&&O&&(v("color2d",F,"color",oa),q("picktype2d",F,"picktype",0),s("vertex2d",F,"Vertex",3,oc),J("aTextureCoord2d",F,"aTextureCoord"),d.drawArrays(d.POINTS,0,1))};a.beginShape=function(b){W=b;o=[]};E.prototype.vertex=function(b,a,c,d){var h=[];lb&&(lb=!1);h.isVert=!0;h[0]=b;h[1]=a;h[2]=0;h[3]=c;h[4]=d;h[5]=Fa;h[6]=ka;o.push(h)};I.prototype.vertex=function(b,
a,c,d,h){var r=[];lb&&(lb=!1);r.isVert=!0;r[0]=b;r[1]=a;r[2]=c||0;r[3]=d||0;r[4]=h||0;r[5]=na[0];r[6]=na[1];r[7]=na[2];r[8]=na[3];r[9]=oa[0];r[10]=oa[1];r[11]=oa[2];r[12]=oa[3];r[13]=za;r[14]=ob;r[15]=fb;o.push(r)};var vd=function(b,a){var c=new C;c.scale(1,-1,1);c.apply(V.array());c.transpose();d.useProgram(ua);w("uViewUS",ua,"uView",!1,c.array());s("aVertexUS",ua,"aVertex",3,oc);d.bufferData(d.ARRAY_BUFFER,new L(b),d.STREAM_DRAW);s("aColorUS",ua,"aColor",4,Nc);d.bufferData(d.ARRAY_BUFFER,new L(a),
d.STREAM_DRAW);d.drawArrays(d.POINTS,0,b.length/3)},Ja=function(b,a,c){var a=a==="LINES"?d.LINES:a==="LINE_LOOP"?d.LINE_LOOP:d.LINE_STRIP,e=new C;e.scale(1,-1,1);e.apply(V.array());e.transpose();d.useProgram(ua);w("uViewUS",ua,"uView",!1,e.array());s("aVertexUS",ua,"aVertex",3,Mc);d.bufferData(d.ARRAY_BUFFER,new L(b),d.STREAM_DRAW);s("aColorUS",ua,"aColor",4,gd);d.bufferData(d.ARRAY_BUFFER,new L(c),d.STREAM_DRAW);d.drawArrays(a,0,b.length/3)},cb=function(b,a,m,e){var a=a==="TRIANGLES"?d.TRIANGLES:
a==="TRIANGLE_FAN"?d.TRIANGLE_FAN:d.TRIANGLE_STRIP,h=new C;h.scale(1,-1,1);h.apply(V.array());h.transpose();d.useProgram(u);w("model3d",u,"model",!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);w("view3d",u,"view",!1,h.array());d.enable(d.POLYGON_OFFSET_FILL);d.polygonOffset(1,1);v("color3d",u,"color",[-1,0,0,0]);s("vertex3d",u,"Vertex",3,Wb);d.bufferData(d.ARRAY_BUFFER,new L(b),d.STREAM_DRAW);s("aColor3d",u,"aColor",4,Nc);d.bufferData(d.ARRAY_BUFFER,new L(m),d.STREAM_DRAW);J("normal3d",u,"Normal");if(Da){if(kd===
c.IMAGE)for(m=0;m<e.length;m+=2)e[m]/=pc.width,e[m+1]/=pc.height;for(m=0;m<e.length;m+=2)e[m+0]>1&&(e[m+0]-=e[m+0]-1),e[m+1]>1&&(e[m+1]-=e[m+1]-1);q("usingTexture3d",u,"usingTexture",Da);s("aTexture3d",u,"aTexture",2,hd);d.bufferData(d.ARRAY_BUFFER,new L(e),d.STREAM_DRAW)}d.drawArrays(a,0,b.length/3);d.disable(d.POLYGON_OFFSET_FILL)};E.prototype.endShape=function(b){if(o.length!==0){var b=b===c.CLOSE,k=[],m=[],e=[],h=[],r;lb=!0;var j,l,g=o.length;for(j=0;j<g;j++){r=o[j];for(l=0;l<3;l++)k.push(r[l])}for(j=
0;j<g;j++){r=o[j];for(l=5;l<9;l++)m.push(r[l])}for(j=0;j<g;j++){r=o[j];for(l=9;l<13;l++)e.push(r[l])}for(j=0;j<g;j++)r=o[j],h.push(r[3]),h.push(r[4]);if(b){k.push(o[0][0]);k.push(o[0][1]);k.push(o[0][2]);for(j=5;j<9;j++)m.push(o[0][j]);for(j=9;j<13;j++)e.push(o[0][j]);h.push(o[0][3]);h.push(o[0][4])}if(Rb&&(W===c.POLYGON||W===p)){if(g>3){k=[];m=1-Ya;d.beginPath();d.moveTo(o[1][0],o[1][1]);for(j=1;j+2<g;j++)r=o[j],k[0]=[r[0],r[1]],k[1]=[r[0]+(m*o[j+1][0]-m*o[j-1][0])/6,r[1]+(m*o[j+1][1]-m*o[j-1][1])/
6],k[2]=[o[j+1][0]+(m*o[j][0]-m*o[j+2][0])/6,o[j+1][1]+(m*o[j][1]-m*o[j+2][1])/6],k[3]=[o[j+1][0],o[j+1][1]],d.bezierCurveTo(k[1][0],k[1][1],k[2][0],k[2][1],k[3][0],k[3][1]);b&&d.lineTo(o[0][0],o[0][1]);ea();Y();d.closePath()}}else if(Sb&&(W===c.POLYGON||W===p)){d.beginPath();for(j=0;j<g;j++)r=o[j],o[j].isVert?o[j].moveTo?d.moveTo(r[0],r[1]):d.lineTo(r[0],r[1]):d.bezierCurveTo(o[j][0],o[j][1],o[j][2],o[j][3],o[j][4],o[j][5]);b&&d.lineTo(o[0][0],o[0][1]);ea();Y();d.closePath()}else if(W===c.POINTS)for(j=
0;j<g;j++)r=o[j],O&&a.stroke(r[6]),a.point(r[0],r[1]);else if(W===c.LINES)for(j=0;j+1<g;j+=2)r=o[j],O&&a.stroke(o[j+1][6]),a.line(r[0],r[1],o[j+1][0],o[j+1][1]);else if(W===c.TRIANGLES)for(j=0;j+2<g;j+=3)r=o[j],d.beginPath(),d.moveTo(r[0],r[1]),d.lineTo(o[j+1][0],o[j+1][1]),d.lineTo(o[j+2][0],o[j+2][1]),d.lineTo(r[0],r[1]),U&&(a.fill(o[j+2][5]),ea()),O&&(a.stroke(o[j+2][6]),Y()),d.closePath();else if(W===c.TRIANGLE_STRIP)for(j=0;j+1<g;j++)r=o[j],d.beginPath(),d.moveTo(o[j+1][0],o[j+1][1]),d.lineTo(r[0],
r[1]),O&&a.stroke(o[j+1][6]),U&&a.fill(o[j+1][5]),j+2<g&&(d.lineTo(o[j+2][0],o[j+2][1]),O&&a.stroke(o[j+2][6]),U&&a.fill(o[j+2][5])),ea(),Y(),d.closePath();else if(W===c.TRIANGLE_FAN){if(g>2){d.beginPath();d.moveTo(o[0][0],o[0][1]);d.lineTo(o[1][0],o[1][1]);d.lineTo(o[2][0],o[2][1]);U&&(a.fill(o[2][5]),ea());O&&(a.stroke(o[2][6]),Y());d.closePath();for(j=3;j<g;j++)r=o[j],d.beginPath(),d.moveTo(o[0][0],o[0][1]),d.lineTo(o[j-1][0],o[j-1][1]),d.lineTo(r[0],r[1]),U&&(a.fill(r[5]),ea()),O&&(a.stroke(r[6]),
Y()),d.closePath()}}else if(W===c.QUADS)for(j=0;j+3<g;j+=4){r=o[j];d.beginPath();d.moveTo(r[0],r[1]);for(l=1;l<4;l++)d.lineTo(o[j+l][0],o[j+l][1]);d.lineTo(r[0],r[1]);U&&(a.fill(o[j+3][5]),ea());O&&(a.stroke(o[j+3][6]),Y());d.closePath()}else if(W===c.QUAD_STRIP){if(g>3)for(j=0;j+1<g;j+=2)r=o[j],d.beginPath(),j+3<g?(d.moveTo(o[j+2][0],o[j+2][1]),d.lineTo(r[0],r[1]),d.lineTo(o[j+1][0],o[j+1][1]),d.lineTo(o[j+3][0],o[j+3][1]),U&&a.fill(o[j+3][5]),O&&a.stroke(o[j+3][6])):(d.moveTo(r[0],r[1]),d.lineTo(o[j+
1][0],o[j+1][1])),ea(),Y(),d.closePath()}else{d.beginPath();d.moveTo(o[0][0],o[0][1]);for(j=1;j<g;j++)r=o[j],r.isVert&&(r.moveTo?d.moveTo(r[0],r[1]):d.lineTo(r[0],r[1]));b&&d.lineTo(o[0][0],o[0][1]);ea();Y();d.closePath()}Sb=Rb=!1;va=[];ta=0}};I.prototype.endShape=function(b){if(o.length!==0){var a=b===c.CLOSE,b=[],m=[],e=[],h=[],g=[],j;lb=!0;var l,f,i=o.length;for(l=0;l<i;l++){j=o[l];for(f=0;f<3;f++)m.push(j[f])}for(l=0;l<i;l++){j=o[l];for(f=5;f<9;f++)e.push(j[f])}for(l=0;l<i;l++){j=o[l];for(f=9;f<
13;f++)h.push(j[f])}for(l=0;l<i;l++)j=o[l],g.push(j[3]),g.push(j[4]);if(a){m.push(o[0][0]);m.push(o[0][1]);m.push(o[0][2]);for(l=5;l<9;l++)e.push(o[0][l]);for(l=9;l<13;l++)h.push(o[0][l]);g.push(o[0][3]);g.push(o[0][4])}if(Rb&&(W===c.POLYGON||W===p))O&&Ja(m,null,h),U&&cb(m,null,e);else if(Sb&&(W===c.POLYGON||W===p))b=m,b.splice(b.length-3),h.splice(h.length-4),O&&Ja(b,null,h),U&&cb(m,"TRIANGLES",e);else{if(W===c.POINTS){for(l=0;l<i;l++){j=o[l];for(f=0;f<3;f++)b.push(j[f])}vd(b,h)}else if(W===c.LINES){for(l=
0;l<i;l++){j=o[l];for(f=0;f<3;f++)b.push(j[f])}for(l=0;l<i;l++){j=o[l];for(f=5;f<9;f++)e.push(j[f])}Ja(b,"LINES",h)}else if(W===c.TRIANGLES){if(i>2)for(l=0;l+2<i;l+=3){m=[];g=[];b=[];e=[];h=[];for(f=0;f<3;f++)for(a=0;a<3;a++)b.push(o[l+f][a]),m.push(o[l+f][a]);for(f=0;f<3;f++)for(a=3;a<5;a++)g.push(o[l+f][a]);for(f=0;f<3;f++)for(a=5;a<9;a++)e.push(o[l+f][a]),h.push(o[l+f][a+4]);O&&Ja(b,"LINE_LOOP",h);(U||Da)&&cb(m,"TRIANGLES",e,g)}}else if(W===c.TRIANGLE_STRIP){if(i>2)for(l=0;l+2<i;l++){b=[];m=[];
h=[];e=[];g=[];for(f=0;f<3;f++)for(a=0;a<3;a++)b.push(o[l+f][a]),m.push(o[l+f][a]);for(f=0;f<3;f++)for(a=3;a<5;a++)g.push(o[l+f][a]);for(f=0;f<3;f++)for(a=5;a<9;a++)h.push(o[l+f][a+4]),e.push(o[l+f][a]);(U||Da)&&cb(m,"TRIANGLE_STRIP",e,g);O&&Ja(b,"LINE_LOOP",h)}}else if(W===c.TRIANGLE_FAN){if(i>2){for(l=0;l<3;l++){j=o[l];for(f=0;f<3;f++)b.push(j[f])}for(l=0;l<3;l++){j=o[l];for(f=9;f<13;f++)h.push(j[f])}O&&Ja(b,"LINE_LOOP",h);for(l=2;l+1<i;l++){b=[];h=[];b.push(o[0][0]);b.push(o[0][1]);b.push(o[0][2]);
h.push(o[0][9]);h.push(o[0][10]);h.push(o[0][11]);h.push(o[0][12]);for(f=0;f<2;f++)for(a=0;a<3;a++)b.push(o[l+f][a]);for(f=0;f<2;f++)for(a=9;a<13;a++)h.push(o[l+f][a]);O&&Ja(b,"LINE_STRIP",h)}(U||Da)&&cb(m,"TRIANGLE_FAN",e,g)}}else if(W===c.QUADS)for(l=0;l+3<i;l+=4){b=[];for(f=0;f<4;f++){j=o[l+f];for(a=0;a<3;a++)b.push(j[a])}O&&Ja(b,"LINE_LOOP",h);if(U){m=[];e=[];g=[];for(f=0;f<3;f++)m.push(o[l][f]);for(f=5;f<9;f++)e.push(o[l][f]);for(f=0;f<3;f++)m.push(o[l+1][f]);for(f=5;f<9;f++)e.push(o[l+1][f]);
for(f=0;f<3;f++)m.push(o[l+3][f]);for(f=5;f<9;f++)e.push(o[l+3][f]);for(f=0;f<3;f++)m.push(o[l+2][f]);for(f=5;f<9;f++)e.push(o[l+2][f]);Da&&(g.push(o[l+0][3]),g.push(o[l+0][4]),g.push(o[l+1][3]),g.push(o[l+1][4]),g.push(o[l+3][3]),g.push(o[l+3][4]),g.push(o[l+2][3]),g.push(o[l+2][4]));cb(m,"TRIANGLE_STRIP",e,g)}}else if(W===c.QUAD_STRIP){if(i>3){for(l=0;l<2;l++){j=o[l];for(f=0;f<3;f++)b.push(j[f])}for(l=0;l<2;l++){j=o[l];for(f=9;f<13;f++)h.push(j[f])}Ja(b,"LINE_STRIP",h);i>4&&i%2>0&&(m.splice(m.length-
3),o.pop());for(l=0;l+3<i;l+=2){b=[];h=[];for(f=0;f<3;f++)b.push(o[l+1][f]);for(f=0;f<3;f++)b.push(o[l+3][f]);for(f=0;f<3;f++)b.push(o[l+2][f]);for(f=0;f<3;f++)b.push(o[l+0][f]);for(f=9;f<13;f++)h.push(o[l+1][f]);for(f=9;f<13;f++)h.push(o[l+3][f]);for(f=9;f<13;f++)h.push(o[l+2][f]);for(f=9;f<13;f++)h.push(o[l+0][f]);O&&Ja(b,"LINE_STRIP",h)}(U||Da)&&cb(m,"TRIANGLE_LIST",e,g)}}else if(i===1){for(f=0;f<3;f++)b.push(o[0][f]);for(f=9;f<13;f++)h.push(o[0][f]);vd(b,h)}else{for(l=0;l<i;l++){j=o[l];for(f=
0;f<3;f++)b.push(j[f]);for(f=5;f<9;f++)h.push(j[f])}O&&a?Ja(b,"LINE_LOOP",h):O&&!a&&Ja(b,"LINE_STRIP",h);(U||Da)&&cb(m,"TRIANGLE_FAN",e,g)}Da=!1;d.useProgram(u);q("usingTexture3d",u,"usingTexture",Da)}Sb=Rb=!1;va=[];ta=0}};var wd=function(a,c){var d=1/a,e=d*d,h=e*d;c.set(0,0,0,1,h,e,d,0,6*h,2*e,0,0,6*h,0,0,0)},xd=function(){Gb||(ac=new C,Gb=new C,Ub=!0);var a=Ya;ac.set((a-1)/2,(a+3)/2,(-3-a)/2,(1-a)/2,1-a,(-5-a)/2,a+2,(a-1)/2,(a-1)/2,0,(1-a)/2,0,0,1,0,0);wd(Yb,Gb);Bc||(kc=new C);kc.set(ac);kc.preApply(Bc);
Gb.apply(ac)};E.prototype.bezierVertex=function(){Sb=!0;var a=[];if(lb)throw"vertex() must be used at least once before calling bezierVertex()";for(var c=0;c<arguments.length;c++)a[c]=arguments[c];o.push(a);o[o.length-1].isVert=!1};I.prototype.bezierVertex=function(){Sb=!0;if(lb)throw"vertex() must be used at least once before calling bezierVertex()";if(arguments.length===9){Fb===p&&(Fb=new C);var b=o.length-1;wd(yb,Fb);Fb.apply(Hc);for(var c=Fb.array(),d=o[b][0],e=o[b][1],b=o[b][2],h=c[4]*d+c[5]*
arguments[0]+c[6]*arguments[3]+c[7]*arguments[6],f=c[8]*d+c[9]*arguments[0]+c[10]*arguments[3]+c[11]*arguments[6],j=c[12]*d+c[13]*arguments[0]+c[14]*arguments[3]+c[15]*arguments[6],l=c[4]*e+c[5]*arguments[1]+c[6]*arguments[4]+c[7]*arguments[7],g=c[8]*e+c[9]*arguments[1]+c[10]*arguments[4]+c[11]*arguments[7],i=c[12]*e+c[13]*arguments[1]+c[14]*arguments[4]+c[15]*arguments[7],q=c[4]*b+c[5]*arguments[2]+c[6]*arguments[5]+c[7]*arguments[8],s=c[8]*b+c[9]*arguments[2]+c[10]*arguments[5]+c[11]*arguments[8],
c=c[12]*b+c[13]*arguments[2]+c[14]*arguments[5]+c[15]*arguments[8],n=0;n<yb;n++)d+=h,h+=f,f+=j,e+=l,l+=g,g+=i,b+=q,q+=s,s+=c,a.vertex(d,e,b);a.vertex(arguments[6],arguments[7],arguments[8])}};var Tb=function(){var a=A.createElement("canvas");try{d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,a),Tb=function(a){d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,a)}}catch(c){Tb=function(a){d.texImage2D(d.TEXTURE_2D,0,a,!1)}}Tb.apply(this,arguments)};a.texture=function(a){var c=ga.$ensureContext();
if(a.localName==="canvas")c.bindTexture(c.TEXTURE_2D,id),Tb(a),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR),c.generateMipmap(c.TEXTURE_2D);else if(a.__texture)c.bindTexture(c.TEXTURE_2D,a.__texture);else{var d=c.createTexture();a.__texture=d;var d=A.createElement("canvas"),e;if(a.width&a.width-1===0)d.width=a.width;else{for(e=1;e<a.width;)e*=2;d.width=e}if(a.height&a.height-1===0)d.height=a.height;else{for(e=1;e<a.height;)e*=
2;d.height=e}e=d.getContext("2d");for(var h=e.createImageData(d.width,d.height),f=a.toImageData(),j=0;j<d.width;j+=1)for(var l=0;l<d.height;l+=1){var g=(l*d.width+j)*4;h.data[g+0]=f.data[g+0];h.data[g+1]=f.data[g+1];h.data[g+2]=f.data[g+2];h.data[g+3]=255}e.putImageData(h,0,0);a.__cvs=d;c.bindTexture(c.TEXTURE_2D,a.__texture);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR_MIPMAP_LINEAR);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,
c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);Tb(a.__cvs);c.generateMipmap(c.TEXTURE_2D)}pc.width=a.width;pc.height=a.height;Da=!0;c.useProgram(u);q("usingTexture3d",u,"usingTexture",Da)};a.textureMode=function(a){kd=a};E.prototype.curveVertex=function(b,c){Rb=!0;a.vertex(b,c)};I.prototype.curveVertex=function(b,c,d){Rb=!0;Ub||xd();var e=[];e[0]=b;e[1]=c;e[2]=d;va.push(e);ta++;if(ta>3){var h=va[ta-4][0],f=va[ta-4][1],j=va[ta-4][2],g=va[ta-3][0],i=va[ta-3][1],p=va[ta-
3][2],o=va[ta-2][0],q=va[ta-2][1],n=va[ta-2][2],s=va[ta-1][0],v=va[ta-1][1],u=va[ta-1][2],b=g,c=i,d=p,t=Gb.array(),e=t[4]*h+t[5]*g+t[6]*o+t[7]*s,w=t[8]*h+t[9]*g+t[10]*o+t[11]*s,h=t[12]*h+t[13]*g+t[14]*o+t[15]*s,g=t[4]*f+t[5]*i+t[6]*q+t[7]*v,o=t[8]*f+t[9]*i+t[10]*q+t[11]*v,f=t[12]*f+t[13]*i+t[14]*q+t[15]*v,i=t[4]*j+t[5]*p+t[6]*n+t[7]*u,q=t[8]*j+t[9]*p+t[10]*n+t[11]*u,j=t[12]*j+t[13]*p+t[14]*n+t[15]*u;a.vertex(b,c,d);for(p=0;p<Yb;p++)b+=e,e+=w,w+=h,c+=g,g+=o,o+=f,d+=i,i+=q,q+=j,a.vertex(b,c,d)}};E.prototype.curve=
function(){arguments.length===8&&(a.beginShape(),a.curveVertex(arguments[0],arguments[1]),a.curveVertex(arguments[2],arguments[3]),a.curveVertex(arguments[4],arguments[5]),a.curveVertex(arguments[6],arguments[7]),a.endShape())};I.prototype.curve=function(){arguments.length===12&&(a.beginShape(),a.curveVertex(arguments[0],arguments[1],arguments[2]),a.curveVertex(arguments[3],arguments[4],arguments[5]),a.curveVertex(arguments[6],arguments[7],arguments[8]),a.curveVertex(arguments[9],arguments[10],arguments[11]),
a.endShape())};a.curveTightness=function(a){Ya=a};a.curveDetail=function(a){Yb=a;xd()};a.rectMode=function(a){T=a};a.imageMode=function(a){switch(a){case c.CORNER:tc=td;break;case c.CORNERS:tc=Gc;break;case c.CENTER:tc=Ed;break;default:throw"Invalid imageMode";}};a.ellipseMode=function(a){ba=a};a.arc=function(b,d,m,e,h,f){if(!(m<=0||f<h)){ba===c.CORNERS?(m-=b,e-=d):ba===c.RADIUS?(b-=m,d-=e,m*=2,e*=2):ba===c.CENTER&&(b-=m/2,d-=e/2);for(;h<0;)h+=c.TWO_PI,f+=c.TWO_PI;if(f-h>c.TWO_PI)h=0,f=c.TWO_PI;m/=
2;e/=2;b+=m;d+=e;var h=0|-0.5+h/c.TWO_PI*c.SINCOS_LENGTH,f=0|0.5+f/c.TWO_PI*c.SINCOS_LENGTH,j,g;if(U){var i=O;O=!1;a.beginShape();a.vertex(b,d);for(g=j=h;j<f;j++,g++)g>=c.SINCOS_LENGTH&&(g-=c.SINCOS_LENGTH),a.vertex(b+Ob[g]*m,d+Nb[g]*e);a.endShape(c.CLOSE);O=i}if(O){i=U;U=!1;a.beginShape();for(g=j=h;j<f;j++,g++)g>=c.SINCOS_LENGTH&&(g-=c.SINCOS_LENGTH),a.vertex(b+Ob[g]*m,d+Nb[g]*e);g=f%c.SINCOS_LENGTH;a.vertex(b+Ob[g]*m,d+Nb[g]*e);a.endShape();U=i}}};E.prototype.line=function(b,c,m,e){if(b===m&&c===
e)a.point(b,c);else if((b===m||c===e)&&pa<=1&&O&&$.options.crispLines){var h;if(b===m){c>e&&(h=c,c=e,e=h);for(;c<=e;++c)a.set(b,c,ka)}else{b>m&&(h=b,b=m,m=h);for(;b<=m;++b)a.set(b,c,ka)}}else O&&(d.beginPath(),d.moveTo(b||0,c||0),d.lineTo(m||0,e||0),Y(),d.closePath())};I.prototype.line=function(b,c,m,e,h,f){if(h===p||f===p)f=0,h=e,e=m,m=0;b===e&&c===h&&m===f?a.point(b,c,m):(b=[b,c,m,e,h,f],c=new C,c.scale(1,-1,1),c.apply(V.array()),c.transpose(),pa>0&&O&&(d.useProgram(F),w("model2d",F,"model",!1,
[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),w("view2d",F,"view",!1,c.array()),v("color2d",F,"color",oa),q("picktype2d",F,"picktype",0),s("vertex2d",F,"Vertex",3,Mc),J("aTextureCoord2d",F,"aTextureCoord"),d.bufferData(d.ARRAY_BUFFER,new L(b),d.STREAM_DRAW),d.drawArrays(d.LINES,0,2)))};E.prototype.bezier=function(){if(arguments.length!==8)throw"You must use 8 parameters for bezier() in 2D mode";a.beginShape();a.vertex(arguments[0],arguments[1]);a.bezierVertex(arguments[2],arguments[3],arguments[4],arguments[5],
arguments[6],arguments[7]);a.endShape()};I.prototype.bezier=function(){if(arguments.length!==12)throw"You must use 12 parameters for bezier() in 3D mode";a.beginShape();a.vertex(arguments[0],arguments[1],arguments[2]);a.bezierVertex(arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8],arguments[9],arguments[10],arguments[11]);a.endShape()};a.bezierDetail=function(a){yb=a};a.bezierPoint=function(a,c,d,e,h){return(1-h)*(1-h)*(1-h)*a+3*(1-h)*(1-h)*h*c+3*(1-h)*h*h*d+h*h*h*e};
a.bezierTangent=function(a,c,d,e,h){return 3*h*h*(-a+3*c-3*d+e)+6*h*(a-2*c+d)+3*(-a+c)};a.curvePoint=function(a,c,d,e,h){return 0.5*(2*c+(-a+d)*h+(2*a-5*c+4*d-e)*h*h+(-a+3*c-3*d+e)*h*h*h)};a.curveTangent=function(a,c,d,e,h){return 0.5*(-a+d+2*(2*a-5*c+4*d-e)*h+3*(-a+3*c-3*d+e)*h*h)};a.triangle=function(b,d,m,e,h,f){a.beginShape(c.TRIANGLES);a.vertex(b,d,0);a.vertex(m,e,0);a.vertex(h,f,0);a.endShape()};a.quad=function(b,d,f,e,h,g,j,l){a.beginShape(c.QUADS);a.vertex(b,d,0);a.vertex(f,e,0);a.vertex(h,
g,0);a.vertex(j,l,0);a.endShape()};E.prototype.rect=function(b,k,f,e){if(f||e)if(O&&!U&&pa<=1&&$.options.crispLines){var h,r=b+f-1,j=k+e-1;for(h=0;h<f;++h)a.set(b+h,k,ka),a.set(b+h,j,ka);for(h=0;h<e;++h)a.set(b,k+h,ka),a.set(r,k+h,ka)}else{d.beginPath();T===c.CORNERS&&(f-=b,e-=k);T===c.RADIUS&&(f*=2,e*=2);if(T===c.CENTER||T===c.RADIUS)b-=f/2,k-=e/2;d.rect(g.round(b)-0,g.round(k)-0,g.round(f)+0,g.round(e)+0);ea();Y();d.closePath()}};I.prototype.rect=function(a,c,f,e){var h=new C;h.translate(a,c,0);
h.scale(f,e,1);h.transpose();c=new C;c.scale(1,-1,1);c.apply(V.array());c.transpose();pa>0&&O&&(d.useProgram(F),w("model2d",F,"model",!1,h.array()),w("view2d",F,"view",!1,c.array()),v("color2d",F,"color",oa),q("picktype2d",F,"picktype",0),s("vertex2d",F,"Vertex",3,nc),J("aTextureCoord2d",F,"aTextureCoord"),d.drawArrays(d.LINE_LOOP,0,Uc.length/3));U&&(d.useProgram(u),w("model3d",u,"model",!1,h.array()),w("view3d",u,"view",!1,c.array()),d.enable(d.POLYGON_OFFSET_FILL),d.polygonOffset(1,1),v("color3d",
u,"color",na),K>0?(a=new C,a.set(c),c=new C,c.set(h),a.mult(c),h=new C,h.set(a),h.invert(),h.transpose(),w("normalTransform3d",u,"normalTransform",!1,h.array()),s("normal3d",u,"Normal",3,Lc)):J("normal3d",u,"Normal"),s("vertex3d",u,"Vertex",3,nc),d.drawArrays(d.TRIANGLE_FAN,0,Uc.length/3),d.disable(d.POLYGON_OFFSET_FILL))};M.prototype.ellipse=function(a,d,f,e){a=a||0;d=d||0;if(!(f<=0&&e<=0)){ba===c.RADIUS&&(f*=2,e*=2);ba===c.CORNERS&&(f-=a,e-=d);if(ba===c.CORNER||ba===c.CORNERS)a+=f/2,d+=e/2;return{x:a,
y:d,width:f,height:e}}};E.prototype.ellipse=function(b,k,f,e){var h=M.prototype.ellipse.apply(this,arguments);if(h)if(b=h.x,k=h.y,f=h.width,e=h.height,f===e)d.beginPath(),d.arc(b-0,k-0,f/2,0,c.TWO_PI,!1),ea(),Y(),d.closePath();else{var h=f/2,g=e/2,j=0.5522847498307933*h,l=0.5522847498307933*g;a.beginShape();a.vertex(b+h,k);a.bezierVertex(b+h,k-l,b+j,k-g,b,k-g);a.bezierVertex(b-j,k-g,b-h,k-l,b-h,k);a.bezierVertex(b-h,k+l,b-j,k+g,b,k+g);a.bezierVertex(b+j,k+g,b+h,k+l,b+h,k);a.endShape()}};I.prototype.ellipse=
function(b,c,d,e){var h=M.prototype.ellipse.apply(this,arguments);if(h){var b=h.x,c=h.y,d=h.width,e=h.height,h=d/2,f=e/2,j=0.5522847498307933*h,g=0.5522847498307933*f;a.beginShape();a.vertex(b+h,c);a.bezierVertex(b+h,c-g,0,b+j,c-f,0,b,c-f,0);a.bezierVertex(b-j,c-f,0,b-h,c-g,0,b-h,c,0);a.bezierVertex(b-h,c+g,0,b-j,c+f,0,b,c+f,0);a.bezierVertex(b+j,c+f,0,b+h,c+g,0,b+h,c,0);a.endShape();if(U){var g=j=0,i;for(i=0;i<o.length;i++)j+=o[i][0],g+=o[i][1];j/=o.length;g/=o.length;i=[];h=[];f=[];i[0]=j;i[1]=
g;i[2]=0;i[3]=0;i[4]=0;i[5]=na[0];i[6]=na[1];i[7]=na[2];i[8]=na[3];i[9]=oa[0];i[10]=oa[1];i[11]=oa[2];i[12]=oa[3];i[13]=za;i[14]=ob;i[15]=fb;o.unshift(i);for(i=0;i<o.length;i++){for(j=0;j<3;j++)h.push(o[i][j]);for(j=5;j<9;j++)f.push(o[i][j])}cb(h,"TRIANGLE_FAN",f)}}};a.normal=function(a,d,f){if(arguments.length!==3||!(typeof a==="number"&&typeof d==="number"&&typeof f==="number"))throw"normal() requires three numeric arguments.";za=a;ob=d;fb=f;if(W!==0)if(hb===c.NORMAL_MODE_AUTO)hb=c.NORMAL_MODE_SHAPE;
else if(hb===c.NORMAL_MODE_SHAPE)hb=c.NORMAL_MODE_VERTEX};a.save=function(b,c){return c!==p?X.open(c.toDataURL(),"_blank"):X.open(a.externals.canvas.toDataURL(),"_blank")};var Fd=0;a.saveFrame=function(b){b===p&&(b="screen-####.png");b=b.replace(/#+/,function(a){for(var b=""+Fd++;b.length<a.length;)b="0"+b;return b});a.save(b)};var yd=A.createElement("canvas").getContext("2d"),ad=[p,p,p],Ka=function(b,d,f){this.get=function(b,c,d,e){if(arguments.length)if(arguments.length===2)return a.get(b,c,this);
else{if(arguments.length===4)return a.get(b,c,d,e,this)}else return a.get(this)};this.set=function(b,c,d){a.set(b,c,d,this)};this.blend=function(b,c,d,e,k,h,f,m,g,r){arguments.length===9?a.blend(this,b,c,d,e,k,h,f,m,g,this):arguments.length===10&&a.blend(b,c,d,e,k,h,f,m,g,r,this);delete this.sourceImg};this.copy=function(b,d,e,k,h,f,m,g,r){arguments.length===8?a.blend(this,b,d,e,k,h,f,m,g,c.REPLACE,this):arguments.length===9&&a.blend(b,d,e,k,h,f,m,g,r,c.REPLACE,this);delete this.sourceImg};this.filter=
function(b,c){arguments.length===2?a.filter(b,c,this):arguments.length===1&&a.filter(b,null,this);delete this.sourceImg};this.save=function(b){a.save(b,this)};this.resize=function(a,b){if(this.isRemote)throw"Image is loaded remotely. Cannot resize.";else if(this.width!==0||this.height!==0){a===0&&b!==0?a=g.floor(this.width/this.height*b):b===0&&a!==0&&(b=g.floor(this.height/this.width*a));var c=ma(this.imageData).canvas;this.fromImageData(ma(c,a,b).context.getImageData(0,0,a,b))}};this.mask=function(a){this.__mask=
p;if(a instanceof Ka)if(a.width===this.width&&a.height===this.height)this.__mask=a;else throw"mask must have the same dimensions as PImage.";else if(a instanceof Array)if(this.pixels.length===a.length)this.__mask=a;else throw"mask array must be the same length as PImage pixels array.";};this.pixels={getLength:function(a){if(a.isRemote)throw"Image is loaded remotely. Cannot get length.";else return function(){return a.imageData.data.length?a.imageData.data.length/4:0}}(this),getPixel:function(b){if(b.isRemote)throw"Image is loaded remotely. Cannot get pixels.";
else return function(c){c*=4;return a.color.toInt(b.imageData.data[c],b.imageData.data[c+1],b.imageData.data[c+2],b.imageData.data[c+3])}}(this),setPixel:function(a){if(a.isRemote)throw"Image is loaded remotely. Cannot set pixel.";else return function(b,d){var e=b*4;a.imageData.data[e+0]=(d&c.RED_MASK)>>>16;a.imageData.data[e+1]=(d&c.GREEN_MASK)>>>8;a.imageData.data[e+2]=d&c.BLUE_MASK;a.imageData.data[e+3]=(d&c.ALPHA_MASK)>>>24}}(this),set:function(a){if(this.isRemote)throw"Image is loaded remotely. Cannot set pixels.";
else for(var b=0,c=a.length;b<c;b++)this.setPixel(b,a[b])}};this.loadPixels=function(){};this.updatePixels=function(){};this.toImageData=function(){return this.isRemote?this.sourceImg:ma(this.imageData).context.getImageData(0,0,this.width,this.height)};this.toDataURL=function(){if(this.isRemote)throw"Image is loaded remotely. Cannot create dataURI.";else return ma(this.imageData).canvas.toDataURL()};this.fromImageData=function(a){this.width=a.width;this.height=a.height;this.imageData=a;this.format=
c.ARGB};this.fromHTMLImageData=function(a){var b=ma(a);try{this.fromImageData(b.context.getImageData(0,0,a.width,a.height))}catch(c){if(a.width&&a.height)this.isRemote=!0,this.width=a.width,this.height=a.height}this.sourceImg=a};if(arguments.length===1)this.fromHTMLImageData(arguments[0]);else if(arguments.length===2||arguments.length===3){if(this.width=b||1,this.height=d||1,this.imageData=yd.createImageData(this.width,this.height),this.format=f===c.ARGB||f===c.ALPHA?f:c.RGB,this.format===c.RGB)for(var e=
3,h=this.imageData.data,r=h.length;e<r;e+=4)h[e]=255}else this.height=this.width=0,this.imageData=yd.createImageData(1,1),this.format=c.ARGB};a.PImage=Ka;a.createImage=function(a,c,d){return new Ka(a,c,d)};a.loadImage=function(a,c,d){c&&(a=a+"."+c);if($.imageCache.images[a])c=new Ka($.imageCache.images[a]),c.loaded=!0;else{var c=new Ka,e=A.createElement("img");c.sourceImg=e;e.onload=function(a,b,c){return function(){b.fromHTMLImageData(a);b.loaded=!0;c&&c()}}(e,c,d);e.src=a}return c};a.requestImage=
a.loadImage;a.get=function(b,k,f,e,h){if(arguments.length===2){var r;if(b<a.width&&b>=0&&k>=0&&k<a.height)if(bc){var j=((0|b)+a.width*(0|k))*4;r=a.imageData.data;r=a.color.toInt(r[j],r[j+1],r[j+2],r[j+3])}else r=d.getImageData(0|b,0|k,1,1).data,r=a.color.toInt(r[0],r[1],r[2],r[3]);else r=0;return r}else if(arguments.length===0)return r=new Ka(a.width,a.height,c.RGB),r.fromImageData(d.getImageData(0,0,a.width,a.height)),r;else if(arguments.length===5){if(h.isRemote)throw"Image is loaded remotely. Cannot get x,y,w,h.";
else{r=new Ka(f,e,c.RGB);for(var j=r.imageData.data,l=h.width,i=h.height,p=h.imageData.data,o=g.max(0,-k),q=g.max(0,-b),i=g.min(e,i-k),n=g.min(f,l-b);o<i;++o)for(var s=((k+o)*l+(b+q))*4,v=(o*f+q)*4,u=q;u<n;++u)j[v++]=p[s++],j[v++]=p[s++],j[v++]=p[s++],j[v++]=p[s++]}return r}else if(arguments.length===4)return r=new Ka(f,e,c.RGB),r.fromImageData(d.getImageData(b,k,f,e)),r;else if(arguments.length===3){if(f.isRemote)throw"Image is loaded remotely. Cannot get x,y.";else r=k*f.width*4+b*4,r=a.color.toInt(f.imageData.data[r],
f.imageData.data[r+1],f.imageData.data[r+2],f.imageData.data[r+3]);return r}else if(arguments.length===1)return b};a.createGraphics=function(a,c,d){var e=new z;e.size(a,c,d);return e};a.set=function(b,c,f,e){if(arguments.length===3)typeof f==="number"?b<a.width&&b>=0&&c>=0&&c<a.height&&(bc||(a.loadPixels(),Sc===null&&(bd=d,Sc=new La),bc=!0,d=Sc,ld=0),a.pixels.setPixel((0|b)+a.width*(0|c),f),++ld>md&&Ba()):f instanceof Ka&&a.image(f,b,c);else if(arguments.length===4)if(e.isRemote)throw"Image is loaded remotely. Cannot set x,y.";
else{var h=a.color.toArray(f),g=c*e.width*4+b*4,j=e.imageData.data;j[g]=h[0];j[g+1]=h[1];j[g+2]=h[2];j[g+3]=h[3]}};a.imageData={};a.pixels={getLength:function(){return a.imageData.data.length?a.imageData.data.length/4:0},getPixel:function(b){b*=4;return a.imageData.data[b+3]<<24&4278190080|a.imageData.data[b+0]<<16&16711680|a.imageData.data[b+1]<<8&65280|a.imageData.data[b+2]&255},setPixel:function(b,c){var d=b*4;a.imageData.data[d+0]=(c&16711680)>>>16;a.imageData.data[d+1]=(c&65280)>>>8;a.imageData.data[d+
2]=c&255;a.imageData.data[d+3]=(c&4278190080)>>>24},set:function(a){for(var c=0,d=a.length;c<d;c++)this.setPixel(c,a[c])}};a.loadPixels=function(){a.imageData=ga.$ensureContext().getImageData(0,0,a.width,a.height)};a.updatePixels=function(){a.imageData&&ga.$ensureContext().putImageData(a.imageData,0,0)};a.hint=function(a){var d=ga.$ensureContext();a===c.DISABLE_DEPTH_TEST?(d.disable(d.DEPTH_TEST),d.depthMask(!1),d.clear(d.DEPTH_BUFFER_BIT)):a===c.ENABLE_DEPTH_TEST&&(d.enable(d.DEPTH_TEST),d.depthMask(!0))};
var zd=function(b,c,d,e){if(b instanceof Ka)if(b.loaded){if(b.width!==a.width||b.height!==a.height)throw"Background image must be the same dimensions as the canvas.";}else throw"Error using image in background(): PImage not loaded.";else b=a.color(b,c,d,e);Za=b};E.prototype.background=function(b,c,f,e){b!==p&&zd(b,c,f,e);Za instanceof Ka?(d.save(),d.setTransform(1,0,0,1,0,0),a.image(Za,0,0)):(d.save(),d.setTransform(1,0,0,1,0,0),a.alpha(Za)!==Z&&d.clearRect(0,0,a.width,a.height),d.fillStyle=a.color.toString(Za),
d.fillRect(0,0,a.width,a.height),Ga=!0);zb()};I.prototype.background=function(b,c,f,e){arguments.length>0&&zd(b,c,f,e);var h=a.color.toGLArray(Za);d.clearColor(h[0],h[1],h[2],h[3]);d.clear(d.COLOR_BUFFER_BIT|d.DEPTH_BUFFER_BIT)};E.prototype.image=function(a,c,f,e,h){if(a.width>0){var g=tc(c||0,f||0,e||a.width,h||a.height,arguments.length<4);if(a.sourceImg&&nb===null&&!a.__mask){var j=a.sourceImg;d.drawImage(j,0,0,j.width,j.height,g.x,g.y,g.w,g.h)}else{j=a.toImageData();if(a.__mask){var l,i;if(a.__mask instanceof
Ka){var p=a.__mask.toImageData();l=2;for(i=a.width*a.height*4;l<i;l+=4)j.data[l+1]=p.data[l]}else{l=0;for(i=a.__mask.length;l<i;++l)j.data[(l<<2)+3]=a.__mask[l]}}nb!==null&&nb(j);d.drawImage(ma(j).canvas,0,0,a.width,a.height,g.x,g.y,g.w,g.h)}}};I.prototype.image=function(b,c,d,e,h){b.width>0&&(e=e||b.width,h=h||b.height,a.beginShape(a.QUADS),a.texture(b.externals.canvas),a.vertex(c,d,0,0,0),a.vertex(c,d+h,0,0,h),a.vertex(c+e,d+h,0,e,h),a.vertex(c+e,d,0,e,0),a.endShape())};a.tint=function(){var b=
a.color.apply(this,arguments),c=a.red(b)/ia,d=a.green(b)/xa,e=a.blue(b)/B,h=a.alpha(b)/Z;nb=function(a){for(var b=a.data,a=4*a.width*a.height,f=0;f<a;)b[f++]*=c,b[f++]*=d,b[f++]*=e,b[f++]*=h}};a.noTint=function(){nb=null};a.copy=function(b,d,f,e,h,g,j,l,i){arguments.length===8&&(i=l,l=j,j=g,g=h,h=e,e=f,f=d,d=b,b=a);a.blend(b,d,f,e,h,g,j,l,i,c.REPLACE)};a.blend=function(b,c,d,e,h,f,g,l,i,p,o){arguments.length===9&&(p=i,i=l,l=g,g=f,f=h,h=e,e=d,d=c,c=b,b=a);var q=c+e,n=d+h,s=f+l,v=g+i,u;if(b.isRemote)throw"Image is loaded remotely. Cannot blend image.";
else arguments.length===10||arguments.length===9?(a.loadPixels(),u=a):arguments.length===11&&o&&o.imageData&&(u=o),b===a?a.intersect(c,d,q,n,f,g,s,v)?a.blit_resize(a.get(c,d,q-c,n-d),0,0,q-c-1,n-d-1,u.imageData.data,u.width,u.height,f,g,s,v,p):a.blit_resize(b,c,d,q,n,u.imageData.data,u.width,u.height,f,g,s,v,p):(b.loadPixels(),a.blit_resize(b,c,d,q,n,u.imageData.data,u.width,u.height,f,g,s,v,p)),arguments.length===10&&a.updatePixels()};var Ad=function(a,c){var d=0,e=c.pixels.getLength(),h=new Cd(e),
f,g,l,i,p,o,q,n,s,v,u,t;if(a)for(;d<e;){f=d;for(g=d+c.width;d<g;)l=i=c.pixels.getPixel(d),o=d-1,p=d+1,q=d-c.width,n=d+c.width,o<f&&(o=d),p>=g&&(p=d),q<0&&(q=0),n>=e&&(n=d),q=c.pixels.getPixel(q),o=c.pixels.getPixel(o),n=c.pixels.getPixel(n),p=c.pixels.getPixel(p),l=77*(l>>16&255)+151*(l>>8&255)+28*(l&255),v=77*(o>>16&255)+151*(o>>8&255)+28*(o&255),s=77*(p>>16&255)+151*(p>>8&255)+28*(p&255),u=77*(q>>16&255)+151*(q>>8&255)+28*(q&255),t=77*(n>>16&255)+151*(n>>8&255)+28*(n&255),v<l&&(i=o,l=v),s<l&&(i=
p,l=s),u<l&&(i=q,l=u),t<l&&(i=n),h[d++]=i}else for(;d<e;){f=d;for(g=d+c.width;d<g;)l=i=c.pixels.getPixel(d),o=d-1,p=d+1,q=d-c.width,n=d+c.width,o<f&&(o=d),p>=g&&(p=d),q<0&&(q=0),n>=e&&(n=d),q=c.pixels.getPixel(q),o=c.pixels.getPixel(o),n=c.pixels.getPixel(n),p=c.pixels.getPixel(p),l=77*(l>>16&255)+151*(l>>8&255)+28*(l&255),v=77*(o>>16&255)+151*(o>>8&255)+28*(o&255),s=77*(p>>16&255)+151*(p>>8&255)+28*(p&255),u=77*(q>>16&255)+151*(q>>8&255)+28*(q&255),t=77*(n>>16&255)+151*(n>>8&255)+28*(n&255),v>l&&
(i=o,l=v),s>l&&(i=p,l=s),u>l&&(i=q,l=u),t>l&&(i=n),h[d++]=i}c.pixels.set(h)};a.filter=function(b,d,f){var e,h,g,j;arguments.length===3?(f.loadPixels(),e=f):(a.loadPixels(),e=a);d===p&&(d=null);if(e.isRemote)throw"Image is loaded remotely. Cannot filter image.";else{var l=e.pixels.getLength();switch(b){case c.BLUR:var i=d||1,o=e,q,s,n,v,u,w,t,x,z;g=o.pixels.getLength();j=new L(g);l=new L(g);h=new L(g);g=new L(g);var Q=0,B,C,G,i=a.floor(i*3.5),A,i=i<1?1:i<248?i:248;if(a.shared.blurRadius!==i){a.shared.blurRadius=
i;a.shared.blurKernelSize=1+(a.shared.blurRadius<<1);a.shared.blurKernel=new L(a.shared.blurKernelSize);var D=a.shared.blurKernel,F=a.shared.blurKernelSize;for(A=0;A<F;A++)D[A]=0;F=(i-1)*(i-1);for(A=1;A<i;A++)D[i+A]=D[void 0]=F;D[i]=i*i}i=o.height;A=o.width;D=a.shared.blurKernelSize;x=a.shared.blurRadius;var F=a.shared.blurKernel,E=o.imageData.data;for(C=0;C<i;C++){for(B=0;B<A;B++){n=s=q=v=o=0;w=B-x;if(w<0)u=-w,w=0;else{if(w>=A)break;u=0}for(G=u;G<D;G++){if(w>=A)break;t=(w+Q)*4;u=F[G];v+=u*E[t+3];
q+=u*E[t];s+=u*E[t+1];n+=u*E[t+2];o+=u;w++}t=Q+B;g[t]=v/o;j[t]=q/o;l[t]=s/o;h[t]=n/o}Q+=A}Q=0;x=-x;z=x*A;for(C=0;C<i;C++){for(B=0;B<A;B++){n=s=q=v=o=0;if(x<0)u=t=-x,w=B;else{if(x>=i)break;u=0;t=x;w=B+z}for(G=u;G<D;G++){if(t>=i)break;u=F[G];v+=u*g[w];q+=u*j[w];s+=u*l[w];n+=u*h[w];o+=u;t++;w+=A}t=(B+Q)*4;E[t]=q/o;E[t+1]=s/o;E[t+2]=n/o;E[t+3]=v/o}Q+=A;z+=A;x++}break;case c.GRAY:if(e.format===c.ALPHA){for(j=0;j<l;j++)h=255-e.pixels.getPixel(j),e.pixels.setPixel(j,4278190080|h<<16|h<<8|h);e.format=c.RGB}else for(j=
0;j<l;j++)h=e.pixels.getPixel(j),g=77*(h>>16&255)+151*(h>>8&255)+28*(h&255)>>8,e.pixels.setPixel(j,h&c.ALPHA_MASK|g<<16|g<<8|g);break;case c.INVERT:for(j=0;j<l;j++)e.pixels.setPixel(j,e.pixels.getPixel(j)^16777215);break;case c.POSTERIZE:if(d===null)throw"Use filter(POSTERIZE, int levels) instead of filter(POSTERIZE)";h=a.floor(d);if(h<2||h>255)throw"Levels must be between 2 and 255 for filter(POSTERIZE, levels)";g=h-1;for(j=0;j<l;j++)Q=e.pixels.getPixel(j)>>16&255,i=e.pixels.getPixel(j)>>8&255,A=
e.pixels.getPixel(j)&255,Q=(Q*h>>8)*255/g,i=(i*h>>8)*255/g,A=(A*h>>8)*255/g,e.pixels.setPixel(j,4278190080&e.pixels.getPixel(j)|Q<<16|i<<8|A);break;case c.OPAQUE:for(j=0;j<l;j++)e.pixels.setPixel(j,e.pixels.getPixel(j)|4278190080);e.format=c.RGB;break;case c.THRESHOLD:d===null&&(d=0.5);if(d<0||d>1)throw"Level must be between 0 and 1 for filter(THRESHOLD, level)";h=a.floor(d*255);for(j=0;j<l;j++)g=a.max((e.pixels.getPixel(j)&c.RED_MASK)>>16,a.max((e.pixels.getPixel(j)&c.GREEN_MASK)>>8,e.pixels.getPixel(j)&
c.BLUE_MASK)),e.pixels.setPixel(j,e.pixels.getPixel(j)&c.ALPHA_MASK|(g<h?0:16777215));break;case c.ERODE:Ad(!0,e);break;case c.DILATE:Ad(!1,e)}e.updatePixels()}};a.shared={fracU:0,ifU:0,fracV:0,ifV:0,u1:0,u2:0,v1:0,v2:0,sX:0,sY:0,iw:0,iw1:0,ih1:0,ul:0,ll:0,ur:0,lr:0,cUL:0,cLL:0,cUR:0,cLR:0,srcXOffset:0,srcYOffset:0,r:0,g:0,b:0,a:0,srcBuffer:null,blurRadius:0,blurKernelSize:0,blurKernel:null};a.intersect=function(a,c,d,e,h,f,g,l){d=d-a+1;e=e-c+1;g=g-h+1;l=l-f+1;h<a?(g+=h-a,g>d&&(g=d)):(a=d+a-h,g>a&&
(g=a));f<c?(l+=f-c,l>e&&(l=e)):(c=e+c-f,l>c&&(l=c));return!(g<=0||l<=0)};a.filter_new_scanline=function(){a.shared.sX=a.shared.srcXOffset;a.shared.fracV=a.shared.srcYOffset&c.PREC_MAXVAL;a.shared.ifV=c.PREC_MAXVAL-a.shared.fracV;a.shared.v1=(a.shared.srcYOffset>>c.PRECISIONB)*a.shared.iw;a.shared.v2=g.min((a.shared.srcYOffset>>c.PRECISIONB)+1,a.shared.ih1)*a.shared.iw};a.filter_bilinear=function(){a.shared.fracU=a.shared.sX&c.PREC_MAXVAL;a.shared.ifU=c.PREC_MAXVAL-a.shared.fracU;a.shared.ul=a.shared.ifU*
a.shared.ifV>>c.PRECISIONB;a.shared.ll=a.shared.ifU*a.shared.fracV>>c.PRECISIONB;a.shared.ur=a.shared.fracU*a.shared.ifV>>c.PRECISIONB;a.shared.lr=a.shared.fracU*a.shared.fracV>>c.PRECISIONB;a.shared.u1=a.shared.sX>>c.PRECISIONB;a.shared.u2=g.min(a.shared.u1+1,a.shared.iw1);var b=(a.shared.v1+a.shared.u1)*4,d=(a.shared.v1+a.shared.u2)*4,f=(a.shared.v2+a.shared.u1)*4,e=(a.shared.v2+a.shared.u2)*4;a.shared.cUL=a.color.toInt(a.shared.srcBuffer[b],a.shared.srcBuffer[b+1],a.shared.srcBuffer[b+2],a.shared.srcBuffer[b+
3]);a.shared.cUR=a.color.toInt(a.shared.srcBuffer[d],a.shared.srcBuffer[d+1],a.shared.srcBuffer[d+2],a.shared.srcBuffer[d+3]);a.shared.cLL=a.color.toInt(a.shared.srcBuffer[f],a.shared.srcBuffer[f+1],a.shared.srcBuffer[f+2],a.shared.srcBuffer[f+3]);a.shared.cLR=a.color.toInt(a.shared.srcBuffer[e],a.shared.srcBuffer[e+1],a.shared.srcBuffer[e+2],a.shared.srcBuffer[e+3]);a.shared.r=a.shared.ul*((a.shared.cUL&c.RED_MASK)>>16)+a.shared.ll*((a.shared.cLL&c.RED_MASK)>>16)+a.shared.ur*((a.shared.cUR&c.RED_MASK)>>
16)+a.shared.lr*((a.shared.cLR&c.RED_MASK)>>16)<<c.PREC_RED_SHIFT&c.RED_MASK;a.shared.g=a.shared.ul*(a.shared.cUL&c.GREEN_MASK)+a.shared.ll*(a.shared.cLL&c.GREEN_MASK)+a.shared.ur*(a.shared.cUR&c.GREEN_MASK)+a.shared.lr*(a.shared.cLR&c.GREEN_MASK)>>>c.PRECISIONB&c.GREEN_MASK;a.shared.b=a.shared.ul*(a.shared.cUL&c.BLUE_MASK)+a.shared.ll*(a.shared.cLL&c.BLUE_MASK)+a.shared.ur*(a.shared.cUR&c.BLUE_MASK)+a.shared.lr*(a.shared.cLR&c.BLUE_MASK)>>>c.PRECISIONB;a.shared.a=a.shared.ul*((a.shared.cUL&c.ALPHA_MASK)>>>
24)+a.shared.ll*((a.shared.cLL&c.ALPHA_MASK)>>>24)+a.shared.ur*((a.shared.cUR&c.ALPHA_MASK)>>>24)+a.shared.lr*((a.shared.cLR&c.ALPHA_MASK)>>>24)<<c.PREC_ALPHA_SHIFT&c.ALPHA_MASK;return a.shared.a|a.shared.r|a.shared.g|a.shared.b};a.blit_resize=function(b,d,f,e,h,i,j,l,o,p,q,s,n){d<0&&(d=0);f<0&&(f=0);e>=b.width&&(e=b.width-1);h>=b.height&&(h=b.height-1);e-=d;h-=f;q-=o;s-=p;if(!(q<=0||s<=0||e<=0||h<=0||o>=j||p>=l||d>=b.width||f>=b.height))switch(e=g.floor(e/q*c.PRECISIONF),h=g.floor(h/s*c.PRECISIONF),
a.shared.srcXOffset=g.floor(o<0?-o*e:d*c.PRECISIONF),a.shared.srcYOffset=g.floor(p<0?-p*h:f*c.PRECISIONF),o<0&&(q+=o,o=0),p<0&&(s+=p,p=0),q=g.min(q,j-o),s=g.min(s,l-p),d=p*j+o,a.shared.srcBuffer=b.imageData.data,a.shared.iw=b.width,a.shared.iw1=b.width-1,a.shared.ih1=b.height-1,n){case c.BLEND:for(f=0;f<s;f++){a.filter_new_scanline();for(n=0;n<q;n++)l=a.color.toInt(i[(d+n)*4],i[(d+n)*4+1],i[(d+n)*4+2],i[(d+n)*4+3]),l=a.color.toArray(a.modes.blend(l,a.filter_bilinear())),i[(d+n)*4]=l[0],i[(d+n)*4+
1]=l[1],i[(d+n)*4+2]=l[2],i[(d+n)*4+3]=l[3],a.shared.sX+=e;d+=j;a.shared.srcYOffset+=h}break;case c.ADD:for(f=0;f<s;f++){a.filter_new_scanline();for(n=0;n<q;n++)l=a.color.toInt(i[(d+n)*4],i[(d+n)*4+1],i[(d+n)*4+2],i[(d+n)*4+3]),l=a.color.toArray(a.modes.add(l,a.filter_bilinear())),i[(d+n)*4]=l[0],i[(d+n)*4+1]=l[1],i[(d+n)*4+2]=l[2],i[(d+n)*4+3]=l[3],a.shared.sX+=e;d+=j;a.shared.srcYOffset+=h}break;case c.SUBTRACT:for(f=0;f<s;f++){a.filter_new_scanline();for(n=0;n<q;n++)l=a.color.toInt(i[(d+n)*4],
i[(d+n)*4+1],i[(d+n)*4+2],i[(d+n)*4+3]),l=a.color.toArray(a.modes.subtract(l,a.filter_bilinear())),i[(d+n)*4]=l[0],i[(d+n)*4+1]=l[1],i[(d+n)*4+2]=l[2],i[(d+n)*4+3]=l[3],a.shared.sX+=e;d+=j;a.shared.srcYOffset+=h}break;case c.LIGHTEST:for(f=0;f<s;f++){a.filter_new_scanline();for(n=0;n<q;n++)l=a.color.toInt(i[(d+n)*4],i[(d+n)*4+1],i[(d+n)*4+2],i[(d+n)*4+3]),l=a.color.toArray(a.modes.lightest(l,a.filter_bilinear())),i[(d+n)*4]=l[0],i[(d+n)*4+1]=l[1],i[(d+n)*4+2]=l[2],i[(d+n)*4+3]=l[3],a.shared.sX+=e;
d+=j;a.shared.srcYOffset+=h}break;case c.DARKEST:for(f=0;f<s;f++){a.filter_new_scanline();for(n=0;n<q;n++)l=a.color.toInt(i[(d+n)*4],i[(d+n)*4+1],i[(d+n)*4+2],i[(d+n)*4+3]),l=a.color.toArray(a.modes.darkest(l,a.filter_bilinear())),i[(d+n)*4]=l[0],i[(d+n)*4+1]=l[1],i[(d+n)*4+2]=l[2],i[(d+n)*4+3]=l[3],a.shared.sX+=e;d+=j;a.shared.srcYOffset+=h}break;case c.REPLACE:for(f=0;f<s;f++){a.filter_new_scanline();for(n=0;n<q;n++)l=a.color.toInt(i[(d+n)*4],i[(d+n)*4+1],i[(d+n)*4+2],i[(d+n)*4+3]),l=b.format!==
c.RGB&&i[(d+n)*4]!==255?a.color.toArray(a.modes.blend(l,a.filter_bilinear())):a.color.toArray(a.filter_bilinear()),i[(d+n)*4]=l[0],i[(d+n)*4+1]=l[1],i[(d+n)*4+2]=l[2],i[(d+n)*4+3]=l[3],a.shared.sX+=e;d+=j;a.shared.srcYOffset+=h}break;case c.DIFFERENCE:for(f=0;f<s;f++){a.filter_new_scanline();for(n=0;n<q;n++)l=a.color.toInt(i[(d+n)*4],i[(d+n)*4+1],i[(d+n)*4+2],i[(d+n)*4+3]),l=a.color.toArray(a.modes.difference(l,a.filter_bilinear())),i[(d+n)*4]=l[0],i[(d+n)*4+1]=l[1],i[(d+n)*4+2]=l[2],i[(d+n)*4+3]=
l[3],a.shared.sX+=e;d+=j;a.shared.srcYOffset+=h}break;case c.EXCLUSION:for(f=0;f<s;f++){a.filter_new_scanline();for(n=0;n<q;n++)l=a.color.toInt(i[(d+n)*4],i[(d+n)*4+1],i[(d+n)*4+2],i[(d+n)*4+3]),l=a.color.toArray(a.modes.exclusion(l,a.filter_bilinear())),i[(d+n)*4]=l[0],i[(d+n)*4+1]=l[1],i[(d+n)*4+2]=l[2],i[(d+n)*4+3]=l[3],a.shared.sX+=e;d+=j;a.shared.srcYOffset+=h}break;case c.MULTIPLY:for(f=0;f<s;f++){a.filter_new_scanline();for(n=0;n<q;n++)l=a.color.toInt(i[(d+n)*4],i[(d+n)*4+1],i[(d+n)*4+2],i[(d+
n)*4+3]),l=a.color.toArray(a.modes.multiply(l,a.filter_bilinear())),i[(d+n)*4]=l[0],i[(d+n)*4+1]=l[1],i[(d+n)*4+2]=l[2],i[(d+n)*4+3]=l[3],a.shared.sX+=e;d+=j;a.shared.srcYOffset+=h}break;case c.SCREEN:for(f=0;f<s;f++){a.filter_new_scanline();for(n=0;n<q;n++)l=a.color.toInt(i[(d+n)*4],i[(d+n)*4+1],i[(d+n)*4+2],i[(d+n)*4+3]),l=a.color.toArray(a.modes.screen(l,a.filter_bilinear())),i[(d+n)*4]=l[0],i[(d+n)*4+1]=l[1],i[(d+n)*4+2]=l[2],i[(d+n)*4+3]=l[3],a.shared.sX+=e;d+=j;a.shared.srcYOffset+=h}break;
case c.OVERLAY:for(f=0;f<s;f++){a.filter_new_scanline();for(n=0;n<q;n++)l=a.color.toInt(i[(d+n)*4],i[(d+n)*4+1],i[(d+n)*4+2],i[(d+n)*4+3]),l=a.color.toArray(a.modes.overlay(l,a.filter_bilinear())),i[(d+n)*4]=l[0],i[(d+n)*4+1]=l[1],i[(d+n)*4+2]=l[2],i[(d+n)*4+3]=l[3],a.shared.sX+=e;d+=j;a.shared.srcYOffset+=h}break;case c.HARD_LIGHT:for(f=0;f<s;f++){a.filter_new_scanline();for(n=0;n<q;n++)l=a.color.toInt(i[(d+n)*4],i[(d+n)*4+1],i[(d+n)*4+2],i[(d+n)*4+3]),l=a.color.toArray(a.modes.hard_light(l,a.filter_bilinear())),
i[(d+n)*4]=l[0],i[(d+n)*4+1]=l[1],i[(d+n)*4+2]=l[2],i[(d+n)*4+3]=l[3],a.shared.sX+=e;d+=j;a.shared.srcYOffset+=h}break;case c.SOFT_LIGHT:for(f=0;f<s;f++){a.filter_new_scanline();for(n=0;n<q;n++)l=a.color.toInt(i[(d+n)*4],i[(d+n)*4+1],i[(d+n)*4+2],i[(d+n)*4+3]),l=a.color.toArray(a.modes.soft_light(l,a.filter_bilinear())),i[(d+n)*4]=l[0],i[(d+n)*4+1]=l[1],i[(d+n)*4+2]=l[2],i[(d+n)*4+3]=l[3],a.shared.sX+=e;d+=j;a.shared.srcYOffset+=h}break;case c.DODGE:for(f=0;f<s;f++){a.filter_new_scanline();for(n=
0;n<q;n++)l=a.color.toInt(i[(d+n)*4],i[(d+n)*4+1],i[(d+n)*4+2],i[(d+n)*4+3]),l=a.color.toArray(a.modes.dodge(l,a.filter_bilinear())),i[(d+n)*4]=l[0],i[(d+n)*4+1]=l[1],i[(d+n)*4+2]=l[2],i[(d+n)*4+3]=l[3],a.shared.sX+=e;d+=j;a.shared.srcYOffset+=h}break;case c.BURN:for(f=0;f<s;f++){a.filter_new_scanline();for(n=0;n<q;n++)l=a.color.toInt(i[(d+n)*4],i[(d+n)*4+1],i[(d+n)*4+2],i[(d+n)*4+3]),l=a.color.toArray(a.modes.burn(l,a.filter_bilinear())),i[(d+n)*4]=l[0],i[(d+n)*4+1]=l[1],i[(d+n)*4+2]=l[2],i[(d+n)*
4+3]=l[3],a.shared.sX+=e;d+=j;a.shared.srcYOffset+=h}}};Pa.prototype.width=function(a){return"measureText"in d?d.measureText(typeof a==="number"?String.fromCharCode(a):a).width/S:0};Pa.list=function(){return["sans-serif","serif","monospace","fantasy","cursive"]};a.PFont=Pa;a.loadFont=function(b){if(b===p||b.indexOf(".svg")===-1)return new Pa(b);else{var c=a.loadGlyphs(b);return{name:b,glyph:!0,units_per_em:c.units_per_em,horiz_adv_x:1/c.units_per_em*c.horiz_adv_x,ascent:c.ascent,descent:c.descent,
width:function(c){for(var d=0,f=c.length,g=0;g<f;g++)try{d+=parseFloat(a.glyphLook(a.glyphTable[b],c[g]).horiz_adv_x)}catch(i){z.debug(i)}return d/a.glyphTable[b].units_per_em}}}};a.createFont=function(b,c){if(arguments.length===2)return a.textSize(c),a.loadFont(b);else if(arguments.length===3)return a.textSize(c),a.loadFont(b);else if(arguments.length===4)return a.textSize(c),a.loadFont(b);else throw"incorrent number of parameters for createFont";};a.textFont=function(b,c){ja=b;c?a.textSize(c):ga.$ensureContext().font=
S+"px "+ja.name};a.textSize=function(a){if(a)S=a,ga.$ensureContext().font=S+"px "+ja.name};a.textAlign=function(){arguments.length===1?Mb=arguments[0]:arguments.length===2&&(Mb=arguments[0],Lb=arguments[1])};E.prototype.textWidth=function(a){var a=Ea(a).split(/\r?\n/g),c=0,f,e=a.length;d.font=S+"px "+ja.name;for(f=0;f<e;++f)c=g.max(c,d.measureText(a[f]).width);return c};I.prototype.textWidth=function(a){var a=Ea(a).split(/\r?\n/g),c=0,d,e=a.length;Ha===p&&(Ha=A.createElement("canvas"));var f=Ha.getContext("2d");
f.font=S+"px "+ja.name;for(d=0;d<e;++d)c=g.max(c,f.measureText(a[d]).width);return c};a.textLeading=function(a){eb=a};a.textAscent=function(){var b=p,c=p,d=p,e=p;return function(){if(c!==ja||b!==S){c=ja;b=S;var f=!1,i=a.color(0),j=0,l=S,o=S/2;for(e=new Qa(ja.name,S,S,"k");o!==l;){for(var p=0;p<S;p++)e.get(p,o)!==i&&(f=!0,p=S);f?(l=o,f=!1):j=o;o=g.ceil((l+j)/2)}d=S-1-o+1}return d}}();a.textDescent=function(){var b=p,c=p,d=p,e=p;return function(){if(c!==ja||b!==S){c=ja;b=S;var f=!1,i=a.color(0),j=0,
l=S,o=S/2;for(e=new Qa(ja.name,S,0,"p");o!==l;){for(var p=0;p<S;p++)e.get(p,o)!==i&&(f=!0,p=S);f?(j=o,f=!1):l=o;o=g.ceil((l+j)/2)}d=o+1}return d}}();a.glyphLook=function(a,c){try{switch(c){case "1":return a.one;case "2":return a.two;case "3":return a.three;case "4":return a.four;case "5":return a.five;case "6":return a.six;case "7":return a.seven;case "8":return a.eight;case "9":return a.nine;case "0":return a.zero;case " ":return a.space;case "$":return a.dollar;case "!":return a.exclam;case '"':return a.quotedbl;
case "#":return a.numbersign;case "%":return a.percent;case "&":return a.ampersand;case "'":return a.quotesingle;case "(":return a.parenleft;case ")":return a.parenright;case "*":return a.asterisk;case "+":return a.plus;case ",":return a.comma;case "-":return a.hyphen;case ".":return a.period;case "/":return a.slash;case "_":return a.underscore;case ":":return a.colon;case ";":return a.semicolon;case "<":return a.less;case "=":return a.equal;case ">":return a.greater;case "?":return a.question;case "@":return a.at;
case "[":return a.bracketleft;case "\\":return a.backslash;case "]":return a.bracketright;case "^":return a.asciicircum;case "`":return a.grave;case "{":return a.braceleft;case "|":return a.bar;case "}":return a.braceright;case "~":return a.asciitilde;default:return a[c]}}catch(d){z.debug(d)}};E.prototype.text$line=function(b,f,g,e,h){e=e=0;if(ja.glyph){e=a.glyphTable[ja.name];d.save();d.translate(f,g+S);(h===c.RIGHT||h===c.CENTER)&&e.width(b);f=1/e.units_per_em*S;d.scale(f,f);f=0;for(g=b.length;f<
g;f++)try{a.glyphLook(e,b[f]).draw()}catch(i){z.debug(i)}zb()}else if(b&&"fillText"in d){if(Ga)d.fillStyle=a.color.toString(Fa),Ga=!1;if(h===c.RIGHT||h===c.CENTER)e=d.measureText(b).width,e=h===c.RIGHT?-e:-e/2;d.fillText(b,f+e,g)}};I.prototype.text$line=function(a,f,g,e,h){Ha===p&&(Ha=A.createElement("canvas"));var i=d;d=Ha.getContext("2d");d.font=S+"px "+ja.name;var j=d.measureText(a).width;Ha.width=j;Ha.height=S;d=Ha.getContext("2d");d.font=S+"px "+ja.name;d.textBaseline="top";E.prototype.text$line(a,
0,0,0,c.LEFT);a=Ha.width/Ha.height;d=i;d.bindTexture(d.TEXTURE_2D,jd);Tb(Ha);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE);i=0;h===c.RIGHT?i=-j:h===c.CENTER&&(i=-j/2);h=new C;j=S*0.5;h.translate(f+i-j/2,g-j,e);h.scale(-a*j,-j,j);h.translate(-1,-1,-1);h.transpose();f=new C;f.scale(1,-1,1);f.apply(V.array());
f.transpose();d.useProgram(F);s("vertex2d",F,"Vertex",3,Oc);s("aTextureCoord2d",F,"aTextureCoord",2,Pc);q("uSampler2d",F,"uSampler",[0]);q("picktype2d",F,"picktype",1);w("model2d",F,"model",!1,h.array());w("view2d",F,"view",!1,f.array());v("color2d",F,"color",na);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,Qc);d.drawElements(d.TRIANGLES,6,d.UNSIGNED_SHORT,0)};a.text=function(){if(Rc===c.SCREEN){a.pushMatrix();a.resetMatrix();var b=a.textAscent(),d=a.textDescent(),f=a.textWidth(arguments[0]),e=b+d,d=a.loadFont(ja.origName),
f=a.createGraphics(f,e);f.beginDraw();f.fill(Fa);f.opaque=!1;f.background(0,0,0,0);f.textFont(d);f.textSize(S);f.text(arguments[0],0,b);f.endDraw();arguments.length===5||arguments.length===6?a.image(f,arguments[1],arguments[2]-b,arguments[3],arguments[4]):a.image(f,arguments[1],arguments[2]-b);a.popMatrix()}else Rc!==c.SHAPE&&(arguments.length===3?ic(Ea(arguments[0]),arguments[1],arguments[2],0):arguments.length===4?ic(Ea(arguments[0]),arguments[1],arguments[2],arguments[3]):arguments.length===5?
Ab(Ea(arguments[0]),arguments[1],arguments[2],arguments[3],arguments[4],0):arguments.length===6&&Ab(Ea(arguments[0]),arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]))};a.textMode=function(a){Rc=a};a.loadGlyphs=function(b){var c,f,e,h,i,j,l,o,q,s,u,n,v=function(a,b){var c=0,d=[],e,f=RegExp(a,"g");for(e=d[c]=f.exec(b);e;)c++,e=d[c]=f.exec(b);return d},w=function(a){var b=v("[A-Za-z][0-9\\- ]+|Z",a);n="return {draw:function(){var curContext=beforePathDraw();curContext.beginPath();";
o=a=j=i=h=e=f=c=0;q="";s=b.length-1;for(var l=0;l<s;l++){var p=b[l][0],a=v("[0-9\\-]+",p);switch(p[0]){case "M":c=parseFloat(a[0][0]);f=parseFloat(a[1][0]);n+="curContext.moveTo("+c+","+-f+");";break;case "L":c=parseFloat(a[0][0]);f=parseFloat(a[1][0]);n+="curContext.lineTo("+c+","+-f+");";break;case "H":c=parseFloat(a[0][0]);n+="curContext.lineTo("+c+","+-f+");";break;case "V":f=parseFloat(a[0][0]);n+="curContext.lineTo("+c+","+-f+");";break;case "T":i=parseFloat(a[0][0]);j=parseFloat(a[1][0]);q===
"Q"||q==="T"?(a=g.sqrt(g.pow(c-e,2)+g.pow(h-f,2)),o=g.PI+g.atan2(e-c,h-f),e=c+g.sin(o)*a,h=f+g.cos(o)*a):(e=c,h=f);n+="curContext.quadraticCurveTo("+e+","+-h+","+i+","+-j+");";c=i;f=j;break;case "Q":e=parseFloat(a[0][0]);h=parseFloat(a[1][0]);i=parseFloat(a[2][0]);j=parseFloat(a[3][0]);n+="curContext.quadraticCurveTo("+e+","+-h+","+i+","+-j+");";c=i;f=j;break;case "Z":n+="curContext.closePath();"}q=p[0]}n+="afterPathDraw();";n+="curContext.translate("+u+",0);";n+="}}";return(new Function("beforePathDraw",
"afterPathDraw",n))(function(){d.save();return ga.$ensureContext()},function(){ea();Y();zb()})},x=function(c){var d=c.getElementsByTagName("font");a.glyphTable[b].horiz_adv_x=d[0].getAttribute("horiz-adv-x");d=c.getElementsByTagName("font-face")[0];a.glyphTable[b].units_per_em=parseFloat(d.getAttribute("units-per-em"));a.glyphTable[b].ascent=parseFloat(d.getAttribute("ascent"));a.glyphTable[b].descent=parseFloat(d.getAttribute("descent"));for(var c=c.getElementsByTagName("glyph"),d=c.length,e=0;e<
d;e++){var f=c[e].getAttribute("unicode"),h=c[e].getAttribute("glyph-name");u=c[e].getAttribute("horiz-adv-x");if(u===null)u=a.glyphTable[b].horiz_adv_x;l=c[e].getAttribute("d");l!==p&&(n=w(l),a.glyphTable[b][h]={name:h,unicode:f,horiz_adv_x:u,draw:n.draw})}};a.glyphTable[b]={};(function(){var a;try{a=A.implementation.createDocument("","",null)}catch(c){z.debug(c.message);return}try{a.async=!1,a.load(b),x(a.getElementsByTagName("svg")[0])}catch(d){z.debug(d);try{var e=new X.XMLHttpRequest;e.open("GET",
b,!1);e.send(null);x(e.responseXML.documentElement)}catch(f){z.debug(d)}}})(b);return a.glyphTable[b]};a.param=function(a){var c="data-processing-"+a;if(i.hasAttribute(c))return i.getAttribute(c);for(var c=0,d=i.childNodes.length;c<d;++c){var e=i.childNodes.item(c);if(!(e.nodeType!==1||e.tagName.toLowerCase()!=="param")&&e.getAttribute("name")===a)return e.getAttribute("value")}if($.params.hasOwnProperty(a))return $.params[a];return null};D.prototype.translate=H("translate");D.prototype.scale=H("scale");
D.prototype.pushMatrix=H("pushMatrix");D.prototype.popMatrix=H("popMatrix");D.prototype.resetMatrix=H("resetMatrix");D.prototype.applyMatrix=H("applyMatrix");D.prototype.rotate=H("rotate");D.prototype.rotateZ=H("rotateZ");D.prototype.redraw=H("redraw");D.prototype.ambientLight=H("ambientLight");D.prototype.directionalLight=H("directionalLight");D.prototype.lightFalloff=H("lightFalloff");D.prototype.lightSpecular=H("lightSpecular");D.prototype.pointLight=H("pointLight");D.prototype.noLights=H("noLights");
D.prototype.spotLight=H("spotLight");D.prototype.box=H("box");D.prototype.sphere=H("sphere");D.prototype.ambient=H("ambient");D.prototype.emissive=H("emissive");D.prototype.shininess=H("shininess");D.prototype.specular=H("specular");D.prototype.fill=H("fill");D.prototype.stroke=H("stroke");D.prototype.strokeWeight=H("strokeWeight");D.prototype.smooth=H("smooth");D.prototype.noSmooth=H("noSmooth");D.prototype.point=H("point");D.prototype.vertex=H("vertex");D.prototype.endShape=H("endShape");D.prototype.bezierVertex=
H("bezierVertex");D.prototype.curveVertex=H("curveVertex");D.prototype.curve=H("curve");D.prototype.line=H("line");D.prototype.bezier=H("bezier");D.prototype.rect=H("rect");D.prototype.ellipse=H("ellipse");D.prototype.background=H("background");D.prototype.image=H("image");D.prototype.textWidth=H("textWidth");D.prototype.text$line=H("text$line");D.prototype.$ensureContext=H("$ensureContext");D.prototype.$newPMatrix=H("$newPMatrix");D.prototype.size=function(b,d,f){Ra(f===c.WEBGL?"3D":"2D");a.size(b,
d,f)};D.prototype.$init=function(){};E.prototype.$init=function(){a.size(a.width,a.height);d.translate(0.5,0.5);d.lineCap="round";a.noSmooth();a.disableContextMenu()};I.prototype.$init=function(){a.use3DContext=!0};M.prototype.$ensureContext=function(){return d};G(i,"touchstart",function(b){i.setAttribute("style","-webkit-user-select: none");i.setAttribute("onclick","void(0)");i.setAttribute("style","-webkit-tap-highlight-color:rgba(0,0,0,0)");for(var d=0,f=Kb.length;d<f;d++){var e=Kb[d].type;(e===
"mouseout"||e==="mousemove"||e==="mousedown"||e==="mouseup"||e==="DOMMouseScroll"||e==="mousewheel"||e==="touchstart")&&ca(Kb[d])}a.touchStart!==p||a.touchMove!==p||a.touchEnd!==p||a.touchCancel!==p?(G(i,"touchstart",function(b){a.touchStart!==p&&(b=rb(b),a.touchStart(b))}),G(i,"touchmove",function(b){a.touchMove!==p&&(b.preventDefault(),b=rb(b),a.touchMove(b))}),G(i,"touchend",function(b){a.touchEnd!==p&&(b=rb(b),a.touchEnd(b))}),G(i,"touchcancel",function(b){a.touchCancel!==p&&(b=rb(b),a.touchCancel(b))})):
(G(i,"touchstart",function(b){qb(i,b.touches[0]);a.__mousePressed=!0;a.mouseDragging=!1;a.mouseButton=c.LEFT;typeof a.mousePressed==="function"&&a.mousePressed()}),G(i,"touchmove",function(b){b.preventDefault();qb(i,b.touches[0]);typeof a.mouseMoved==="function"&&!a.__mousePressed&&a.mouseMoved();if(typeof a.mouseDragged==="function"&&a.__mousePressed)a.mouseDragged(),a.mouseDragging=!0}),G(i,"touchend",function(){a.__mousePressed=!1;typeof a.mouseClicked==="function"&&!a.mouseDragging&&a.mouseClicked();
typeof a.mouseReleased==="function"&&a.mouseReleased()}));i.dispatchEvent(b)});(function(){var b=!0,c=function(a){a.preventDefault();a.stopPropagation()};a.disableContextMenu=function(){b&&(G(i,"contextmenu",c),b=!1)};a.enableContextMenu=function(){b||(ca({elem:i,type:"contextmenu",fn:c}),b=!0)}})();G(i,"mousemove",function(b){qb(i,b);typeof a.mouseMoved==="function"&&!a.__mousePressed&&a.mouseMoved();if(typeof a.mouseDragged==="function"&&a.__mousePressed)a.mouseDragged(),a.mouseDragging=!0});G(i,
"mouseout",function(){typeof a.mouseOut==="function"&&a.mouseOut()});G(i,"mouseover",function(b){qb(i,b);typeof a.mouseOver==="function"&&a.mouseOver()});G(i,"mousedown",function(b){a.__mousePressed=!0;a.mouseDragging=!1;switch(b.which){case 1:a.mouseButton=c.LEFT;break;case 2:a.mouseButton=c.CENTER;break;case 3:a.mouseButton=c.RIGHT}typeof a.mousePressed==="function"&&a.mousePressed()});G(i,"mouseup",function(){a.__mousePressed=!1;typeof a.mouseClicked==="function"&&!a.mouseDragging&&a.mouseClicked();
typeof a.mouseReleased==="function"&&a.mouseReleased()});fc=function(b){var c=0;b.wheelDelta?(c=b.wheelDelta/120,X.opera&&(c=-c)):b.detail&&(c=-b.detail/3);(a.mouseScroll=c)&&typeof a.mouseScrolled==="function"&&a.mouseScrolled()};G(A,"DOMMouseScroll",fc);G(A,"mousewheel",fc);typeof i==="string"&&(i=A.getElementById(i));i.getAttribute("tabindex")||i.setAttribute("tabindex",0);if(ib)$=new z.Sketch,Ra(),a.size=function(b,f,i){i&&i===c.WEBGL?Ra("3D"):Ra("2D");a.toImageData=i===c.WEBGL?function(){var a=
A.createElement("canvas").getContext("2d").createImageData(this.width,this.height),b=new $c(this.width*this.height*4);d.readPixels(0,0,this.width,this.height,d.RGBA,d.UNSIGNED_BYTE,b);for(var c=0,f=b.length,i=this.height,k=this.width,m=a.data;c<f;c++)m[c]=b[(i-1-g.floor(c/4/k))*k*4+c%(k*4)];return a}:function(){return d.getImageData(0,0,this.width,this.height)};a.size(b,f,i)};else{$=f instanceof z.Sketch?f:typeof f==="function"?new z.Sketch(f):f?z.compile(f):new z.Sketch(function(){});a.externals.sketch=
$;Ra();i.onfocus=function(){a.focused=!0};i.onblur=function(){a.focused=!1;if(!$.options.globalKeyEvents)a.__keyPressed=!1,kb=[],sb=null};$.options.pauseOnBlur&&(G(X,"focus",function(){$a&&a.loop()}),G(X,"blur",function(){$a&&jb&&(a.noLoop(),$a=!0);a.__keyPressed=!1;kb=[];sb=null}));ib=$.options.globalKeyEvents?X:i;G(ib,"keydown",Zb);G(ib,"keypress",$b);G(ib,"keyup",Cb);for(var gc in z.lib)z.lib.hasOwnProperty(gc)&&(z.lib[gc].hasOwnProperty("attach")?z.lib[gc].attach(a):z.lib[gc]instanceof Function&&
z.lib[gc].call(this));var Bd=function(b){!$.imageCache.pending&&$.fonts.pending()?($.attach(b,la),$.onLoad(),b.setup&&(b.setup(),d&&!a.use3DContext&&d.setTransform(1,0,0,1,0,0),$.onSetup()),Ba(),b.draw&&($a?b.loop():b.redraw())):X.setTimeout(function(){Bd(b)},10)};if(this.externals.canvas.id===p||!this.externals.canvas.id.length)this.externals.canvas.id="__processing"+Ca.length;lc[this.externals.canvas.id]=Ca.length;Ca.push(this);Bd(a)}};z.debug=Hb;z.prototype=la;z.compile=function(c){var f=new z.Sketch,
c=Cc(c,f),c=zc(c);f.sourceCode=c;return f};Hb=function(){var c={};typeof tinylog!=="undefined"&&typeof tinylog.log==="function"?c.log=tinylog.log:typeof A!=="undefined"&&!A.fake?function(){var f=A,g={zIndex:1E4,position:"fixed",bottom:"0px",width:"100%",height:"15%",fontFamily:"sans-serif",color:"#ccc",backgroundColor:"black"},p={position:"relative",fontFamily:"monospace",overflow:"auto",height:"100%",paddingTop:"5px"},q={height:"5px",marginTop:"-5px",cursor:"n-resize",backgroundColor:"darkgrey"},
s={position:"absolute",top:"5px",right:"20px",color:"#111",MozBorderRadius:"4px",webkitBorderRadius:"4px",borderRadius:"4px",cursor:"pointer",fontWeight:"normal",textAlign:"center",padding:"3px 5px",backgroundColor:"#333",fontSize:"12px"},z={minHeight:"16px"},w={fontSize:"12px",margin:"0 8px 0 8px",maxWidth:"100%",whiteSpace:"pre-wrap",overflow:"auto"},x=f.defaultView,L=f.documentElement,G=L.style,ca=function(){for(var c=arguments.length,f,g,i;c--;)for(i in g=arguments[c--],f=arguments[c].style,g)g.hasOwnProperty(i)&&
(f[i]=g[i])},da=function(c,f,g){c.addEventListener?c.addEventListener(f,g,!1):c.attachEvent&&c.attachEvent("on"+f,g);return[c,f,g]},X=function(c,f,g){c.removeEventListener?c.removeEventListener(f,g,!1):c.detachEvent&&c.detachEvent("on"+f,g)},fa=function(c){for(var f=c.childNodes,g=f.length;g--;)c.removeChild(f.item(0))},aa=function(c,f){return c.appendChild(f)},la=c.log=function(A){var qa,Ia=G.paddingBottom,ha=f.createElement("div"),Ca=ha.style,ea=aa(ha,f.createElement("div")),Y=aa(ha,f.createElement("div")),
wa=aa(ha,f.createElement("div")),ma=!1,Ba=!1,La=!1,Pa=0,Ea=function(c){var f=x.innerHeight,g=ea.clientHeight;c<0?c=0:c+g>f&&(c=f-g);Ca.height=c/f*100+"%";G.paddingBottom=ha.clientHeight+"px"},Qa=[da(f,"mousemove",function(c){if(ma)Ea(x.innerHeight-c.clientY),Y.scrollTop=La}),da(f,"mouseup",function(){ma&&(ma=La=!1)}),da(ea,"dblclick",function(c){c.preventDefault();Ba?(Ea(Ba),Ba=!1):(Ba=ha.clientHeight,Ca.height="0px")}),da(ea,"mousedown",function(c){c.preventDefault();ma=!0;La=Y.scrollTop}),da(ea,
"contextmenu",function(){ma=!1}),da(wa,"click",function(){qa()})];qa=function(){for(var f=Qa.length;f--;)X.apply(c,Qa[f]);L.removeChild(ha);G.paddingBottom=Ia;fa(Y);fa(ha);c.log=la};ca(ha,g,Y,p,ea,q,wa,s);wa.title="Close Log";aa(wa,f.createTextNode("\u2716"));ea.title="Double-click to toggle log minimization";L.insertBefore(ha,L.firstChild);c.log=function(c){Pa===512?Y.removeChild(Y.firstChild):Pa++;var g=aa(Y,f.createElement("div")),i=aa(g,f.createElement("div"));g.title=(new Date).toLocaleTimeString();
ca(g,z,i,w);aa(i,f.createTextNode(c));Y.scrollTop=Y.scrollHeight};c.log(A);G.paddingBottom=ha.clientHeight+"px"}}():typeof print==="function"&&(c.log=print);return c}();z.logger=Hb;z.version="1.2.3";z.lib={};z.registerLibrary=function(c,f){z.lib[c]=f;f.hasOwnProperty("init")&&f.init(la)};z.instances=Ca;z.getInstanceById=function(c){return Ca[lc[c]]};z.Sketch=function(c){this.attachFunction=c;this.options={crispLines:!1,pauseOnBlur:!1,globalKeyEvents:!1};this.onExit=this.onFrameEnd=this.onFrameStart=
this.onLoop=this.onPause=this.onSetup=this.onLoad=Dc;this.params={};this.imageCache={pending:0,images:{},add:function(c){if(Ia){var g=new Image;g.onload=function(c){return function(){c.pending--}}(this);this.pending++;this.images[c]=g;g.src=c}else this.images[c]=null}};this.fonts={template:function(){if(!Ia)return null;var c=A.createElement("p");c.style.fontFamily="serif";c.style.fontSize="72px";c.style.visibility="hidden";c.innerHTML="This element is a text block for font loading";A.getElementsByTagName("body")[0].appendChild(c);
return c}(),attempt:0,pending:function(){for(var c=!0,g=0;g<this.fontList.length;g++)this.fontList[g].offsetWidth===this.template.offsetWidth&&this.fontList[g].offsetHeight===this.template.offsetHeight?(c=!1,this.attempt++):(A.getElementsByTagName("body")[0].removeChild(this.fontList[g]),this.fontList.splice(g--,1),this.attempt=0);if(this.attempt>=30){c=!0;for(g=0;g<this.fontList.length;g++)A.getElementsByTagName("body")[0].removeChild(this.fontList[g]),this.fontList.splice(g--,1)}c&&A.getElementsByTagName("body")[0].removeChild(this.template);
return c},fontList:[],fontFamily:"",style:Ia?A.createElement("style"):null,add:function(c){var g=typeof c==="object"?c.fontFace:c;this.fontFamily+="@font-face{\n  font-family: '"+g+"';\n  src:  url('"+(typeof c==="object"?c.url:c)+"');\n}\n";this.style.innerHTML=this.fontFamily;A.getElementsByTagName("head")[0].appendChild(this.style);c=A.createElement("p");c.style.fontFamily="'"+g+"', serif";c.style.fontSize="72px";c.style.visibility="hidden";c.innerHTML="This element is a text block for font loading";
A.getElementsByTagName("body")[0].appendChild(c);this.fontList.push(c)}};this.sourceCode=void 0;this.attach=function(c){if(typeof this.attachFunction==="function")this.attachFunction(c);else if(this.sourceCode){var g=(new Function("return ("+this.sourceCode+");"))();g(c);this.attachFunction=g}else throw"Unable to attach sketch to the processing instance";};this.toString=function(){var c,g="((function(Sketch) {\n";g+="var sketch = new Sketch(\n"+this.sourceCode+");\n";for(c in this.options)if(this.options.hasOwnProperty(c)){var i=
this.options[c];g+="sketch.options."+c+" = "+(typeof i==="string"?'"'+i+'"':""+i)+";\n"}for(c in this.imageCache)this.options.hasOwnProperty(c)&&(g+='sketch.imageCache.add("'+c+'");\n');g+="return sketch;\n})(Processing.Sketch))";return g}};var Ub=function(c,f){function g(c,f){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(i.readyState===4){var c;i.status!==200&&i.status!==0?c="Invalid XHR status "+i.status:i.responseText===""&&(c="withCredentials"in new XMLHttpRequest&&(new XMLHttpRequest).withCredentials===
!1&&X.location.protocol==="file:"?"XMLHttpRequest failure, possibly due to a same-origin policy violation. You can try loading this page in another browser, or load it from http://localhost using a local webserver. See the Processing.js README for a more detailed explanation of this problem and solutions.":"File is empty.");f(i.responseText,c)}};i.open("GET",c,!0);i.overrideMimeType&&i.overrideMimeType("application/json");i.setRequestHeader("If-Modified-Since","Fri, 01 Jan 1960 00:00:00 GMT");i.send(null)}
function p(f,v){function x(g,p){q[f]=g;++w;p&&s.push(v+" ==> "+p);if(w===J)if(s.length===0)try{return new z(c,q.join("\n"))}catch(A){z.logger.log("Unable to execute pjs sketch: "+A)}else z.logger.log("Unable to load pjs sketch files: "+s.join("\n"))}if(v.charAt(0)==="#"){var L=A.getElementById(v.substring(1));L?x(L.text||L.textContent):x("","Unable to load pjs sketch: element with id '"+v.substring(1)+"' was not found")}else g(v,x)}for(var q=[],s=[],J=f.length,w=0,x=0;x<J;++x)p(x,f[x])},Vb=function(){A.removeEventListener("DOMContentLoaded",
Vb,!1);for(var c=A.getElementsByTagName("canvas"),f,g=0,v=c.length;g<v;g++)if(f=c[g].getAttribute("data-processing-sources"),f===null&&(f=c[g].getAttribute("data-src"),f===null&&(f=c[g].getAttribute("datasrc"))),f){f=f.split(" ");for(var q=0;q<f.length;)f[q]?q++:f.splice(q,1);Ub(c[g],f)}g=A.getElementsByTagName("script");for(v=0;v<g.length;v++)if(f=g[v],f.getAttribute&&(c=f.getAttribute("type"))&&(c.toLowerCase()==="text/processing"||c.toLowerCase()==="application/processing")){q=f.getAttribute("data-processing-target");
c=p;if(q)c=A.getElementById(q);else{for(q=f.nextSibling;q&&q.nodeType!==1;)q=q.nextSibling;q.nodeName.toLowerCase()==="canvas"&&(c=q)}c&&(f.getAttribute("src")?(f=f.getAttribute("src").split(/\s+/),Ub(c,f)):(f=f.innerText||f.textContent,new z(c,f)))}};z.loadSketchFromSources=Ub;z.disableInit=function(){Ia&&A.removeEventListener("DOMContentLoaded",Vb,!1)};Ia?(X.Processing=z,A.addEventListener("DOMContentLoaded",Vb,!1)):this.Processing=z})(window,window.document,Math);
;
/**
 * @file
 */


/**
 * Processing module javascript file to switch between render & source.
 *
 * We can't generate script elements on the fly because in Webkit,
 * Gecko, and IE it will always try to compile the script in JavaScript
 * even when type is NOT text/javascript. This doesn't make any sense.
 *
 * A note on performance. There can be a maximum of 0..n processing
 * instances loaded on a page where n is the number of [processing] tag
 * blocks on the page. This value is always increasing and never
 * decreasing so it is possible for a user to overload themselves for
 * high values of n.
 */
if (Drupal.jsEnabled) {
  $(document).ready(function () {
    var instances = new Array;

    $(".processing-wrapper").each(function() {
      if ($(this).children(".processing-button").length == 0 || $(this).children(".processing-button").attr('value') == Drupal.t('View Source')) {
        var canvas = $(this).children('canvas');
        var script = $(this).children('script');
        var canvas_element = script.next('canvas').get(0);
        canvas.show(400);

        if (instances[canvas.attr('id')] === undefined) {
          try {
            instances[canvas.attr('id')] = new Processing(canvas_element, script.get(0).text);
          }
          catch (err) {
            if ($(this).siblings('div.messages').length == 0) {
              $(this).before('<div class="messages error">' + Drupal.t('Syntax Error: ') + err.message + '</div>');
            }
          }
        }
      }
    });

    $(".processing-button").click(function() {
      if ($(this).attr('value') == Drupal.t('Render Sketch')) {
        $(this).attr('value', Drupal.t('View Source'));
        var pre = $(this).nextAll('pre');
        var canvas = $(this).nextAll('canvas');
        var script = $(this).nextAll('script');
        var canvas_element = script.next('canvas').get(0);
        pre.hide(400);
        canvas.show(400);
        
        // If by any chance the process is still running, let's
        // NOT start a new one.
        if (instances[canvas.attr('id')] === undefined) {
          try {
            instances[canvas.attr('id')] = new Processing(canvas_element, script.get(0).text);
          }
          catch (err) {
            $(this).attr('value', Drupal.t('Render Sketch'));
            pre.show(400);
            canvas.hide(400);
//            console.log($(this).prev('div.messages'));
            if ($(this).siblings('div.messages').length == 0) {
              $(this).before('<div class="messages error">' + Drupal.t('Syntax Error: ') + err.message + '</div>');
            }
          }
        }
      }
      else {
        $(this).attr('value', Drupal.t('Render Sketch'));
        $(this).nextAll('pre').show(400);
        $(this).nextAll('canvas').hide(400);
        // @todo We're out of context here so delete or Processing.removeInstances
        // won't work. Since it doesn't work, we still want to keep it in the
        // instances array in case the user clicks the button again.
        // delete instances[$(this).nextAll('canvas').attr('id')];
      }
    });
  });
}
;
// $Id: textareatabs.js,v 1.1 2008/03/15 21:14:41 smokris Exp $
// based on TTabs from http://interface.eyecon.ro/

$(document).ready(function(){
  $("textarea").bind('keydown',
    function(e){
      pressedKey = e.charCode || e.keyCode || -1;
      if (pressedKey == 9) {
        if (window.event) {
          window.event.cancelBubble = true;
          window.event.returnValue = false;
        } else {
          e.preventDefault();
          e.stopPropagation();
        }

        // save current scroll position for later restoration
        var oldScrollTop=this.scrollTop;

        if (this.createTextRange) {
          document.selection.createRange().text="\t";
          this.onblur = function() { this.focus(); this.onblur = null; };
        } else if (this.setSelectionRange) {
          start = this.selectionStart;
          end = this.selectionEnd;
          this.value = this.value.substring(0, start) + "\t" + this.value.substr(end);
          this.setSelectionRange(start + 1, start + 1);
          this.focus();
        }

        this.scrollTop=oldScrollTop;

        return false;
      }
    }
  );
});
;
// $Id: extlink.js,v 1.4.2.12 2010/05/26 01:25:56 quicksketch Exp $
(function ($) {

function extlinkAttach(context) {
  // Strip the host name down, removing ports, subdomains, or www.
  var pattern = /^(([^\/:]+?\.)*)([^\.:]{4,})((\.[a-z]{1,4})*)(:[0-9]{1,5})?$/;
  var host = window.location.host.replace(pattern, '$3$4');
  var subdomain = window.location.host.replace(pattern, '$1');

  // Determine what subdomains are considered internal.
  if (Drupal.settings.extlink.extSubdomains) {
    var subdomains = "([^/]*\\.)?";
  }
  else if (subdomain == 'www.' || subdomain == '') {
    var subdomains = "(www\\.)?";
  }
  else {
    var subdomains = subdomain.replace(".", "\\.");
  }

  // Build regular expressions that define an internal link.
  var internal_link = new RegExp("^https?://" + subdomains + host, "i");

  // Extra internal link matching.
  var extInclude = false;
  if (Drupal.settings.extlink.extInclude) {
    extInclude = new RegExp(Drupal.settings.extlink.extInclude.replace(/\\/, '\\'));
  }

  // Extra external link matching.
  var extExclude = false;
  if (Drupal.settings.extlink.extExclude) {
    extExclude = new RegExp(Drupal.settings.extlink.extExclude.replace(/\\/, '\\'));
  }

  // Find all links which are NOT internal and begin with http (as opposed
  // to ftp://, javascript:, etc. other kinds of links.
  // When operating on the 'this' variable, the host has been appended to
  // all links by the browser, even local ones.
  // In jQuery 1.1 and higher, we'd use a filter method here, but it is not
  // available in jQuery 1.0 (Drupal 5 default).
  var external_links = new Array();
  var mailto_links = new Array();
  $("a:not(." + Drupal.settings.extlink.extClass + ", ." + Drupal.settings.extlink.mailtoClass + ")", context).each(function(el) {
    try {
      var url = this.href.toLowerCase();
      if (url.indexOf('http') == 0 && (!url.match(internal_link) || (extInclude && url.match(extInclude))) && !(extExclude && url.match(extExclude))) {
        external_links.push(this);
      }
      else if (url.indexOf('mailto:') == 0) {
        mailto_links.push(this);
      }
    }
    // IE7 throws errors often when dealing with irregular links, such as:
    // <a href="node/10"></a> Empty tags.
    // <a href="http://user:pass@example.com">example</a> User:pass syntax.
    catch(error) {
      return false;
    }
  });

  if (Drupal.settings.extlink.extClass) {
    // Apply the "ext" class to all links not containing images.
    if (parseFloat($().jquery) < 1.2) {
      $(external_links).not('[img]').addClass(Drupal.settings.extlink.extClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.extClass + '></span>'); });
    }
    else {
      $(external_links).not($(external_links).find('img').parents('a')).addClass(Drupal.settings.extlink.extClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.extClass + '></span>'); });
    }
  }

  if (Drupal.settings.extlink.mailtoClass) {
    // Apply the "mailto" class to all mailto links not containing images.
    if (parseFloat($().jquery) < 1.2) {
      $(mailto_links).not('[img]').addClass(Drupal.settings.extlink.mailtoClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.mailtoClass + '></span>'); });
    }
    else {
      $(mailto_links).not($(mailto_links).find('img').parents('a')).addClass(Drupal.settings.extlink.mailtoClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.mailtoClass + '></span>'); });
    }
  }

  if (Drupal.settings.extlink.extTarget) {
    // Apply the target attribute to all links.
    $(external_links).attr('target', Drupal.settings.extlink.extTarget);
  }

  if (Drupal.settings.extlink.extAlert) {
    // Add pop-up click-through dialog.
    $(external_links).click(function(e) {
     return confirm(Drupal.settings.extlink.extAlertText);
    });
  }

  // Work around for Internet Explorer box model problems.
  if (($.support && !($.support.boxModel === undefined) && !$.support.boxModel) || ($.browser.msie && parseInt($.browser.version) <= 7)) {
    $('span.ext, span.mailto').css('display', 'inline-block');
  }
}

Drupal.behaviors.extlink = function(context) {
  extlinkAttach(context);
}

})(jQuery);
;

Drupal.behaviors.openid = function (context) {
  var $loginElements = $("#edit-name-wrapper, #edit-pass-wrapper, li.openid-link");
  var $openidElements = $("#edit-openid-identifier-wrapper, li.user-link");

  // This behavior attaches by ID, so is only valid once on a page.
  if (!$("#edit-openid-identifier.openid-processed").size() && $("#edit-openid-identifier").val()) {
    $("#edit-openid-identifier").addClass('openid-processed');
    $loginElements.hide();
    // Use .css("display", "block") instead of .show() to be Konqueror friendly.
    $openidElements.css("display", "block");
  }
  $("li.openid-link:not(.openid-processed)", context)
    .addClass('openid-processed')
    .click( function() {
       $loginElements.hide();
       $openidElements.css("display", "block");
      // Remove possible error message.
      $("#edit-name, #edit-pass").removeClass("error");
      $("div.messages.error").hide();
      // Set focus on OpenID Identifier field.
      $("#edit-openid-identifier")[0].focus();
      return false;
    });
  $("li.user-link:not(.openid-processed)", context)
    .addClass('openid-processed')
    .click(function() {
       $openidElements.hide();
       $loginElements.css("display", "block");
      // Clear OpenID Identifier field and remove possible error message.
      $("#edit-openid-identifier").val('').removeClass("error");
      $("div.messages.error").css("display", "block");
      // Set focus on username field.
      $("#edit-name")[0].focus();
      return false;
    });
};
;

