eval(function(p,a,c,k,e,d){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--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[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}('B dd={du:\'1.11\'};m $71(Q){o(Q!=bG)};m $G(Q){C(!$71(Q))o O;C(Q.5u)o\'I\';B G=7I Q;C(G==\'2X\'&&Q.al){1U(Q.79){P 1:o\'I\';P 3:o(/\\S/).2G(Q.bx)?\'dm\':\'cQ\'}}C(G==\'2X\'||G==\'m\'){1U(Q.bK){P 2K:o\'1B\';P 9g:o\'7b\';P 1b:o\'53\'}C(7I Q.U==\'4M\'){C(Q.3F)o\'cG\';C(Q.8K)o\'1a\'}}o G};m $2j(){B 5D={};M(B i=0;i<1a.U;i++){M(B L 1e 1a[i]){B ap=1a[i][L];B 7y=5D[L];C(7y&&$G(ap)==\'2X\'&&$G(7y)==\'2X\')5D[L]=$2j(7y,ap);14 5D[L]=ap}}o 5D};B $Y=m(){B 1u=1a;C(!1u[1])1u=[c,1u[0]];M(B L 1e 1u[1])1u[0][L]=1u[1][L];o 1u[0]};B $5y=m(){M(B i=0,l=1a.U;i<l;i++){1a[i].Y=m(25){M(B 23 1e 25){C(!c.1O[23])c.1O[23]=25[23];C(!c[23])c[23]=$5y.6M(23)}}}};$5y.6M=m(23){o m(12){o c.1O[23].3Q(12,2K.1O.6v.26(1a,1))}};$5y(8S,2K,6E,bc);m $2w(Q){o!!(Q||Q===0)};m $6b(Q,ab){o $71(Q)?Q:ab};m $8Y(3s,1E){o 1g.ak(1g.8Y()*(1E-3s+1)+3s)};m $3M(){o N b4().b5()};m $5r(1K){cS(1K);d2(1K);o 1p};B 3w=m(Q){Q=Q||{};Q.Y=$Y;o Q};B cZ=N 3w(W);B cY=N 3w(R);R.7p=R.2Y(\'7p\')[0];W.2F=!!(R.5l);C(W.aB)W.35=W[W.6S?\'cU\':\'bO\']=1d;14 C(R.84&&!R.88&&!cW.dh)W.4k=W[W.2F?\'cD\':\'6h\']=1d;14 C(R.ch!=1p)W.94=1d;W.cp=W.4k;8L.Y=$Y;C(7I 5S==\'bG\'){B 5S=m(){};C(W.4k)R.bf("cu");5S.1O=(W.4k)?W["[[c7.1O]]"]:{}}5S.1O.5u=m(){};C(W.bO)5I{R.df("dq",O,1d)}5H(e){};B 1b=m(1R){B 64=m(){o(1a[0]!==1p&&c.1l&&$G(c.1l)==\'m\')?c.1l.3Q(c,1a):c};$Y(64,c);64.1O=1R;64.bK=1b;o 64};1b.1r=m(){};1b.1O={Y:m(1R){B 7v=N c(1p);M(B L 1e 1R){B bA=7v[L];7v[L]=1b.aU(bA,1R[L])}o N 1b(7v)},3y:m(){M(B i=0,l=1a.U;i<l;i++)$Y(c.1O,1a[i])}};1b.aU=m(2y,2v){C(2y&&2y!=2v){B G=$G(2v);C(G!=$G(2y))o 2v;1U(G){P\'m\':B 8D=m(){c.1w=1a.8K.1w;o 2v.3Q(c,1a)};8D.1w=2y;o 8D;P\'2X\':o $2j(2y,2v)}}o 2v};B 9e=N 1b({dj:m(fn){c.4y=c.4y||[];c.4y.1f(fn);o c},7V:m(){C(c.4y&&c.4y.U)c.4y.9O().2t(10,c)},da:m(){c.4y=[]}});B 2E=N 1b({1F:m(G,fn){C(fn!=1b.1r){c.$1c=c.$1c||{};c.$1c[G]=c.$1c[G]||[];c.$1c[G].6c(fn)}o c},1m:m(G,1u,2t){C(c.$1c&&c.$1c[G]){c.$1c[G].1v(m(fn){fn.3k({\'12\':c,\'2t\':2t,\'1a\':1u})()},c)}o c},4U:m(G,fn){C(c.$1c&&c.$1c[G])c.$1c[G].31(fn);o c}});B 4g=N 1b({3h:m(){c.F=$2j.3Q(1p,[c.F].Y(1a));C(c.1F){M(B 3r 1e c.F){C($G(c.F[3r]==\'m\')&&(/^5P[A-Z]/).2G(3r))c.1F(3r,c.F[3r])}}o c}});2K.Y({7K:m(fn,12){M(B i=0,j=c.U;i<j;i++)fn.26(12,c[i],i,c)},2S:m(fn,12){B 5v=[];M(B i=0,j=c.U;i<j;i++){C(fn.26(12,c[i],i,c))5v.1f(c[i])}o 5v},2T:m(fn,12){B 5v=[];M(B i=0,j=c.U;i<j;i++)5v[i]=fn.26(12,c[i],i,c);o 5v},4V:m(fn,12){M(B i=0,j=c.U;i<j;i++){C(!fn.26(12,c[i],i,c))o O}o 1d},cv:m(fn,12){M(B i=0,j=c.U;i<j;i++){C(fn.26(12,c[i],i,c))o 1d}o O},3t:m(3F,19){B 3P=c.U;M(B i=(19<0)?1g.1E(0,3P+19):19||0;i<3P;i++){C(c[i]===3F)o i}o-1},8C:m(1k,U){1k=1k||0;C(1k<0)1k=c.U+1k;U=U||(c.U-1k);B 95=[];M(B i=0;i<U;i++)95[i]=c[1k++];o 95},31:m(3F){B i=0;B 3P=c.U;5W(i<3P){C(c[i]===3F){c.6J(i,1);3P--}14{i++}}o c},1i:m(3F,19){o c.3t(3F,19)!=-1},cd:m(1W){B Q={},U=1g.3s(c.U,1W.U);M(B i=0;i<U;i++)Q[1W[i]]=c[i];o Q},Y:m(1B){M(B i=0,j=1B.U;i<j;i++)c.1f(1B[i]);o c},2j:m(1B){M(B i=0,l=1B.U;i<l;i++)c.6c(1B[i]);o c},6c:m(3F){C(!c.1i(3F))c.1f(3F);o c},cr:m(){o c[$8Y(0,c.U-1)]||1p},8E:m(){o c[c.U-1]||1p}});2K.1O.1v=2K.1O.7K;2K.1v=2K.7K;m $A(1B){o 2K.8C(1B)};m $1v(4n,fn,12){C(4n&&7I 4n.U==\'4M\'&&$G(4n)!=\'2X\'){2K.7K(4n,fn,12)}14{M(B 1q 1e 4n)fn.26(12||4n,4n[1q],1q)}};2K.1O.2G=2K.1O.1i;6E.Y({2G:m(7F,1I){o(($G(7F)==\'2C\')?N 9g(7F,1I):7F).2G(c)},3p:m(){o 6r(c,10)},be:m(){o 6l(c)},7X:m(){o c.3d(/-\\D/g,m(2q){o 2q.4C(1).9i()})},aY:m(){o c.3d(/\\w[A-Z]/g,m(2q){o(2q.4C(0)+\'-\'+2q.4C(1).4F())})},7O:m(){o c.3d(/\\b[a-z]/g,m(2q){o 2q.9i()})},5e:m(){o c.3d(/^\\s+|\\s+$/g,\'\')},9l:m(){o c.3d(/\\s{2,}/g,\' \').5e()},5L:m(1B){B 1y=c.2q(/\\d{1,3}/g);o(1y)?1y.5L(1B):O},5J:m(1B){B 47=c.2q(/^#?(\\w{1,2})(\\w{1,2})(\\w{1,2})$/);o(47)?47.6v(1).5J(1B):O},1i:m(2C,s){o(s)?(s+c+s).3t(s+2C+s)>-1:c.3t(2C)>-1},bb:m(){o c.3d(/([.*+?^${}()|[\\]\\/\\\\])/g,\'\\\\$1\')}});2K.Y({5L:m(1B){C(c.U<3)o O;C(c.U==4&&c[3]==0&&!1B)o\'co\';B 47=[];M(B i=0;i<3;i++){B 3i=(c[i]-0).4A(16);47.1f((3i.U==1)?\'0\'+3i:3i)}o 1B?47:\'#\'+47.2f(\'\')},5J:m(1B){C(c.U!=3)o O;B 1y=[];M(B i=0;i<3;i++){1y.1f(6r((c[i].U==1)?c[i]+c[i]:c[i],16))}o 1B?1y:\'1y(\'+1y.2f(\',\')+\')\'}});8S.Y({3k:m(F){B fn=c;F=$2j({\'12\':fn,\'J\':O,\'1a\':1p,\'2t\':O,\'4c\':O,\'70\':O},F);C($2w(F.1a)&&$G(F.1a)!=\'1B\')F.1a=[F.1a];o m(J){B 1u;C(F.J){J=J||W.J;1u=[(F.J===1d)?J:N F.J(J)];C(F.1a)1u.Y(F.1a)}14 1u=F.1a||1a;B 3I=m(){o fn.3Q($6b(F.12,fn),1u)};C(F.2t)o bv(3I,F.2t);C(F.4c)o cn(3I,F.4c);C(F.70)5I{o 3I()}5H(cl){o O};o 3I()}},cw:m(1u,12){o c.3k({\'1a\':1u,\'12\':12})},70:m(1u,12){o c.3k({\'1a\':1u,\'12\':12,\'70\':1d})()},12:m(12,1u){o c.3k({\'12\':12,\'1a\':1u})},ck:m(12,1u){o c.3k({\'12\':12,\'J\':1d,\'1a\':1u})},2t:m(2t,12,1u){o c.3k({\'2t\':2t,\'12\':12,\'1a\':1u})()},4c:m(bd,12,1u){o c.3k({\'4c\':bd,\'12\':12,\'1a\':1u})()}});bc.Y({3p:m(){o 6r(c)},be:m(){o 6l(c)},1H:m(3s,1E){o 1g.3s(1E,1g.1E(3s,c))},2B:m(5U){5U=1g.3R(10,5U||0);o 1g.2B(c*5U)/5U},cg:m(fn){M(B i=0;i<c;i++)fn(i)}});B T=N 1b({1l:m(el,25){C($G(el)==\'2C\'){C(W.35&&25&&(25.1q||25.G)){B 1q=(25.1q)?\' 1q="\'+25.1q+\'"\':\'\';B G=(25.G)?\' G="\'+25.G+\'"\':\'\';57 25.1q;57 25.G;el=\'<\'+el+1q+G+\'>\'}el=R.bf(el)}el=$(el);o(!25||!el)?el:el.2A(25)}});B 1L=N 1b({1l:m(V){o(V)?$Y(V,c):c}});1L.Y=m(25){M(B 23 1e 25){c.1O[23]=25[23];c[23]=$5y.6M(23)}};m $(el){C(!el)o 1p;C(el.5u)o 2Q.5x(el);C([W,R].1i(el))o el;B G=$G(el);C(G==\'2C\'){el=R.6g(el);G=(el)?\'I\':O}C(G!=\'I\')o 1p;C(el.5u)o 2Q.5x(el);C([\'2X\',\'cy\'].1i(el.5o.4F()))o el;$Y(el,T.1O);el.5u=m(){};o 2Q.5x(el)};R.7f=R.2Y;m $$(){B V=[];M(B i=0,j=1a.U;i<j;i++){B 1J=1a[i];1U($G(1J)){P\'I\':V.1f(1J);P\'cx\':1h;P O:1h;P\'2C\':1J=R.7f(1J,1d);4q:V.Y(1J)}}o $$.6f(V)};$$.6f=m(1B){B V=[];M(B i=0,l=1B.U;i<l;i++){C(1B[i].$6P)72;B I=$(1B[i]);C(I&&!I.$6P){I.$6P=1d;V.1f(I)}}M(B n=0,d=V.U;n<d;n++)V[n].$6P=1p;o N 1L(V)};1L.74=m(L){o m(){B 1u=1a;B 18=[];B V=1d;M(B i=0,j=c.U,3I;i<j;i++){3I=c[i][L].3Q(c[i],1u);C($G(3I)!=\'I\')V=O;18.1f(3I)};o(V)?$$.6f(18):18}};T.Y=m(1R){M(B L 1e 1R){5S.1O[L]=1R[L];T.1O[L]=1R[L];T[L]=$5y.6M(L);B b9=(2K.1O[L])?L+\'1L\':L;1L.1O[b9]=1L.74(L)}};T.Y({2A:m(25){M(B 23 1e 25){B 4B=25[23];1U(23){P\'83\':c.4P(4B);1h;P\'1c\':C(c.7H)c.7H(4B);1h;P\'1R\':c.7r(4B);1h;4q:c.7h(23,4B)}}o c},2h:m(el,bi){el=$(el);1U(bi){P\'bk\':el.3C.8G(c,el);1h;P\'bj\':B 2W=el.8a();C(!2W)el.3C.9d(c);14 el.3C.8G(c,2W);1h;P\'1t\':B 8R=el.8o;C(8R){el.8G(c,8R);1h}4q:el.9d(c)}o c},8z:m(el){o c.2h(el,\'bk\')},7d:m(el){o c.2h(el,\'bj\')},c5:m(el){o c.2h(el,\'3X\')},c6:m(el){o c.2h(el,\'1t\')},bE:m(){B V=[];$1v(1a,m(2o){V=V.55(2o)});$$(V).2h(c);o c},31:m(){o c.3C.bF(c)},aW:m(bo){B el=$(c.ct(bo!==O));C(!el.$1c)o el;el.$1c={};M(B G 1e c.$1c)el.$1c[G]={\'1W\':$A(c.$1c[G].1W),\'1P\':$A(c.$1c[G].1P)};o el.6Q()},de:m(el){el=$(el);c.3C.dg(el,c);o el},bL:m(1Q){c.9d(R.d8(1Q));o c},7R:m(1D){o c.1D.1i(1D,\' \')},aM:m(1D){C(!c.7R(1D))c.1D=(c.1D+\' \'+1D).9l();o c},aL:m(1D){c.1D=c.1D.3d(N 9g(\'(^|\\\\s)\'+1D+\'(?:\\\\s|$)\'),\'$1\').9l();o c},d7:m(1D){o c.7R(1D)?c.aL(1D):c.aM(1D)},1X:m(L,K){1U(L){P\'2b\':o c.aG(6l(K));P\'dv\':L=(W.35)?\'dw\':\'dx\'}L=L.7X();1U($G(K)){P\'4M\':C(![\'ds\',\'aA\'].1i(L))K+=\'5q\';1h;P\'1B\':K=\'1y(\'+K.2f(\',\')+\')\'}c.1T[L]=K;o c},4P:m(2a){1U($G(2a)){P\'2X\':T.6K(c,\'1X\',2a);1h;P\'2C\':c.1T.8x=2a}o c},aG:m(2b){C(2b==0){C(c.1T.52!="4Y")c.1T.52="4Y"}14{C(c.1T.52!="8Z")c.1T.52="8Z"}C(!c.7j||!c.7j.dp)c.1T.aA=1;C(W.35)c.1T.2S=(2b==1)?\'\':"7u(2b="+2b*3j+")";c.1T.2b=c.$22.2b=2b;o c},2s:m(L){L=L.7X();B 1S=c.1T[L];C(!$2w(1S)){C(L==\'2b\')o c.$22.2b;1S=[];M(B 1T 1e T.4h){C(L==1T){T.4h[1T].1v(m(s){B 1T=c.2s(s);1S.1f(6r(1T)?1T:\'bR\')},c);C(L==\'3c\'){B 4V=1S.4V(m(3i){o(3i==1S[0])});o(4V)?1S[0]:O}o 1S.2f(\' \')}}C(L.1i(\'3c\')){C(T.4h.3c.1i(L)){o[\'bH\',\'8g\',\'33\'].2T(m(p){o c.2s(L+p)},c).2f(\' \')}14 C(T.9E.1i(L)){o[\'bz\',\'bT\',\'bQ\',\'az\'].2T(m(p){o c.2s(\'3c\'+p+L.3d(\'3c\',\'\'))},c).2f(\' \')}}C(R.aD)1S=R.aD.cN(c,1p).cM(L.aY());14 C(c.7j)1S=c.7j[L]}C(W.35)1S=T.bP(L,1S,c);C(1S&&L.2G(/2R/i)&&1S.1i(\'1y\')){o 1S.61(\'1y\').6J(1,4).2T(m(2R){o 2R.5L()}).2f(\' \')}o 1S},bM:m(){o T.9a(c,\'2s\',1a)},5M:m(73,1k){73+=\'cF\';B el=(1k)?c[1k]:c[73];5W(el&&$G(el)!=\'I\')el=el[73];o $(el)},by:m(){o c.5M(\'2y\')},8a:m(){o c.5M(\'2W\')},cR:m(){o c.5M(\'2W\',\'8o\')},8E:m(){o c.5M(\'2y\',\'d4\')},cT:m(){o $(c.3C)},99:m(){o $$(c.84)},90:m(el){o!!$A(c.2Y(\'*\')).1i(el)},5O:m(L){B 2e=T.6V[L];C(2e)o c[2e];B 8i=T.ah[L]||0;C(!W.35||8i)o c.cV(L,8i);B 8j=c.3z[L];o(8j)?8j.bx:1p},cX:m(L){B 2e=T.6V[L];C(2e)c[2e]=\'\';14 c.aE(L);o c},d0:m(){o T.9a(c,\'5O\',1a)},7h:m(L,K){B 2e=T.6V[L];C(2e)c[2e]=K;14 c.d1(L,K);o c},7r:m(2a){o T.6K(c,\'7h\',2a)},66:m(){c.bX=$A(1a).2f(\'\');o c},cI:m(1Q){B 1M=c.51();C([\'1T\',\'2I\'].1i(1M)){C(W.35){C(1M==\'1T\')c.bI.8x=1Q;14 C(1M==\'2I\')c.7h(\'1Q\',1Q);o c}14{c.bF(c.8o);o c.bL(1Q)}}c[$71(c.7U)?\'7U\':\'bN\']=1Q;o c},cK:m(){B 1M=c.51();C([\'1T\',\'2I\'].1i(1M)){C(W.35){C(1M==\'1T\')o c.bI.8x;14 C(1M==\'2I\')o c.5O(\'1Q\')}14{o c.bX}}o($6b(c.7U,c.bN))},51:m(){o c.5o.4F()},1r:m(){2Q.4v(c.2Y(\'*\'));o c.66(\'\')}});T.bP=m(L,1S,I){C($2w(6r(1S)))o 1S;C([\'2Z\',\'2L\'].1i(L)){B 1P=(L==\'2L\')?[\'1z\',\'4Q\']:[\'1t\',\'3X\'];B 3v=0;1P.1v(m(K){3v+=I.2s(\'3c-\'+K+\'-2L\').3p()+I.2s(\'4Z-\'+K).3p()});o I[\'1G\'+L.7O()]-3v+\'5q\'}14 C(L.2G(/3c(.+)bH|3q|4Z/)){o\'bR\'}o 1S};T.4h={\'3c\':[],\'4Z\':[],\'3q\':[]};[\'bz\',\'bT\',\'bQ\',\'az\'].1v(m(bY){M(B 1T 1e T.4h)T.4h[1T].1f(1T+bY)});T.9E=[\'ce\',\'cs\',\'c0\'];T.9a=m(el,2u,1W){B 1S={};$1v(1W,m(1A){1S[1A]=el[2u](1A)});o 1S};T.6K=m(el,2u,82){M(B 1A 1e 82)el[2u](1A,82[1A]);o el};T.6V=N 3w({\'53\':\'1D\',\'M\':\'di\',\'d9\':\'db\',\'dk\':\'dt\',\'dr\':\'dn\',\'d6\':\'d5\',\'cO\':\'cP\',\'cL\':\'cE\',\'cH\':\'cJ\',\'K\':\'K\',\'8p\':\'8p\',\'8l\':\'8l\',\'8k\':\'8k\',\'8m\':\'8m\'});T.ah={\'4R\':2,\'4z\':2};T.2P={6N:{2V:m(G,fn){C(c.96)c.96(G,fn,O);14 c.d3(\'5P\'+G,fn);o c},3x:m(G,fn){C(c.9M)c.9M(G,fn,O);14 c.dl(\'5P\'+G,fn);o c}}};W.Y(T.2P.6N);R.Y(T.2P.6N);T.Y(T.2P.6N);B 2Q={V:[],5x:m(el){C(!el.$22){2Q.V.1f(el);el.$22={\'2b\':1}}o el},4v:m(V){M(B i=0,j=V.U,el;i<j;i++){C(!(el=V[i])||!el.$22)72;C(el.$1c)el.1m(\'4v\').6Q();M(B p 1e el.$22)el.$22[p]=1p;M(B d 1e T.1O)el[d]=1p;2Q.V[2Q.V.3t(el)]=1p;el.5u=el.$22=el=1p}2Q.V.31(1p)},1r:m(){2Q.5x(W);2Q.5x(R);2Q.4v(2Q.V)}};W.2V(\'9X\',m(){W.2V(\'8N\',2Q.1r);C(W.35)W.2V(\'8N\',dy)});B 3e=N 1b({1l:m(J){C(J&&J.$9S)o J;c.$9S=1d;J=J||W.J;c.J=J;c.G=J.G;c.3V=J.3V||J.c4;C(c.3V.79==3)c.3V=c.3V.3C;c.9O=J.c3;c.c8=J.cb;c.c2=J.ca;c.c9=J.cc;C([\'8U\',\'5B\'].1i(c.G)){c.c1=(J.9Y)?J.9Y/cC:-(J.cB||0)/3}14 C(c.G.1i(\'1A\')){c.6G=J.a0||J.cA;M(B 1q 1e 3e.1W){C(3e.1W[1q]==c.6G){c.1A=1q;1h}}C(c.G==\'a5\'){B 6C=c.6G-cz;C(6C>0&&6C<13)c.1A=\'f\'+6C}c.1A=c.1A||6E.cq(c.6G).4F()}14 C(c.G.2G(/(78|3A|ci)/)){c.29={\'x\':J.9r||J.a3+(R.48.5g||R.3b.5g),\'y\':J.7M||J.9Z+(R.48.5d||R.3b.5d)};c.ae={\'x\':J.9r?J.9r-W.9G:J.a3,\'y\':J.7M?J.7M-W.9K:J.9Z};c.cf=(J.a0==3)||(J.cj==2);1U(c.G){P\'8T\':c.2D=J.2D||J.cm;1h;P\'8J\':c.2D=J.2D||J.7W}c.a2()}o c},21:m(){o c.6U().6H()},6U:m(){C(c.J.6U)c.J.6U();14 c.J.e5=1d;o c},6H:m(){C(c.J.6H)c.J.6H();14 c.J.fy=O;o c}});3e.6I={2D:m(){C(c.2D&&c.2D.79==3)c.2D=c.2D.3C},a1:m(){5I{3e.6I.2D.26(c)}5H(e){c.2D=c.3V}}};3e.1O.a2=(W.94)?3e.6I.a1:3e.6I.2D;3e.1W=N 3w({\'eU\':13,\'7m\':38,\'fh\':40,\'1z\':37,\'4Q\':39,\'ff\':27,\'f9\':32,\'eZ\':8,\'fc\':9,\'57\':46});T.2P.2E={1F:m(G,fn){c.$1c=c.$1c||{};c.$1c[G]=c.$1c[G]||{\'1W\':[],\'1P\':[]};C(c.$1c[G].1W.1i(fn))o c;c.$1c[G].1W.1f(fn);B 6D=G;B 2M=T.2E[G];C(2M){C(2M.87)2M.87.26(c,fn);C(2M.2T)fn=2M.2T;C(2M.G)6D=2M.G}C(!c.96)fn=fn.3k({\'12\':c,\'J\':1d});c.$1c[G].1P.1f(fn);o(T.93.1i(6D))?c.2V(6D,fn):c},4U:m(G,fn){C(!c.$1c||!c.$1c[G])o c;B 1s=c.$1c[G].1W.3t(fn);C(1s==-1)o c;B 1A=c.$1c[G].1W.6J(1s,1)[0];B K=c.$1c[G].1P.6J(1s,1)[0];B 2M=T.2E[G];C(2M){C(2M.31)2M.31.26(c,fn);C(2M.G)G=2M.G}o(T.93.1i(G))?c.3x(G,K):c},7H:m(2a){o T.6K(c,\'1F\',2a)},6Q:m(G){C(!c.$1c)o c;C(!G){M(B 6B 1e c.$1c)c.6Q(6B);c.$1c=1p}14 C(c.$1c[G]){c.$1c[G].1W.1v(m(fn){c.4U(G,fn)},c);c.$1c[G]=1p}o c},1m:m(G,1u,2t){C(c.$1c&&c.$1c[G]){c.$1c[G].1W.1v(m(fn){fn.3k({\'12\':c,\'2t\':2t,\'1a\':1u})()},c)}o c},a6:m(19,G){C(!19.$1c)o c;C(!G){M(B 6B 1e 19.$1c)c.a6(19,6B)}14 C(19.$1c[G]){19.$1c[G].1W.1v(m(fn){c.1F(G,fn)},c)}o c}};W.Y(T.2P.2E);R.Y(T.2P.2E);T.Y(T.2P.2E);T.2E=N 3w({\'8s\':{G:\'8T\',2T:m(J){J=N 3e(J);C(J.2D!=c&&!c.90(J.2D))c.1m(\'8s\',J)}},\'8y\':{G:\'8J\',2T:m(J){J=N 3e(J);C(J.2D!=c&&!c.90(J.2D))c.1m(\'8y\',J)}},\'5B\':{G:(W.94)?\'8U\':\'5B\'}});T.93=[\'78\',\'fd\',\'62\',\'5A\',\'5B\',\'8U\',\'8T\',\'8J\',\'34\',\'a5\',\'fb\',\'fa\',\'4r\',\'8N\',\'9X\',\'f8\',\'56\',\'fe\',\'fk\',\'3K\',\'fl\',\'fj\',\'4i\',\'b8\',\'92\',\'fi\',\'2O\'];8S.Y({3n:m(12,1u){o c.3k({\'12\':12,\'1a\':1u,\'J\':3e})}});1L.Y({fg:m(1M){o N 1L(c.2S(m(el){o(T.51(el)==1M)}))},7P:m(1D,2c){B V=c.2S(m(el){o(el.1D&&el.1D.1i(1D,\' \'))});o(2c)?V:N 1L(V)},86:m(2g,2c){B V=c.2S(m(el){o(el.2g==2g)});o(2c)?V:N 1L(V)},7a:m(1q,8O,K,2c){B V=c.2S(m(el){B 2v=T.5O(el,1q);C(!2v)o O;C(!8O)o 1d;1U(8O){P\'=\':o(2v==K);P\'*=\':o(2v.1i(K));P\'^=\':o(2v.6T(0,K.U)==K);P\'$=\':o(2v.6T(2v.U-K.U)==K);P\'!=\':o(2v!=K);P\'~=\':o 2v.1i(K,\' \')}o O});o(2c)?V:N 1L(V)}});m $E(1J,2S){o($(2S)||R).ag(1J)};m $f7(1J,2S){o($(2S)||R).7f(1J)};$$.6y={\'7b\':/^(\\w*|\\*)(?:#([\\w-]+)|\\.([\\w-]+))?(?:\\[(\\w+)(?:([!*^$]?=)["\']?([^"\'\\]]*)["\']?)?])?$/,\'2F\':{67:m(18,2d,1o,i){B 1n=[2d.9T?\'5s:\':\'\',1o[1]];C(1o[2])1n.1f(\'[@2g="\',1o[2],\'"]\');C(1o[3])1n.1f(\'[1i(55(" ", @53, " "), " \',1o[3],\' ")]\');C(1o[4]){C(1o[5]&&1o[6]){1U(1o[5]){P\'*=\':1n.1f(\'[1i(@\',1o[4],\', "\',1o[6],\'")]\');1h;P\'^=\':1n.1f(\'[a9-aa(@\',1o[4],\', "\',1o[6],\'")]\');1h;P\'$=\':1n.1f(\'[ar(@\',1o[4],\', 2C-U(@\',1o[4],\') - \',1o[6].U,\' + 1) = "\',1o[6],\'"]\');1h;P\'=\':1n.1f(\'[@\',1o[4],\'="\',1o[6],\'"]\');1h;P\'!=\':1n.1f(\'[@\',1o[4],\'!="\',1o[6],\'"]\')}}14{1n.1f(\'[@\',1o[4],\']\')}}18.1f(1n.2f(\'\'));o 18},69:m(18,2d,2c){B V=[];B 2F=R.5l(\'.//\'+18.2f(\'//\'),2d,$$.6y.6w,aq.ao,1p);M(B i=0,j=2F.an;i<j;i++)V.1f(2F.8F(i));o(2c)?V:N 1L(V.2T($))}},\'9R\':{67:m(18,2d,1o,i){C(i==0){C(1o[2]){B el=2d.6g(1o[2]);C(!el||((1o[1]!=\'*\')&&(T.51(el)!=1o[1])))o O;18=[el]}14{18=$A(2d.2Y(1o[1]))}}14{18=$$.6y.2Y(18,1o[1]);C(1o[2])18=1L.86(18,1o[2],1d)}C(1o[3])18=1L.7P(18,1o[3],1d);C(1o[4])18=1L.7a(18,1o[4],1o[5],1o[6],1d);o 18},69:m(18,2d,2c){o(2c)?18:$$.6f(18)}},6w:m(6u){o(6u==\'5s\')?\'8H://7Z.as.at/ax/5s\':O},2Y:m(2d,5o){B 44=[];M(B i=0,j=2d.U;i<j;i++)44.Y(2d[i].2Y(5o));o 44}};$$.6y.2u=(W.2F)?\'2F\':\'9R\';B 2x={\'9W\':/:([^-:(]+)[^:(]*(?:\\((["\']?)(.*?)\\2\\))?|\\[(\\w+)(?:([!*^$~|]?=)(["\']?)(.*?)\\6)?\\]|\\.[\\w-]+|#[\\w-]+|\\w+|\\*/g,\'ac\':/\\s*([+>~\\s])[a-eW-Z#.*\\s]/g};2x.$2U=m(1J){B 1I={1M:\'*\',2g:1p,8A:[],3z:[],3S:[]};1J=1J.3d(2x.9W,m(3i){1U(3i.4C(0)){P\'.\':1I.8A.1f(3i.6v(1));1h;P\'#\':1I.2g=3i.6v(1);1h;P\'[\':1I.3z.1f([1a[4],1a[5],1a[7]]);1h;P\':\':B 1q=1a[1];B 3Y=2x.9U[1q];B 28={\'1q\':1q,\'3l\':3Y,\'2o\':1a[3]};C(3Y&&3Y.3l)28.2o=(3Y.3l.3Q)?3Y.3l(28.2o):3Y.3l;1I.3S.1f(28);1h;4q:1I.1M=3i}o\'\'});o 1I};2x.9U=N 3w();2x.8t={67:m(18,4D,2d,1M,2g,5G,3z,3S){B 1n=(2d.9T&&!W.4k)?\'5s:\':\'\';1U(4D){P\'~\':P\'+\':1n+=\'/eX-eV::\';1h;P\'>\':1n+=\'/\';1h;P\' \':1n+=\'//\'}1n+=1M;C(4D==\'+\')1n+=\'[1]\';B i;M(i=3S.U;i--;i){B 28=3S[i];C(28.3l&&28.3l.2F)1n+=28.3l.2F(28.2o);14 1n+=($2w(28.2o))?\'[@\'+28.1q+\'="\'+28.2o+\'"]\':\'[@\'+28.1q+\']\'}C(2g)1n+=\'[@2g="\'+2g+\'"]\';M(i=5G.U;i--;i)1n+=\'[1i(55(" ", @53, " "), " \'+5G[i]+\' ")]\';M(i=3z.U;i--;i){B 1V=3z[i];1U(1V[1]){P\'=\':1n+=\'[@\'+1V[0]+\'="\'+1V[2]+\'"]\';1h;P\'*=\':1n+=\'[1i(@\'+1V[0]+\', "\'+1V[2]+\'")]\';1h;P\'^=\':1n+=\'[a9-aa(@\'+1V[0]+\', "\'+1V[2]+\'")]\';1h;P\'$=\':1n+=\'[ar(@\'+1V[0]+\', 2C-U(@\'+1V[0]+\') - \'+1V[2].U+\' + 1) = "\'+1V[2]+\'"]\';1h;P\'!=\':1n+=\'[@\'+1V[0]+\'!="\'+1V[2]+\'"]\';1h;P\'~=\':1n+=\'[1i(55(" ", @\'+1V[0]+\', " "), " \'+1V[2]+\' ")]\';1h;P\'|=\':1n+=\'[1i(55("-", @\'+1V[0]+\', "-"), "-\'+1V[2]+\'-")]\';1h;4q:1n+=\'[@\'+1V[0]+\']\'}}18.1f(1n);o 18},69:m(18,2d,2c){B V=[];B 2F=R.5l(\'.//\'+18.2f(\'\'),2d,2x.8t.6w,aq.ao,1p);M(B i=0,j=2F.an;i<j;i++)V[i]=(2c)?2F.8F(i):$(2F.8F(i));o(2c)?V:N 1L(V,1d)},6w:m(6u){o(6u==\'5s\')?\'8H://7Z.as.at/ax/5s\':O}};2x.7c={67:m(18,4D,2d,1M,2g,5G,3z,3S){B i;C(4D){B 44=[],j=18.U;1U(4D){P\' \':M(i=0;i<j;i++)44.Y(18[i].2Y(1M));1h;P\'>\':M(i=0;i<j;i++){B 6t=18[i].84;M(B k=0,l=6t.U;k<l;k++){C(2x.7c.7S(6t[k],1M))44.1f(6t[k])}}1h;4q:B 88=!!(4D==\'~\');M(i=0;i<j;i++){B 2W=18[i];5W((2W=2W.eS)){C(2x.7c.7S(2W,1M)){44.1f(2W);C(!88)1h}}}}18=(2g)?1L.86(44,2g,1d):44}14{C(2g){B el=2d.6g(2g);C(!el||((1M!=\'*\')&&(1M!=el.5o.4F())))o O;18=[el]}14{18=$A(2d.2Y(1M))}}M(i=5G.U;i--;i)18=1L.7P(18,5G[i],1d);M(i=3z.U;i--;i){B 1V=3z[i];18=1L.7a(18,1V[0],1V[1],1V[2],1d)}M(i=3S.U;i--;i){B 28=3S[i];C(28.3l&&28.3l.2S){B 1n={},3Y=28.3l,2o=28.2o;18=18.2S(m(el,i,1B){o 3Y.2S(el,2o,i,1B,1n)});1n=1p}14{18=1L.7a(18,28.1q,($2w(28.2o))?\'=\':O,28.2o,1d)}}o 18},69:m(18,2d,2c){o(2c)?18:N 1L(18)},7S:m(el,1M){o(el.al&&el.79==1&&(1M==\'*\'||el.5o.4F()==1M))}};2x.8f=(W.2F)?2x.8t:2x.7c;T.2P.8n={75:m(1J,2c){B 18=[];B 8B=[];1J=1J.5e().3d(2x.ac,m(2q){C(2q.4C(2))2q=2q.5e();8B.1f(2q.4C(0));o\'%\'+2q.4C(1)}).61(\'%\');M(B i=0,j=1J.U;i<j;i++){B 1I=2x.$2U(1J[i]);C(!1I)1h;B 1n=2x.8f.67(18,8B[i-1]||O,c,1I.1M,1I.2g,1I.8A,1I.3z,1I.3S);C(!1n)1h;18=1n}o 2x.8f.69(18,c,2c)},ag:m(1J){o $(c.75(1J,1d)[0]||O)},7f:m(1J,2c){B V=[];1J=1J.61(\',\');M(B i=0,j=1J.U;i<j;i++)V=V.55(c.75(1J[i],1d));o(2c)?V:$$.6f(V)}};T.Y({6g:m(2g){B el=R.6g(2g);C(!el)o O;M(B 1w=el.3C;1w!=c;1w=1w.3C){C(!1w)o O}o el},eT:m(1D){o c.75(\'.\'+1D)}});R.Y(T.2P.8n);T.Y(T.2P.8n);T.Y({4s:m(){1U(c.51()){P\'4i\':B 1P=[];$1v(c.F,m(3r){C(3r.8m)1P.1f((3r.K!=\'\')?3r.K:3r.1Q)});o(c.8k)?1P:1P[0];P\'9H\':C(!(c.8l&&[\'eY\',\'fo\'].1i(c.G))&&![\'4Y\',\'1Q\',\'f4\'].1i(c.G))1h;P\'9t\':o c.K}o O},9B:m(){o $$(c.2Y(\'9H\'),c.2Y(\'4i\'),c.2Y(\'9t\'))},5R:m(){B 5z=[];c.9B().1v(m(el){B 1q=el.1q;B K=el.4s();C(K===O||!1q||el.8p)o;B 8q=m(4B){5z.1f(1q+\'=\'+6A(4B))};C($G(K)==\'1B\')K.1v(8q);14 8q(K)});o 5z.2f(\'&\')}});T.Y({43:m(x,y){c.5g=x;c.5d=y},7B:m(){o{\'2O\':{\'x\':c.5g,\'y\':c.5d},\'3v\':{\'x\':c.4p,\'y\':c.3J},\'7A\':{\'x\':c.6Z,\'y\':c.6d}}},3u:m(2p){2p=2p||[];B el=c,1z=0,1t=0;do{1z+=el.f5||0;1t+=el.f3||0;el=el.f2}5W(el);2p.1v(m(I){1z-=I.5g||0;1t-=I.5d||0});o{\'x\':1z,\'y\':1t}},b1:m(2p){o c.3u(2p).y},b0:m(2p){o c.3u(2p).x},4X:m(2p){B 1x=c.3u(2p);B Q={\'2L\':c.4p,\'2Z\':c.3J,\'1z\':1x.x,\'1t\':1x.y};Q.4Q=Q.1z+Q.2L;Q.3X=Q.1t+Q.2Z;o Q}});T.2E.7Y={87:m(fn){C(W.6X){fn.26(c);o}B 68=m(){C(W.6X)o;W.6X=1d;W.1K=$5r(W.1K);c.1m(\'7Y\')}.12(c);C(R.5t&&W.4k){W.1K=m(){C([\'6X\',\'8v\'].1i(R.5t))68()}.4c(50)}14 C(R.5t&&W.35){C(!$(\'7N\')){B 4z=(W.59.f0==\'f1:\')?\'://0\':\'9p:fm(0)\';R.fA(\'<2I 2g="7N" fI 4z="\'+4z+\'"><\\/2I>\');$(\'7N\').7g=m(){C(c.5t==\'8v\')68()}}}14{W.2V("4r",68);R.2V("fG",68)}}};W.fH=m(fn){o c.1F(\'7Y\',fn)};W.Y({9k:m(){C(c.6h)o c.fD;C(c.9v)o R.48.9A;o R.3b.9A},9f:m(){C(c.6h)o c.fL;C(c.9v)o R.48.9x;o R.3b.9x},9D:m(){C(c.35)o 1g.1E(R.3b.4p,R.3b.6Z);C(c.4k)o R.48.6Z;o R.3b.6Z},9w:m(){C(c.35)o 1g.1E(R.3b.3J,R.3b.6d);C(c.4k)o R.48.6d;o R.3b.6d},9s:m(){o c.9G||R.3b.5g},8M:m(){o c.9K||R.3b.5d},7B:m(){o{\'3v\':{\'x\':c.9k(),\'y\':c.9f()},\'7A\':{\'x\':c.9D(),\'y\':c.9w()},\'2O\':{\'x\':c.9s(),\'y\':c.8M()}}},3u:m(){o{\'x\':0,\'y\':0}}});B 1j={};1j.3a=N 1b({F:{4d:1b.1r,1Y:1b.1r,9c:1b.1r,2i:m(p){o-(1g.aT(1g.8d*p)-1)/2},4u:dz,2H:\'5q\',3L:1d,9C:50},1l:m(F){c.I=c.I||1p;c.3h(F);C(c.F.1l)c.F.1l.26(c)},2z:m(){B 3M=$3M();C(3M<c.3M+c.F.4u){c.4I=c.F.2i((3M-c.3M)/c.F.4u);c.4G();c.4K()}14{c.21(1d);c.2A(c.17);c.1m(\'1Y\',c.I,10);c.7V()}},2A:m(17){c.15=17;c.4K();o c},4G:m(){c.15=c.4H(c.19,c.17)},4H:m(19,17){o(17-19)*c.4I+19},1k:m(19,17){C(!c.F.3L)c.21();14 C(c.1K)o c;c.19=19;c.17=17;c.3K=c.17-c.19;c.3M=$3M();c.1K=c.2z.4c(1g.2B(ba/c.F.9C),c);c.1m(\'4d\',c.I);o c},21:m(2m){C(!c.1K)o c;c.1K=$5r(c.1K);C(!2m)c.1m(\'9c\',c.I);o c},2M:m(19,17){o c.1k(19,17)},ft:m(2m){o c.21(2m)}});1j.3a.3y(N 9e,N 2E,N 4g);1j.3B={4i:m(L,17){C(L.2G(/2R/i))o c.33;B G=$G(17);C((G==\'1B\')||(G==\'2C\'&&17.1i(\' \')))o c.74;o c.9y},2U:m(el,L,5m){C(!5m.1f)5m=[5m];B 19=5m[0],17=5m[1];C(!$2w(17)){17=19;19=el.2s(L)}B 1C=c.4i(L,17);o{\'19\':1C.2U(19),\'17\':1C.2U(17),\'1C\':1C}}};1j.3B.9y={2U:m(K){o 6l(K)},5a:m(19,17,fx){o fx.4H(19,17)},4s:m(K,2H,L){C(2H==\'5q\'&&L!=\'2b\')K=1g.2B(K);o K+2H}};1j.3B.74={2U:m(K){o K.1f?K:K.61(\' \').2T(m(v){o 6l(v)})},5a:m(19,17,fx){B 15=[];M(B i=0;i<19.U;i++)15[i]=fx.4H(19[i],17[i]);o 15},4s:m(K,2H,L){C(2H==\'5q\'&&L!=\'2b\')K=K.2T(1g.2B);o K.2f(2H+\' \')+2H}};1j.3B.33={2U:m(K){o K.1f?K:K.5J(1d)},5a:m(19,17,fx){B 15=[];M(B i=0;i<19.U;i++)15[i]=1g.2B(fx.4H(19[i],17[i]));o 15},4s:m(K){o\'1y(\'+K.2f(\',\')+\')\'}};1j.8g=1j.3a.Y({1l:m(el,L,F){c.I=$(el);c.L=L;c.1w(F)},4m:m(){o c.2A(0)},4G:m(){c.15=c.1C.5a(c.19,c.17,c)},2A:m(17){c.1C=1j.3B.4i(c.L,17);o c.1w(c.1C.2U(17))},1k:m(19,17){C(c.1K&&c.F.3L)o c;B 2n=1j.3B.2U(c.I,c.L,[19,17]);c.1C=2n.1C;o c.1w(2n.19,2n.17)},4K:m(){c.I.1X(c.L,c.1C.4s(c.15,c.F.2H,c.L))}});T.Y({fu:m(L,F){o N 1j.8g(c,L,F)}});1j.4h=1j.3a.Y({1l:m(el,F){c.I=$(el);c.1w(F)},4G:m(){M(B p 1e c.19)c.15[p]=c.1C[p].5a(c.19[p],c.17[p],c)},2A:m(17){B 2n={};c.1C={};M(B p 1e 17){c.1C[p]=1j.3B.4i(p,17[p]);2n[p]=c.1C[p].2U(17[p])}o c.1w(2n)},1k:m(Q){C(c.1K&&c.F.3L)o c;c.15={};c.1C={};B 19={},17={};M(B p 1e Q){B 2n=1j.3B.2U(c.I,p,Q[p]);19[p]=2n.19;17[p]=2n.17;c.1C[p]=2n.1C}o c.1w(19,17)},4K:m(){M(B p 1e c.15)c.I.1X(p,c.1C[p].4s(c.15[p],c.F.2H,p))}});T.Y({3G:m(F){o N 1j.4h(c,F)}});1j.1L=1j.3a.Y({1l:m(V,F){c.V=$$(V);c.1w(F)},4G:m(){M(B i 1e c.19){B 6p=c.19[i],4j=c.17[i],3U=c.1C[i],6n=c.15[i]={};M(B p 1e 6p)6n[p]=3U[p].5a(6p[p],4j[p],c)}},2A:m(17){B 2n={};c.1C={};M(B i 1e 17){B 4j=17[i],3U=c.1C[i]={},bU=2n[i]={};M(B p 1e 4j){3U[p]=1j.3B.4i(p,4j[p]);bU[p]=3U[p].2U(4j[p])}}o c.1w(2n)},1k:m(Q){C(c.1K&&c.F.3L)o c;c.15={};c.1C={};B 19={},17={};M(B i 1e Q){B 89=Q[i],6p=19[i]={},4j=17[i]={},3U=c.1C[i]={};M(B p 1e 89){B 2n=1j.3B.2U(c.V[i],p,89[p]);6p[p]=2n.19;4j[p]=2n.17;3U[p]=2n.1C}}o c.1w(19,17)},4K:m(){M(B i 1e c.15){B 6n=c.15[i],3U=c.1C[i];M(B p 1e 6n)c.V[i].1X(p,3U[p].4s(6n[p],c.F.2H,p))}}});1j.au=1j.3a.Y({F:{2p:[],1G:{\'x\':0,\'y\':0},bB:1d},1l:m(I,F){c.15=[];c.I=$(I);c.1N={\'21\':c.21.12(c,O)};c.1w(F);C(c.F.bB){c.1F(\'4d\',m(){R.1F(\'5B\',c.1N.21)}.12(c));c.1F(\'1Y\',m(){R.4U(\'5B\',c.1N.21)}.12(c))}},4G:m(){M(B i=0;i<2;i++)c.15[i]=c.4H(c.19[i],c.17[i])},43:m(x,y){C(c.1K&&c.F.3L)o c;B el=c.I.7B();B 1P={\'x\':x,\'y\':y};M(B z 1e el.3v){B 1E=el.7A[z]-el.3v[z];C($2w(1P[z]))1P[z]=($G(1P[z])==\'4M\')?1P[z].1H(0,1E):1E;14 1P[z]=el.2O[z];1P[z]+=c.F.1G[z]}o c.1k([el.2O.x,el.2O.y],[1P.x,1P.y])},fs:m(){o c.43(O,0)},fw:m(){o c.43(O,\'bC\')},fz:m(){o c.43(0,O)},fv:m(){o c.43(\'bC\',O)},7W:m(el){B 1w=c.I.3u(c.F.2p);B 3V=$(el).3u(c.F.2p);o c.43(3V.x-1w.x,3V.y-1w.y)},4K:m(){c.I.43(c.15[0],c.15[1])}});1j.fq=1j.3a.Y({F:{2k:\'81\'},1l:m(el,F){c.I=$(el);c.3o=N T(\'5w\',{\'83\':$Y(c.I.bM(\'3q\'),{\'9Q\':\'4Y\'})}).7d(c.I).bE(c.I);c.I.1X(\'3q\',0);c.3h(F);c.15=[];c.1w(c.F);c.5c=1d;c.1F(\'1Y\',m(){c.5c=(c.15[0]===0)});C(W.6h)c.1F(\'1Y\',m(){C(c.5c)c.I.31().2h(c.3o)})},4G:m(){M(B i=0;i<2;i++)c.15[i]=c.4H(c.19[i],c.17[i])},81:m(){c.3q=\'3q-1t\';c.6k=\'2Z\';c.1G=c.I.3J},85:m(){c.3q=\'3q-1z\';c.6k=\'2L\';c.1G=c.I.4p},bW:m(2k){c[2k||c.F.2k]();o c.1k([c.I.2s(c.3q).3p(),c.3o.2s(c.6k).3p()],[0,c.1G])},bV:m(2k){c[2k||c.F.2k]();o c.1k([c.I.2s(c.3q).3p(),c.3o.2s(c.6k).3p()],[-c.1G,0])},4m:m(2k){c[2k||c.F.2k]();c.5c=O;o c.2A([-c.1G,0])},4o:m(2k){c[2k||c.F.2k]();c.5c=1d;o c.2A([0,c.1G])},fp:m(2k){C(c.3o.3J==0||c.3o.4p==0)o c.bW(2k);o c.bV(2k)},4K:m(){c.I.1X(c.3q,c.15[0]+c.F.2H);c.3o.1X(c.6k,c.15[1]+c.F.2H)}});1j.8e=m(2i,1I){1I=1I||[];C($G(1I)!=\'1B\')1I=[1I];o $Y(2i,{fr:m(1s){o 2i(1s,1I)},fC:m(1s){o 1-2i(1-1s,1I)},fF:m(1s){o(1s<=0.5)?2i(2*1s,1I)/2:(2-2i(2*(1-1s),1I))/2}})};1j.3E=N 3w({fJ:m(p){o p}});1j.3E.Y=m(8w){M(B 2i 1e 8w){1j.3E[2i]=N 1j.8e(8w[2i]);1j.3E.8h(2i)}};1j.3E.8h=m(2i){[\'fE\',\'fK\',\'f6\'].1v(m(8c){1j.3E[2i.4F()+8c]=1j.3E[2i][\'eQ\'+8c]})};1j.3E.Y({dZ:m(p,x){o 1g.3R(p,x[0]||6)},e0:m(p){o 1g.3R(2,8*(p-1))},e1:m(p){o 1-1g.bD(1g.dY(p))},dX:m(p){o 1-1g.bD((1-p)*1g.8d/2)},dU:m(p,x){x=x[0]||1.dV;o 1g.3R(p,2)*((x+1)*p-x)},dW:m(p){B K;M(B a=0,b=1;1;a+=b,b/=2){C(p>=(7-4*a)/11){K=-1g.3R((11-6*a-11*p)/4,2)+b*b;1h}}o K},e2:m(p,x){o 1g.3R(2,10*--p)*1g.aT(20*p*1g.8d*(x[0]||1)/3)}});[\'e3\',\'e9\',\'ea\',\'eb\'].1v(m(2i,i){1j.3E[2i]=N 1j.8e(m(p){o 1g.3R(p,[i+2])});1j.3E.8h(2i)});B 4a={};4a.3a=N 1b({F:{3O:O,2H:\'5q\',4d:1b.1r,aS:1b.1r,1Y:1b.1r,aQ:1b.1r,8W:1b.1r,1H:O,3H:{x:\'1z\',y:\'1t\'},4J:O,7t:6},1l:m(el,F){c.3h(F);c.I=$(el);c.3O=$(c.F.3O)||c.I;c.3A={\'15\':{},\'1s\':{}};c.K={\'1k\':{},\'15\':{}};c.1N={\'1k\':c.1k.3n(c),\'4l\':c.4l.3n(c),\'3T\':c.3T.3n(c),\'21\':c.21.12(c)};c.7x();C(c.F.1l)c.F.1l.26(c)},7x:m(){c.3O.1F(\'5A\',c.1N.1k);o c},aV:m(){c.3O.4U(\'5A\',c.1N.1k);o c},1k:m(J){c.1m(\'aS\',c.I);c.3A.1k=J.29;B 1H=c.F.1H;c.1H={\'x\':[],\'y\':[]};M(B z 1e c.F.3H){C(!c.F.3H[z])72;c.K.15[z]=c.I.2s(c.F.3H[z]).3p();c.3A.1s[z]=J.29[z]-c.K.15[z];C(1H&&1H[z]){M(B i=0;i<2;i++){C($2w(1H[z][i]))c.1H[z][i]=($G(1H[z][i])==\'m\')?1H[z][i]():1H[z][i]}}}C($G(c.F.4J)==\'4M\')c.F.4J={\'x\':c.F.4J,\'y\':c.F.4J};R.2V(\'34\',c.1N.4l);R.2V(\'62\',c.1N.21);c.1m(\'4d\',c.I);J.21()},4l:m(J){B aP=1g.2B(1g.e8(1g.3R(J.29.x-c.3A.1k.x,2)+1g.3R(J.29.y-c.3A.1k.y,2)));C(aP>c.F.7t){R.3x(\'34\',c.1N.4l);R.2V(\'34\',c.1N.3T);c.3T(J);c.1m(\'aQ\',c.I)}J.21()},3T:m(J){c.65=O;c.3A.15=J.29;M(B z 1e c.F.3H){C(!c.F.3H[z])72;c.K.15[z]=c.3A.15[z]-c.3A.1s[z];C(c.1H[z]){C($2w(c.1H[z][1])&&(c.K.15[z]>c.1H[z][1])){c.K.15[z]=c.1H[z][1];c.65=1d}14 C($2w(c.1H[z][0])&&(c.K.15[z]<c.1H[z][0])){c.K.15[z]=c.1H[z][0];c.65=1d}}C(c.F.4J[z])c.K.15[z]-=(c.K.15[z]%c.F.4J[z]);c.I.1X(c.F.3H[z],c.K.15[z]+c.F.2H)}c.1m(\'8W\',c.I);J.21()},21:m(){R.3x(\'34\',c.1N.4l);R.3x(\'34\',c.1N.3T);R.3x(\'62\',c.1N.21);c.1m(\'1Y\',c.I)}});4a.3a.3y(N 2E,N 4g);T.Y({e7:m(F){o N 4a.3a(c,$2j({3H:{x:\'2L\',y:\'2Z\'}},F))}});4a.aC=4a.3a.Y({F:{6Y:[],2l:O,2p:[]},1l:m(el,F){c.3h(F);c.I=$(el);c.6Y=$$(c.F.6Y);c.2l=$(c.F.2l);c.1x={\'I\':c.I.2s(\'1x\'),\'2l\':O};C(c.2l)c.1x.2l=c.2l.2s(\'1x\');C(![\'7D\',\'4t\',\'5f\'].1i(c.1x.I))c.1x.I=\'4t\';B 1t=c.I.2s(\'1t\').3p();B 1z=c.I.2s(\'1z\').3p();C(c.1x.I==\'4t\'&&![\'7D\',\'4t\',\'5f\'].1i(c.1x.2l)){1t=$2w(1t)?1t:c.I.b1(c.F.2p);1z=$2w(1z)?1z:c.I.b0(c.F.2p)}14{1t=$2w(1t)?1t:0;1z=$2w(1z)?1z:0}c.I.4P({\'1t\':1t,\'1z\':1z,\'1x\':c.1x.I});c.1w(c.I)},1k:m(J){c.3m=1p;C(c.2l){B 4L=c.2l.4X();B el=c.I.4X();C(c.1x.I==\'4t\'&&![\'7D\',\'4t\',\'5f\'].1i(c.1x.2l)){c.F.1H={\'x\':[4L.1z,4L.4Q-el.2L],\'y\':[4L.1t,4L.3X-el.2Z]}}14{c.F.1H={\'y\':[0,4L.2Z-el.2Z],\'x\':[0,4L.2L-el.2L]}}}c.1w(J)},3T:m(J){c.1w(J);B 3m=c.65?O:c.6Y.2S(c.aO,c).8E();C(c.3m!=3m){C(c.3m)c.3m.1m(\'eR\',[c.I,c]);c.3m=3m?3m.1m(\'e6\',[c.I,c]):1p}o c},aO:m(el){el=el.4X(c.F.2p);B 15=c.3A.15;o(15.x>el.1z&&15.x<el.4Q&&15.y<el.3X&&15.y>el.1t)},21:m(){C(c.3m&&!c.65)c.3m.1m(\'dT\',[c.I,c]);14 c.I.1m(\'dS\',c);c.1w();o c}});T.Y({dF:m(F){o N 4a.aC(c,F)}});B 6F=N 1b({F:{2u:\'5E\',aI:1d,b2:1b.1r,5k:1b.1r,7e:1b.1r,aH:1d,5Y:\'dG-8\',aK:O,4E:{}},9b:m(){c.2J=(W.6S)?N 6S():(W.35?N aB(\'dH.dE\'):O);o c},1l:m(F){c.9b().3h(F);c.F.5X=c.F.5X||c.5X;c.4E={};C(c.F.aH&&c.F.2u==\'5E\'){B 5Y=(c.F.5Y)?\'; dD=\'+c.F.5Y:\'\';c.5h(\'bl-G\',\'bm/x-7Z-dA-dB\'+5Y)}C(c.F.1l)c.F.1l.26(c)},aJ:m(){C(c.2J.5t!=4||!c.54)o;c.54=O;B 4O=0;5I{4O=c.2J.4O}5H(e){};C(c.F.5X.26(c,4O))c.5k();14 c.7e();c.2J.7g=1b.1r},5X:m(4O){o((4O>=dC)&&(4O<dI))},5k:m(){c.42={\'1Q\':c.2J.dJ,\'5N\':c.2J.dP};c.1m(\'5k\',[c.42.1Q,c.42.5N]);c.7V()},7e:m(){c.1m(\'7e\',c.2J)},5h:m(1q,K){c.4E[1q]=K;o c},5T:m(36,1Z){C(c.F.aK)c.b3();14 C(c.54)o c;c.54=1d;C(1Z&&c.F.2u==\'5p\'){36=36+(36.1i(\'?\')?\'&\':\'?\')+1Z;1Z=1p}c.2J.5c(c.F.2u.9i(),36,c.F.aI);c.2J.7g=c.aJ.12(c);C((c.F.2u==\'5E\')&&c.2J.dQ)c.5h(\'dR\',\'dO\');$Y(c.4E,c.F.4E);M(B G 1e c.4E)5I{c.2J.dN(G,c.4E[G])}5H(e){};c.1m(\'b2\');c.2J.5T($6b(1Z,1p));o c},b3:m(){C(!c.54)o c;c.54=O;c.2J.92();c.2J.7g=1b.1r;c.9b();c.1m(\'9c\');o c}});6F.3y(N 9e,N 2E,N 4g);B bh=6F.Y({F:{1Z:1p,9q:1p,1Y:1b.1r,77:O,97:O},1l:m(36,F){c.1F(\'5k\',c.1Y);c.3h(F);c.F.1Z=c.F.1Z||c.F.dK;C(![\'5E\',\'5p\'].1i(c.F.2u)){c.63=\'63=\'+c.F.2u;c.F.2u=\'5E\'}c.1w();c.5h(\'X-dL-dM\',\'6S\');c.5h(\'ec\',\'1Q/9p, 1Q/ed, bm/5N, 1Q/5N, */*\');c.36=36},1Y:m(){C(c.F.9q)$(c.F.9q).1r().66(c.42.1Q);C(c.F.77||c.F.97)c.77();c.1m(\'1Y\',[c.42.1Q,c.42.5N],20)},b7:m(1Z){1Z=1Z||c.F.1Z;1U($G(1Z)){P\'I\':1Z=$(1Z).5R();1h;P\'2X\':1Z=8L.5R(1Z)}C(c.63)1Z=(1Z)?[c.63,1Z].2f(\'&\'):c.63;o c.5T(c.36,1Z)},77:m(){B 2I,45;C(c.F.97||(/(eE|eF)2I/).2G(c.bs(\'bl-G\')))45=c.42.1Q;14{45=[];B 7b=/<2I[^>]*>([\\s\\S]*?)<\\/2I>/eG;5W((2I=7b.eD(c.42.1Q)))45.1f(2I[1]);45=45.2f(\'\\n\')}C(45)(W.bw)?W.bw(45):W.bv(45,0)},bs:m(1q){5I{o c.2J.eC(1q)}5H(e){};o 1p}});8L.5R=m(2a){B 5z=[];M(B L 1e 2a)5z.1f(6A(L)+\'=\'+6A(2a[L]));o 5z.2f(\'&\')};T.Y({5T:m(F){o N bh(c.5O(\'ez\'),$2j({1Z:c.5R()},F,{2u:\'5E\'})).b7()}});B 3Z=N 3w({F:{6s:O,6R:O,4u:O,58:O},2A:m(1A,K,F){F=$2j(c.F,F);K=6A(K);C(F.6s)K+=\'; 6s=\'+F.6s;C(F.6R)K+=\'; 6R=\'+F.6R;C(F.4u){B 6O=N b4();6O.eA(6O.b5()+F.4u*24*60*60*ba);K+=\'; eB=\'+6O.eH()}C(F.58)K+=\'; 58\';R.4N=1A+\'=\'+K;o $Y(F,{\'1A\':1A,\'K\':K})},5p:m(1A){B K=R.4N.2q(\'(?:^|;)\\\\s*\'+1A.bb()+\'=([^;]*)\');o K?eI(K[1]):O},31:m(4N,F){C($G(4N)==\'2X\')c.2A(4N.1A,\'\',$2j(4N,{4u:-1}));14 c.2A(4N,\'\',$2j(F,{4u:-1}))}});B 3N={4A:m(Q){1U($G(Q)){P\'2C\':o\'"\'+Q.3d(/(["\\\\])/g,\'\\\\$1\')+\'"\';P\'1B\':o\'[\'+Q.2T(3N.4A).2f(\',\')+\']\';P\'2X\':B 2C=[];M(B L 1e Q)2C.1f(3N.4A(L)+\':\'+3N.4A(Q[L]));o\'{\'+2C.2f(\',\')+\'}\';P\'4M\':C(eO(Q))1h;P O:o\'1p\'}o 6E(Q)},5l:m(4x,58){o(($G(4x)!=\'2C\')||(58&&!4x.2G(/^("(\\\\.|[^"\\\\\\n\\r])*?"|[,:{}\\[\\]0-9.\\-+eP-u \\n\\r\\t])+?$/)))?1p:eN(\'(\'+4x+\')\')}};3N.eM=6F.Y({1l:m(36,F){c.36=36;c.1F(\'5k\',c.1Y);c.1w(F);c.5h(\'X-eJ\',\'eK\')},5T:m(Q){o c.1w(c.36,\'eL=\'+3N.4A(Q))},1Y:m(){c.1m(\'1Y\',[3N.5l(c.42.1Q,c.F.58)])}});B bq=N 3w({9p:m(2a,1R){1R=$2j({\'5V\':1b.1r},1R);B 2I=N T(\'2I\',{\'4z\':2a}).7H({\'4r\':1R.5V,\'ex\':m(){C(c.5t==\'8v\')c.1m(\'4r\')}});57 1R.5V;o 2I.7r(1R).2h(R.7p)},1C:m(2a,1R){o N T(\'4W\',$2j({\'bu\':\'ej\',\'ek\':\'em\',\'G\':\'1Q/1C\',\'4R\':2a},1R)).2h(R.7p)},5F:m(2a,1R){1R=$2j({\'5V\':1b.1r,\'ei\':1b.1r,\'eh\':1b.1r},1R);B 5F=N ee();5F.4z=2a;B I=N T(\'9o\',{\'4z\':2a});[\'4r\',\'92\',\'b8\'].1v(m(G){B J=1R[\'5P\'+G];57 1R[\'5P\'+G];I.1F(G,m(){c.4U(G,1a.8K);J.26(c)})});C(5F.2L&&5F.2Z)I.1m(\'4r\',I,1);o I.7r(1R)},7n:m(5n,F){F=$2j({1Y:1b.1r,bp:1b.1r},F);C(!5n.1f)5n=[5n];B 7n=[];B 7o=0;5n.1v(m(2a){B 9o=N bq.5F(2a,{\'5V\':m(){F.bp.26(c,7o);7o++;C(7o==5n.U)F.1Y()}});7n.1f(9o)});o N 1L(7n)}});B 49=N 1b({U:0,1l:m(2X){c.Q=2X||{};c.5Z()},5p:m(1A){o(c.7l(1A))?c.Q[1A]:1p},7l:m(1A){o(1A 1e c.Q)},2A:m(1A,K){C(!c.7l(1A))c.U++;c.Q[1A]=K;o c},5Z:m(){c.U=0;M(B p 1e c.Q)c.U++;o c},31:m(1A){C(c.7l(1A)){57 c.Q[1A];c.U--}o c},1v:m(fn,12){$1v(c.Q,fn,12)},Y:m(Q){$Y(c.Q,Q);o c.5Z()},2j:m(){c.Q=$2j.3Q(1p,[c.Q].Y(1a));o c.5Z()},1r:m(){c.Q={};c.U=0;o c},1W:m(){B 1W=[];M(B L 1e c.Q)1W.1f(L);o 1W},1P:m(){B 1P=[];M(B L 1e c.Q)1P.1f(c.Q[L]);o 1P}});m $H(Q){o N 49(Q)};49.3Z=49.Y({1l:m(1q,F){c.1q=1q;c.F=$Y({\'aN\':1d},F||{});c.4r()},aX:m(){C(c.U==0){3Z.31(c.1q,c.F);o 1d}B 4x=3N.4A(c.Q);C(4x.U>ef)o O;3Z.2A(c.1q,4x,c.F);o 1d},4r:m(){c.Q=3N.5l(3Z.5p(c.1q),1d)||{};c.5Z()}});49.3Z.2P={};[\'Y\',\'2A\',\'2j\',\'1r\',\'31\'].1v(m(2u){49.3Z.2P[2u]=m(){49.1O[2u].3Q(c,1a);C(c.F.aN)c.aX();o c}});49.3Z.3y(49.3Z.2P);B 33=N 1b({1l:m(2R,G){G=G||(2R.1f?\'1y\':\'47\');B 1y,2r;1U(G){P\'1y\':1y=2R;2r=1y.91();1h;P\'2r\':1y=2R.9z();2r=2R;1h;4q:1y=2R.5J(1d);2r=1y.91()}1y.2r=2r;1y.47=1y.5L();o $Y(1y,33.1O)},5D:m(){B 5K=$A(1a);B 7u=($G(5K[5K.U-1])==\'4M\')?5K.en():50;B 1y=c.8C();5K.1v(m(2R){2R=N 33(2R);M(B i=0;i<3;i++)1y[i]=1g.2B((1y[i]/ 3j * (3j - 7u)) + (2R[i] /3j*7u))});o N 33(1y,\'1y\')},eo:m(){o N 33(c.2T(m(K){o 5j-K}))},eu:m(K){o N 33([K,c.2r[1],c.2r[2]],\'2r\')},ev:m(7w){o N 33([c.2r[0],7w,c.2r[2]],\'2r\')},ew:m(7w){o N 33([c.2r[0],c.2r[1],7w],\'2r\')}});m $et(r,g,b){o N 33([r,g,b],\'1y\')};m $es(h,s,b){o N 33([h,s,b],\'2r\')};2K.Y({91:m(){B 6a=c[0],6i=c[1],7C=c[2];B 3g,7z,7T;B 1E=1g.1E(6a,6i,7C),3s=1g.3s(6a,6i,7C);B 4I=1E-3s;7T=1E/5j;7z=(1E!=0)?4I/1E:0;C(7z==0){3g=0}14{B 9h=(1E-6a)/4I;B 9n=(1E-6i)/4I;B br=(1E-7C)/4I;C(6a==1E)3g=br-9n;14 C(6i==1E)3g=2+9h-br;14 3g=4+9n-9h;3g/=6;C(3g<0)3g++}o[1g.2B(3g*ay),1g.2B(7z*3j),1g.2B(7T*3j)]},9z:m(){B br=1g.2B(c[2]/3j*5j);C(c[1]==0){o[br,br,br]}14{B 3g=c[0]%ay;B f=3g%60;B p=1g.2B((c[2]*(3j-c[1]))/ep*5j);B q=1g.2B((c[2]*(ai-c[1]*f))/aj*5j);B t=1g.2B((c[2]*(ai-c[1]*(60-f)))/aj*5j);1U(1g.ak(3g/60)){P 0:o[br,t,p];P 1:o[q,br,p];P 2:o[p,br,t];P 3:o[p,q,br];P 4:o[t,p,br];P 5:o[br,p,q]}}o O}});B av=N 1b({F:{6q:20,7L:1,7J:m(x,y){c.I.43(x,y)}},1l:m(I,F){c.3h(F);c.I=$(I);c.8r=([W,R].1i(I))?$(R.48):c.I},1k:m(){c.8u=c.ad.3n(c);c.8r.2V(\'34\',c.8u)},21:m(){c.8r.3x(\'34\',c.8u);c.1K=$5r(c.1K)},ad:m(J){c.29=(c.I==W)?J.ae:J.29;C(!c.1K)c.1K=c.2O.4c(50,c)},2O:m(){B el=c.I.7B();B 1s=c.I.3u();B 3K={\'x\':0,\'y\':0};M(B z 1e c.29){C(c.29[z]<(c.F.6q+1s[z])&&el.2O[z]!=0)3K[z]=(c.29[z]-c.F.6q-1s[z])*c.F.7L;14 C(c.29[z]+c.F.6q>(el.3v[z]+1s[z])&&el.2O[z]+el.3v[z]!=el.7A[z])3K[z]=(c.29[z]-el.3v[z]+c.F.6q-1s[z])*c.F.7L}C(3K.y||3K.x)c.1m(\'7J\',[el.2O.x+3K.x,el.2O.y+3K.y])}});av.3y(N 2E,N 4g);B 9m=N 1b({F:{7J:1b.1r,1Y:1b.1r,8I:m(1s){c.4b.1X(c.p,1s)},2k:\'85\',7k:3j,1G:0},1l:m(el,4b,F){c.I=$(el);c.4b=$(4b);c.3h(F);c.98=-1;c.8V=-1;c.2z=-1;c.I.1F(\'5A\',c.a7.3n(c));B 7q,1G;1U(c.F.2k){P\'85\':c.z=\'x\';c.p=\'1z\';7q={\'x\':\'1z\',\'y\':O};1G=\'4p\';1h;P\'81\':c.z=\'y\';c.p=\'1t\';7q={\'x\':O,\'y\':\'1t\'};1G=\'3J\'}c.1E=c.I[1G]-c.4b[1G]+(c.F.1G*2);c.a4=c.4b[1G]/2;c.a8=c.I[\'5p\'+c.p.7O()].12(c.I);c.4b.1X(\'1x\',\'7D\').1X(c.p,-c.F.1G);B 8P={};8P[c.z]=[-c.F.1G,c.1E-c.F.1G];c.3T=N 4a.3a(c.4b,{1H:8P,3H:7q,7t:0,4d:m(){c.7G()}.12(c),8W:m(){c.7G()}.12(c),1Y:m(){c.7G();c.2m()}.12(c)});C(c.F.1l)c.F.1l.26(c)},2A:m(2z){c.2z=2z.1H(0,c.F.7k);c.7E();c.2m();c.1m(\'8I\',c.9N(c.2z));o c},a7:m(J){B 1x=J.29[c.z]-c.a8()-c.a4;1x=1x.1H(-c.F.1G,c.1E-c.F.1G);c.2z=c.8Q(1x);c.7E();c.2m();c.1m(\'8I\',1x)},7G:m(){c.2z=c.8Q(c.3T.K.15[c.z]);c.7E()},7E:m(){C(c.98!=c.2z){c.98=c.2z;c.1m(\'7J\',c.2z)}},2m:m(){C(c.8V!==c.2z){c.8V=c.2z;c.1m(\'1Y\',c.2z+\'\')}},8Q:m(1x){o 1g.2B((1x+c.F.1G)/c.1E*c.F.7k)},9N:m(2z){o c.1E*2z/c.F.7k}});9m.3y(N 2E);9m.3y(N 4g);B er=1j.au.Y({1l:m(F){c.1w(W,F);c.6m=(c.F.6m)?$$(c.F.6m):$$(R.6m);B 59=W.59.4R.2q(/^[^#]*/)[0]+\'#\';c.6m.1v(m(4W){C(4W.4R.3t(59)!=0)o;B 3W=4W.4R.6T(59.U);C(3W&&$(3W))c.9L(4W,3W)},c);C(!W.6h)c.1F(\'1Y\',m(){W.59.eq=c.3W})},9L:m(4W,3W){4W.1F(\'78\',m(J){c.3W=3W;c.7W(3W);J.21()}.3n(c))}});B b6=N 1b({F:{4T:O,4d:1b.1r,1Y:1b.1r,3f:1d,7t:3,aZ:m(I,3f){3f.1X(\'2b\',0.7);I.1X(\'2b\',0.7)},bt:m(I,3f){I.1X(\'2b\',1);3f.31();c.4v.31()}},1l:m(5b,F){c.3h(F);c.5b=$(5b);c.V=c.5b.99();c.4T=(c.F.4T)?$$(c.F.4T):c.V;c.1N={\'1k\':[],\'5Q\':c.5Q.3n(c)};M(B i=0,l=c.4T.U;i<l;i++){c.1N.1k[i]=c.1k.3n(c,c.V[i])}c.7x();C(c.F.1l)c.F.1l.26(c);c.1N.56=c.56.3n(c);c.1N.2m=c.2m.12(c)},7x:m(){c.4T.1v(m(3O,i){3O.1F(\'5A\',c.1N.1k[i])},c)},aV:m(){c.4T.1v(m(3O,i){3O.4U(\'5A\',c.1N.1k[i])},c)},1k:m(J,el){c.4S=el;c.7Q=c.5b.4X();C(c.F.3f){B 1x=el.3u();c.1G=J.29.y-1x.y;c.4v=N T(\'5w\').2h(R.48);c.3f=el.aW().2h(c.4v).4P({\'1x\':\'4t\',\'1z\':1x.x,\'1t\':J.29.y-c.1G});R.2V(\'34\',c.1N.5Q);c.1m(\'aZ\',[el,c.3f])}R.2V(\'34\',c.1N.56);R.2V(\'62\',c.1N.2m);c.1m(\'4d\',el);J.21()},5Q:m(J){B K=J.29.y-c.1G;K=K.1H(c.7Q.1t,c.7Q.3X-c.3f.3J);c.3f.1X(\'1t\',K);J.21()},56:m(J){B 15=J.29.y;c.2y=c.2y||15;B 7m=((c.2y-15)>0);B 7s=c.4S.by();B 2W=c.4S.8a();C(7s&&7m&&15<7s.4X().3X)c.4S.8z(7s);C(2W&&!7m&&15>2W.4X().1t)c.4S.7d(2W);c.2y=15},eg:m(bn){o c.5b.99().2T(bn||m(el){o c.V.3t(el)},c)},2m:m(){c.2y=1p;R.3x(\'34\',c.1N.56);R.3x(\'62\',c.1N.2m);C(c.F.3f){R.3x(\'34\',c.1N.5Q);c.1m(\'bt\',[c.4S,c.3f])}c.1m(\'1Y\',c.4S)}});b6.3y(N 2E,N 4g);B 9I=N 1b({F:{9J:m(4e){4e.1X(\'52\',\'8Z\')},9F:m(4e){4e.1X(\'52\',\'4Y\')},8b:30,bS:3j,bZ:3j,1D:\'ey\',6o:{\'x\':16,\'y\':16},5f:O},1l:m(V,F){c.3h(F);c.4f=N T(\'5w\',{\'53\':c.F.1D+\'-4e\',\'83\':{\'1x\':\'4t\',\'1t\':\'0\',\'1z\':\'0\',\'52\':\'4Y\'}}).2h(R.48);c.3o=N T(\'5w\').2h(c.4f);$$(V).1v(c.bg,c);C(c.F.1l)c.F.1l.26(c)},bg:m(el){el.$22.4w=(el.4R&&el.51()==\'a\')?el.4R.3d(\'8H://\',\'\'):(el.bu||O);C(el.5C){B 6W=el.5C.61(\'::\');C(6W.U>1){el.$22.4w=6W[0].5e();el.$22.6j=6W[1].5e()}14{el.$22.6j=el.5C}el.aE(\'5C\')}14{el.$22.6j=O}C(el.$22.4w&&el.$22.4w.U>c.F.8b)el.$22.4w=el.$22.4w.6T(0,c.F.8b-1)+"&e4;";el.1F(\'8s\',m(J){c.1k(el);C(!c.F.5f)c.9j(J);14 c.1x(el)}.12(c));C(!c.F.5f)el.1F(\'34\',c.9j.3n(c));B 2m=c.2m.12(c);el.1F(\'8y\',2m);el.1F(\'4v\',2m)},1k:m(el){c.3o.1r();C(el.$22.4w){c.5C=N T(\'aR\').2h(N T(\'5w\',{\'53\':c.F.1D+\'-5C\'}).2h(c.3o)).66(el.$22.4w)}C(el.$22.6j){c.1Q=N T(\'aR\').2h(N T(\'5w\',{\'53\':c.F.1D+\'-1Q\'}).2h(c.3o)).66(el.$22.6j)}$5r(c.1K);c.1K=c.4o.2t(c.F.bS,c)},2m:m(J){$5r(c.1K);c.1K=c.4m.2t(c.F.bZ,c)},1x:m(I){B 1s=I.3u();c.4f.4P({\'1z\':1s.x+c.F.6o.x,\'1t\':1s.y+c.F.6o.y})},9j:m(J){B bJ={\'x\':W.9k(),\'y\':W.9f()};B 2O={\'x\':W.9s(),\'y\':W.8M()};B 4e={\'x\':c.4f.4p,\'y\':c.4f.3J};B 23={\'x\':\'1z\',\'y\':\'1t\'};M(B z 1e 23){B 1s=J.29[z]+c.F.6o[z];C((1s+4e[z]-2O[z])>bJ[z])1s=J.29[z]-c.F.6o[z]-4e[z];c.4f.1X(23[z],1s)}},4o:m(){C(c.F.aF)c.1K=c.4m.2t(c.F.aF,c);c.1m(\'9J\',[c.4f])},4m:m(){c.1m(\'9F\',[c.4f])}});9I.3y(N 2E,N 4g);B fB=N 1b({1l:m(){c.76=$A(1a);c.1c={};c.5i={}},1F:m(G,fn){c.5i[G]=c.5i[G]||{};c.1c[G]=c.1c[G]||[];C(c.1c[G].1i(fn))o O;14 c.1c[G].1f(fn);c.76.1v(m(6e,i){6e.1F(G,c.4l.12(c,[G,6e,i]))},c);o c},4l:m(G,6e,i){c.5i[G][i]=1d;B 4V=c.76.4V(m(2v,j){o c.5i[G][j]||O},c);C(!4V)o;c.5i[G]={};c.1c[G].1v(m(J){J.26(c,c.76,6e)},c)}});B 80=1j.1L.Y({F:{8X:1b.1r,9u:1b.1r,41:0,4o:O,2Z:1d,2L:O,2b:1d,6L:O,6z:O,3L:O,6x:O},1l:m(){B F,2N,V,2l;$1v(1a,m(2o,i){1U($G(2o)){P\'2X\':F=2o;1h;P\'I\':2l=$(2o);1h;4q:B 1n=$$(2o);C(!2N)2N=1n;14 V=1n}});c.2N=2N||[];c.V=V||[];c.2l=$(2l);c.3h(F);c.2y=-1;C(c.F.6x)c.F.3L=1d;C($2w(c.F.4o)){c.F.41=O;c.2y=c.F.4o}C(c.F.1k){c.F.41=O;c.F.4o=O}c.3G={};C(c.F.2b)c.3G.2b=\'aw\';C(c.F.2L)c.3G.2L=c.F.6z?\'9V\':\'4p\';C(c.F.2Z)c.3G.2Z=c.F.6L?\'9P\':\'6d\';M(B i=0,l=c.2N.U;i<l;i++)c.af(c.2N[i],c.V[i]);c.V.1v(m(el,i){C(c.F.4o===i){c.1m(\'8X\',[c.2N[i],el])}14{M(B fx 1e c.3G)el.1X(fx,0)}},c);c.1w(c.V);C($2w(c.F.41))c.41(c.F.41)},af:m(3D,I,1s){3D=$(3D);I=$(I);B 2G=c.2N.1i(3D);B 3P=c.2N.U;c.2N.6c(3D);c.V.6c(I);C(3P&&(!2G||1s)){1s=$6b(1s,3P-1);3D.8z(c.2N[1s]);I.7d(3D)}14 C(c.2l&&!2G){3D.2h(c.2l);I.2h(c.2l)}B am=c.2N.3t(3D);3D.1F(\'78\',c.41.12(c,am));C(c.F.2Z)I.4P({\'4Z-1t\':0,\'3c-1t\':\'7i\',\'4Z-3X\':0,\'3c-3X\':\'7i\'});C(c.F.2L)I.4P({\'4Z-1z\':0,\'3c-1z\':\'7i\',\'4Z-4Q\':0,\'3c-4Q\':\'7i\'});I.aw=1;C(c.F.6z)I.9V=c.F.6z;C(c.F.6L)I.9P=c.F.6L;I.1X(\'9Q\',\'4Y\');C(!2G){M(B fx 1e c.3G)I.1X(fx,0)}o c},41:m(2e){2e=($G(2e)==\'I\')?c.V.3t(2e):2e;C((c.1K&&c.F.3L)||(2e===c.2y&&!c.F.6x))o c;c.2y=2e;B Q={};c.V.1v(m(el,i){Q[i]={};B 4m=(i!=2e)||(c.F.6x&&(el.3J>0));c.1m(4m?\'9u\':\'8X\',[c.2N[i],el]);M(B fx 1e c.3G)Q[i][fx]=4m?0:el[c.3G[fx]]},c);o c.1k(Q)},dc:m(2e){o c.41(2e)}});1j.80=80;',62,978,'||||||||||||this||||||||||function||return|||||||||||||var|if|||options|type||element|event|value|property|for|new|false|case|obj|document||Element|length|elements|window||extend||||bind||else|now||to|items|from|arguments|Class|events|true|in|push|Math|break|contains|Fx|start|initialize|fireEvent|temp|param|null|name|empty|pos|top|args|each|parent|position|rgb|left|key|array|css|className|max|addEvent|offset|limit|params|selector|timer|Elements|tag|bound|prototype|values|text|properties|result|style|switch|bits|keys|setStyle|onComplete|data||stop|tmp|prop||props|call||pseudo|page|source|opacity|nocash|context|index|join|id|inject|transition|merge|mode|container|end|parsed|argument|overflown|match|hsb|getStyle|delay|method|current|chk|Selectors|previous|step|set|round|string|relatedTarget|Events|xpath|test|unit|script|transport|Array|width|custom|togglers|scroll|Methods|Garbage|color|filter|map|parse|addListener|next|object|getElementsByTagName|height||remove||Color|mousemove|ie|url||||Base|documentElement|border|replace|Event|ghost|hue|setOptions|bit|100|create|parser|overed|bindWithEvent|wrapper|toInt|margin|option|min|indexOf|getPosition|size|Abstract|removeListener|implement|attributes|mouse|CSS|parentNode|toggler|Transitions|item|effects|modifiers|returns|offsetHeight|change|wait|time|Json|handle|len|apply|pow|pseudos|drag|iCss|target|anchor|bottom|xparser|Cookie||display|response|scrollTo|found|scripts||hex|body|Hash|Drag|knob|periodical|onStart|tip|toolTip|Options|Styles|select|iTo|webkit|check|hide|iterable|show|offsetWidth|default|load|getValue|absolute|duration|trash|myTitle|str|chains|src|toString|val|charAt|separator|headers|toLowerCase|setNow|compute|delta|grid|increase|cont|number|cookie|status|setStyles|right|href|active|handles|removeEvent|every|link|getCoordinates|hidden|padding||getTag|visibility|class|running|concat|move|delete|secure|location|getNow|list|open|scrollTop|trim|fixed|scrollLeft|setHeader|checker|255|onSuccess|evaluate|fromTo|sources|tagName|get|px|clear|xhtml|readyState|htmlElement|results|div|collect|native|queryString|mousedown|mousewheel|title|mix|post|image|classNames|catch|try|hexToRgb|colors|rgbToHex|walk|xml|getProperty|on|moveGhost|toQueryString|HTMLElement|send|precision|onload|while|isSuccess|encoding|setLength||split|mouseup|_method|klass|out|setHTML|getParam|domReady|getItems|red|pick|include|scrollHeight|instance|unique|getElementById|webkit419|green|myText|layout|parseFloat|links|iNow|offsets|iFrom|area|parseInt|domain|children|prefix|slice|resolver|alwaysHide|shared|fixedWidth|encodeURIComponent|evType|fKey|realType|String|XHR|code|preventDefault|fix|splice|setMany|fixedHeight|generic|Listeners|date|included|removeEvents|path|XMLHttpRequest|substr|stopPropagation|Properties|dual|loaded|droppables|scrollWidth|attempt|defined|continue|brother|Multi|getElements|instances|evalScripts|click|nodeType|filterByAttribute|regexp|Filter|injectAfter|onFailure|getElementsBySelector|onreadystatechange|setProperty|none|currentStyle|steps|hasKey|up|images|counter|head|mod|setProperties|prev|snap|alpha|proto|percent|attach|mp|saturation|scrollSize|getSize|blue|relative|checkStep|regex|draggedKnob|addEvents|typeof|onChange|forEach|velocity|pageY|ie_ready|capitalize|filterByClass|coordinates|hasClass|hasTag|brightness|innerText|callChain|toElement|camelCase|domready|www|Accordion|vertical|pairs|styles|childNodes|horizontal|filterById|add|all|iProps|getNext|maxTitleChars|easeType|PI|Transition|Method|Style|compat|flag|node|multiple|checked|selected|Dom|firstChild|disabled|qs|mousemover|mouseenter|XPath|coord|complete|transitions|cssText|mouseleave|injectBefore|classes|separators|copy|merged|getLast|snapshotItem|insertBefore|http|onTick|mouseout|callee|Object|getScrollTop|unload|operator|lim|toStep|first|Function|mouseover|DOMMouseScroll|previousEnd|onDrag|onActive|random|visible|hasChild|rgbToHsb|abort|NativeEvents|gecko|newArray|addEventListener|evalResponse|previousChange|getChildren|getMany|setTransport|onCancel|appendChild|Chain|getHeight|RegExp|rr|toUpperCase|locate|getWidth|clean|Slider|gr|img|javascript|update|pageX|getScrollLeft|textarea|onBackground|opera|getScrollHeight|clientHeight|Single|hsbToRgb|clientWidth|getFormElements|fps|getScrollWidth|borderShort|onHide|pageXOffset|input|Tips|onShow|pageYOffset|useLink|removeEventListener|toPosition|shift|fullHeight|overflow|normal|extended|namespaceURI|Pseudo|fullWidth|regExp|beforeunload|wheelDelta|clientY|which|relatedTargetGecko|fixRelatedTarget|clientX|half|keydown|cloneEvents|clickedElement|getPos|starts|with|picked|sRegExp|getCoords|client|addSection|getElement|PropertiesIFlag|6000|600000|floor|nodeName|idx|snapshotLength|UNORDERED_NODE_SNAPSHOT_TYPE||XPathResult|substring|w3|org|Scroll|Scroller|fullOpacity|1999|360|Left|zoom|ActiveXObject|Move|defaultView|removeAttribute|timeout|setOpacity|urlEncoded|async|onStateChange|autoCancel|removeClass|addClass|autoSave|checkAgainst|distance|onSnap|span|onBeforeStart|cos|Merge|detach|clone|save|hyphenate|onDragStart|getLeft|getTop|onRequest|cancel|Date|getTime|Sortables|request|error|elementsProperty|1000|escapeRegExp|Number|interval|toFloat|createElement|build|Ajax|where|after|before|Content|application|converter|contents|onProgress|Asset||getHeader|onDragComplete|rel|setTimeout|execScript|nodeValue|getPrevious|Top|pp|wheelStops|full|sin|adopt|removeChild|undefined|Width|styleSheet|win|constructor|appendText|getStyles|textContent|ie6|fixStyle|Bottom|0px|showDelay|Right|iParsed|slideOut|slideIn|innerHTML|direction|hideDelay|borderColor|wheel|alt|shiftKey|srcElement|injectInside|injectTop|DOMElement|control|meta|altKey|ctrlKey|metaKey|associate|borderWidth|rightClick|times|getBoxObjectFor|menu|button|bindAsEventListener|err|fromElement|setInterval|transparent|khtml|fromCharCode|getRandom|borderStyle|cloneNode|iframe|some|pass|boolean|embed|111|keyCode|detail|120|webkit420|readOnly|Sibling|collection|frameborder|setText|frameBorder|getText|readonly|getPropertyValue|getComputedStyle|maxlength|maxLength|whitespace|getFirst|clearTimeout|getParent|ie7|getAttribute|navigator|removeProperty|Document|Window|getProperties|setAttribute|clearInterval|attachEvent|lastChild|tabIndex|tabindex|toggleClass|createTextNode|colspan|clearChain|colSpan|showThisHideOpen|MooTools|replaceWith|execCommand|replaceChild|taintEnabled|htmlFor|chain|rowspan|detachEvent|textnode|accessKey||hasLayout|BackgroundImageCache|accesskey|zIndex|rowSpan|version|float|styleFloat|cssFloat|CollectGarbage|500|form|urlencoded|200|charset|XMLHTTP|makeDraggable|utf|Microsoft|300|responseText|postBody|Requested|With|setRequestHeader|close|responseXML|overrideMimeType|Connection|emptydrop|drop|Back|618|Bounce|Sine|acos|Pow|Expo|Circ|Elastic|Quad|hellip|cancelBubble|over|makeResizable|sqrt|Cubic|Quart|Quint|Accept|html|Image|4096|serialize|onerror|onabort|stylesheet|media||screen|pop|invert|10000|hash|SmoothScroll|HSB|RGB|setHue|setSaturation|setBrightness|readystatechange|tool|action|setTime|expires|getResponseHeader|exec|ecma|java|gi|toGMTString|decodeURIComponent|Request|JSON|json|Remote|eval|isFinite|Eaeflnr|ease|leave|nextSibling|getElementsByClassName|enter|sibling|zA|following|checkbox|backspace|protocol|https|offsetParent|offsetTop|password|offsetLeft|InOut|ES|resize|space|keyup|keypress|tab|dblclick|focus|esc|filterByTag|down|contextmenu|reset|blur|submit|void||radio|toggle|Slide|easeIn|toTop|clearTimer|effect|toRight|toBottom||returnValue|toLeft|write|Group|easeOut|innerWidth|In|easeInOut|DOMContentLoaded|onDomReady|defer|linear|Out|innerHeight'.split('|'),0,{}))
window.extend({

        getWidth: function(){
                if (this.webkit419) return this.innerWidth;
                if (this.opera) return document.body.clientWidth;
                return document.documentElement.clientWidth || document.body.clientWidth;
        },

        getHeight: function(){
                if (this.webkit419) return this.innerHeight;
                if (this.opera) return document.body.clientHeight;
                return document.documentElement.clientHeight || document.body.clientHeight;
        },

        getScrollWidth: function(){
                if (this.ie) return Math.max(document.documentElement.offsetWidth || document.body.offsetWidth, document.documentElement.scrollWidth || document.body.scrollWidth);
                if (this.webkit) return document.body.scrollWidth;
                return document.documentElement.scrollWidth;
        },

        getScrollHeight: function(){
                if (this.ie) return Math.max(document.documentElement.offsetHeight || document.body.offsetHeight, document.documentElement.scrollHeight || document.body.scrollHeight);
                if (this.webkit) return document.body.scrollHeight;
                return document.documentElement.scrollHeight;
        },

        getScrollLeft: function(){
                return this.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft;
        },

        getScrollTop: function(){
                return this.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
        },

        getSize: function(){
                return {
                        'size': {'x': this.getWidth(), 'y': this.getHeight()},
                        'scrollSize': {'x': this.getScrollWidth(), 'y': this.getScrollHeight()},
                        'scroll': {'x': this.getScrollLeft(), 'y': this.getScrollTop()}
                };
        }

});

Element.extend({

        getValue: function() {
          /*if ((this.getTag() == 'input') && ['checkbox', 'radio'].contains(this.type)) {
            return this.checked ? 1 : 0;
          } else {
            return this.parent();
          }*/
                switch(this.getTag()){
                        case 'select':
                                var values = [];
                                $each(this.options, function(option){
                                        if (option.selected) values.push((option.value != '')?option.value:option.text);
                                });
                                return (this.multiple) ? values : values[0];
                        case 'input': 
                                if (this.type == 'radio') {
                                  return this.checked ? this.value : false;
                                }
                                /*if (['checkbox', 'radio'].contains(this.type)) {
                                        return this.checked ? 1 : 0;
                                } else {
                                        if (!['hidden', 'text', 'password'].contains(this.type)) break;
                                }*/
                                if (this.type == 'checkbox') {
                                        return this.checked ? 1 : 0;
                                /*} else if (this.type == 'radio') {
                                        return this.checked ? this.value : 0;
                                */} else {
                                        if (!['hidden', 'text', 'password'].contains(this.type)) break;
                                }
                        case 'textarea': return this.value;
                }
                return false;
        }

});

Element.counter = 1;

Element.extend({

  upwards: function(iterator) {
    var element = this;
    while (element) {
      if (iterator(element)) return element;
      element = element.getParent?element.getParent():null;
    }
    return element;
  },

  getParentByTagName: function(tagName) {
    return this.upwards(function(e) {
      if (e.getTag() == tagName) 
        return e;
    });
  },

  identify: function() {
    var id = this.getAttribute('id');
    if (id) return id;
    do { id = 'anonymous_element_' + Element.counter++ } while ($(id));
    this.setAttribute('id', id);
    return id;
  },

  hasAttribute: function(attribute) {
    return this.getAttributeNode(attribute);
  },
  
  fireStdEvent: function(event) {
    if (window.ie) {
        var eventObj = document.createEventObject();
        eventObj.fromElement = eventObj.toElement = this;
      return this.fireEvent_native('on' + event, eventObj);
    } else {
      var evt = document.createEvent("Events");
      evt.initEvent(event, true, true);
      return this.dispatchEvent(evt);
    }
  },
  
  focusFirstElement: function() {
    if (this.getTag() != 'form') return;
    if (this.elements.length <= 0) return;
    // Find first non-hidden input
    for (var i = 0; i < this.elements.length; i++) {
      if (this.elements[i].type == 'hidden') continue;
      this.elements[i].focus();
      break;
    }
  },

  highlight: function(color, options) {
    if (!this.fx) this.fx = this.effect('background-color', $merge({ wait: false, duration: 500 }));
    if (options) this.fx.$merge(options);
    var from = this.getStyle('background-color').substring(1) || 'transparent';               
    var to   = color;
    /*this.fx.start(from, to).chain(function() {
      this.setStyle('background-color', from);
    }.bind(this));*/
    this.fx.start(from, to).chain(function() {
      //this.setStyle('background-color', 'transparent');
      this.setStyle('background-color', '');
    }.bind(this));
  }
  
});

Element.Storage = {

  get: function(uid){
    return (this[uid] = this[uid] || {});
  }

};

Element.Methods.Storage = {

  retrieve: function(property, dflt){
    var storage = Element.Storage.get(this.identify());
    var prop = storage[property];
    if ($defined(dflt) && !$defined(prop)) prop = storage[property] = dflt;
    return $pick(prop);
  },

  store: function(property, value){
    var storage = Element.Storage.get(this.identify());
    storage[property] = value;
    return this;
  },

  eliminate: function(property){
    var storage = Element.Storage.get(this.identify());
    delete storage[property];
    return this;
  }

};

window.extend(Element.Methods.Storage);
document.extend(Element.Methods.Storage);
Element.extend(Element.Methods.Storage);

if (!Object.prototype.hasOwnProperty) {
        Object.prototype.hasOwnProperty = function(property) {
                try {
                        var prototype = this.constructor.prototype;
                        while (prototype) {
                                if (prototype[property] == this[property]) {
                                  return false;
                        }
                        prototype = prototype.prototype;
                }
                } catch(e) {}
                return true;
        }
}

Element.extend({

  toQueryString: function(filter){
    var elements = this.getFormElements();
    if (filter && $type(filter) == 'function') {
      elements = elements.filter(filter);
    }
    
    /*var queryString = [];
    elements.each(function(el){
      var name = el.name;
      var value = el.getValue();
      if (value === false || !name || el.disabled) return;
      var qs = function(val){
        queryString.push(name + '=' + encodeURIComponent(val));
      };
      if ($type(value) == 'array') value.each(qs);
      else qs(value);
    });
    return queryString.join('&');*/
    var values = {};
    var queryString = [];
    elements.each(function(el){
      var name = el.name;
      var value = el.getValue();
      if (value === false || !name || el.disabled) return;
      var qs = function(val){
        //queryString.push(name + '=' + encodeURIComponent(val));
        values[name] = encodeURIComponent(val);
      };
      if ($type(value) == 'array') value.each(qs);
      else qs(value);
    });
    $H(values).each(function(value, name) {
      queryString.push(name + '=' + value);
    });
    return queryString.join('&');
  }

});

String.extend({
  pad: function(len, chr) {
    chr = chr || ' ';
    var times = function(chr, count) {
      var result = '';
      for (var i = 0; i < count; i++) result += chr;
      return result;
    };
    return times(chr, len - this.length) + this;
  },
  
  extractFileName: function() {
    return this.split("/").getLast();
  },
  
  nl2br: function() {
    return this.replace(/\n/g, '<br/>').replace(/\r/g, '');
  },
  
  prepare: function(params) {
    return this.replace(/\:[a-z0-9_\-]+/ig, function(value) {
      return params[value] || '';
    });
  },

  sprintf: function(params) {
    var _params = $A(params).copy();
    return this.replace(/%[a-z0-9]{1}/ig, function(value) {
      try {
        return (_params.length > 0) ? _params.shift() : '';
      } catch(e) {
        return '';
      }
    });
  }
});

Number.extend({
  pad: function(len, chr) {
    chr = chr || ' ';
    var times = function(chr, count) {
      var result = '';
      for (var i = 0; i < count; i++) result += chr;
      return result;
    };
    var s = this.toString();
    return times(chr, len - s.length) + s;
  }
});

Element.Styles12 = $H({
  width: '@px', height: '@px', left: '@px', top: '@px', bottom: '@px', right: '@px', maxWidth: '@px', maxHeight: '@px',
  backgroundColor: 'rgb(@, @, @)', backgroundPosition: '@px @px', color: 'rgb(@, @, @)',
  fontSize: '@px', letterSpacing: '@px', lineHeight: '@px', clip: 'rect(@px @px @px @px)',
  margin: '@px @px @px @px', padding: '@px @px @px @px', border: '@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)',
  borderWidth: '@px @px @px @px', borderStyle: '@ @ @ @', borderColor: 'rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)',
  zIndex: '@', 'zoom': '@', fontWeight: '@',
  textIndent: '@px', opacity: '@'
});

Element.ShortStyles = {'margin': {}, 'padding': {}, 'border': {}, 'borderWidth': {}, 'borderStyle': {}, 'borderColor': {}};

['Top', 'Right', 'Bottom', 'Left'].each(function(direction){
  var Short = Element.ShortStyles;
  var All = Element.Styles12;
  ['margin', 'padding'].each(function(style){
    var sd = style + direction;
    Short[style][sd] = All[sd] = '@px';
  });
  var bd = 'border' + direction;
  Short.border[bd] = All[bd] = '@px @ rgb(@, @, @)';
  var bdw = bd + 'Width', bds = bd + 'Style', bdc = bd + 'Color';
  Short[bd] = {};
  Short.borderWidth[bdw] = Short[bd][bdw] = All[bdw] = '@px';
  Short.borderStyle[bds] = Short[bd][bds] = All[bds] = '@';
  Short.borderColor[bdc] = Short[bd][bdc] = All[bdc] = 'rgb(@, @, @)';
});

Fx.Styles = Fx.Styles.extend({

  set: function(to) {
    if (typeof to == 'string') to = this.search(to);
    return this.parent(to);
  },

  start: function(obj) {
    if (typeof obj == 'string') obj = this.search(obj);
    return this.parent(obj);
  },
  
  //searches inside the page css to find the values for a selector

  search: function(selector) {
    var to = {};
    Array.each(document.styleSheets, function(sheet, j) {
      var rules = sheet.rules || sheet.cssRules;
      Array.each(rules, function(rule, i) {
        if (!rule.style || !rule.selectorText || !rule.selectorText.test('^' + selector + '$')) return;
        Element.Styles12.each(function(value, style) {
          if (!rule.style[style] || Element.ShortStyles[style]) return;
          value = rule.style[style];
          to[style] = (value.test(/^rgb/)) ? value.rgbToHex() : value;
        });
      });
    });
    return to;
  }
  
});
/* MooWaiter 1.0 by Andy Chentsov
 * Created on: 6.02.2008
 *
 * This simple piece of code automates the creating of Ajax loading symbols.
 * The loading symbol covers an HTML element with correct position and size - example:
 * $('myElement').startWaiting() and $('myElement').stopWaiting()
 *
 * Ported for Mootools from Protoload by Andreas Kalsch http://aka-fotos.de/MooWaiter/ All credit goes to him
 */
MooWaiter = {
  // the script to wait this amount of msecs until it shows the loading element
  timeUntilShow: 250,
  
  // opacity of loading element
  opacity: 0.8,

  // Start waiting status - show loading element
  startWaiting: function(className, timeUntilShow, opacity) {
    element = this;
    className = className || 'waiting';
    timeUntilShow = timeUntilShow || MooWaiter.timeUntilShow;
    opacity = opacity || MooWaiter.opacity;
    element._waiting = true;
    if (!element._loading) {
      var e = element._loading = new Element('div', {
      	'styles': {
      		'position': 'absolute',
      		'opacity': opacity
      	}
      }).injectInside(/*element.offsetParent*/$(element).getParent() || document.body);
    }
    element._loading.className = className;
    (function() {
      if (this._waiting) {
        $(this._loading).setStyles({
          'left': this.getLeft(),
          'top': this.getTop(),
          'width': this.getSize()['size']['x'],
          'height': this.getSize()['size']['y']
        });
      }
    }).bind(element).delay(timeUntilShow);
    return this;
  },
  
  // Stop waiting status - hide loading element
  stopWaiting: function() {
    element = this;
    if (element._waiting) {
      element._waiting = false;
      //element._loading.parentNode.removeChild(element._loading);
      $(element._loading).remove();
      element._loading = null;
    }
    return this;
  }
};

if (MooTools) {
  Element.extend(MooWaiter);

  /* Extends functionality from <Waiter> into <Ajax>.
                 
     Additional Options:
     useWaiter - (boolean) if true will automatically apply a <Waiter> to the update target; defaults to false. Note: if you do not specify a value for update option this is ignored.
     waiterOptions - (object) options value passed on to <Waiter> class.
     waiterTarget - (element) if specified, the Waiter will overlay this element, otherwise it uses the update target specified in the ajax options.
  */
  if (typeof Ajax != "undefined") {
     var Ajax = Ajax.extend({
         options: {
           useWaiter: false,
           waiterOptions: {
             className: 'waiting',
             timeUntilShow: MooWaiter.timeUntilShow,
             opacity: MooWaiter.opacity
           },
           waiterTarget: false
         },
         initialize: function(url, options) {
           this.parent(url, options);
           if (this.options.useWaiter && ($(this.options.waiterTarget) || $(this.options.update))) {
             var stop = function() {
               ($(this.options.waiterTarget) || $(this.options.update)).stopWaiting();
             }.bind(this);
             this.addEvent('onComplete', stop);
             this.addEvent('onFailure', stop);
           }
         },
         request: function(data) {
           if (this.options.useWaiter) {
             try {
               ($(this.options.waiterTarget) || $(this.options.update)).startWaiting(this.options.waiterOptions.className, this.options.waiterOptions.timeUntilShow, this.options.waiterOptions.opacity);
             } catch(e) {}
           }
           this.parent(data);
           return this;
         }
     });
  }
}

var Rollout = new Class({

  options: {
    rightAlign: false,
    autoAlign: false,
    focusFirst: true,
    bind: true
  },

  initialize: function(point, box, options) {
    this.point = $(point);
    this.box = $(box);
    this.setOptions(options);
    this.disabled = false;
    this.opened = false;
  
    this.handlers = {
      open: this.open.bindWithEvent(this),
      close: this.close.bindWithEvent(this),
      overlayClick: this.overlayClick.bindWithEvent(this),
      resize: this.resized.bind(this)
    };
    
    this.attach();
  },
  
  attach: function() {
    if (!this.point) return;
    if (this.options.bind) {
      this.point.addEvent('click', this.handlers.open);
    }
  },
  
  resized: function() {
    var overlay = $('rollout-overlay');
    if (overlay) {
      var sizes = window.getSize();
      /*overlay.setStyles({
        'left': sizes.scroll.x,
        'top': sizes.scroll.y,
        'width': sizes.size.x,
        'height': sizes.size.y
      });*/
      overlay.setStyles({
        'left': sizes.scroll.x,
        'top': sizes.scroll.y,
        'width': sizes.size.x,
        'height': sizes.size.y
      });
      if (this.opened) {
        this.point_bounds = this.point.getCoordinates();
        var x = this.point_bounds.left;
        if (this.options.rightAlign) {
          x -= (this.box.getSize().size.x - this.point_bounds.width);
        }
        this.box.setStyles({
          'left': x,
          'top': this.point_bounds.top + this.point_bounds.height
        });        
      }
    }
  },

  toggleListeners: function(state) {
    var task = state ? 'addEvent' : 'removeEvent';
    window[task]('resize', this.handlers.resize);
    window[task]('scroll', this.handlers.resize);
  },

  showOverlay: function() {
    var overlay = $('rollout-overlay');
    if (!overlay) {
      overlay = new Element('div', {
        'id': 'rollout-overlay',
        'styles': {
          'position': 'absolute',
          'left': 0,
          'top': 0,
          'width': 1,
          'height': 1,
          'padding': 0,
          'margin': 0,
          'background': 'white',
          'opacity': 0,
          'visibility': 'visible'
        }
      }).injectInside(document.body);
    } else {
      overlay.setStyle('display', '');
    }
    this.resized();
    this.toggleListeners(true);
    overlay.addEvent('click', this.handlers.overlayClick);
  },

  hideOverlay: function() {
    var overlay = $('rollout-overlay');
    if (overlay) {
      overlay.setStyle('display', 'none');
      this.toggleListeners(false);
      overlay.removeEvent('click', this.handlers.close);
    }
  },
  
  open: function(event) {
    if (event) event.stop();
    this.point.blur();
    if (this.box.getStyle('display') == 'block') {
      this.close();
      return;
    }
    if (this.disabled) return;
    
    this.showOverlay();

    this.point_bounds = this.point.getCoordinates();

    if (this.options.autoAlign) {
      this.options.rightAlign = (this.point_bounds.left >= Math.round(window.getWidth() / 2));
    }

    this.box.setStyles({
      'position': 'absolute',
      'overflow': 'hidden',
      'opacity': 0,
      'display': 'block',
      'left': 0,
      'top': 0
    });

    this.point.addClass('rolled');
    
    var x = this.point_bounds.left;
    if (this.options.rightAlign) {
      x -= (this.box.getSize().size.x - this.point_bounds.width);
    }
    x -= this.options.rightAlign ? -(this.point.getStyle('padding-right').toInt() + this.box.getStyle('border-right-width').toInt()) : (this.point.getStyle('padding-left').toInt() + this.box.getStyle('border-left-width').toInt());
    var height = this.box.getSize().size.y;
    $H(this.box.getStyles('padding-top', 'border-top-width', 'padding-bottom', 'border-bottom-width')).each(function(value) {
      height -= value.toInt();
    });

    this.opened = true;
    Rollout.current = this;

    /*this.point.effects({duration: 200}).
      addEvent('onComplete', function() {
        this.point.addClass('rolled');
      }.bind(this)).
      start('a.rolled');*/
    this.box.setStyles({
      'left': x,
      'top': this.point_bounds.top + this.point_bounds.height,
      'height': 0,
      'opacity': 1
    });
    if (this.options.focusFirst) {
      var box = this.box;
      (function() {
        var form = box.getElement('form');
        if (form) {
          try {
            form.focusFirstElement();
          } catch(e) {}
        }
      }).delay(200);
    }
    this.box.effects({duration: 1000, transition: Fx.Transitions.elasticOut}).
      addEvent('onComplete', function() {
        this.box.setStyle('height', '');
        /*if (this.options.focusFirst) {
          var form = this.box.getElement('form');
          if (form) {
            form.focusFirstElement();
          }
        }*/
        this.callChain();
        this.fireEvent('onOpen');
      }.bind(this)).
      start({
        'height': height,
        'opacity': 1
      });
    return this;
  },
  
  close: function(event) {
    if (event) event.stop();
    this.point.blur();
    if (this.box.getStyle('display') != 'block') return;
    if (this.disabled) return;

    var height = this.box.getSize().size.y;
    $H(this.box.getStyles('padding-top', 'border-top-width', 'padding-bottom', 'border-bottom-width')).each(function(value) {
      height -= value.toInt();
    });
    
    this.box.effects({duration: 600, transition: Fx.Transitions.elasticIn}).
      addEvent('onComplete', function () {
        $(this.point).removeClass('rolled');
        $(this.box).setStyles({
          'height': height,
          'display': 'none'
        });
        this.opened = false;
        Rollout.current = null;
        this.callChain();
        this.fireEvent('onClose');
      }.bind(this)).
      start({
        'height': 0
      });
      
    this.hideOverlay();
    return this;
  },

  overlayClick: function(event) {
    if (event) event.stop();
    this.fireEvent('onOverlayClick');
    this.close();
  },
  
  disable: function() {
    this.disabled = true;
    return this;
  },
  
  enable: function() {
    this.disabled = false;
    return this;
  }

});

Rollout.implement(new Options, new Chain, new Events);

Rollout.current = null;

Rollout.methods = {
  element: {
    rollpoint: function(box, options) {
      var rollout = this.retrieve('rollout');
      if (!rollout) {
        rollout = new Rollout(this, box, options);
      } else {
        rollout.point = this;
      }
      this.store('rollout', rollout);
      return rollout;
    },

    rollin: function(box, options) {
      var rollout = this.retrieve('rollout');
      if (!rollout) {
        rollout = new Rollout(this, box, $merge(options, {bind: false}));
      } else {
        rollout.point = this;
      }
      rollout.open();
      this.store('rollout', rollout);
      return rollout;
    },
    
    rollout: function() {
      var rollout = this.retrieve('rollout');
      if (rollout) {
        rollout.close();
      }
      return rollout;
    },

    disableRollout: function() {
      var rollout = this.retrieve('rollout');
      if (rollout) {
        rollout.disable();
      }
    },

    enableRollout: function() {
      var rollout = this.retrieve('rollout');
      if (rollout) {
        rollout.enable();
      }
    }
  }
}

Element.extend(Rollout.methods.element);
/*      
        Script: form.validator.js
        A css-class based form validation system.
        
        Dependencies:
        Mootools: <Moo.js>, <Utility.js>, <Common.js>, <Element.js>, <Function.js>, <Event.js>, <String.js>, <Fx.Base.js>, 
                        <Window.Base.js>, <Fx.Style.js>, <Fx.Styles.js>, <Dom.js>
                        
        Authors:
                Aaron Newton, <aaron [dot] newton [at] cnet [dot] com>
                Based on validation.js by Andrew Tetlaw (http://tetlaw.id.au/view/blog/really-easy-field-validation-with-prototype)

        Class: InputValidator
        This class contains functionality to test a field for various criteria and also to generate 
        an error message when that test fails.
        
        Arguments:
        className - a className that this field will be related to (see example below);
        options - an object with name/value pairs.
        
        Options:
        errorMsg - a message to display; see section below for details.
        test - a function that returns true or false
        
        errorMsg:
        The errorMsg option can be any of the following:
                string - the message to display if the field fails validation
                boolean false - do not display a message at all
                function - a function to evaluate that returns either a string or false.
                        This function will be passed two parameters: the field being evaluated and
                        any properties defined for the validator as a className (see examples below)
        
        test:
        The test option is a function that will be passed the field being evaluated and
        any properties defined for the validator as a className (see example below); this
        function must return true or false.

        Examples:
(start code)
//html code
<input type="text" name="firstName" class="required" id="firstName">
//simple validator
var isEmpty = new InputValidator('required', {
        errorMsg: 'This field is required.',
        test: function(field){
                return ((element.getValue() == null) || (element.getValue().length == 0));
        }
});
isEmpty.test($("firstName")); //true if empty
isEmpty.getError($("firstName")) //returns "This field is required."

//two complex validators
<input type="text" name="username" class="minLength maxLength" validatorProps="{minLength:10, maxLength:100}" id="username">

var minLength = new InputValidator ('minLength', {
        errorMsg: function(element, props){
                //props is {minLength:10, maxLength:100}
                if($type(props.minLength))
                        return 'Please enter at least ' + props.minLength + ' characters (you entered ' + element.value.length + ' characters).';
                else return '';
        }, 
        test: function(element, props) {
                //if the value is >= than the minLength value, element passes test
                return (element.value.length >= $pick(props.minLength, 0));
                else return false;
        }
});

minLength.test($('username'));

var maxLength = new InputValidator ('maxLength', {
        errorMsg: function(element, props){
                //props is {minLength:10, maxLength:100}
                if($type(props.maxLength))
                        return 'Please enter no more than ' + props.maxLength + ' characters (you entered ' + element.value.length + ' characters).';
                else return '';
        }, 
        test: function(element, props) {
                //if the value is <= than the maxLength value, element passes test
                return (element.value.length <= $pick(props.maxLength, 10000));
                else return false;
        }
});(end)
        */

var InputValidator = new Class({
        initialize: function(className, options){
                this.options = Object.extend({
                        errorMsg: 'Validation failed.',
                        test: function(field){return true}
                }, options || {});
                this.className = className;
        },
/*      Property: test
                Tests a field against the validator's rule(s).
                
                Arguments:
                field - the form input to test
                
                Returns:
                true - the field passes the test
                false - it does not pass the test
        */
        test: function(field){
                if($(field)) return this.options.test($(field), this.getProps(field));
                else return false;
        },
/*      Property: getError
                Retrieves the error message for the validator.
                
                Arguments:
                field - the form input to test
                
                Returns:
                The error message or the boolean false if no message is meant to be returned.
        */
        getError: function(field){
                var err = this.options.errorMsg;
                if($type(err) == "function") err = err($(field), this.getProps(field));
                return err;
        },
        getProps: function(field){
                /*if($(field) && $(field).getProperty('validatorProps')){
                        try {
                                return Json.evaluate($(field).getProperty('validatorProps'));
                        }catch(e){ return {}}
                } else {
                        return {}
                }*/
    var rx = /validatorProps\{(.*)\}/i;
    if ($(field) && (props = $(field).className.match(rx)) && props && (props.length > 0)) {
      try {
        return Json.evaluate('{' + props[1] + '}');
      } catch(e) { return {} }
    } else {
      return {}
    }
        }
});

/*      Class: FormValidator
                Evalutes an entire form against all the validators that are set up, displaying messages
                and returning a true/false response for the evaluation of the entire form.
                
                An instance of the FormValidator class will test each field and then behave according to
                the options passed in.
                
                Arguments:
                form - the form to evaluate
                options - an object with name/value pairs
                
                Options:
                fieldSelectors - the selector for fields to include in the validation;
                                defaults to: "input, select, textarea"
                useTitles - use the titles of inputs for the error message; overrides
                                the messages defined in the InputValidators (see <InputValidator>); defaults to false
                evaluateOnSubmit - validate the form when the user submits it; defaults to true
                evaluateFieldsOnBlur - validate the fields when the blur event fires; defaults to true
                onFormValidate - function to execute when the form validation completes; this function
                        is passed two arguments: a boolean (true if the form passed validation) and the form element
                onElementValidate - function to execute when an input element is tested; this function
                        is passed two arguments: a boolean (true if the form passed validation) and the input element
                
                Example:
(start code)var myFormValidator = new FormValidator($('myForm'), {
        onFormValidate: myFormHandler,
        useTitles: true
});(end)

                Note: FormValidator must be configured with <Validator> objects; see below for details as well as a list of built-in validators. Each <Validator> will be applied to any input that matches its className within the elements of the form that match the fieldSelectors option.
        */
var FormValidator = new Class({
        initialize: function(form, options){
                this.options = Object.extend({
                        fieldSelectors:"input,select,textarea",
                        useTitles:false,
                        evaluateOnSubmit:true,
                        evaluateFieldsOnBlur: true,
                        useFX: true,
                        useShowFX: true,
                        useHideFX: true,
                        onFormValidate: function(isValid, form){},
                        onElementValidate: function(isValid, field){}
                }, options || {});
                try {
                        this.form = $(form);
                        if(this.options.evaluateOnSubmit) this.form.addEvent('submit', this.onSubmit.bind(this));
                        if(this.options.evaluateFieldsOnBlur) this.watchFields();
                }catch(e){//console.log('error: %s', e);
                }
        },
        watchFields: function(){
                try{
                        this.form.getElementsBySelector(this.options.fieldSelectors).each(function(el){
                                el.addEvent('blur', this.validateField.pass(el, this));
                        }, this);
                }catch(e){//console.log('error: %s', e);
                }
        },
        onSubmit: function(event){
                if(!this.validate()) new Event(event).stop();
        },
/*      Property: reset
                Removes all the error messages from the form.
        */
        reset: function() {
                this.form.getElementsBySelector(this.options.fieldSelectors).each(this.resetField, this);
        }, 
/*      Property: validate
                Validates all the inputs in the form; note that this function is called on submit unless
                you specify otherwise in the options.
        */
        validate : function() {
                var result = this.form.getElementsBySelector(this.options.fieldSelectors, true).map(function(field) { return this.validateField(field); }, this);
                result = result.every(function(val){
                        return val;
                });
                this.options.onFormValidate(result, this.form);
                return result;
        },
/*      Property: validateField
                Validates the value of a field against all the validators.
                
                Arguments:
                field - the input element to evaluate
        */
        validateField: function(field){
                field = $(field);
                var result = true;
                if(field){
                        var validators = field.className.split(" ").some(function(cn){
                                return FormValidator.getValidator(cn);
                        });
                        result = field.className.split(" ").map(function(className){
                                var test = this.test(className,field);
                                return test;
                        }, this);
                        result = result.every(function(val){
                                return val;
                        });
                        if(validators){
                                if(result) field.addClass('validation-passed').removeClass('validation-failed');
                                else field.addClass('validation-failed').removeClass('validation-passed');
                        }
                }
                return result;
        },
        getPropName: function(className){
                return '__advice'+className;
        },
/*      Property: test
                Tests a field against a specific validator.
                
                Arguments:
                className - the className associated with the validator
                field - the input element
        */
        test: function(className, field){
                field = $(field);
                var isValid = true;
                if(field) {
                        var validator = FormValidator.getValidator(className);
                        if(validator && this.isVisible(field)) {
                                isValid = validator.test(field);
                                //if the element is visible and it failes to validate
                                if(!isValid && validator.getError(field)){
                                        var advice = this.makeAdvice(className, field, validator.getError(field));
                                        this.showAdvice(className, field);
                                } else this.hideAdvice(className, field);
                                this.options.onElementValidate(isValid, field);
                        }
                }
                return isValid;
        },
        showAdvice: function(className, field){
                var advice = this.getAdvice(className, field);
                if(advice && !field[this.getPropName(className)] && (advice.getStyle('display') == "none" || advice.getStyle('visiblity') == "hidden" || advice.getStyle('opacity')==0)){
                        field[this.getPropName(className)] = true;
                        advice.setStyles({
                                'display':'block',
                                'visibility':'hidden'
                        });
                        if (this.options.useFX && this.options.useShowFX) {
                        var h = advice.getSize().scrollSize.y;
                        var pt = advice.getStyle('padding-top').toInt();
                        var pb = advice.getStyle('padding-bottom').toInt();
                        var mt = advice.getStyle('margin-top').toInt();
                        var mb = advice.getStyle('margin-bottom').toInt();
                        h = h-pt-pb;
                        advice.setStyles({
                                'opacity':0,
                                'height':'0px',
                                'padding-top':'0px',
                                'padding-bottom':'0px',
                                'margin-top':'0px',
                                'margin-bottom':'0px'
                        }).effects().start({
                                'height':h,
                                'opacity':1,
                                'padding-top':pt,
                                'padding-bottom':pb,
                                'margin-top':mt,
                                'margin-bottom':mb
                        });
                        } else {
        advice.setStyles({
          'opacity':1,
          'visibility':'visible'
        });                       
                        }
                }
        },
        hideAdvice: function(className, field){
                var advice = this.getAdvice(className, field);
                if(advice && field[this.getPropName(className)]) {
                        field[this.getPropName(className)] = false;
      if (this.options.useFX && this.options.useHideFX) {
                        var h = advice.getSize().scrollSize.y;
                        var pt = advice.getStyle('padding-top').toInt();
                        var pb = advice.getStyle('padding-bottom').toInt();
                        var mt = advice.getStyle('margin-top').toInt();
                        var mb = advice.getStyle('margin-bottom').toInt();
                        h = h-pt-pb;
                        advice.effects().start({
                                'height':0,
                                'opacity':0,
                                'padding-top':0,
                                'padding-bottom':0,
                                'margin-top':0,
                                'margin-bottom':0
                        }).chain(function(){
                                advice.setStyles({
                                        'display':'none',
                                        'height':h+'px',
                                        'padding-top':pt+'px',
                                        'padding-bottom':pb+'px',
                                        'margin-top':mt+'px',
                                        'margin-bottom':mb+'px'
                                });
                        });
      } else {
        advice.setStyles({
          'opacity':0,
          'display':'none'
        });        
      }
                }
        },
        isVisible : function(field) {
                while(field.tagName != 'BODY') {
                        if($(field).getStyle('display') == "none") return false;
                        field = field.parentNode;
                }
                return true;
        },
        getAdvice: function(className, field) {
                return $('advice-' + className + '-' + this.getFieldId(field))
        },
        makeAdvice: function(className, field, error){
                var errorMsg = this.options.useTitles ? $pick(field.title, error):error;
                var advice = this.getAdvice(className, field);
                if(!advice){
                        advice = new Element('div').addClass('validation-advice').setProperty(
                                'id','advice-'+className+'-'+this.getFieldId(field)).setStyle('display','none').appendText(errorMsg);
                        switch (field.type.toLowerCase()) {
                                case 'radio':
                                        var p = $(field.parentNode);
                                        if(p) {
                                                p.adopt(advice);
                                                break;
                                        }
                                default: advice.injectAfter($(field));
                  };
                } else{
                        advice.setHTML(errorMsg);
                }
                return advice;
        },
        getFieldId : function(field) {
                return field.id ? field.id : field.id = "input_"+field.name;
        },
/*      Property: resetField
                Removes all the error messages for a specific field.
                
                Arguments:
                field - the field to reset.
        */
        resetField: function(field) {
                field = $(field);
                if(field) {
                        var cn = field.className.split(" ");
                        cn.each(function(className) {
                                var prop = this.getPropName(className);
                                if(field[prop]) this.hideAdvice(className, field);
                                field.removeClass('validation-failed');
                                field.removeClass('validation-passed');
                        }, this);
                }
        }
});

/*      Section: FormValidator global functions
                These functions are available to the <FormValidator> object itself, not instances of it.
                Use these functions to add validators to the FormValidator object, which will be available
                to all instances of the FormValidator class.
        */
FormValidator.adders = {
/*  Property: validators
    An array of <Validator> objects.
  */
  validators:[],
/*  Property: add
    Adds a new form validator to the FormValidator object.
    
    Arguments:
    className - the className associated with the validator
    options - the <Validator> options (errorMsg and test)
    Example:
(start code)
FormValidator.add('isEmpty', {
  errorMsg: 'This field is required',
  test: function(element){
    if(element.value.length ==0) return false;
    else return true;
  }
});
  */
  add : function(className, options) {
    this.validators[className] = new InputValidator(className, options);
    return this;
  },
/*  Property: addAllThese
    An array of InputValidator configurations (see <FormValidator.add> above).
    
    Example:
(start code)
FormValidator.addAllThese([
  ['className1', {errorMsg: ..., test: ...}],
  ['className2', {errorMsg: ..., test: ...}],
  ['className3', {errorMsg: ..., test: ...}],
]);
  */
  addAllThese : function(validators) {
    $A(validators).each(function(validator) {
      this.add(validator[0], validator[1]);
    }, this);
  },
  getValidator: function(className){
    return FormValidator.validators[className] = $pick(FormValidator.validators[className], false);
  }
};      

Object.extend(FormValidator, FormValidator.adders);
FormValidator.implement(FormValidator.adders);

/*      Section: Included InputValidators
                Here is are the validators that are included in this libary. Add the className to
                any input and then create a new <FormValidator> and these will automatically be
                applied. See <FormValidator.add> on how to add your own.

                Property: IsEmpty
                Evalutes if the input is empty; this is a utility validator, see <FormValidator.required>.
                
                Error Msg - returns false (no message)
                        */
FormValidator.add('IsEmpty', {
        errorMsg: false,
        test: function(element) { 
                if(element.type == "select-one"||element.type == "select")
                        return !(element.selectedIndex >= 0 && element.options[element.selectedIndex].value != "");
                else {
                  if (element.type == "select-multiple") {
                          return ((element.getValue() == null) || (element.getValue().length == 0));
                  } else {
                        var space = new RegExp('[a-z,0-9,à-ÿ\*_]', 'i');
                        return ((element.getValue() == null) || (element.getValue().length == 0) || (!element.getValue().match(space)));
                  }
                }
        }
});


FormValidator.addAllThese([
/*      Property: required
                Displays an error if the field is empty.
                
                Error Msg - "This field is required"                    
        */
        ['required', {
                errorMsg: function(element){return 'This field is required.'}, 
                test: function(element) { 
                        return !FormValidator.getValidator('IsEmpty').test(element); 
                }
        }],
/*      Property: minLength
                Displays a message if the input value is less than the supplied length.
                
                Error Msg - Please enter at least [defined minLength] characters (you entered [input length] characters)
                
                Note:
                You must add this className AND properties for it to your input.
        
                Example:
                ><input type="text" name="username" class="minLength props{minLength:10}" id="username">
        */
        ['minLength', {
                errorMsg: function(element, props){
                        if($type(props.minLength))
                                return 'Please enter at least ' + props.minLength + ' characters (you entered ' + element.getValue().length + ' characters).';
                        else return '';
                }, 
                test: function(element, props) {
                        if($type(props.minLength)) return (element.getValue().length >= $pick(props.minLength, 0));
                        else return true;
                }
        }],
/*      Property: maxLength
                Displays a message if the input value is less than the supplied length.
                
                Error Msg - Please enter no more than [defined maxLength] characters (you entered [input length] characters)
                
                Note:
                You must add this className AND properties for it to your input.
                
                Example:
                ><input type="text" name="username" class="maxLength props{maxLength:100}" id="username">
        */
        ['maxLength', {
                errorMsg: function(element, props){
                        //props is {maxLength:10}
                        if($type(props.maxLength))
                                return 'Please enter no more than ' + props.maxLength + ' characters (you entered ' + element.getValue().length + ' characters).';
                        else return '';
                }, 
                test: function(element, props) {
                        //if the value is <= than the maxLength value, element passes test
                        return (element.getValue().length <= $pick(props.maxLength, 10000));
                }
        }],
/*      Property: validate-number
                Validates that the entry is a number.
                
                Error Msg - 'Please enter a valid number in this field.'
        */      
        ['validate-number', {
                errorMsg: 'Please enter a valid number in this field.',
                test: function(element) {
                                return FormValidator.getValidator('IsEmpty').test(element) || ((!isNaN(element.getValue()) && !/^\s+$/.test(element.getValue())));
                }
        }],
/*      Property: validate-digits
                Validates that the entry contains only numbers

                Error Msg - 'Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.'
        */
        ['validate-digits', {
                errorMsg: 'Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.', 
                test: function(element) {
                        return FormValidator.getValidator('IsEmpty').test(element) || 
                                (!/[^a-zA-Z]/.test(element.getValue()) && /[\d]/.test(element.getValue()));
                }
        }],
/*      Property: validate-alpha
                Validates that the entry contains only letters 

                Error Msg - 'Please use letters only (a-z) in this field.'
        */
        ['validate-alpha', {
                errorMsg: 'Please use letters only (a-z) in this field.', 
                test: function (element) {
                        return FormValidator.getValidator('IsEmpty').test(element) ||  /^[a-zA-Z]+$/.test(element.getValue())
                }
        }],
/*      Property: validate-alphanum
                Validates that the entry is letters and numbers only

                Error Msg - 'Please use only letters (a-z) or numbers (0-9) only in this field. No spaces or other characters are allowed.'
        */
        ['validate-alphanum', {
                errorMsg: 'Please use only letters (a-z) or numbers (0-9) only in this field. No spaces or other characters are allowed.', 
                test: function(element) {
                        return FormValidator.getValidator('IsEmpty').test(element) || !/\W/.test(element.getValue())
                }
        }],
/*      Property: validate-date
                Validates that the entry parses to a date.

                Error Msg - 'Please use this date format: mm/dd/yyyy. For example 03/17/2006 for the 17th of March, 2006.'
        */
        ['validate-date', {
                errorMsg: 'Please use this date format: mm/dd/yyyy. For example 03/17/2006 for the 17th of March, 2006.',
                test: function(element) {
                        if(FormValidator.getValidator('IsEmpty').test(element)) return true;
            var regex = /^(\d{2})\/(\d{2})\/(\d{4})$/;
            if(!regex.test(element.getValue())) return false;
            var d = new Date(element.getValue().replace(regex, '$1/$2/$3'));
            return (parseInt(RegExp.$1, 10) == (1+d.getMonth())) && 
        (parseInt(RegExp.$2, 10) == d.getDate()) && 
        (parseInt(RegExp.$3, 10) == d.getFullYear() );
                }
        }],
/*      Property: validate-email
                Validates that the entry is a valid email address.

                Error Msg - 'Please enter a valid email address. For example fred@domain.com .'
        */
        ['validate-email', {
                errorMsg: 'Please enter a valid email address. For example fred@domain.com .', 
                test: function (element) {
                        return FormValidator.getValidator('IsEmpty').test(element) || /\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(element.getValue());
                }
        }],
/*      Property: validate-url
                Validates that the entry is a valid url

                Error Msg - 'Please enter a valid URL.'
        */
        ['validate-url', {
                errorMsg: 'Please enter a valid URL.', 
                test: function (element) {
                        return FormValidator.getValidator('IsEmpty').test(element) || /^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i.test(element.getValue());
                }
        }],
/*      Property: validate-date-au
                Validates that the entry matches dd/mm/yyyy.

                Error Msg - 'Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006.'
        */
        

        ['validate-date-au', {
                errorMsg: 'Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006.',
                test: function(element) {
                        if(FormValidator.getValidator('IsEmpty').test(element)) return true;
            var regex = /^(\d{2})\/(\d{2})\/(\d{4})$/;
            if(!regex.test(element.getValue())) return false;
            var d = new Date(element.getValue().replace(regex, '$2/$1/$3'));
            return (parseInt(RegExp.$2, 10) == (1+d.getMonth())) && 
        (parseInt(RegExp.$1, 10) == d.getDate()) && 
        (parseInt(RegExp.$3, 10) == d.getFullYear() );
                }
        }],
/*      Property: validate-currency-dollar
                Validates that the entry matches any of the following:
                        - [$]1[##][,###]+[.##]
                        - [$]1###+[.##]
                        - [$]0.##
                        - [$].##
                
                Error Msg - 'Please enter a valid $ amount. For example $100.00 .'
        */
        ['validate-currency-dollar', {
                errorMsg: 'Please enter a valid $ amount. For example $100.00 .', 
                test: function(element) {
                        // [$]1[##][,###]+[.##]
                        // [$]1###+[.##]
                        // [$]0.##
                        // [$].##
                        return FormValidator.getValidator('IsEmpty').test(element) ||  /^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/.test(element.getValue());
                }
        }],
/*      Property: validate-one-required
                Validates that all the entries within the same node are not empty.

                Error Msg - 'Please enter something for at least one of the above options.'
                
                Note:
                This validator will get the parent element for the input and then check all its children.
                To use this validator, enclose all the inputs you want to group in another element (doesn't
                matter which); you only need apply this class to *one* of the elements.
                
                Example:
(start code)
<div>
        <input ....>
        <input ....>
        <input .... className="validate-one-required">
</div>(end)
        */
        ['validate-one-required', {
                errorMsg: 'Please enter something for at least one of the above options.', 
                test: function (element) {
                        var p = element.parentNode;
                        var options = p.getElements('input');
                        return $A(options).some(function(el) {
                                return el.getValue();
                        });
                }
        }]
]);

/* do not edit below this line */   
/* Section: Change Log 

$Source: /cvs/main/flatfile/html/rb/js/global/cnet.global.framework/common/js.widgets/form.validator.js,v $
$Log: form.validator.js,v $
Revision 1.3  2007/01/26 05:48:03  newtona
docs update

Revision 1.2  2007/01/22 22:00:15  newtona
numerous bug fixes to modalizer, stickywin, and popupdetails
updated for mootools 1.0
fixed date validation in form.validator

Revision 1.1  2007/01/19 01:22:05  newtona
*** empty log message ***


*/
var SimpleBox = new Class({

  options: {
    opacity: 0.7,
    title: '',
    size: {
      width: 380,
      height: 180
    },
    closeWithOverlay: false,
    className: ''
  },

  initialize: function(message, options) {
    this.message = message;
    this.setOptions(options);

    this.handlers = {
      key: this.key.bindWithEvent(this),
      resize: this.resize.bind(this),
      close: this.close.bind(this)
    };

    this.build();
    this.open();
  },

  resize: function() {
    var overlay = $('simplebox-overlay');
    var simplebox = $('simplebox');
    if (overlay && simplebox) {
      var sizes = window.getSize();
      if (window.ie6) {
        overlay.setStyles({
          'left': sizes.scroll.x,
          'top': sizes.scroll.y
        });
      }
      overlay.setStyles({
        'width': sizes.size.x,
        'height': sizes.size.y
      });
      var bounds = simplebox.getSize().size;
      simplebox.setStyles({
        'left': window.getScrollLeft() + Math.round((sizes.size.x - bounds.x) / 2),
        'top': window.getScrollTop() + Math.round((sizes.size.y - bounds.y) / 2) - 20
      });
    }
  },

  toggleListeners: function(state) {
    var task = state ? 'addEvent' : 'removeEvent';
    if (window.gecko) {
      window[task]('keydown', this.handlers.key);
    } else {
      document.body[task]('keydown', this.handlers.key);
    }
    window[task]('resize', this.handlers.resize);
    window[task]('scroll', this.handlers.resize);
  },

  showOverlay: function() {
    var overlay = $('simplebox-overlay');
    if (!overlay) {
      overlay = new Element('div', {
        'id': 'simplebox-overlay',
        'class': 'simplebox-overlay',
        'styles': {
          'position': window.ie6 ? 'absolute' : 'fixed',
          'left': 0,
          'top': 0,
          'width': 1,
          'height': 1,
          'padding': 0,
          'margin': 0,
          'opacity': 0,
          'visibility': 'visible'
        }
      }).injectInside(document.body);
      /*if (window.ie6) {    
        this.overlay.style.setExpression('left', 'document.body.scrollLeft || document.documentElement.scrollLeft');
        this.overlay.style.setExpression('top', 'document.body.scrollTop || document.documentElement.scrollTop');
      }*/
    } else {
      overlay.setStyles({
        'display': '',
        'opacity': 0
      });
    }
    this.resize();
    this.toggleListeners(true);
    if (this.options.closeWithOverlay) {
      overlay.addEvent('click', this.handlers.close);
    }
    overlay.effect('opacity', {duration: 250}).start(this.options.opacity);
  },

  hideOverlay: function() {
    var overlay = $('simplebox-overlay');
    if (overlay) {
      overlay.effect('opacity', {duration: 250}).start(0).chain(function() {
        overlay.setStyle('display', 'none');
        this.toggleListeners(false);
        overlay.removeEvent('click', this.handlers.close);
        overlay.remove();
      }.bind(this));
    }
  },
  
  build: function() {
    var box = $('simplebox');
    if (!box) {
      box = new Element('div', {
        'id': 'simplebox',
        'class': 'simplebox',
        'styles': {
          'position': 'absolute',
          'left': 0,
          'top': 0,
          'width': this.options.size.width,
          'height': this.options.size.height,
          'opacity': 0,
          'visibility': 'visible'
        }
      }).addClass(this.options.className).injectInside(document.body);
      
      title = new Element('h1', {
        'id': 'simplebox-title'
      }).injectInside(box);

      msg = new Element('div', {
        'id': 'simplebox-message',
        'class': 'simplebox-message',
        'styles': {
          'overflow': 'hidden'
        }
      }).injectInside(box);

      buttons = new Element('div', {
        'id': 'simplebox-buttons',
        'class': 'simplebox-buttons',
        'align': 'center'
      }).injectInside(box);

      okbutton = new Element('input', {
        'id': 'simplebox-ok-button',
        'type': 'button',
        'value': '           OK           '
      }).injectInside(buttons).addEvent('click', this.handlers.close);
      
      this.resize();
    } else {
      title = $('simplebox-title');
      msg = $('simplebox-message');
      buttons = $('simplebox-buttons');
    }
    title.setHTML(this.options.title);
    msg.setHTML(this.message);
    var height = this.options.size.height - title.getSize().size.y - buttons.getSize().size.y;
    height -= box.getStyle('padding-top').toInt() + box.getStyle('padding-bottom').toInt();
    height -= title.getStyle('padding-top').toInt() + title.getStyle('padding-bottom').toInt() +
      title.getStyle('margin-top').toInt() + title.getStyle('margin-bottom').toInt();
    height -= msg.getStyle('padding-top').toInt() + msg.getStyle('padding-bottom').toInt() +
      msg.getStyle('margin-top').toInt() + msg.getStyle('margin-bottom').toInt();
    height -= buttons.getStyle('padding-top').toInt() + msg.getStyle('padding-bottom').toInt();
    msg.setStyle('height', height);
    box.effect('opacity', {duration: 250}).start(1);
  },
  
  open: function() {
    try {
      window.focus();
    } catch(e) {}
    this.showOverlay();
  },
  
  close: function() {
    this.hideOverlay();
    var box = $('simplebox');
    if (box) {
      box.effect('opacity', {duration: 250}).start(0).chain(function() {
        box.remove();
      });
    }
  },
  
  key: function(event) {
    if ((event.key == 'enter') || (event.key == 'esc')) {
      event.stop();
      this.close();
    }
  }

});

SimpleBox.implement(new Options);

function login(form) {
  // validate form
  var validator = $(form).retrieve('validator');
  if (validator && !validator.validate()) {
    return;
  }
  $('login').disableRollout();
  $(form).send({
    useWaiter: true,
    waiterTarget: 'loginbox',
    waiterOptions: {
      className: 'rollout-waiting',
      opacity: 0.7
    },
    onComplete: function() {
      $('login').enableRollout();
      //document.location.href = document.location.href;
      $('login').rollout();
      form.submit();
    },
    onFailure: function(transport) {
      $('login').enableRollout();
      // TODO: alert
      new SimpleBox(transport.responseText, {title: 'Chyba', size: {width: 300, height: 150} });
    }
  });
}

window.addEvent('domready', function() {
  
  var login_form = $('login_form');
  if (login_form) {
    login_form.store('validator',
      new FormValidator(login_form, {
        useTitles: true,
        evaluateFieldsOnBlur: false,
        evaluateOnSubmit: false,
        useHideFX: false
      })
    );
  }
  
});
