eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('G Y={6Q:\'1.6.0.2\',1w:{2N:!!(1i.5J&&!1i.6R),3J:!!1i.6R,3j:3K.3L.2O(\'bp/\')>-1,5K:3K.3L.2O(\'5K\')>-1&&3K.3L.2O(\'8A\')==-1,8B:!!3K.3L.1k(/bq.*br.*8C/)},2P:{5L:!!V.2b,4R:!!1i.4S,5M:V.2Q(\'2k\').3M&&V.2Q(\'2k\').3M!==V.2Q(\'6S\').3M},5N:\'<4T[^>]*>([\\\\S\\\\s]*?)<\\/4T>\',8D:/^\\/\\*-bs-([\\s\\S]*)\\*\\/\\s*$/,2q:q(){},K:q(x){o x}};E(Y.1w.8B)Y.2P.5M=1d;G 1E={1L:q(){G a=17,4U=$A(1c);E(J.1M(4U[0]))a=4U.3N();q 2r(){C.22.2B(C,1c)}J.U(2r,1E.W);2r.6T=a;2r.8E=[];E(a){G b=q(){};b.18=a.18;2r.18=1e b;a.8E.14(2r)}N(G i=0;i<4U.M;i++)2r.4V(4U[i]);E(!2r.18.22)2r.18.22=Y.2q;2r.18.bt=2r;o 2r}};1E.W={4V:q(a){G b=C.6T&&C.6T.18;G c=J.4g(a);E(!J.4g({24:1f}).M)c.14("24","8F");N(G i=0,M=c.M;i<M;i++){G d=c[i],1g=a[d];E(b&&J.1M(1g)&&1g.8G().2C()=="$2Y"){G e=1g,1g=J.U((q(m){o q(){o b[m].2B(C,1c)}})(d).3O(e),{8F:q(){o e},24:q(){o e.24()}})}C.18[d]=1g}o C}};G 3P={};J.U=q(a,b){N(G c 1s b)a[c]=b[c];o a};J.U(J,{1W:q(a){1N{E(J.1X(a))o\'3k\';E(a===17)o\'17\';o a.1W?a.1W():1B(a)}1Y(e){E(e 8H bu)o\'...\';3l e;}},2s:q(a){G b=2R a;4h(b){1O\'3k\':1O\'q\':1O\'bv\':o;1O\'bw\':o a.24()}E(a===17)o\'17\';E(a.2s)o a.2s();E(J.2Z(a))o;G c=[];N(G d 1s a){G e=J.2s(a[d]);E(!J.1X(e))c.14(d.2s()+\': \'+e)}o\'{\'+c.1P(\', \')+\'}\'},3m:q(a){o $H(a).3m()},31:q(a){o a&&a.31?a.31():1B.4i(a)},4g:q(a){G b=[];N(G c 1s a)b.14(c);o b},25:q(a){G b=[];N(G c 1s a)b.14(a[c]);o b},1Z:q(a){o J.U({},a)},2Z:q(a){o a&&a.2t==1},3n:q(a){o a!=17&&2R a=="2D"&&\'bx\'1s a&&\'1P\'1s a},6U:q(a){o a 8H 2S},1M:q(a){o 2R a=="q"},2l:q(a){o 2R a=="5O"},3Q:q(a){o 2R a=="by"},1X:q(a){o 2R a=="3k"}});J.U(6V.18,{8G:q(){G a=C.24().1k(/^[\\s\\(]*q[^(]*\\((.*?)\\)/)[1].32(",").5P("2T");o a.M==1&&!a[0]?[]:a},1o:q(){E(1c.M<2&&J.1X(1c[0]))o C;G a=C,2c=$A(1c),2D=2c.3N();o q(){o a.2B(2D,2c.1z($A(1c)))}},bz:q(){G b=C,2c=$A(1c),2D=2c.3N();o q(a){o b.2B(2D,[a||1i.bA].1z(2c))}},5Q:q(){E(!1c.M)o C;G a=C,2c=$A(1c);o q(){o a.2B(C,2c.1z($A(1c)))}},6W:q(){G a=C,2c=$A(1c),8I=2c.3N()*8J;o 1i.bB(q(){o a.2B(a,2c)},8I)},3O:q(a){G b=C;o q(){o a.2B(C,[b.1o(C)].1z($A(1c)))}},3o:q(){E(C.6X)o C.6X;G a=C;o C.6X=q(){o a.2B(17,[C].1z($A(1c)))}}});6V.18.3p=6V.18.6W.5Q(0.bC);bD.18.2s=q(){o\'"\'+C.bE()+\'-\'+(C.bF()+1).3q(2)+\'-\'+C.bG().3q(2)+\'T\'+C.bH().3q(2)+\':\'+C.bI().3q(2)+\':\'+C.bJ().3q(2)+\'Z"\'};G 8K={8L:q(){G a;N(G i=0,M=1c.M;i<M;i++){G b=1c[i];1N{a=b();1F}1Y(e){}}o a}};3a.18.1k=3a.18.2d;3a.8M=q(a){o 1B(a).1x(/([.*+?^=!:${}()|[\\]\\/\\\\])/g,\'\\\\$1\')};G 8N=1E.1L({22:q(a,b){C.4W=a;C.4X=b;C.5R=1d;C.4Y()},4Y:q(){C.4j=8O(C.4Z.1o(C),C.4X*8J)},6Y:q(){C.4W(C)},6Z:q(){E(!C.4j)o;8P(C.4j);C.4j=17},4Z:q(){E(!C.5R){1N{C.5R=1f;C.6Y()}bK{C.5R=1d}}}});J.U(1B,{4i:q(a){o a==17?\'\':1B(a)},8Q:{\'\\b\':\'\\\\b\',\'\\t\':\'\\\\t\',\'\\n\':\'\\\\n\',\'\\f\':\'\\\\f\',\'\\r\':\'\\\\r\',\'\\\\\':\'\\\\\\\\\'}});J.U(1B.18,{2m:q(a,b){G c=\'\',3r=C,1k;b=1c.4k.70(b);1q(3r.M>0){E(1k=3r.1k(a)){c+=3r.3s(0,1k.50);c+=1B.4i(b(1k));3r=3r.3s(1k.50+1k[0].M)}19{c+=3r,3r=\'\'}}o c},8R:q(b,c,d){c=C.2m.70(c);d=J.1X(d)?1:d;o C.2m(b,q(a){E(--d<0)o a[0];o c(a)})},8S:q(a,b){C.2m(a,b);o 1B(C)},bL:q(a,b){a=a||30;b=J.1X(b)?\'...\':b;o C.M>a?C.3s(0,a-b.M)+b:1B(C)},2T:q(){o C.1x(/^\\s+/,\'\').1x(/\\s+$/,\'\')},8T:q(){o C.1x(/<\\/?[^>]+>/8U,\'\')},3b:q(){o C.1x(1e 3a(Y.5N,\'8V\'),\'\')},8W:q(){G b=1e 3a(Y.5N,\'8V\');G c=1e 3a(Y.5N,\'bM\');o(C.1k(b)||[]).2e(q(a){o(a.1k(c)||[\'\',\'\'])[1]})},3R:q(){o C.8W().2e(q(a){o 5S(a)})},5T:q(){G a=1c.4k;a.2U.bN=C;o a.2k.3t},8X:q(){G c=1e I(\'2k\');c.3t=C.8T();o c.2o[0]?(c.2o.M>1?$A(c.2o).2E(\'\',q(a,b){o a+b.71}):c.2o[0].71):\'\'},5U:q(e){G f=C.2T().1k(/([^?#]*)(#.*)?$/);E(!f)o{};o f[1].32(e||\'&\').2E({},q(a,b){E((b=b.32(\'=\'))[0]){G c=72(b.3N());G d=b.M>1?b.1P(\'=\'):b[0];E(d!=3k)d=72(d);E(c 1s a){E(!J.3n(a[c]))a[c]=[a[c]];a[c].14(d)}19 a[c]=d}o a})},2u:q(){o C.32(\'\')},73:q(){o C.3s(0,C.M-1)+1B.bO(C.8Y(C.M-1)+1)},5V:q(a){o a<1?\'\':1e 1I(a+1).1P(C)},74:q(){G a=C.32(\'-\'),75=a.M;E(75==1)o a[0];G b=C.5W(0)==\'-\'?a[0].5W(0).2f()+a[0].4l(1):a[0];N(G i=1;i<75;i++)b+=a[i].5W(0).2f()+a[i].4l(1);o b},51:q(){o C.5W(0).2f()+C.4l(1).1G()},bP:q(){o C.2m(/::/,\'/\').2m(/([A-Z]+)([A-Z][a-z])/,\'#{1}52#{2}\').2m(/([a-z\\d])([A-Z])/,\'#{1}52#{2}\').2m(/-/,\'52\').1G()},bQ:q(){o C.2m(/52/,\'-\')},1W:q(c){G d=C.2m(/[\\bR-\\bS\\\\]/,q(a){G b=1B.8Q[a[0]];o b?b:\'\\\\bT\'+a[0].8Y().3q(2,16)});E(c)o\'"\'+d.1x(/"/g,\'\\\\"\')+\'"\';o"\'"+d.1x(/\'/g,\'\\\\\\\'\')+"\'"},2s:q(){o C.1W(1f)},76:q(a){o C.8R(a||Y.8D,\'#{1}\')},8Z:q(){G a=C;E(a.3S())o 1d;a=C.1x(/\\\\./g,\'@\').1x(/"[^"\\\\\\n\\r]*"/g,\'\');o(/^[,:{}\\[\\]0-9.\\-+bU-u \\n\\r\\t]*$/).2d(a)},4m:q(a){G b=C.76();1N{E(!a||b.8Z())o 5S(\'(\'+b+\')\')}1Y(e){}3l 1e bV(\'bW bX 90 5O: \'+C.1W());},1p:q(a){o C.2O(a)>-1},77:q(a){o C.2O(a)===0},91:q(a){G d=C.M-a.M;o d>=0&&C.78(a)===d},4n:q(){o C==\'\'},3S:q(){o/^\\s*$/.2d(C)},92:q(a,b){o 1e 2g(C,b).2b(a)}});E(Y.1w.3j||Y.1w.2N)J.U(1B.18,{5T:q(){o C.1x(/&/g,\'&93;\').1x(/</g,\'&94;\').1x(/>/g,\'&95;\')},8X:q(){o C.1x(/&93;/g,\'&\').1x(/&94;/g,\'<\').1x(/&95;/g,\'>\')}});1B.18.2m.70=q(b){E(J.1M(b))o b;G c=1e 2g(b);o q(a){o c.2b(a)}};1B.18.bY=1B.18.5U;J.U(1B.18.5T,{2k:V.2Q(\'2k\'),2U:V.96(\'\')});97(1B.18.5T)2k.4o(2U);G 2g=1E.1L({22:q(a,b){C.98=a.24();C.99=b||2g.9a},2b:q(f){E(J.1M(f.79))f=f.79();o C.98.2m(C.99,q(a){E(f==17)o\'\';G b=a[1]||\'\';E(b==\'\\\\\')o a[2];G c=f,53=a[3];G d=/^([^.[]+|\\[((?:.*?[^\\\\])?)\\])(\\.|\\[|$)/;a=d.9b(53);E(a==17)o b;1q(a!=17){G e=a[1].77(\'[\')?a[2].2m(\'\\\\\\\\]\',\']\'):a[1];c=c[e];E(17==c||\'\'==a[3])1F;53=53.4l(\'[\'==a[3]?a[1].M:a[0].M);a=d.9b(53)}o b+1B.4i(c)})}});2g.9a=/(^|.|\\r|\\n)(#\\{(.*?)\\})/;G $1F={};G 26={1l:q(b,c){G d=0;b=b.1o(c);1N{C.3c(q(a){b(a,d++)})}1Y(e){E(e!=$1F)3l e;}o C},9c:q(a,b,c){b=b?b.1o(c):Y.K;G d=-a,7a=[],7b=C.2u();1q((d+=a)<7b.M)7a.14(7b.3s(d,d+a));o 7a.7c(b,c)},7d:q(c,d){c=c?c.1o(d):Y.K;G e=1f;C.1l(q(a,b){e=e&&!!c(a,b);E(!e)3l $1F;});o e},9d:q(c,d){c=c?c.1o(d):Y.K;G e=1d;C.1l(q(a,b){E(e=!!c(a,b))3l $1F;});o e},7c:q(c,d){c=c?c.1o(d):Y.K;G e=[];C.1l(q(a,b){e.14(c(a,b))});o e},5X:q(c,d){c=c.1o(d);G e;C.1l(q(a,b){E(c(a,b)){e=a;3l $1F;}});o e},4p:q(c,d){c=c.1o(d);G e=[];C.1l(q(a,b){E(c(a,b))e.14(a)});o e},bZ:q(c,d,e){d=d?d.1o(e):Y.K;G f=[];E(J.2l(c))c=1e 3a(c);C.1l(q(a,b){E(c.1k(a))f.14(d(a,b))});o f},1p:q(b){E(J.1M(C.2O))E(C.2O(b)!=-1)o 1f;G c=1d;C.1l(q(a){E(a==b){c=1f;3l $1F;}});o c},c0:q(b,c){c=J.1X(c)?17:c;o C.9c(b,q(a){1q(a.M<b)a.14(c);o a})},2E:q(c,d,e){d=d.1o(e);C.1l(q(a,b){c=d(c,a,b)});o c},5P:q(b){G c=$A(1c).3s(1);o C.2e(q(a){o a[b].2B(a,c)})},c1:q(c,d){c=c?c.1o(d):Y.K;G e;C.1l(q(a,b){a=c(a,b);E(e==17||a>=e)e=a});o e},c2:q(c,d){c=c?c.1o(d):Y.K;G e;C.1l(q(a,b){a=c(a,b);E(e==17||a<e)e=a});o e},c3:q(c,d){c=c?c.1o(d):Y.K;G e=[],7e=[];C.1l(q(a,b){(c(a,b)?e:7e).14(a)});o[e,7e]},4q:q(b){G c=[];C.1l(q(a){c.14(a[b])});o c},c4:q(c,d){c=c.1o(d);G e=[];C.1l(q(a,b){E(!c(a,b))e.14(a)});o e},9e:q(e,f){e=e.1o(f);o C.2e(q(a,b){o{1g:a,54:e(a,b)}}).c5(q(c,d){G a=c.54,b=d.54;o a<b?-1:a>b?1:0}).4q(\'1g\')},2u:q(){o C.2e()},c6:q(){G c=Y.K,2c=$A(1c);E(J.1M(2c.1Q()))c=2c.c7();G d=[C].1z(2c).2e($A);o C.2e(q(a,b){o c(d.4q(b))})},9f:q(){o C.2u().M},1W:q(){o\'#<26:\'+C.2u().1W()+\'>\'}};J.U(26,{2e:26.7c,7f:26.5X,20:26.4p,4r:26.4p,c8:26.1p,c9:26.2u,ca:26.7d,cb:26.9d});q $A(a){E(!a)o[];E(a.2u)o a.2u();G b=a.M||0,15=1e 1I(b);1q(b--)15[b]=a[b];o 15}E(Y.1w.3j){$A=q(a){E(!a)o[];E(!(J.1M(a)&&a==\'[2D cc]\')&&a.2u)o a.2u();G b=a.M||0,15=1e 1I(b);1q(b--)15[b]=a[b];o 15}}1I.9g=$A;J.U(1I.18,26);E(!1I.18.7g)1I.18.7g=1I.18.55;J.U(1I.18,{3c:q(a){N(G i=0,M=C.M;i<M;i++)a(C[i])},9h:q(){C.M=0;o C},2C:q(){o C[0]},1Q:q(){o C[C.M-1]},cd:q(){o C.20(q(a){o a!=17})},9i:q(){o C.2E([],q(a,b){o a.1z(J.3n(b)?b.9i():[b])})},56:q(){G b=$A(1c);o C.20(q(a){o!b.1p(a)})},55:q(a){o(a!==1d?C:C.2u()).7g()},ce:q(){o C.M>1?C:C[0]},9j:q(d){o C.2E([],q(a,b,c){E(0==c||(d?a.1Q()!=b:!a.1p(b)))a.14(b);o a})},cf:q(c){o C.9j().4p(q(b){o c.5X(q(a){o b===a})})},1Z:q(){o[].1z(C)},9f:q(){o C.M},1W:q(){o\'[\'+C.2e(J.1W).1P(\', \')+\']\'},2s:q(){G c=[];C.1l(q(a){G b=J.2s(a);E(!J.1X(b))c.14(b)});o\'[\'+c.1P(\', \')+\']\'}});E(J.1M(1I.18.9k))1I.18.3c=1I.18.9k;E(!1I.18.2O)1I.18.2O=q(a,i){i||(i=0);G b=C.M;E(i<0)i=b+i;N(;i<b;i++)E(C[i]===a)o i;o-1};E(!1I.18.78)1I.18.78=q(a,i){i=cg(i)?C.M:(i<0?C.M+i:i)+1;G n=C.3s(0,i).55().2O(a);o(n<0)?n:i-n-1};1I.18.2u=1I.18.1Z;q $w(a){E(!J.2l(a))o[];a=a.2T();o a?a.32(/\\s+/):[]}E(Y.1w.3J){1I.18.1z=q(){G a=[];N(G i=0,M=C.M;i<M;i++)a.14(C[i]);N(G i=0,M=1c.M;i<M;i++){E(J.3n(1c[i])){N(G j=0,9l=1c[i].M;j<9l;j++)a.14(1c[i][j])}19{a.14(1c[i])}}o a}}J.U(3T.18,{ch:q(){o C.3q(2,16)},73:q(){o C+1},5V:q(a){$R(0,C,1f).1l(a);o C},3q:q(a,b){G c=C.24(b||10);o\'0\'.5V(a-c.M)+c},2s:q(){o ci(C)?C.24():\'17\'}});$w(\'cj ck cl cm\').1l(q(a){3T.18[a]=co[a].3o()});q $H(a){o 1e 2S(a)};G 2S=1E.1L(26,(q(){q 7h(a,b){E(J.1X(b))o a;o a+\'=\'+9m(1B.4i(b))}o{22:q(a){C.3u=J.6U(a)?a.57():J.1Z(a)},3c:q(a){N(G b 1s C.3u){G c=C.3u[b],5Y=[b,c];5Y.4s=b;5Y.1g=c;a(5Y)}},58:q(a,b){o C.3u[a]=b},7i:q(a){o C.3u[a]},cp:q(a){G b=C.3u[a];7j C.3u[a];o b},57:q(){o J.1Z(C.3u)},4g:q(){o C.4q(\'4s\')},25:q(){o C.4q(\'1g\')},50:q(b){G c=C.5X(q(a){o a.1g===b});o c&&c.4s},cq:q(a){o C.1Z().3U(a)},3U:q(c){o 1e 2S(c).2E(C,q(a,b){a.58(b.4s,b.1g);o a})},3m:q(){o C.2e(q(a){G b=9m(a.4s),25=a.1g;E(25&&2R 25==\'2D\'){E(J.3n(25))o 25.2e(7h.5Q(b)).1P(\'&\')}o 7h(b,25)}).1P(\'&\')},1W:q(){o\'#<2S:{\'+C.2e(q(a){o a.2e(J.1W).1P(\': \')}).1P(\', \')+\'}>\'},2s:q(){o J.2s(C.57())},1Z:q(){o 1e 2S(C)}}})());2S.18.79=2S.18.57;2S.9g=$H;G 9n=1E.1L(26,{22:q(a,b,c){C.59=a;C.7k=b;C.9o=c},3c:q(a){G b=C.59;1q(C.1p(b)){a(b);b=b.73()}},1p:q(a){E(a<C.59)o 1d;E(C.9o)o a<C.7k;o a<=C.7k}});G $R=q(a,b,c){o 1e 9n(a,b,c)};G 1t={9p:q(){o 8K.8L(q(){o 1e 9q()},q(){o 1e 9r(\'cr.9s\')},q(){o 1e 9r(\'cs.9s\')})||1d},7l:0};1t.4t={5a:[],3c:q(a){C.5a.3c(a)},9t:q(a){E(!C.1p(a))C.5a.14(a)},ct:q(a){C.5a=C.5a.56(a)},5Z:q(b,c,d,f){C.1l(q(a){E(J.1M(a[b])){1N{a[b].2B(a,[c,d,f])}1Y(e){}}})}};J.U(1t.4t,26);1t.4t.9t({60:q(){1t.7l++},3v:q(){1t.7l--}});1t.7m=1E.1L({22:q(a){C.1b={28:\'5b\',61:1f,9u:\'62/x-cu-6S-cv\',7n:\'cw-8\',2v:\'\',4m:1f,7o:1f};J.U(C.1b,a||{});C.1b.28=C.1b.28.1G();E(J.2l(C.1b.2v))C.1b.2v=C.1b.2v.5U();19 E(J.6U(C.1b.2v))C.1b.2v=C.1b.2v.57()}});1t.3V=1E.1L(1t.7m,{7p:1d,22:q($2Y,b,c){$2Y(c);C.1R=1t.9p();C.2V(b)},2V:q(a){C.3W=a;C.28=C.1b.28;G b=J.1Z(C.1b.2v);E(![\'7i\',\'5b\'].1p(C.28)){b[\'cx\']=C.28;C.28=\'5b\'}C.2v=b;E(b=J.3m(b)){E(C.28==\'7i\')C.3W+=(C.3W.1p(\'?\')?\'&\':\'?\')+b;19 E(/cy|8C|8A/.2d(3K.3L))b+=\'&52=\'}1N{G c=1e 1t.7q(C);E(C.1b.60)C.1b.60(c);1t.4t.5Z(\'60\',C,c);C.1R.cz(C.28.2f(),C.3W,C.1b.61);E(C.1b.61)C.7r.1o(C).3p(1);C.1R.63=C.7s.1o(C);C.9v();C.1S=C.28==\'5b\'?(C.1b.cA||b):17;C.1R.cB(C.1S);E(!C.1b.61&&C.1R.9w)C.7s()}1Y(e){C.3X(e)}},7s:q(){G a=C.1R.2W;E(a>1&&!((a==4)&&C.7p))C.7r(C.1R.2W)},9v:q(){G b={\'X-cC-cD\':\'9q\',\'X-Y-6Q\':Y.6Q,\'cE\':\'2U/cF, 2U/cG, 62/9x, 2U/9x, */*\'};E(C.28==\'5b\'){b[\'7t-1n\']=C.1b.9u+(C.1b.7n?\'; cH=\'+C.1b.7n:\'\');E(C.1R.9w&&(3K.3L.1k(/5K\\/(\\d{4})/)||[0,9y])[1]<9y)b[\'cI\']=\'cJ\'}E(2R C.1b.9z==\'2D\'){G c=C.1b.9z;E(J.1M(c.14))N(G i=0,M=c.M;i<M;i+=2)b[c[i]]=c[i+1];19 $H(c).1l(q(a){b[a.4s]=a.1g})}N(G d 1s b)C.1R.cK(d,b[d])},3Y:q(){G a=C.5c();o!a||(a>=cL&&a<cM)},5c:q(){1N{o C.1R.64||0}1Y(e){o 0}},7r:q(a){G b=1t.3V.9A[a],3d=1e 1t.7q(C);E(b==\'7u\'){1N{C.7p=1f;(C.1b[\'4u\'+3d.64]||C.1b[\'4u\'+(C.3Y()?\'cN\':\'cO\')]||Y.2q)(3d,3d.65)}1Y(e){C.3X(e)}G c=3d.4v(\'7t-1n\');E(C.1b.7o==\'9B\'||(C.1b.7o&&C.66()&&c&&c.1k(/^\\s*(2U|62)\\/(x-)?(cP|cQ)4T(;.*)?\\s*$/i)))C.9C()}1N{(C.1b[\'4u\'+b]||Y.2q)(3d,3d.65);1t.4t.5Z(\'4u\'+b,C,3d,3d.65)}1Y(e){C.3X(e)}E(b==\'7u\'){C.1R.63=Y.2q}},66:q(){G m=C.3W.1k(/^\\s*cR?:\\/\\/[^\\/]*/);o!m||(m[0]==\'#{7v}//#{7w}#{67}\'.92({7v:68.7v,7w:V.7w,67:68.67?\':\'+68.67:\'\'}))},4v:q(a){1N{o C.1R.7x(a)||17}1Y(e){o 17}},9C:q(){1N{o 5S((C.1R.3w||\'\').76())}1Y(e){C.3X(e)}},3X:q(a){(C.1b.9D||Y.2q)(C,a);1t.4t.5Z(\'9D\',C,a)}});1t.3V.9A=[\'cS\',\'cT\',\'cU\',\'cV\',\'7u\'];1t.7q=1E.1L({22:q(a){C.2V=a;G b=C.1R=a.1R,2W=C.2W=b.2W;E((2W>2&&!Y.1w.2N)||2W==4){C.64=C.5c();C.7y=C.9E();C.3w=1B.4i(b.3w);C.65=C.9F()}E(2W==4){G c=b.9G;C.9G=J.1X(c)?17:c;C.cW=C.9H()}},64:0,7y:\'\',5c:1t.3V.18.5c,9E:q(){1N{o C.1R.7y||\'\'}1Y(e){o\'\'}},4v:1t.3V.18.4v,cX:q(){1N{o C.7z()}1Y(e){o 17}},7x:q(a){o C.1R.7x(a)},7z:q(){o C.1R.7z()},9F:q(){G a=C.4v(\'X-90\');E(!a)o 17;a=72(8M(a));1N{o a.4m(C.2V.1b.9I||!C.2V.66())}1Y(e){C.2V.3X(e)}},9H:q(){G a=C.2V.1b;E(!a.4m||(a.4m!=\'9B\'&&!(C.4v(\'7t-1n\')||\'\').1p(\'62/cY\'))||C.3w.3S())o 17;1N{o C.3w.4m(a.9I||!C.2V.66())}1Y(e){C.2V.3X(e)}}});1t.9J=1E.1L(1t.3V,{22:q($2Y,d,e,f){C.69={3Y:(d.3Y||d),7A:(d.7A||(d.3Y?17:d))};f=J.1Z(f);G g=f.3v;f.3v=(q(a,b){C.9K(a.3w);E(J.1M(g))g(a,b)}).1o(C);$2Y(e,f)},9K:q(a){G b=C.69[C.3Y()?\'3Y\':\'7A\'],1b=C.1b;E(!1b.3R)a=a.3b();E(b=$(b)){E(1b.6a){E(J.2l(1b.6a)){G c={};c[1b.6a]=a;b.2w(c)}19 1b.6a(b,a)}19 b.3U(a)}}});1t.cZ=1E.1L(1t.7m,{22:q($2Y,b,c,d){$2Y(d);C.3v=C.1b.3v;C.4X=(C.1b.4X||2);C.3Z=(C.1b.3Z||1);C.7B={};C.69=b;C.3W=c;C.59()},59:q(){C.1b.3v=C.9L.1o(C);C.4Z()},6Z:q(){C.7B.1b.3v=3k;d0(C.4j);(C.3v||Y.2q).2B(C,1c)},9L:q(a){E(C.1b.3Z){C.3Z=(a.3w==C.9M?C.3Z*C.1b.3Z:1);C.9M=a.3w}C.4j=C.4Z.1o(C).6W(C.3Z*C.4X)},4Z:q(){C.7B=1e 1t.9J(C.69,C.3W,C.1b)}});q $(a){E(1c.M>1){N(G i=0,7C=[],M=1c.M;i<M;i++)7C.14($(1c[i]));o 7C}E(J.2l(a))a=V.d1(a);o I.U(a)}E(Y.2P.5L){V.7D=q(a,b){G c=[];G d=V.2b(a,$(b)||V,17,d2.d3,17);N(G i=0,M=d.d4;i<M;i++)c.14(I.U(d.d5(i)));o c}}E(!1i.5d)G 5d={};E(!5d.9N){J.U(5d,{9N:1,d6:2,9O:3,d7:4,d8:5,d9:6,da:7,db:8,dc:9,dd:10,de:11,df:12})}(q(){G d=C.I;C.I=q(a,b){b=b||{};a=a.1G();G c=I.5e;E(Y.1w.2N&&b.21){a=\'<\'+a+\' 21="\'+b.21+\'">\';7j b.21;o I.5f(V.2Q(a),b)}E(!c[a])c[a]=I.U(V.2Q(a));o I.5f(c[a].dg(1d),b)};J.U(C.I,d||{})}).7E(1i);I.5e={};I.W={7F:q(a){o $(a).1a.3e!=\'6b\'},9P:q(a){a=$(a);I[I.7F(a)?\'9Q\':\'9R\'](a);o a},9Q:q(a){$(a).1a.3e=\'6b\';o a},9R:q(a){$(a).1a.3e=\'\';o a},9S:q(a){a=$(a);a.1A.5g(a);o a},3U:q(a,b){a=$(a);E(b&&b.2x)b=b.2x();E(J.2Z(b))o a.3U().2w(b);b=J.31(b);a.3t=b.3b();b.3R.1o(b).3p();o a},1x:q(a,b){a=$(a);E(b&&b.2x)b=b.2x();19 E(!J.2Z(b)){b=J.31(b);G c=a.dh.di();c.dj(a);b.3R.1o(b).3p();b=c.dk(b.3b())}a.1A.7G(b,a);o a},2w:q(a,b){a=$(a);E(J.2l(b)||J.3Q(b)||J.2Z(b)||(b&&(b.2x||b.31)))b={41:b};G c,2w,1h,2o;N(G d 1s b){c=b[d];d=d.1G();2w=I.4w[d];E(c&&c.2x)c=c.2x();E(J.2Z(c)){2w(a,c);2F}c=J.31(c);1h=((d==\'7H\'||d==\'6c\')?a.1A:a).1h.2f();2o=I.6d(1h,c.3b());E(d==\'2h\'||d==\'6c\')2o.55();2o.1l(2w.5Q(a));c.3R.1o(c).3p()}o a},3O:q(a,b,c){a=$(a);E(J.2Z(b))$(b).5f(c||{});19 E(J.2l(b))b=1e I(b,c);19 b=1e I(\'2k\',b);E(a.1A)a.1A.7G(b,a);b.4o(a);o b},1W:q(d){d=$(d);G e=\'<\'+d.1h.1G();$H({\'29\':\'29\',\'1J\':\'5h\'}).1l(q(a){G b=a.2C(),9T=a.1Q();G c=(d[b]||\'\').24();E(c)e+=\' \'+9T+\'=\'+c.1W(1f)});o e+\'>\'},6e:q(a,b){a=$(a);G c=[];1q(a=a[b])E(a.2t==1)c.14(I.U(a));o c},7I:q(a){o $(a).6e(\'1A\')},9U:q(a){o $(a).20("*")},9V:q(a){a=$(a).4x;1q(a&&a.2t!=1)a=a.3x;o $(a)},9W:q(a){E(!(a=$(a).4x))o[];1q(a&&a.2t!=1)a=a.3x;E(a)o[a].1z($(a).5i());o[]},7J:q(a){o $(a).6e(\'9X\')},5i:q(a){o $(a).6e(\'3x\')},dl:q(a){a=$(a);o a.7J().55().1z(a.5i())},1k:q(a,b){E(J.2l(b))b=1e O(b);o b.1k($(a))},dm:q(a,b,c){a=$(a);E(1c.M==1)o $(a.1A);G d=a.7I();o J.3Q(b)?d[b]:O.4y(d,b,c)},dn:q(a,b,c){a=$(a);E(1c.M==1)o a.9V();o J.3Q(b)?a.9U()[b]:a.20(b)[c||0]},dp:q(a,b,c){a=$(a);E(1c.M==1)o $(O.1C.5j(a));G d=a.7J();o J.3Q(b)?d[b]:O.4y(d,b,c)},9Y:q(a,b,c){a=$(a);E(1c.M==1)o $(O.1C.5k(a));G d=a.5i();o J.3Q(b)?d[b]:O.4y(d,b,c)},20:q(){G a=$A(1c),1u=$(a.3N());o O.6f(1u,a)},42:q(){G a=$A(1c),1u=$(a.3N());o O.6f(1u.1A,a).56(1u)},9Z:q(a){a=$(a);G b=a.43(\'29\'),7K=1c.4k;E(b)o b;do{b=\'dq\'+7K.a0++}1q($(b));a.5f(\'29\',b);o b},43:q(a,b){a=$(a);E(Y.1w.2N){G t=I.2G.6g;E(t.25[b])o t.25[b](a,b);E(t.3y[b])b=t.3y[b];E(b.1p(\':\')){o(!a.7L||!a.7L[b])?17:a.7L[b].1g}}o a.7M(b)},5f:q(a,b,c){a=$(a);G d={},t=I.2G.5l;E(2R b==\'2D\')d=b;19 d[b]=J.1X(c)?1f:c;N(G e 1s d){b=t.3y[e]||e;c=d[e];E(t.25[e])b=t.25[e](a,c);E(c===1d||c===17)a.7N(b);19 E(c===1f)a.a1(b,b);19 a.a1(b,c)}o a},a2:q(a){o $(a).4z().2y},a3:q(a){o $(a).4z().1T},5m:q(a){o 1e I.6h(a)},6i:q(a,b){E(!(a=$(a)))o;G c=a.1J;o(c.M>0&&(c==b||1e 3a("(^|\\\\s)"+b+"(\\\\s|$)").2d(c)))},a4:q(a,b){E(!(a=$(a)))o;E(!a.6i(b))a.1J+=(a.1J?\' \':\'\')+b;o a},a5:q(a,b){E(!(a=$(a)))o;a.1J=a.1J.1x(1e 3a("(^|\\\\s+)"+b+"(\\\\s+|$)"),\' \').2T();o a},dr:q(a,b){E(!(a=$(a)))o;o a[a.6i(b)?\'a5\':\'a4\'](b)},ds:q(a){a=$(a);G b=a.4x;1q(b){G c=b.3x;E(b.2t==3&&!/\\S/.2d(b.71))a.5g(b);b=c}o a},4n:q(a){o $(a).3t.3S()},6j:q(b,c){b=$(b),c=$(c);G d=c;E(b.a6)o(b.a6(c)&8)===8;E(b.5n&&!Y.1w.3J){G e=b.5n,a=c.5n,4A=c.3x;E(!4A){do{c=c.1A}1q(!(4A=c.3x)&&c.1A)}E(4A&&4A.5n)o(e>a&&e<4A.5n)}1q(b=b.1A)E(b==d)o 1f;o 1d},a7:q(a){a=$(a);G b=a.44();1i.a7(b[0],b[1]);o a},1D:q(a,b){a=$(a);b=b==\'7O\'?\'6k\':b.74();G c=a.1a[b];E(!c){G d=V.dt.du(a,17);c=d?d[b]:17}E(b==\'2H\')o c?4B(c):1.0;o c==\'6l\'?17:c},dv:q(a){o $(a).1D(\'2H\')},4C:q(a,b){a=$(a);G c=a.1a,1k;E(J.2l(b)){a.1a.7P+=\';\'+b;o b.1p(\'2H\')?a.4D(b.1k(/2H:\\s*(\\d?\\.?\\d*)/)[1]):a}N(G d 1s b)E(d==\'2H\')a.4D(b[d]);19 c[(d==\'7O\'||d==\'6k\')?(J.1X(c.7Q)?\'6k\':\'7Q\'):d]=b[d];o a},4D:q(a,b){a=$(a);a.1a.2H=(b==1||b===\'\')?\'\':(b<0.6m)?0:b;o a},4z:q(a){a=$(a);G b=$(a).1D(\'3e\');E(b!=\'6b\'&&b!=17)o{1T:a.4E,2y:a.4F};G c=a.1a;G d=c.7R;G e=c.1v;G f=c.3e;c.7R=\'6n\';c.1v=\'4G\';c.3e=\'dw\';G g=a.a8;G h=a.a9;c.3e=f;c.1v=e;c.7R=d;o{1T:g,2y:h}},dx:q(a){a=$(a);G b=I.1D(a,\'1v\');E(b==\'4H\'||!b){a.7S=1f;a.1a.1v=\'5o\';E(1i.6R){a.1a.2h=0;a.1a.2I=0}}o a},dy:q(a){a=$(a);E(a.7S){a.7S=3k;a.1a.1v=a.1a.2h=a.1a.2I=a.1a.41=a.1a.6o=\'\'}o a},dz:q(a){a=$(a);E(a.47)o a;a.47=I.1D(a,\'7T\')||\'6l\';E(a.47!==\'6n\')a.1a.7T=\'6n\';o a},dA:q(a){a=$(a);E(!a.47)o a;a.1a.7T=a.47==\'6l\'?\'\':a.47;a.47=17;o a},44:q(a){G b=0,2a=0;do{b+=a.48||0;2a+=a.49||0;a=a.3f}1q(a);o I.4a(2a,b)},5p:q(a){G b=0,2a=0;do{b+=a.48||0;2a+=a.49||0;a=a.3f;E(a){E(a.1h==\'aa\')1F;G p=I.1D(a,\'1v\');E(p!==\'4H\')1F}}1q(a);o I.4a(2a,b)},7U:q(a){a=$(a);E(a.1D(\'1v\')==\'4G\')o;G b=a.5p();G c=b[1];G d=b[0];G e=a.a8;G f=a.a9;a.ab=d-4B(a.1a.2I||0);a.ac=c-4B(a.1a.2h||0);a.ad=a.1a.1T;a.ae=a.1a.2y;a.1a.1v=\'4G\';a.1a.2h=c+\'2p\';a.1a.2I=d+\'2p\';a.1a.1T=e+\'2p\';a.1a.2y=f+\'2p\';o a},7V:q(a){a=$(a);E(a.1D(\'1v\')==\'5o\')o;a.1a.1v=\'5o\';G b=4B(a.1a.2h||0)-(a.ac||0);G c=4B(a.1a.2I||0)-(a.ab||0);a.1a.2h=b+\'2p\';a.1a.2I=c+\'2p\';a.1a.2y=a.ae;a.1a.1T=a.ad;o a},7W:q(a){G b=0,2a=0;do{b+=a.3z||0;2a+=a.3A||0;a=a.1A}1q(a);o I.4a(2a,b)},4I:q(a){E(a.3f)o $(a.3f);E(a==V.1S)o $(a);1q((a=a.1A)&&a!=V.1S)E(I.1D(a,\'1v\')!=\'4H\')o $(a);o $(V.1S)},5q:q(a){G b=0,2a=0;G c=a;do{b+=c.48||0;2a+=c.49||0;E(c.3f==V.1S&&I.1D(c,\'1v\')==\'4G\')1F}1q(c=c.3f);c=a;do{E(!Y.1w.3J||c.1h==\'aa\'){b-=c.3z||0;2a-=c.3A||0}}1q(c=c.1A);o I.4a(2a,b)},af:q(a,b){G c=J.U({ag:1f,ah:1f,ai:1f,aj:1f,48:0,49:0},1c[2]||{});b=$(b);G p=b.5q();a=$(a);G d=[0,0];G e=17;E(I.1D(a,\'1v\')==\'4G\'){e=a.4I();d=e.5q()}E(e==V.1S){d[0]-=V.1S.49;d[1]-=V.1S.48}E(c.ag)a.1a.2I=(p[0]-d[0]+c.49)+\'2p\';E(c.ah)a.1a.2h=(p[1]-d[1]+c.48)+\'2p\';E(c.ai)a.1a.1T=b.4E+\'2p\';E(c.aj)a.1a.2y=b.4F+\'2p\';o a}};I.W.9Z.a0=1;J.U(I.W,{dB:I.W.20,dC:I.W.9W});I.2G={5l:{3y:{1J:\'5h\',ak:\'N\'},25:{}}};E(Y.1w.3J){I.W.1D=I.W.1D.3O(q(d,e,f){4h(f){1O\'2I\':1O\'2h\':1O\'6o\':1O\'41\':E(d(e,\'1v\')===\'4H\')o 17;1O\'2y\':1O\'1T\':E(!I.7F(e))o 17;G g=al(d(e,f),10);E(g!==e[\'2i\'+f.51()])o g+\'2p\';G h;E(f===\'2y\'){h=[\'6p-2h-1T\',\'6q-2h\',\'6q-41\',\'6p-41-1T\']}19{h=[\'6p-2I-1T\',\'6q-2I\',\'6q-6o\',\'6p-6o-1T\']}o h.2E(g,q(a,b){G c=d(e,b);o c===17?a:a-al(c,10)})+\'2p\';5r:o d(e,f)}});I.W.43=I.W.43.3O(q(a,b,c){E(c===\'6r\')o b.6r;o a(b,c)})}19 E(Y.1w.2N){I.W.4I=I.W.4I.3O(q(a,b){b=$(b);G c=b.1D(\'1v\');E(c!==\'4H\')o a(b);b.4C({1v:\'5o\'});G d=a(b);b.4C({1v:c});o d});$w(\'5p 5q\').1l(q(f){I.W[f]=I.W[f].3O(q(a,b){b=$(b);G c=b.1D(\'1v\');E(c!==\'4H\')o a(b);G d=b.4I();E(d&&d.1D(\'1v\')===\'dD\')d.4C({7X:1});b.4C({1v:\'5o\'});G e=a(b);b.4C({1v:c});o e})});I.W.1D=q(a,b){a=$(a);b=(b==\'7O\'||b==\'6k\')?\'7Q\':b.74();G c=a.1a[b];E(!c&&a.7Y)c=a.7Y[b];E(b==\'2H\'){E(c=(a.1D(\'4r\')||\'\').1k(/7Z\\(2H=(.*)\\)/))E(c[1])o 4B(c[1])/am;o 1.0}E(c==\'6l\'){E((b==\'1T\'||b==\'2y\')&&(a.1D(\'3e\')!=\'6b\'))o a[\'2i\'+b.51()]+\'2p\';o 17}o c};I.W.4D=q(b,c){q 80(a){o a.1x(/7Z\\([^\\)]*\\)/8U,\'\')}b=$(b);G d=b.7Y;E((d&&!d.dE)||(!d&&b.1a.7X==\'dF\'))b.1a.7X=1;G e=b.1D(\'4r\'),1a=b.1a;E(c==1||c===\'\'){(e=80(e))?1a.4r=e:1a.7N(\'4r\');o b}19 E(c<0.6m)c=0;1a.4r=80(e)+\'7Z(2H=\'+(c*am)+\')\';o b};I.2G={6g:{3y:{\'5h\':\'1J\',\'N\':\'ak\'},25:{6s:q(a,b){o a.7M(b,2)},an:q(a,b){G c=a.ao(b);o c?c.1g:""},1K:q(a,b){b=a.7M(b);o b?b.24().3s(23,-2):17},5s:q(a,b){o $(a).2J(b)?b:17},1a:q(a){o a.1a.7P.1G()},6r:q(a){o a.6r}}}};I.2G.5l={3y:J.U({dG:\'dH\',dI:\'dJ\'},I.2G.6g.3y),25:{2K:q(a,b){a.2K=!!b},1a:q(a,b){a.1a.7P=b?b:\'\'}}};I.2G.81={};$w(\'dK dL dM dN dO 6t \'+\'dP dQ dR dS\').1l(q(a){I.2G.5l.3y[a.1G()]=a;I.2G.81[a.1G()]=a});(q(v){J.U(v,{ap:v.6s,aq:v.6s,1n:v.6s,4J:v.an,2z:v.5s,2K:v.5s,dT:v.5s,dU:v.5s,dV:v.1K,ar:v.1K,dW:v.1K,dX:v.1K,dY:v.1K,dZ:v.1K,e0:v.1K,e1:v.1K,e2:v.1K,e3:v.1K,e4:v.1K,e5:v.1K,e6:v.1K,e7:v.1K,e8:v.1K,e9:v.1K,ea:v.1K,eb:v.1K})})(I.2G.6g.25)}19 E(Y.1w.5K&&/ec:1\\.8\\.0/.2d(3K.3L)){I.W.4D=q(a,b){a=$(a);a.1a.2H=(b==1)?0.ed:(b===\'\')?\'\':(b<0.6m)?0:b;o a}}19 E(Y.1w.3j){I.W.4D=q(a,b){a=$(a);a.1a.2H=(b==1||b===\'\')?\'\':(b<0.6m)?0:b;E(b==1)E(a.1h==\'at\'&&a.1T){a.1T++;a.1T--}19 1N{G n=V.96(\' \');a.4o(n);a.5g(n)}1Y(e){}o a};I.W.44=q(a){G b=0,2a=0;do{b+=a.48||0;2a+=a.49||0;E(a.3f==V.1S)E(I.1D(a,\'1v\')==\'4G\')1F;a=a.3f}1q(a);o I.4a(2a,b)}}E(Y.1w.2N||Y.1w.3J){I.W.3U=q(b,c){b=$(b);E(c&&c.2x)c=c.2x();E(J.2Z(c))o b.3U().2w(c);c=J.31(c);G d=b.1h.2f();E(d 1s I.4w.3B){$A(b.2o).1l(q(a){b.5g(a)});I.6d(d,c.3b()).1l(q(a){b.4o(a)})}19 b.3t=c.3b();c.3R.1o(c).3p();o b}}E(\'au\'1s V.2Q(\'2k\')){I.W.1x=q(b,c){b=$(b);E(c&&c.2x)c=c.2x();E(J.2Z(c)){b.1A.7G(c,b);o b}c=J.31(c);G d=b.1A,1h=d.1h.2f();E(I.4w.3B[1h]){G e=b.9Y();G f=I.6d(1h,c.3b());d.5g(b);E(e)f.1l(q(a){d.6u(a,e)});19 f.1l(q(a){d.4o(a)})}19 b.au=c.3b();c.3R.1o(c).3p();o b}}I.4a=q(l,t){G a=[l,t];a.2I=l;a.2h=t;o a};I.6d=q(a,b){G c=1e I(\'2k\'),t=I.4w.3B[a];E(t){c.3t=t[0]+b+t[1];t[2].5V(q(){c=c.4x})}19 c.3t=b;o $A(c.2o)};I.4w={7H:q(a,b){a.1A.6u(b,a)},2h:q(a,b){a.6u(b,a.4x)},41:q(a,b){a.4o(b)},6c:q(a,b){a.1A.6u(b,a.3x)},3B:{ee:[\'<3C>\',\'</3C>\',1],6v:[\'<3C><4K>\',\'</4K></3C>\',2],av:[\'<3C><4K><6w>\',\'</6w></4K></3C>\',3],82:[\'<3C><4K><6w><aw>\',\'</aw></6w></4K></3C>\',4],ax:[\'<20>\',\'</20>\',1]}};(q(){J.U(C.3B,{ay:C.3B.6v,az:C.3B.6v,aA:C.3B.82})}).7E(I.4w);I.W.6x={2J:q(a,b){b=I.2G.81[b]||b;G c=$(a).ao(b);o c&&c.ef}};I.W.2A={};J.U(I,I.W);E(!Y.2P.4R&&V.2Q(\'2k\').3M){1i.4S={};1i.4S.18=V.2Q(\'2k\').3M;Y.2P.4R=1f}I.U=(q(){E(Y.2P.5M)o Y.K;G c={},2A=I.W.2A;G d=J.U(q(a){E(!a||a.6y||a.2t!=1||a==1i)o a;G b=J.1Z(c),1h=a.1h,5t,1g;E(2A[1h])J.U(b,2A[1h]);N(5t 1s b){1g=b[5t];E(J.1M(1g)&&!(5t 1s a))a[5t]=1g.3o()}a.6y=Y.2q;o a},{6z:q(){E(!Y.2P.4R){J.U(c,I.W);J.U(c,I.W.6x)}}});d.6z();o d})();I.2J=q(a,b){E(a.2J)o a.2J(b);o I.W.6x.2J(a,b)};I.4V=q(f){G F=Y.2P,T=I.W.2A;E(!f){J.U(1j,1j.W);J.U(1j.I,1j.I.W);J.U(I.W.2A,{"eg":J.1Z(1j.W),"eh":J.1Z(1j.I.W),"ax":J.1Z(1j.I.W),"aB":J.1Z(1j.I.W)})}E(1c.M==2){G g=f;f=1c[1]}E(!g)J.U(I.W,f||{});19{E(J.3n(g))g.1l(U);19 U(g)}q U(a){a=a.2f();E(!I.W.2A[a])I.W.2A[a]={};J.U(I.W.2A[a],f)}q 6A(a,b,c){c=c||1d;N(G d 1s a){G e=a[d];E(!J.1M(e))2F;E(!c||!(d 1s b))b[d]=e.3o()}}q aC(a){G b;G c={"ei":"ej","aB":"ek","P":"el","em":"eo","ep":"eq","er":"es","et":"eu","ev":"ew","ex":"4L","ey":"4L","ez":"4L","eA":"4L","eB":"4L","eC":"4L","Q":"eD","eE":"aD","eF":"aD","A":"eG","at":"eH","eI":"eJ","eK":"aE","eL":"aE","ay":"83","az":"83","6v":"83","av":"eM","aA":"aF","82":"aF","eN":"eO","eP":"eQ"};E(c[a])b=\'84\'+c[a]+\'I\';E(1i[b])o 1i[b];b=\'84\'+a+\'I\';E(1i[b])o 1i[b];b=\'84\'+a.51()+\'I\';E(1i[b])o 1i[b];1i[b]={};1i[b].18=V.2Q(a).3M;o 1i[b]}E(F.4R){6A(I.W,4S.18);6A(I.W.6x,4S.18,1f)}E(F.5M){N(G h 1s I.W.2A){G i=aC(h);E(J.1X(i))2F;6A(T[h],i.18)}}J.U(I,I.W);7j I.2A;E(I.U.6z)I.U.6z();I.5e={}};V.eR={4z:q(){G a={};G B=Y.1w;$w(\'1T 2y\').1l(q(d){G D=d.51();a[d]=(B.3j&&!V.2b)?7K[\'eS\'+D]:(B.3J)?V.1S[\'aG\'+D]:V.3D[\'aG\'+D]});o a},a3:q(){o C.4z().1T},a2:q(){o C.4z().2y},eT:q(){o I.4a(1i.aH||V.3D.3A||V.1S.3A,1i.aI||V.3D.3z||V.1S.3z)}};G O=1E.1L({22:q(a){C.2X=a.2T();C.aJ()},aK:q(){E(!Y.2P.5L)o 1d;G e=C.2X;E(Y.1w.3j&&(e.1p("-1U-1n")||e.1p(":4n")))o 1d;E((/(\\[[\\w-]*?:|:2K)/).2d(C.2X))o 1d;o 1f},aJ:q(){E(C.aK())o C.aL();G e=C.2X,3g=O.5u,h=O.1C,c=O.54,3h,p,m;E(O.4b[e]){C.2L=O.4b[e];o}C.2L=["C.2L = q(aM) {","G r = aM, h = O.1C, c = 1d, n;"];1q(e&&3h!=e&&(/\\S/).2d(e)){3h=e;N(G i 1s 3g){p=3g[i];E(m=e.1k(p)){C.2L.14(J.1M(c[i])?c[i](m):1e 2g(c[i]).2b(m));e=e.1x(m[0],\'\');1F}}}C.2L.14("o h.85(n);\\n}");5S(C.2L.1P(\'\\n\'));O.4b[C.2X]=C.2L},aL:q(){G e=C.2X,3g=O.5u,x=O.1V,3h,m;E(O.4b[e]){C.1V=O.4b[e];o}C.2L=[\'.//*\'];1q(e&&3h!=e&&(/\\S/).2d(e)){3h=e;N(G i 1s 3g){E(m=e.1k(3g[i])){C.2L.14(J.1M(x[i])?x[i](m):1e 2g(x[i]).2b(m));e=e.1x(m[0],\'\');1F}}}C.1V=C.2L.1P(\'\');O.4b[C.2X]=C.1V},6B:q(a){a=a||V;E(C.1V)o V.7D(C.1V,a);o C.2L(a)},1k:q(a){C.86=[];G e=C.2X,3g=O.5u,as=O.87;G b,p,m;1q(e&&b!==e&&(/\\S/).2d(e)){b=e;N(G i 1s 3g){p=3g[i];E(m=e.1k(p)){E(as[i]){C.86.14([i,J.1Z(m)]);e=e.1x(m[0],\'\')}19{o C.6B(V).1p(a)}}}}G c=1f,21,88;N(G i=0,6C;6C=C.86[i];i++){21=6C[0],88=6C[1];E(!O.87[21](a,88)){c=1d;1F}}o c},24:q(){o C.2X},1W:q(){o"#<O:"+C.2X.1W()+">"}});J.U(O,{4b:{},1V:{3E:"//*",1r:"/*",42:"/5v-3F::*[1]",5w:\'/5v-3F::*\',1h:q(m){E(m[1]==\'*\')o\'\';o"[aN-21()=\'"+m[1].1G()+"\' 89 aN-21()=\'"+m[1].2f()+"\']"},1J:"[5x(1z(\' \', @5h, \' \'), \' #{1} \')]",29:"[@29=\'#{1}\']",4M:q(m){m[1]=m[1].1G();o 1e 2g("[@#{1}]").2b(m)},4N:q(m){m[1]=m[1].1G();m[3]=m[5]||m[6];o 1e 2g(O.1V.5y[m[2]]).2b(m)},5z:q(m){G h=O.1V.1H[m[1]];E(!h)o\'\';E(J.1M(h))o h(m);o 1e 2g(O.1V.1H[m[1]]).2b(m)},5y:{\'=\':"[@#{1}=\'#{3}\']",\'!=\':"[@#{1}!=\'#{3}\']",\'^=\':"[eU-97(@#{1}, \'#{3}\')]",\'$=\':"[4l(@#{1}, (5O-M(@#{1}) - 5O-M(\'#{3}\') + 1))=\'#{3}\']",\'*=\':"[5x(@#{1}, \'#{3}\')]",\'~=\':"[5x(1z(\' \', @#{1}, \' \'), \' #{3} \')]",\'|=\':"[5x(1z(\'-\', @#{1}, \'-\'), \'-#{3}-\')]"},1H:{\'2C-1r\':\'[3G(8a-3F::*)]\',\'1Q-1r\':\'[3G(5v-3F::*)]\',\'5A-1r\':\'[3G(8a-3F::* 89 5v-3F::*)]\',\'4n\':"[6D(*) = 0 8b (6D(2U()) = 0 89 eV(2U(), \' \\t\\r\\n\', \'\') = \'\')]",\'2K\':"[@2K]",\'2z\':"[@2z]",\'aO\':"[3G(@2z)]",\'3G\':q(m){G e=m[6],p=O.5u,x=O.1V,3h,v;G a=[];1q(e&&3h!=e&&(/\\S/).2d(e)){3h=e;N(G i 1s p){E(m=e.1k(p[i])){v=J.1M(x[i])?x[i](m):1e 2g(x[i]).2b(m);a.14("("+v.4l(1,v.M-1)+")");e=e.1x(m[0],\'\');1F}}}o"[3G("+a.1P(" 8b ")+")]"},\'1y-1r\':q(m){o O.1V.1H.1y("(6D(./8a-3F::*) + 1) ",m)},\'1y-1Q-1r\':q(m){o O.1V.1H.1y("(6D(./5v-3F::*) + 1) ",m)},\'1y-1U-1n\':q(m){o O.1V.1H.1y("1v() ",m)},\'1y-1Q-1U-1n\':q(m){o O.1V.1H.1y("(1Q() + 1 - 1v()) ",m)},\'2C-1U-1n\':q(m){m[6]="1";o O.1V.1H[\'1y-1U-1n\'](m)},\'1Q-1U-1n\':q(m){m[6]="1";o O.1V.1H[\'1y-1Q-1U-1n\'](m)},\'5A-1U-1n\':q(m){G p=O.1V.1H;o p[\'2C-1U-1n\'](m)+p[\'1Q-1U-1n\'](m)},1y:q(c,m){G d,4c=m[6],8c;E(4c==\'aP\')4c=\'2n+0\';E(4c==\'aQ\')4c=\'2n+1\';E(d=4c.1k(/^(\\d+)$/))o\'[\'+c+"= "+d[1]+\']\';E(d=4c.1k(/^(-?\\d*)?n(([+-])(\\d+))?/)){E(d[1]=="-")d[1]=-1;G a=d[1]?3T(d[1]):1;G b=d[2]?3T(d[2]):0;8c="[((#{8d} - #{b}) eW #{a} = 0) 8b "+"((#{8d} - #{b}) 2k #{a} >= 0)]";o 1e 2g(8c).2b({8d:c,a:a,b:b})}}}},54:{1h:\'n = h.1h(n, r, "#{1}", c);      c = 1d;\',1J:\'n = h.1J(n, r, "#{1}", c);    c = 1d;\',29:\'n = h.29(n, r, "#{1}", c);           c = 1d;\',4M:\'n = h.4M(n, r, "#{1}", c); c = 1d;\',4N:q(m){m[3]=(m[5]||m[6]);o 1e 2g(\'n = h.4N(n, r, "#{1}", "#{3}", "#{2}", c); c = 1d;\').2b(m)},5z:q(m){E(m[6])m[6]=m[6].1x(/"/g,\'\\\\"\');o 1e 2g(\'n = h.5z(n, "#{1}", "#{6}", r, c); c = 1d;\').2b(m)},3E:\'c = "3E";\',1r:\'c = "1r";\',42:\'c = "42";\',5w:\'c = "5w";\'},5u:{5w:/^\\s*~\\s*/,1r:/^\\s*>\\s*/,42:/^\\s*\\+\\s*/,3E:/^\\s/,1h:/^\\s*(\\*|[\\w\\-]+)(\\b|$)?/,29:/^#([\\w\\-\\*]+)(\\b|$)/,1J:/^\\.([\\w\\-\\*]+)(\\b|$)/,5z:/^:((2C|1Q|1y|1y-1Q|5A)(-1r|-1U-1n)|4n|2K|(en|eX)eY|3G)(\\((.*?)\\))?(\\b|$|(?=\\s|[:+~>]))/,4M:/^\\[([\\w]+)\\]/,4N:/\\[((?:[\\w-]*:)?[\\w-]+)\\s*(?:([!^$*~|]?=)\\s*(([\'"])([^\\4]*?)\\4|([^\'"][^\\]]*?)))?\\]/},87:{1h:q(a,b){o b[1].2f()==a.1h.2f()},1J:q(a,b){o I.6i(a,b[1])},29:q(a,b){o a.29===b[1]},4M:q(a,b){o I.2J(a,b[1])},4N:q(a,b){G c=I.43(a,b[1]);o c&&O.5y[b[2]](c,b[5]||b[6])}},1C:{1z:q(a,b){N(G i=0,L;L=b[i];i++)a.14(L);o a},6E:q(a){G b=Y.2q;N(G i=0,L;L=a[i];i++)L.2M=b;o a},4d:q(a){N(G i=0,L;L=a[i];i++)L.2M=3k;o a},50:q(a,b,c){a.2M=Y.2q;E(b){N(G d=a.2o,i=d.M-1,j=1;i>=0;i--){G e=d[i];E(e.2t==1&&(!c||e.2M))e.6F=j++}}19{N(G i=0,j=1,d=a.2o;e=d[i];i++)E(e.2t==1&&(!c||e.2M))e.6F=j++}},85:q(a){E(a.M==0)o a;G b=[],n;N(G i=0,l=a.M;i<l;i++)E(!(n=a[i]).2M){n.2M=Y.2q;b.14(I.U(n))}o O.1C.4d(b)},3E:q(a){G h=O.1C;N(G i=0,15=[],L;L=a[i];i++)h.1z(15,L.3i(\'*\'));o 15},1r:q(a){G h=O.1C;N(G i=0,15=[],L;L=a[i];i++){N(G j=0,1r;1r=L.2o[j];j++)E(1r.2t==1&&1r.1h!=\'!\')15.14(1r)}o 15},42:q(a){N(G i=0,15=[],L;L=a[i];i++){G b=C.5k(L);E(b)15.14(b)}o 15},5w:q(a){G h=O.1C;N(G i=0,15=[],L;L=a[i];i++)h.1z(15,I.5i(L));o 15},5k:q(a){1q(a=a.3x)E(a.2t==1)o a;o 17},5j:q(a){1q(a=a.9X)E(a.2t==1)o a;o 17},1h:q(a,b,c,d){G e=c.2f();G f=[],h=O.1C;E(a){E(d){E(d=="3E"){N(G i=0,L;L=a[i];i++)h.1z(f,L.3i(c));o f}19 a=C[d](a);E(c=="*")o a}N(G i=0,L;L=a[i];i++)E(L.1h.2f()===e)f.14(L);o f}19 o b.3i(c)},29:q(a,b,c,d){G e=$(c),h=O.1C;E(!e)o[];E(!a&&b==V)o[e];E(a){E(d){E(d==\'1r\'){N(G i=0,L;L=a[i];i++)E(e.1A==L)o[e]}19 E(d==\'3E\'){N(G i=0,L;L=a[i];i++)E(I.6j(e,L))o[e]}19 E(d==\'42\'){N(G i=0,L;L=a[i];i++)E(O.1C.5j(e)==L)o[e]}19 a=h[d](a)}N(G i=0,L;L=a[i];i++)E(L==e)o[e];o[]}o(e&&I.6j(e,b))?[e]:[]},1J:q(a,b,c,d){E(a&&d)a=C[d](a);o O.1C.aR(a,b,c)},aR:q(a,b,c){E(!a)a=O.1C.3E([b]);G d=\' \'+c+\' \';N(G i=0,15=[],L,5B;L=a[i];i++){5B=L.1J;E(5B.M==0)2F;E(5B==c||(\' \'+5B+\' \').1p(d))15.14(L)}o 15},4M:q(a,b,c,d){E(!a)a=b.3i("*");E(a&&d)a=C[d](a);G e=[];N(G i=0,L;L=a[i];i++)E(I.2J(L,c))e.14(L);o e},4N:q(a,b,c,d,e,f){E(!a)a=b.3i("*");E(a&&f)a=C[f](a);G g=O.5y[e],15=[];N(G i=0,L;L=a[i];i++){G h=I.43(L,c);E(h===17)2F;E(g(h,d))15.14(L)}o 15},5z:q(a,b,c,d,e){E(a&&e)a=C[e](a);E(!a)a=d.3i("*");o O.1H[b](a,c,d)}},1H:{\'2C-1r\':q(a,b,c){N(G i=0,15=[],L;L=a[i];i++){E(O.1C.5j(L))2F;15.14(L)}o 15},\'1Q-1r\':q(a,b,c){N(G i=0,15=[],L;L=a[i];i++){E(O.1C.5k(L))2F;15.14(L)}o 15},\'5A-1r\':q(a,b,c){G h=O.1C;N(G i=0,15=[],L;L=a[i];i++)E(!h.5j(L)&&!h.5k(L))15.14(L);o 15},\'1y-1r\':q(a,b,c){o O.1H.1y(a,b,c)},\'1y-1Q-1r\':q(a,b,c){o O.1H.1y(a,b,c,1f)},\'1y-1U-1n\':q(a,b,c){o O.1H.1y(a,b,c,1d,1f)},\'1y-1Q-1U-1n\':q(a,b,c){o O.1H.1y(a,b,c,1f,1f)},\'2C-1U-1n\':q(a,b,c){o O.1H.1y(a,"1",c,1d,1f)},\'1Q-1U-1n\':q(a,b,c){o O.1H.1y(a,"1",c,1f,1f)},\'5A-1U-1n\':q(a,b,c){G p=O.1H;o p[\'1Q-1U-1n\'](p[\'2C-1U-1n\'](a,b,c),b,c)},aS:q(a,b,d){E(a==0)o b>0?[b]:[];o $R(1,d).2E([],q(c,i){E(0==(i-b)%a&&(i-b)/a>=0)c.14(i);o c})},1y:q(c,d,e,f,g){E(c.M==0)o[];E(d==\'aP\')d=\'2n+0\';E(d==\'aQ\')d=\'2n+1\';G h=O.1C,15=[],8e=[],m;h.6E(c);N(G i=0,L;L=c[i];i++){E(!L.1A.2M){h.50(L.1A,f,g);8e.14(L.1A)}}E(d.1k(/^\\d+$/)){d=3T(d);N(G i=0,L;L=c[i];i++)E(L.6F==d)15.14(L)}19 E(m=d.1k(/^(-?\\d*)?n(([+-])(\\d+))?/)){E(m[1]=="-")m[1]=-1;G a=m[1]?3T(m[1]):1;G b=m[2]?3T(m[2]):0;G k=O.1H.aS(a,b,c.M);N(G i=0,L,l=k.M;L=c[i];i++){N(G j=0;j<l;j++)E(L.6F==k[j])15.14(L)}}h.4d(c);h.4d(8e);o 15},\'4n\':q(a,b,c){N(G i=0,15=[],L;L=a[i];i++){E(L.1h==\'!\'||(L.4x&&!L.3t.1k(/^\\s*$/)))2F;15.14(L)}o 15},\'3G\':q(a,b,c){G h=O.1C,eZ,m;G d=1e O(b).6B(c);h.6E(d);N(G i=0,15=[],L;L=a[i];i++)E(!L.2M)15.14(L);h.4d(d);o 15},\'aO\':q(a,b,c){N(G i=0,15=[],L;L=a[i];i++)E(!L.2z)15.14(L);o 15},\'2z\':q(a,b,c){N(G i=0,15=[],L;L=a[i];i++)E(L.2z)15.14(L);o 15},\'2K\':q(a,b,c){N(G i=0,15=[],L;L=a[i];i++)E(L.2K)15.14(L);o 15}},5y:{\'=\':q(a,v){o a==v},\'!=\':q(a,v){o a!=v},\'^=\':q(a,v){o a.77(v)},\'$=\':q(a,v){o a.91(v)},\'*=\':q(a,v){o a.1p(v)},\'~=\':q(a,v){o(\' \'+a+\' \').1p(\' \'+v+\' \')},\'|=\':q(a,v){o(\'-\'+a.2f()+\'-\').1p(\'-\'+v.2f()+\'-\')}},32:q(a){G b=[];a.8S(/(([\\w#:.~>+()\\s-]+|\\*|\\[.*?\\])+)\\s*(,|$)/,q(m){b.14(m[1].2T())});o b},aT:q(a,b){G c=$$(b),h=O.1C;h.6E(c);N(G i=0,15=[],1u;1u=a[i];i++)E(1u.2M)15.14(1u);h.4d(c);o 15},4y:q(a,b,c){E(J.3Q(b)){c=b;b=1d}o O.aT(a,b||\'*\')[c||0]},6f:q(a,b){b=O.32(b.1P(\',\'));G c=[],h=O.1C;N(G i=0,l=b.M,8f;i<l;i++){8f=1e O(b[i].2T());h.1z(c,8f.6B(a))}o(l>1)?h.85(c):c}});E(Y.1w.2N){J.U(O.1C,{1z:q(a,b){N(G i=0,L;L=b[i];i++)E(L.1h!=="!")a.14(L);o a},4d:q(a){N(G i=0,L;L=a[i];i++)L.7N(\'2M\');o a}})}q $$(){o O.6f(V,$A(1c))}G 1j={8g:q(a){$(a).8g();o a},aU:q(c,d){E(2R d!=\'2D\')d={6G:!!d};19 E(J.1X(d.6G))d.6G=1f;G e,1g,8h=1d,4e=d.4e;G f=c.2E({},q(a,b){E(!b.2z&&b.21){e=b.21;1g=$(b).2j();E(1g!=17&&(b.1n!=\'4e\'||(!8h&&4e!==1d&&(!4e||e==4e)&&(8h=1f)))){E(e 1s a){E(!J.3n(a[e]))a[e]=[a[e]];a[e].14(1g)}19 a[e]=1g}}o a});o d.6G?f:J.3m(f)}};1j.W={5C:q(a,b){o 1j.aU(1j.4O(a),b)},4O:q(c){o $A($(c).3i(\'*\')).2E([],q(a,b){E(1j.I.4P[b.1h.1G()])a.14(I.U(b));o a})},f0:q(a,b,c){a=$(a);G d=a.3i(\'6H\');E(!b&&!c)o $A(d).2e(I.U);N(G i=0,8i=[],M=d.M;i<M;i++){G e=d[i];E((b&&e.1n!=b)||(c&&e.21!=c))2F;8i.14(I.U(e))}o 8i},8j:q(a){a=$(a);1j.4O(a).5P(\'8j\');o a},8k:q(a){a=$(a);1j.4O(a).5P(\'8k\');o a},aV:q(b){G c=$(b).4O().4p(q(a){o\'6n\'!=a.1n&&!a.2z});G d=c.4p(q(a){o a.2J(\'6t\')&&a.6t>=0}).9e(q(a){o a.6t}).2C();o d?d:c.7f(q(a){o[\'6H\',\'20\',\'8l\'].1p(a.1h.1G())})},f1:q(a){a=$(a);a.aV().aW();o a},2V:q(a,b){a=$(a),b=J.1Z(b||{});G c=b.2v,4J=a.43(\'4J\')||\'\';E(4J.3S())4J=1i.68.ap;b.2v=a.5C(1f);E(c){E(J.2l(c))c=c.5U();J.U(b.2v,c)}E(a.2J(\'28\')&&!b.28)b.28=a.28;o 1e 1t.3V(4J,b)}};1j.I={8m:q(a){$(a).8m();o a},20:q(a){$(a).20();o a}};1j.I.W={5C:q(a){a=$(a);E(!a.2z&&a.21){G b=a.2j();E(b!=3k){G c={};c[a.21]=b;o J.3m(c)}}o\'\'},2j:q(a){a=$(a);G b=a.1h.1G();o 1j.I.4P[b](a)},f2:q(a,b){a=$(a);G c=a.1h.1G();1j.I.4P[c](a,b);o a},9h:q(a){$(a).1g=\'\';o a},f3:q(a){o $(a).1g!=\'\'},aW:q(a){a=$(a);1N{a.8m();E(a.20&&(a.1h.1G()!=\'6H\'||![\'8n\',\'8g\',\'4e\'].1p(a.1n)))a.20()}1Y(e){}o a},8j:q(a){a=$(a);a.f4();a.2z=1f;o a},8k:q(a){a=$(a);a.2z=1d;o a}};G f5=1j.I;G $F=1j.I.W.2j;1j.I.4P={6H:q(a,b){4h(a.1n.1G()){1O\'aX\':1O\'aY\':o 1j.I.4P.aZ(a,b);5r:o 1j.I.4P.8l(a,b)}},aZ:q(a,b){E(J.1X(b))o a.2K?a.1g:17;19 a.2K=!!b},8l:q(a,b){E(J.1X(b))o a.1g;19 a.1g=b},20:q(a,b){E(J.1X(b))o C[a.1n==\'20-f6\'?\'b0\':\'b1\'](a);19{G c,1g,b2=!J.3n(b);N(G i=0,M=a.M;i<M;i++){c=a.1b[i];1g=C.6I(c);E(b2){E(1g==b){c.8o=1f;o}}19 c.8o=b.1p(1g)}}},b0:q(a){G b=a.f7;o b>=0?C.6I(a.1b[b]):17},b1:q(a){G b,M=a.M;E(!M)o 17;N(G i=0,b=[];i<M;i++){G c=a.1b[i];E(c.8o)b.14(C.6I(c))}o b},6I:q(a){o I.U(a).2J(\'1g\')?a.1g:a.2U}};3P.8p=1E.1L(8N,{22:q($2Y,b,c,d){$2Y(d,c);C.1u=$(b);C.3H=C.2j()},6Y:q(){G a=C.2j();E(J.2l(C.3H)&&J.2l(a)?C.3H!=a:1B(C.3H)!=1B(a)){C.4W(C.1u,a);C.3H=a}}});1j.I.b3=1E.1L(3P.8p,{2j:q(){o 1j.I.2j(C.1u)}});1j.b3=1E.1L(3P.8p,{2j:q(){o 1j.5C(C.1u)}});3P.5D=1E.1L({22:q(a,b){C.1u=$(a);C.4W=b;C.3H=C.2j();E(C.1u.1h.1G()==\'6S\')C.b4();19 C.4Y(C.1u)},8q:q(){G a=C.2j();E(C.3H!=a){C.4W(C.1u,a);C.3H=a}},b4:q(){1j.4O(C.1u).1l(C.4Y,C)},4Y:q(a){E(a.1n){4h(a.1n.1G()){1O\'aX\':1O\'aY\':1m.3I(a,\'f8\',C.8q.1o(C));1F;5r:1m.3I(a,\'f9\',C.8q.1o(C));1F}}}});1j.I.5D=1E.1L(3P.5D,{2j:q(){o 1j.I.2j(C.1u)}});1j.5D=1E.1L(3P.5D,{2j:q(){o 1j.5C(C.1u)}});E(!1i.1m)G 1m={};J.U(1m,{fa:8,fb:9,fc:13,fd:27,fe:37,ff:38,fg:39,fh:40,fi:46,fj:36,fk:35,fl:33,fm:34,fn:45,5e:{},8r:q(a){G b;4h(a.1n){1O\'fo\':b=a.fp;1F;1O\'fq\':b=a.2x;1F;5r:o 17}o I.U(b)}});1m.W=(q(){G e;E(Y.1w.2N){G f={0:1,1:4,2:2};e=q(a,b){o a.8n==f[b]}}19 E(Y.1w.3j){e=q(a,b){4h(b){1O 0:o a.6J==1&&!a.b5;1O 1:o a.6J==1&&a.b5;5r:o 1d}}}19{e=q(a,b){o a.6J?(a.6J===b+1):(a.8n===b)}}o{fr:q(a){o e(a,0)},fs:q(a){o e(a,1)},ft:q(a){o e(a,2)},1u:q(a){G b=1m.U(a).b6;o I.U(b.2t==5d.9O?b.1A:b)},4y:q(a,b){G c=1m.1u(a);E(!b)o c;G d=[c].1z(c.7I());o O.4y(d,b,0)},6K:q(a){o{x:a.b7||(a.fu+(V.3D.3A||V.1S.3A)),y:a.b8||(a.fv+(V.3D.3z||V.1S.3z))}},fw:q(a){o 1m.6K(a).x},fx:q(a){o 1m.6K(a).y},6Z:q(a){1m.U(a);a.b9();a.ba();a.fy=1f}}})();1m.U=(q(){G c=J.4g(1m.W).2E({},q(m,a){m[a]=1m.W[a].3o();o m});E(Y.1w.2N){J.U(c,{ba:q(){C.fz=1f},b9:q(){C.fA=1d},1W:q(){o"[2D 1m]"}});o q(a){E(!a)o 1d;E(a.6y)o a;a.6y=Y.2q;G b=1m.6K(a);J.U(a,{b6:a.fB,8r:1m.8r(a),b7:b.x,b8:b.y});o J.U(a,c)}}19{1m.18=1m.18||V.5E("bb").3M;J.U(1m.18,c);o Y.K}})();J.U(1m,(q(){G h=1m.5e;q 8s(a){E(a.8t)o a.8t[0];1c.4k.29=1c.4k.29||1;o a.8t=[++1c.4k.29]}q 8u(a){E(a&&a.1p(\':\'))o"bc";o a}q 6L(a){o h[a]=h[a]||{}}q 6M(a,b){G c=6L(a);o c[b]=c[b]||[]}q bd(b,d,e){G f=8s(b);G c=6M(f,d);E(c.4q("6N").1p(e))o 1d;G g=q(a){E(!1m||!1m.U||(a.8v&&a.8v!=d))o 1d;1m.U(a);e.7E(b,a)};g.6N=e;c.14(g);o g}q 8w(b,d,e){G c=6M(b,d);o c.7f(q(a){o a.6N==e})}q be(a,b,d){G c=6L(a);E(!c[b])o 1d;c[b]=c[b].56(8w(a,b,d))}q bf(){N(G a 1s h)N(G b 1s h[a])h[a][b]=17}E(1i.5J){1i.5J("ar",bf)}o{3I:q(a,b,c){a=$(a);G d=8u(b);G e=bd(a,b,c);E(!e)o a;E(a.6O){a.6O(d,e,1d)}19{a.5J("4u"+d,e)}o a},4f:q(b,c,d){b=$(b);G e=8s(b),21=8u(c);E(!d&&c){6M(e,c).1l(q(a){b.4f(c,a.6N)});o b}19 E(!c){J.4g(6L(e)).1l(q(a){b.4f(a)});o b}G f=8w(e,c,d);E(!f)o b;E(b.bg){b.bg(21,f,1d)}19{b.fC("4u"+21,f)}be(e,c,d);o b},4Q:q(a,b,c){a=$(a);E(a==V&&V.5E&&!a.bh)a=V.3D;G d;E(V.5E){d=V.5E("bb");d.fD("bc",1f,1f)}19{d=V.fE();d.bi="fF"}d.8v=b;d.fG=c||{};E(V.5E){a.bh(d)}19{a.fH(d.bi,d)}o 1m.U(d)}}})());J.U(1m,1m.W);I.4V({4Q:1m.4Q,3I:1m.3I,4f:1m.4f});J.U(V,{4Q:I.W.4Q.3o(),3I:I.W.3I.3o(),4f:I.W.4f.3o(),5F:1d});(q(){G a;q 5G(){E(V.5F)o;E(a)1i.8P(a);V.4Q("fI:5F");V.5F=1f}E(V.6O){E(Y.1w.3j){a=1i.8O(q(){E(/5F|bj/.2d(V.2W))5G()},0);1m.3I(1i,"fJ",5G)}19{V.6O("fK",5G,1d)}}19{V.5l("<4T 29=bk 3p aq=//:><\\/4T>");$("bk").63=q(){E(C.2W=="bj"){C.63=17;5G()}}}})();2S.3m=J.3m;G fL={3e:I.9P};I.W.fM=I.W.6j;G fN={fO:q(a,b){o I.2w(a,{7H:b})},fP:q(a,b){o I.2w(a,{2h:b})},fQ:q(a,b){o I.2w(a,{41:b})},fR:q(a,b){o I.2w(a,{6c:b})}};G $2F=1e fS(\'"3l $2F" fT fU, fV "o" fW\');G 8x={bl:1d,8y:q(){C.bm=1i.aH||V.3D.3A||V.1S.3A||0;C.bn=1i.aI||V.3D.3z||V.1S.3z||0},fX:q(a,x,y){E(C.bl)o C.bo(a,x,y);C.5H=x;C.5I=y;C.2i=I.44(a);o(y>=C.2i[1]&&y<C.2i[1]+a.4F&&x>=C.2i[0]&&x<C.2i[0]+a.4E)},bo:q(a,x,y){G b=I.7W(a);C.5H=x+b[0]-C.bm;C.5I=y+b[1]-C.bn;C.2i=I.44(a);o(C.5I>=C.2i[1]&&C.5I<C.2i[1]+a.4F&&C.5H>=C.2i[0]&&C.5H<C.2i[0]+a.4E)},fY:q(a,b){E(!a)o 0;E(a==\'fZ\')o((C.2i[1]+b.4F)-C.5I)/b.4F;E(a==\'g0\')o((C.2i[0]+b.4E)-C.5H)/b.4E},44:I.W.44,5p:I.W.5p,7U:q(a){8x.8y();o I.7U(a)},7V:q(a){8x.8y();o I.7V(a)},g1:I.W.7W,3f:I.W.4I,g2:I.W.5q,1Z:q(a,b,c){c=c||{};o I.af(b,a,c)}};E(!V.6P)V.6P=q(f){q 8z(a){o a.3S()?17:"[5x(1z(\' \', @5h, \' \'), \' "+a+" \')]"}f.6P=Y.2P.5L?q(a,b){b=b.24().2T();G c=/\\s/.2d(b)?$w(b).2e(8z).1P(\'\'):8z(b);o c?V.7D(\'.//*\'+c,a):[]}:q(b,c){c=c.24().2T();G d=[],5m=(/\\s/.2d(c)?$w(c):17);E(!5m&&!c)o d;G e=$(b).3i(\'*\');c=\' \'+c+\' \';N(G i=0,1r,cn;1r=e[i];i++){E(1r.1J&&(cn=\' \'+1r.1J+\' \')&&(cn.1p(c)||(5m&&5m.7d(q(a){o!a.24().3S()&&cn.1p(\' \'+a+\' \')}))))d.14(I.U(1r))}o d};o q(a,b){o $(b||V.1S).6P(a)}}(I.W);I.6h=1E.1L();I.6h.18={22:q(a){C.1u=$(a)},3c:q(b){C.1u.1J.32(/\\s+/).20(q(a){o a.M>0}).3c(b)},58:q(a){C.1u.1J=a},g3:q(a){E(C.1p(a))o;C.58($A(C).1z(a).1P(\' \'))},9S:q(a){E(!C.1p(a))o;C.58($A(C).56(a).1P(\' \'))},24:q(){o $A(C).1P(\' \')}};J.U(I.6h.18,26);I.4V();',62,996,'||||||||||||||||||||||||return||function||||||||||||this||if||var||Element|Object||node|length|for|Selector||||||extend|document|Methods||Prototype||||||push|results||null|prototype|else|style|options|arguments|false|new|true|value|tagName|window|Form|match|each|Event|type|bind|include|while|child|in|Ajax|element|position|Browser|replace|nth|concat|parentNode|String|handlers|getStyle|Class|break|toLowerCase|pseudos|Array|className|_getEv|create|isFunction|try|case|join|last|transport|body|width|of|xpath|inspect|isUndefined|catch|clone|select|name|initialize||toString|values|Enumerable||method|id|valueL|evaluate|args|test|map|toUpperCase|Template|top|offset|getValue|div|isString|gsub||childNodes|px|emptyFunction|klass|toJSON|nodeType|toArray|parameters|insert|toElement|height|disabled|ByTag|apply|first|object|inject|continue|_attributeTranslations|opacity|left|hasAttribute|checked|matcher|_countedByPrototype|IE|indexOf|BrowserFeatures|createElement|typeof|Hash|strip|text|request|readyState|expression|super|isElement||toHTML|split||||||||RegExp|stripScripts|_each|response|display|offsetParent|ps|le|getElementsByTagName|WebKit|undefined|throw|toQueryString|isArray|methodize|defer|toPaddedString|source|slice|innerHTML|_object|onComplete|responseText|nextSibling|names|scrollTop|scrollLeft|tags|table|documentElement|descendant|sibling|not|lastValue|observe|Opera|navigator|userAgent|__proto__|shift|wrap|Abstract|isNumber|evalScripts|blank|Number|update|Request|url|dispatchException|success|decay||bottom|adjacent|readAttribute|cumulativeOffset|||_overflow|offsetTop|offsetLeft|_returnOffset|_cache|formula|unmark|submit|stopObserving|keys|switch|interpret|timer|callee|substring|evalJSON|empty|appendChild|findAll|pluck|filter|key|Responders|on|getHeader|_insertionTranslations|firstChild|findElement|getDimensions|nextAncestor|parseFloat|setStyle|setOpacity|offsetWidth|offsetHeight|absolute|static|getOffsetParent|action|tbody|Heading|attrPresence|attr|getElements|Serializers|fire|ElementExtensions|HTMLElement|script|properties|addMethods|callback|frequency|registerCallback|onTimerEvent|index|capitalize|_|expr|criteria|reverse|without|toObject|set|start|responders|post|getStatus|Node|cache|writeAttribute|removeChild|class|nextSiblings|previousElementSibling|nextElementSibling|write|classNames|sourceIndex|relative|positionedOffset|viewportOffset|default|_flag|property|patterns|following|laterSibling|contains|operators|pseudo|only|nodeClassName|serialize|EventObserver|createEvent|loaded|fireContentLoadedEvent|xcomp|ycomp|attachEvent|Gecko|XPath|SpecificElementExtensions|ScriptFragment|string|invoke|curry|currentlyExecuting|eval|escapeHTML|toQueryParams|times|charAt|detect|pair|dispatch|onCreate|asynchronous|application|onreadystatechange|status|headerJSON|isSameOrigin|port|location|container|insertion|none|after|_getContentFromAnonymousElement|recursivelyCollect|findChildElements|read|ClassNames|hasClassName|descendantOf|cssFloat|auto|00001|hidden|right|border|padding|title|_getAttr|tabIndex|insertBefore|TBODY|tr|Simulated|_extendedByPrototype|refresh|copy|findElements|token|count|mark|nodeIndex|hash|input|optionValue|which|pointer|getCacheForID|getWrappersForEventName|handler|addEventListener|getElementsByClassName|Version|opera|form|superclass|isHash|Function|delay|_methodized|execute|stop|prepareReplacement|nodeValue|decodeURIComponent|succ|camelize|len|unfilterJSON|startsWith|lastIndexOf|toTemplateReplacements|slices|array|collect|all|falses|find|_reverse|toQueryPair|get|delete|end|activeRequestCount|Base|encoding|evalJS|_complete|Response|respondToReadyState|onStateChange|Content|Complete|protocol|domain|getResponseHeader|statusText|getAllResponseHeaders|failure|updater|elements|_getElementsByXPath|call|visible|replaceChild|before|ancestors|previousSiblings|self|attributes|getAttribute|removeAttribute|float|cssText|styleFloat|visibility|_madePositioned|overflow|absolutize|relativize|cumulativeScrollOffset|zoom|currentStyle|alpha|stripAlpha|has|TD|TableSection|HTML|unique|tokens|assertions|matches|or|preceding|and|predicate|fragment|indexed|selector|reset|submitted|matchingInputs|disable|enable|textarea|focus|button|selected|TimedObserver|onElementEvent|relatedTarget|getEventID|_prototypeEventID|getDOMEventName|eventName|findWrapper|Position|prepare|iter|KHTML|MobileSafari|Safari|JSONFilter|subclasses|valueOf|argumentNames|instanceof|timeout|1000|Try|these|escape|PeriodicalExecuter|setInterval|clearInterval|specialChar|sub|scan|stripTags|gi|img|extractScripts|unescapeHTML|charCodeAt|isJSON|JSON|endsWith|interpolate|amp|lt|gt|createTextNode|with|template|pattern|Pattern|exec|eachSlice|any|sortBy|size|from|clear|flatten|uniq|forEach|arrayLength|encodeURIComponent|ObjectRange|exclusive|getTransport|XMLHttpRequest|ActiveXObject|XMLHTTP|register|contentType|setRequestHeaders|overrideMimeType|xml|2005|requestHeaders|Events|force|evalResponse|onException|getStatusText|_getHeaderJSON|responseXML|_getResponseJSON|sanitizeJSON|Updater|updateContent|updateComplete|lastText|ELEMENT_NODE|TEXT_NODE|toggle|hide|show|remove|attribute|descendants|firstDescendant|immediateDescendants|previousSibling|next|identify|counter|setAttribute|getHeight|getWidth|addClassName|removeClassName|compareDocumentPosition|scrollTo|clientWidth|clientHeight|BODY|_originalLeft|_originalTop|_originalWidth|_originalHeight|clonePosition|setLeft|setTop|setWidth|setHeight|htmlFor|parseInt|100|_getAttrNode|getAttributeNode|href|src|onunload||IMG|outerHTML|TR|td|SELECT|THEAD|TFOOT|TH|TEXTAREA|findDOMClass|Mod|TableCol|TableCell|client|pageXOffset|pageYOffset|compileMatcher|shouldUseXPath|compileXPathMatcher|root|local|enabled|even|odd|byClassName|getIndices|matchElements|serializeElements|findFirstElement|activate|checkbox|radio|inputSelector|selectOne|selectMany|single|Observer|registerFormCallbacks|metaKey|target|pageX|pageY|preventDefault|stopPropagation|HTMLEvents|dataavailable|createWrapper|destroyWrapper|destroyCache|removeEventListener|dispatchEvent|eventType|complete|__onDOMContentLoaded|includeScrollOffsets|deltaX|deltaY|withinIncludingScrolloffsets|AppleWebKit|Apple|Mobile|secure|constructor|RangeError|unknown|boolean|splice|number|bindAsEventListener|event|setTimeout|01|Date|getUTCFullYear|getUTCMonth|getUTCDate|getUTCHours|getUTCMinutes|getUTCSeconds|finally|truncate|im|data|fromCharCode|underscore|dasherize|x00|x1f|u00|Eaeflnr|SyntaxError|Badly|formed|parseQuery|grep|inGroupsOf|max|min|partition|reject|sort|zip|pop|member|entries|every|some|NodeList|compact|reduce|intersect|isNaN|toColorPart|isFinite|abs|round|ceil|floor||Math|unset|merge|Msxml2|Microsoft|unregister|www|urlencoded|UTF|_method|Konqueror|open|postBody|send|Requested|With|Accept|javascript|html|charset|Connection|close|setRequestHeader|200|300|Success|Failure|java|ecma|https|Uninitialized|Loading|Loaded|Interactive|responseJSON|getAllHeaders|json|PeriodicalUpdater|clearTimeout|getElementById|XPathResult|ORDERED_NODE_SNAPSHOT_TYPE|snapshotLength|snapshotItem|ATTRIBUTE_NODE|CDATA_SECTION_NODE|ENTITY_REFERENCE_NODE|ENTITY_NODE|PROCESSING_INSTRUCTION_NODE|COMMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE|DOCUMENT_FRAGMENT_NODE|NOTATION_NODE|cloneNode|ownerDocument|createRange|selectNode|createContextualFragment|siblings|up|down||previous|anonymous_element_|toggleClassName|cleanWhitespace|defaultView|getComputedStyle|getOpacity|block|makePositioned|undoPositioned|makeClipping|undoClipping|getElementsBySelector|childElements|fixed|hasLayout|normal|cellpadding|cellPadding|cellspacing|cellSpacing|colSpan|rowSpan|vAlign|dateTime|accessKey|encType|maxLength|readOnly|longDesc|readonly|multiple|onload|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onfocus|onblur|onkeypress|onkeydown|onkeyup|onsubmit|onreset|onselect|onchange|rv|999999|TABLE|specified|FORM|INPUT|OPTGROUP|OptGroup|TextArea|Paragraph|FIELDSET||FieldSet|UL|UList|OL|OList|DL|DList|DIR|Directory|H1|H2|H3|H4|H5|H6|Quote|INS|DEL|Anchor|Image|CAPTION|TableCaption|COL|COLGROUP|TableRow|FRAMESET|FrameSet|IFRAME|IFrame|viewport|inner|getScrollOffsets|starts|translate|mod|dis|abled|selectorType|getInputs|focusFirstElement|setValue|present|blur|Field|one|selectedIndex|click|change|KEY_BACKSPACE|KEY_TAB|KEY_RETURN|KEY_ESC|KEY_LEFT|KEY_UP|KEY_RIGHT|KEY_DOWN|KEY_DELETE|KEY_HOME|KEY_END|KEY_PAGEUP|KEY_PAGEDOWN|KEY_INSERT|mouseover|fromElement|mouseout|isLeftClick|isMiddleClick|isRightClick|clientX|clientY|pointerX|pointerY|stopped|cancelBubble|returnValue|srcElement|detachEvent|initEvent|createEventObject|ondataavailable|memo|fireEvent|dom|load|DOMContentLoaded|Toggle|childOf|Insertion|Before|Top|Bottom|After|Error|is|deprecated|use|instead|within|overlap|vertical|horizontal|realOffset|page|add'.split('|'),0,{}))
ï»¿var Bonobo = {
    _startQueue: [],
    onStart: function(call) {
        this._startQueue.push(call);
    },
    startup: function() {
        this._startQueue.each(function(c) { c(); });
        this._startQueue.length = 0;
    }
};

Bonobo.Events = {
    _events: {},
    observe: function(name, fn) {
        var evt = this._events[name];
        
        if (evt == null) {
            evt = new CustomEvent();
            this._events[name] = evt;
        }
        evt.listen(fn);
    },
    fire: function(name, args) {
        var evt = this._events[name];
        if (evt != null) {
            evt.raise(args);
        }
    }
}

//---------------------------------------------------------------------------------
function textCounter(field, countfield, maxlimit) 
{	
	if (field.value.length > maxlimit)
		field.value = field.value.substring(0, maxlimit);
	else
		countfield.value = maxlimit - field.value.length;
}	
//---------------------------------------------------------------------------------
function textCounter2(field, countfield, maxlimit) 
{	
	if (field.value.length > maxlimit)
		field.value = field.value.substring(0, maxlimit);
	else
		countfield.innerHTML = maxlimit - field.value.length;
}	
//---------------------------------------------------------------------------------

Object.extend(Array.prototype, {
    push: function(obj) { this[this.length] = obj; },
    remove: function(obj) {
        var found = false;
        for(var i = 0; i < this.length; i++) {
            if (found) {
                this[i-1] = this[i]
            } else if (this[i] == obj) {
                found = true;
            }
        }
        this.length = this.length - 1;
    }
});

if (!Array.prototype.contains)
    Array.prototype.contains = function(obj) { return this.indexOf(obj) >= 0; }
    
Object.extend(String.prototype, {
	trim: function() { return this.replace(/^\s*(.*)\s*$/, "$1"); }	
});

var CustomEvent = Class.create();
CustomEvent.prototype = {
    initialize: function() {
        this.listeners = [];
    },
    raise: function(args) {
        this.listeners.each(function(f) { f(args); });
    },
    listen: function(fn) {
        this.listeners.push(fn);
    }
}

function FireCustomValidation(fldobj)
{
    if (typeof(Page_ClientValidate) == 'function') {
        var passed = true;
        for (var i = 0; i < Page_Validators.length; i++) {
            var vdt = Page_Validators[i];
            if (vdt.controltovalidate == fldobj.id) {
                ValidatorValidate(vdt);
                if (!vdt.isvalid)
                    passed = false;
            }
        }
   }
}


var PostCallbacks = [];

function Anthem_PostCallBack() {
    var funcs = PostCallbacks;
    PostCallbacks = [];
    funcs.each(function(c) { c(); });
    Placeholder.init();
}


Bonobo.Fb = {
    queue: [],
    enqueue: function(call) {        
        if (Bonobo.Fb.started)
            call();
        else
            this.queue.push(call);
    },
    invoke: function() {
        this.queue.each(function(c) { c(); });
        this.queue.length = 0;
    },
    connect: function() {
        trace('Bonobo.Fb.Connect');
        if (Bonobo.Fb.started) {
            FB.Connect.requireSession();
            trace('Called FB.Connect.requireSession');
        }
        else {
            setTimeout(Bonobo.Fb.connect, 250);
            trace('Bonobo.Fb.Connect: trying again in 250 ms');
        }
    }
}


trace = function(str) {
    if (typeof console != 'undefined')
        console.log(str);
}

describe = function(obj) {
    var str = "{";
    for (var x in obj) {
        str += "\t" + x + ": " + obj[x] + "\n";
    }
    str += "}";
    return str;
}

changeParam = function(name, value) {
    var params = window.location.search.toQueryParams();
    params[name] = value;
    window.location.search = $H(params).toQueryString();
}
/*
Created By: Chris Campbell
Website: http://particletree.com
Date: 2/1/2006

Inspired by the lightbox implementation found at http://www.huddletogether.com/projects/lightbox/
*/

/*-------------------------------GLOBAL VARIABLES------------------------------------*/

var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

/*-----------------------------------------------------------------------------------------------*/

//Browser detect script origionally created by Peter Paul Koch at http://www.quirksmode.org/

function getBrowserInfo() {
	if (checkIt('konqueror')) {
		browser = "Konqueror";
		OS = "Linux";
	}
	else if (checkIt('safari')) browser 	= "Safari"
	else if (checkIt('omniweb')) browser 	= "OmniWeb"
	else if (checkIt('opera')) browser 		= "Opera"
	else if (checkIt('webtv')) browser 		= "WebTV";
	else if (checkIt('icab')) browser 		= "iCab"
	else if (checkIt('msie')) browser 		= "Internet Explorer"
	else if (!checkIt('compatible')) {
		browser = "Netscape Navigator"
		version = detect.charAt(8);
	}
	else browser = "An unknown browser";

	if (!version) version = detect.charAt(place + thestring.length);

	if (!OS) {
		if (checkIt('linux')) OS 		= "Linux";
		else if (checkIt('x11')) OS 	= "Unix";
		else if (checkIt('mac')) OS 	= "Mac"
		else if (checkIt('win')) OS 	= "Windows"
		else OS 						= "an unknown operating system";
	}
}

function checkIt(string) {
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

/*-----------------------------------------------------------------------------------------------*/

Event.observe(window, 'dom:loaded', getBrowserInfo, false);

var lightbox = Class.create();

lightbox.close = function() {
    if (lightbox.active) lightbox.active.deactivate();
}

lightbox.show = function() {
    var lb = new lightbox();    
    lb.activate();
	$('lightbox').className = "done";	
}

lightbox.prototype = {

	yPos : 0,
	xPos : 0,

	initialize: function() {
	},
	
	// Turn everything on - mainly the IE fixes
	activate: function(){
        lightbox.active = this;
		if (browser == 'Internet Explorer'){
			this.getScroll();
			this.prepareIE('100%', 'hidden');
			this.setScroll(0,0);
			this.hideSelects('hidden');
		}
		this.displayLightbox("block");
	},
	
	// Ie requires height to 100% and overflow hidden or else you can scroll down past the lightbox
	prepareIE: function(height, overflow){
		bod = document.getElementsByTagName('body')[0];
		bod.style.height = height;
		bod.style.overflow = overflow;
  
		htm = document.getElementsByTagName('html')[0];
		htm.style.height = height;
		htm.style.overflow = overflow; 
	},
	
	// In IE, select elements hover on top of the lightbox
	hideSelects: function(visibility){
		selects = $('content').getElementsByTagName('select');
		for(i = 0; i < selects.length; i++) {
		    if (visibility == 'hidden') {
		        var div = document.createElement('div');
		        div.className = 'select';
		        for(var j = 0; j < selects[i].options.length; j++)
		            if (selects[i].options[j].selected) {
		                div.innerHTML = selects[i].options[j].text;
		                break;
		            }
		        selects[i].parentNode.appendChild(div);
		        Position.clone(selects[i], div);
		        selects[i].sel = div;
		    }
		    else {
		        if (selects[i].sel)
		            selects[i].sel.parentNode.removeChild(selects[i].sel);
		    }
			selects[i].style.visibility = visibility;
		}
	},
	
	// Taken from lightbox implementation found at http://www.huddletogether.com/projects/lightbox/
	getScroll: function(){
		if (self.pageYOffset) {
			this.yPos = self.pageYOffset;
		} else if (document.documentElement && document.documentElement.scrollTop){
			this.yPos = document.documentElement.scrollTop; 
		} else if (document.body) {
			this.yPos = document.body.scrollTop;
		}
	},
	
	setScroll: function(x, y){
		window.scrollTo(x, y); 
	},
	
	displayLightbox: function(display){
		$('overlay').style.display = display;
		$('lightbox').style.display = display;		
	},		
	
	// Example of creating your own functionality once lightbox is initiated
	deactivate: function(){
        lightbox.active = null;
		
		if (browser == "Internet Explorer"){
			this.setScroll(0,this.yPos);
			this.prepareIE("auto", "auto");
			this.hideSelects("visible");
		}
		
		this.displayLightbox("none");
	}
}

Event.observe(window, 'keypress', function(e) {
    if (e.keyCode == 27)
        lightbox.close();
}, false);

/*-----------------------------------------------------------------------------------------------*/

/*
 * Copyright (c) 2006 Jonathan Weiss <jw@innerewut.de>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */


/* tooltip-0.2.js - Small tooltip library on top of Prototype 
 * by Jonathan Weiss <jw@innerewut.de> distributed under the BSD license. 
 *
 * This tooltip library works in two modes. If it gets a valid DOM element 
 * or DOM id as an argument it uses this element as the tooltip. This 
 * element will be placed (and shown) near the mouse pointer when a trigger-
 * element is moused-over.
 * If it gets only a text as an argument instead of a DOM id or DOM element
 * it will create a div with the classname 'tooltip' that holds the given text.
 * This newly created div will be used as the tooltip. This is usefull if you 
 * want to use tooltip.js to create popups out of title attributes.
 * 
 *
 * Usage: 
 *   <script src="/javascripts/prototype.js" type="text/javascript"></script>
 *   <script src="/javascripts/tooltip.js" type="text/javascript"></script>
 *   <script type="text/javascript">
 *     // with valid DOM id
 *     var my_tooltip = new Tooltip('id_of_trigger_element', 'id_of_tooltip_to_show_element')
 *
 *     // with text
 *     var my_other_tooltip = new Tooltip('id_of_trigger_element', 'a nice description')
 *
 *     // create popups for each element with a title attribute
 *    Event.observe(window,"load",function() {
 *      $$("*").findAll(function(node){
 *        return node.getAttribute('title');
 *      }).each(function(node){
 *        new Tooltip(node,node.title);
 *        node.removeAttribute("title");
 *      });
 *    });
 *    
 *   </script>
 * 
 * Now whenever you trigger a mouseOver on the `trigger` element, the tooltip element will
 * be shown. On o mouseOut the tooltip disappears. 
 * 
 * Example:
 * 
 *   <script src="/javascripts/prototype.js" type="text/javascript"></script>
 *   <script src="/javascripts/scriptaculous.js" type="text/javascript"></script>
 *   <script src="/javascripts/tooltip.js" type="text/javascript"></script>
 *
 *   <div id='tooltip' style="display:none; margin: 5px; background-color: red;">
 *     Detail infos on product 1....<br />
 *   </div>
 *
 *   <div id='product_1'>
 *     This is product 1
 *   </div>
 *
 *   <script type="text/javascript">
 *     var my_tooltip = new Tooltip('product_1', 'tooltip')
 *   </script>
 *
 * You can use my_tooltip.destroy() to remove the event observers and thereby the tooltip.
 */

var Tooltip = Class.create();
Tooltip.prototype = {
  initialize: function(element, tool_tip) {
    var options = Object.extend({
      default_css: false,
      margin: "0px",
	    padding: "5px",
	    backgroundColor: "#d6d6fc",
	    min_distance_x: 5,
      min_distance_y: 5,
      delta_x: 0,
      delta_y: 0,
      zindex: 1000
    }, arguments[2] || {});

    this.element      = $(element);

    this.options      = options;
    
    // use the supplied tooltip element or create our own div
    if($(tool_tip)) {
      this.tool_tip = $(tool_tip);
    } else {
      this.tool_tip = $(document.createElement("div")); 
      document.body.appendChild(this.tool_tip);
      this.tool_tip.addClassName("tooltip");
      this.tool_tip.appendChild(document.createTextNode(tool_tip));
    }

    // hide the tool-tip by default
    this.tool_tip.hide();

    this.eventMouseOver = this.showTooltip.bindAsEventListener(this);
    this.eventMouseOut   = this.hideTooltip.bindAsEventListener(this);
    this.eventMouseMove  = this.moveTooltip.bindAsEventListener(this);

    this.registerEvents();
  },

  destroy: function() {
    Event.stopObserving(this.element, "mouseover", this.eventMouseOver);
    Event.stopObserving(this.element, "mouseout", this.eventMouseOut);
    Event.stopObserving(this.element, "mousemove", this.eventMouseMove);
  },

  registerEvents: function() {
    Event.observe(this.element, "mouseover", this.eventMouseOver);
    Event.observe(this.element, "mouseout", this.eventMouseOut);
    Event.observe(this.element, "mousemove", this.eventMouseMove);
  },

  moveTooltip: function(event){
	  Event.stop(event);
	  // get Mouse position
    var mouse_x = Event.pointerX(event);
	  var mouse_y = Event.pointerY(event);
	
	  // decide if wee need to switch sides for the tooltip
	  var dimensions = Element.getDimensions( this.tool_tip );
	  var element_width = dimensions.width;
	  var element_height = dimensions.height;
	
	  if ( (element_width + mouse_x) >= ( this.getWindowWidth() - this.options.min_distance_x) ){ // too big for X
		  mouse_x = mouse_x - element_width;
		  // apply min_distance to make sure that the mouse is not on the tool-tip
		  mouse_x = mouse_x - this.options.min_distance_x;
	  } else {
		  mouse_x = mouse_x + this.options.min_distance_x;
	  }
	
	  if ( (element_height + mouse_y) >= ( this.getWindowHeight() - this.options.min_distance_y) ){ // too big for Y
		  mouse_y = mouse_y - element_height;
	    // apply min_distance to make sure that the mouse is not on the tool-tip
		  mouse_y = mouse_y - this.options.min_distance_y;
	  } else {
		  mouse_y = mouse_y + this.options.min_distance_y;
	  } 
	
	  // now set the right styles
	  this.setStyles(mouse_x, mouse_y);
  },
	
		
  showTooltip: function(event) {
    Event.stop(event);
    document.body.appendChild(this.tool_tip);
    this.moveTooltip(event);
	Element.show(this.tool_tip);
  },
  
  setStyles: function(x, y){
    // set the right styles to position the tool tip
	  Element.setStyle(this.tool_tip, { position:'absolute',
	 								    top:y + this.options.delta_y + "px",
	 								    left:x + this.options.delta_x + "px",
									    zindex:this.options.zindex
	 								  });
	
	  // apply default theme if wanted
	  if (this.options.default_css){
	  	  Element.setStyle(this.tool_tip, { margin:this.options.margin,
		 		  						                    padding:this.options.padding,
		                                      backgroundColor:this.options.backgroundColor,
										                      zindex:this.options.zindex
		 								    });	
	  }	
  },

  hideTooltip: function(event){
	  new Element.hide(this.tool_tip);
  },

  getWindowHeight: function(){
    var innerHeight;
	  if (navigator.appVersion.indexOf('MSIE')>0) {
		  innerHeight = document.body.clientHeight;
    } else {
		  innerHeight = window.innerHeight;
    }
    return innerHeight;	
  },
 
  getWindowWidth: function(){
    var innerWidth;
	  if (navigator.appVersion.indexOf('MSIE')>0) {
		  innerWidth = document.body.clientWidth;
    } else {
		  innerWidth = window.innerWidth;
    }
    return innerWidth;	
  }

}

ï»¿
var AreaLink = Class.create();
AreaLink.prototype = {
    initialize: function(link, level) {
        var p = link.parentNode;
        for(var i = 0; i < level - 1; i++)
            p = p.parentNode;
        if (p)
            Event.observe(p, 'click', function() { window.location = link.href; }, true);
    }
}

var AreaLinks = [];
AreaLinks.add = function(link, level) {
    this[link] = new AreaLink(link, level);
    return this;
}
AreaLinks.all = function(container, level) {
   $A($(container).getElementsByTagName('a')).each( function(a) { AreaLinks.add(a, level); });
}

/** 
 * Author and Version Information {{{
 * author: Antonio Ramirez http://webeaters.blogspot.com
 *
 * class: AutoComplete for Prototype 1.6.0
 *
 * version: 1.2.1 - 2007-11-11 
 * 		(based on AutoSuggest 2.1.3 - 2007-07-19)
 * version: 1.3.0 - 2008-01-03 by Andrew Nicols <andrew@nicols.co.uk>
 *  - Fixed incorrect title-casing - CSS is Case Sensitive!!!
 *  - Adjusted the way in which the Notifier images are loaded.
 *  - Changed json code to pass all json variables back instead of just id, value and name
 *  - Fixed 'GMAIL' code such that if valueSep is undefined, it is ignored
 *  - Changed the default for valueSep to null
 *  - Fixed the resetTimeout function
 *
 * REFERENCES AND THANKS 
 * this class is based on the work in AutoSuggest.js of
 * Timothy Groves - http://www.brandspankingnew.net
 * and adapted for use with prototype 1.6.0
 *
 * UPDATED by RŽéda HADJOUTI
 * GMAIL like AutoComplete (semicolon separator) Update
 *
 }}}*/

var AutoComplete = Class.create();

AutoComplete.prototype = { // {{{
    Version: '1.3.0',
    REQUIRED_PROTOTYPE: '1.6.0',

    initialize: function(id, param) { // {{{
        // check whether we have the appropiate javascript libraries
        this.PROTOTYPE_CHECK();

        // Get the field we're watching.
        // It needs to be a valid field so throw an error if it's not valid or can't be found.
        this.fld = $(id);
        if (!this.fld) {
            throw ("AutoComplete requires a field id to initialize");
        }

        // Init variables
        this.sInp = ""; // input value 
        this.nInpC = 0; // input value length
        this.aSug = []; // suggestions array 
        this.iHigh = 0; // level of list selection 

        // Parameter Handling {{{
        // Set the use specified options
        this.options = param ? param : {};
        // These are the default settings {{{
        var k, def = {
            valueSep: null,
            minchars: 1,
            meth: "get",
            varname: "input",
            className: "autocomplete",
            timeout: 3000,
            delay: 5,
            offsety: -5,
            shownoresults: true,
            noresults: "No results were found.",
            maxheight: 250,
            cache: true,
            maxentries: 10,
            onAjaxError: null,
            setWidth: false,
            minWidth: 100,
            maxWidth: 200,
            useNotifier: false
        };
        //}}}
        // Overlay any values which weren't user specified.
        for (k in def) {
            if (typeof (this.options[k]) != typeof (def[k]))
                this.options[k] = def[k];
        }
        // End of Parameter Handling }}}

        // Not everyone wants to use the Notifier. Give them the option	  
        if (this.options.useNotifier) {
            this.fld.addClassName('ac_field');
        }

        // set keyup handler for field
        // and prevent AutoComplete from client
        var p = this;

        // NOTE: not using addEventListener because UpArrow fired twice in Safari
        this.fld.onkeypress = function(ev) { return p.onKeyPress(ev); };
        this.fld.onkeyup = function(ev) { return p.onKeyUp(ev); };
        // ARN-DEBUG Chances are we want to reset the timeout when they lose focus, at least that's what I prefer
        this.fld.onblur = function(ev) { p.resetTimeout(150); return true; };
        // ARN-DEBUG Not sure what this is about!
        this.fld.setAttribute("AutoComplete", "off");

    }, //}}}

    convertVersionString: function(versionString) { // {{{
        var r = versionString.split('.');
        return parseInt(r[0]) * 100000 + parseInt(r[1]) * 1000 + parseInt(r[2]);
    }, // }}}

    PROTOTYPE_CHECK: function() { // {{{
        if ((typeof Prototype == 'undefined') ||
       (typeof Element == 'undefined') ||
       (typeof Element.Methods == 'undefined') ||
       (this.convertVersionString(Prototype.Version) <
        this.convertVersionString(this.REQUIRED_PROTOTYPE)))
            throw ("AutoComplete requires the Prototype JavaScript framework >= " +
        this.REQUIRED_PROTOTYPE);
    }, // }}}

    // set responses to keypress events in the field
    // this allows the user to use the arrow keys to scroll through the results
    // ESCAPE clears the list
    // RETURN sets the current highlighted value
    // UP/DOWN move around the list

    onKeyPress: function(e) { // {{{
        if (!e) e = window.event;
        var key = e.keyCode || e.wich;


        switch (key) {
            case Event.KEY_RETURN:
                this.setHighlightedValue();
                Event.stop(e);
                break;
            case Event.KEY_TAB:
                this.setHighlightedValue();
                //Event.stop(e);
                break;
            case Event.KEY_ESC:
                this.clearSuggestions();
                break;
        }
        return true;
    }, //}}}

    onKeyUp: function(e) { // {{{
        if (!e) e = window.event;

        var key = e.keyCode || e.wich;

        if (key == Event.KEY_UP || key == Event.KEY_DOWN) {
            this.changeHighlight(key);
            Event.stop(e);
        }
        else this.getSuggestions(this.fld.value);

        return true;
    }, //}}}

    getSuggestions: function(val) { // {{{
        // input the same? do nothing
        if (val == this.sInp) return false;

        this.sInp = val;

        // input length is less than the min required to trigger a request
        // do nothing
        if (val.length < this.options.minchars) {
            this.aSug = [];
            this.nInpC = val.length;
            if ($(this.acID)) $(this.acID).remove();
            return false;
        }

        // Here we will detect if there is a comma and the splitted value has a value to check
        // comma stars a new search and val is converted to the new value after the comma
        var ol = this.nInpC; // old length
        this.nInpC = val.length ? val.length : 0;

        // if caching enabled, and we didn't receive the maxentries value
        // and user is typing (ie. length of input is increasing)
        // filter results out of suggestions from last request
        var l = this.aSug.length;
        if (this.options.cache && (this.nInpC > ol) && l && (l < this.options.maxentries)) {
            var arr = new Array();
            for (var i = 0; i < l; i++) {
                if (this.aSug[i].value.toLowerCase().indexOf(val.toLowerCase()) != -1) {
                    arr.push(this.aSug[i]);
                }
            }
            this.aSug = arr;

            // recreate the list
            this.createList(this.aSug);
        } else {
            // do new request
            var p = this;
            //var input	= this.sInp; // send the converted new value (comma)
            clearTimeout(this.ajID); // ajax id timer
            this.ajID = setTimeout(function() { p.doAjaxRequest(p.sInp) }, this.options.delay);
        }
        document.helper = this;
        return false;
    }, // }}}

    getLastInput: function(str) { // {{{
        var ret = str;
        if (undefined != this.options.valueSep) {
            var idx = ret.lastIndexOf(this.options.valueSep);
            ret = idx == -1 ? ret : ret.substring(idx + 1, ret.length);
        }

        return ret;
    }, // }}}

    doAjaxRequest: function(input) { // {{{

        // we have to check here if there is a new splitted value (, or ;)
        // always check against the last part of the comma and then check
        // saved input is still the value of the field
        if (input != this.fld.value)
            return false;

        // Gmail like : get only the last user's input
        this.sInp = this.getLastInput(this.sInp);

        // create ajax request
        // do we need to call a function to recreate the url?
        if (typeof this.options.script == 'function')
            var url = this.options.script(encodeURIComponent(this.sInp));
        else
            var url = this.options.script + this.options.varname + '=' + encodeURIComponent(this.sInp);

        if (!url) return false;

        var p = this;
        var m = this.options.meth;  // get or post?

        var options = {
            method: m,
            onSuccess: function(req) { // {{{
                if (p.options.useNotifier) {
                    p.fld.removeClassName('ac_field_busy');
                    p.fld.addClassName('ac_field');
                };
                p.setSuggestions(req, input);
            }, // }}}

            onFailure: (typeof p.options.onAjaxError == 'function') ? function(status) { // {{{
                if (p.options.useNotifier) {
                    p.fld.removeClassName('ac_field_busy');
                    p.fld.addClassName('ac_field');
                }
                p.options.onAjaxError(status)
            } : // }}}

      function(status) { // {{{
          if (p.options.useNotifier) {
              p.fld.removeClassName('ac_field_busy');
              p.fld.addClassName('ac_field');
          }
          alert("AJAX error: " + status);
      } // }}}
        }

        if (this.options.useNotifier) {
            this.fld.removeClassName('ac_field');
            this.fld.addClassName('ac_field_busy');
        };

        if (!$(this.acID)) {
            this.acID = 'ac_' + this.fld.id;
            var nr = this.options.noresults;
            this.options.noresults = 'Searching Facebook friends...';
            this.createList([]);
            this.options.noresults = nr;
        }

        // make new ajax request
        new Ajax.Request(url, options);
    }, // }}}

    setSuggestions: function(req, input) { // {{{
        // if field input no longer matches what was passed to the request
        // don't show the suggestions
        // here we need to check against the splitted values if any (, or ;)
        if (input != this.fld.value) {
            return false;
        }

        this.aSug = [];

        if (this.options.json) { // response in json format?
            var jsondata = eval('(' + req.responseText + ')');
            this.aSug = jsondata.results;
        } else {
            // response in xml format?
            var results = req.responseXML.getElementsByTagName('results')[0].childNodes;

            for (var i = 0; i < results.length; i++) {
                if (results[i].hasChildNodes())
                    this.aSug.push({ 'id': results[i].getAttribute('id'), 'value': results[i].childNodes[0].nodeValue, 'info': results[i].getAttribute('info') });
            }
        }
        this.acID = 'ac_' + this.fld.id;
        this.createList(this.aSug);
    }, // }}}

    createDOMElement: function(type, attr, cont, html) { // {{{
        var ne = document.createElement(type);

        if (!ne)
            return 0;

        for (var a in attr)
            ne[a] = attr[a];

        var t = typeof (cont);

        if (t == "string" && !html)
            ne.appendChild(document.createTextNode(cont));
        else if (t == "string" && html)
            ne.innerHTML = cont;
        else if (t == "object")
            ne.appendChild(cont);

        return ne;
    }, // }}}

    createList: function(arr) { // {{{
        // get rid of the old list if any  
        if ($(this.acID)) $(this.acID).remove();

        // clear list removal timeout
        this.killTimeout();

        // if no results, and showNoResults is false, do nothing
        if (arr.length == 0 && !this.options.shownoresults)
            return false;

        // create holding div
        var div = this.createDOMElement('div', { id: this.acID, className: this.options.className });

        div.appendChild(this.createDOMElement('div', { className: 'pointer' }));
        // create div header
        var hcorner = this.createDOMElement('div', { className: 'ac_corner' });
        var hbar = this.createDOMElement('div', { className: 'ac_bar' });
        var header = this.createDOMElement('div', { className: 'ac_header' });
        header.appendChild(hcorner);
        header.appendChild(hbar);
        div.appendChild(header);

        // create and populate ul
        var ul = this.createDOMElement('ul', { id: 'ac_ul' });
        var p = this; // pointer that we will need later on
        // no results?
        if (arr.length == 0 && this.options.shownoresults) {
            var li = this.createDOMElement('li', { className: 'ac_warning' }, this.options.noresults);
            ul.appendChild(li);
        } else {
            // loop through arr of suggestions creating an LI element for each of them
            for (var i = 0, l = arr.length; i < l; i++) {
                // format output with the input enclosed in a EM elementFromPoint
                // (as HTML not DOM)
                var val = arr[i].value;
                var st = val.toLowerCase().indexOf(this.sInp.toLowerCase()); // HERE WE CHECK AGAINST THE SPLITTED VALUE IF ANY***
                var output = val.substring(0, st) + '<em>' + val.substring(st, st + this.sInp.length) + '</em>' + val.substring(st + this.sInp.length);

                var span = this.createDOMElement('span', {}, output, true); // type of, properties, output, isHTML?

                if (arr[i].info && arr[i].info != '') // do we need to add extra info?
                {
                    var br = this.createDOMElement('br', {});
                    span.appendChild(br);

                    var small = this.createDOMElement('small', {}, arr[i].info);
                    span.appendChild(small);
                }
                var a = this.createDOMElement('a', { href: '#' });

                var tl = this.createDOMElement('span', { className: 'tl' }, '&nbsp;', true);
                var tr = this.createDOMElement('span', { className: 'tr' }, '&nbsp;', true);

                a.appendChild(tl);
                a.appendChild(tr);
                a.appendChild(span); // add the object span into the link

                a.name = i + 1;

                a.onclick = function() { // {{{
                    p.setHighlightedValue();
                    return false;
                }; // }}}
                a.onmouseover = function() { // {{{
                    p.setHighlight(this.name);
                }; // }}} 

                var li = this.createDOMElement('li', {}, a); // add the link element to a li element

                // finally add the newly created li element to the ul element 
                ul.appendChild(li);
            }
        }

        div.appendChild(ul); // add the newly created list to the div element

        // create div footer
        var fcorner = this.createDOMElement('div', { className: 'ac_corner' });
        var fbar = this.createDOMElement('div', { className: 'ac_bar' });
        var footer = this.createDOMElement('div', { className: 'ac_footer' });
        footer.appendChild(fcorner);
        footer.appendChild(fbar);
        div.appendChild(footer);

        // get position of target textfield
        // position holding div below it
        // set width of holding div to width of field 
        // if 

        if (this.options.setWidth) {
            var w = this.fld.offsetWidth;

            if (w < this.options.minWidth)
                w = this.options.minWidth;
            else if (w > this.options.maxWidth)
                w = this.options.maxWidth;

            div.style.width = w + 'px';
        }

        // set mouseover functions for div
        // when mouse pointer leaves div, set a timeout to remove the list after an interval
        // when mouse enters div, kill the timeout so the list won't be removed
        //
        div.onmouseover = function() { p.killTimeout() };
        div.onmouseout = function() { p.resetTimeout() };

        // add DIV to document
        var container = this.fld.up('div#lightbox');
        if (container == null)
            container = this.fld.up('div#container');
        container.appendChild(div);
        $(div).clonePosition(this.fld, { setWidth: false, setHeight: false, offsetTop: this.fld.getHeight() });

        // highlight first item
        this.iHigh = 1;
        this.setHighlight(1);

        // remove list after interval
        this.toID = setTimeout(
      function() {
          p.clearSuggestions()
      }, this.options.timeout
    );

    }, // }}}

    changeHighlight: function(key) { // {{{
        var list = $("ac_ul");
        if (!list)
            return false;

        var n;

        n = (key == Event.KEY_DOWN || key == Event.KEY_TAB) ? this.iHigh + 1 : this.iHigh - 1; // false assumed to be Event.KEY_UP

        n = (n > list.childNodes.length) ? list.childNodes.length : ((n < 1) ? 1 : n);

        this.setHighlight(n);
    }, // }}}

    setHighlight: function(n) { // {{{
        var list = $('ac_ul');

        if (!list) return false;

        if (this.iHigh > 0) this.clearHighlight();

        this.iHigh = Number(n);

        list.childNodes[this.iHigh - 1].className = 'ac_highlight';

        this.killTimeout();
    }, // }}}

    clearHighlight: function() { // {{{
        var list = $('ac_ul');

        if (!list) return false;

        if (this.iHigh > 0) {
            list.childNodes[this.iHigh - 1].className = '';
            this.iHigh = 0;
        }

    }, // }}}

    setHighlightedValue: function() { // {{{        
        if (this.iHigh) {
            // HERE WE NEED TO IMPLEMENT THE GMAIL LIKE SPLITTED VALUE
            if (!this.aSug[this.iHigh - 1]) return;

            // Gmail like
            if (undefined != this.options.valueSep) {
                var str = this.getLastInput(this.fld.value);
                var idx = this.fld.value.lastIndexOf(str);
                str = this.aSug[this.iHigh - 1].value + this.options.valueSep;
                this.sInp = this.fld.value = idx == -1 ? str : this.fld.value.substring(0, idx) + str;
            } else {
                var str = this.getLastInput(this.fld.value);
                var idx = this.fld.value.lastIndexOf(str);
                str = this.aSug[this.iHigh - 1].value;
                this.sInp = this.fld.value = idx == -1 ? str : this.fld.value.substring(0, idx) + str;
            }

            // move cursor to end of input (safari)
            this.fld.focus();
            if (this.fld.selectionStart)
                this.fld.setSelectionRange(this.sInp.length, this.sInp.length);

            this.clearSuggestions();

            // pass selected object to callback function, if exists
            if (typeof this.options.callback == 'function')
                this.options.callback(this.aSug[this.iHigh - 1]); // the object has the properties we want, it will depend of
        }
    }, // }}}

    killTimeout: function() { // {{{
        clearTimeout(this.toID);
    }, // }}}

    resetTimeout: function(timeout) { // {{{
        this.killTimeout();
        var p = this;
        timeout = timeout || p.options.timeout;
        console.log('reset timeout: %o, %d', p.options, timeout);
        this.toID = setTimeout(function() { p.clearSuggestions(); }, timeout);
        // ARN-DEBUG Added p.options.timeout back :|
    }, // }}}

    clearSuggestions: function() { // {{{

        this.killTimeout();
        if ($(this.acID)) {
            this.fadeOut(100, function() {
                $(this.acID).remove();
            });
        }
    }, // }}}

    fadeOut: function(milliseconds, callback) { // {{{
        this._fadeFrom = 1;
        this._fadeTo = 0;
        this._afterUpdateInternal = callback;

        this._fadeDuration = milliseconds;
        this._fadeInterval = 100;
        this._fadeTime = 500;
        var p = this;
        p._changeOpacity();
        this._fadeIntervalID = setInterval(function() { p._changeOpacity() }, this._fadeInterval);

    }, // }}}

    _changeOpacity: function() { // {{{

        if (!$(this.acID)) {
            this._fadeIntervalID = clearInterval(this._fadeIntervalID);
            return;
        }
        this._fadeTime += this._fadeInterval;

        var ieop = Math.round((this._fadeFrom + ((this._fadeTo - this._fadeFrom) * (this._fadeTime / this._fadeDuration))) * 100)
        var op = ieop / 100;

        var el = $(this.acID);
        if (el.filters) // internet explorer
        {
            try {
                el.filters.item("DXImageTransform.Microsoft.Alpha").opacity = ieop;
            } catch (e) {
                // If it is not set initially, the browser will throw an error.
                // This will set it if it is not set yet.
                el.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + ieop + ')';
            }
        } else {
            el.style.opacity = op;
        }

        if (this._fadeTime >= this._fadeDuration) {
            clearInterval(this._fadeIntervalID);
            if (typeof this._afterUpdateInternal == 'function')
                this._afterUpdateInternal();
        }

    } // }}}

} // }}}

// vim: set filetype=javascript foldmethod=marker foldlevel=5:

ï»¿Bonobo.Selector = Class.create();
Bonobo.Selector.prototype = { 
    initialize: function(control) {
        this.control = control;
    },
    setOptions: function(src) {
        var c = $(this.control);
        c.options.length = 0;
        for(var i = 0; i < src.length; i++)
            c.options[i] = new Option(src[i][0], src[i][1]);
    },
    getValue: function() {
        return $F(this.control);
    },
    toggle: function() {
        $(this.control).disabled = !$(this.control).disabled;
    },
    getOption: function(index) {
        var o = $(this.control).options[index];
        return [o.text,o.value];
    },
    select: function(index) {
        $(this.control).selectedIndex = index;
    },
    selectValue: function(value) {
        var c = $(this.control);
        for(var i = 0; i < c.options.length; i++) {
            if (c.options[i].value == value)
                c.selectedIndex = i;
        }
    },
    selectedValue: function() {
        var c = $(this.control);
        return c.selectedIndex < 0 ? null : c.options[c.selectedIndex].value;
    }
}

ï»¿var BonoboValidator = Class.create();

BonoboValidator.prototype = {
	initialize: function(elt) {
		this.element = $(elt);
		this.checks = [];
	},
	validate: function(source, args) {
		if (this.checks.detect(function(check) { return !check(args.Value); })) {
			this.element.innerHTML = this.message;			
			args.IsValid = false;
		}
	},
	regex: function(rgx, msg) {
		var vdt = this;
		this.checks.push(function(value) {
			if (!value.match(rgx)) {
				vdt.message = msg;
				return false;
			}
			else
				return true;
		});
		return this;
	},
	required: function(msg) {
		var vdt = this;
		this.checks.push(function(value) {
			if (value == null || value.trim().length == 0) {
				vdt.message = msg;
				return false;
			}
			else
				return true;
		});
		return this;
	},
	minLength: function(length, msg) {
		var vdt = this;
		this.checks.push(function(value) {
			if (value.length < length) {
				vdt.message = msg;
				return false;
			}
			else
				return true;
		});
		return this;
	},
	maxLength: function(length, msg) {
		var vdt = this;
		this.checks.push(function(value) {
			if (value.length > length) {
				vdt.message = msg;
				return false;
			}
			else
				return true;
		});
		return this;
	}
}
ï»¿var CheckboxSelector = Class.create();
CheckboxSelector.prototype = {
    initialize: function(main) {
           this.main = main;
        this.others = $A(arguments).without(main);
        Event.observe(main, 'click', this.changeSelection.bindAsEventListener(this), true);
    },
    changeSelection: function(evt) {
        var v = $(this.main).checked;
        this.others.each(function(chk) { $(chk).checked = v; });
    }
}

ï»¿var DateSelector = Class.create();
DateSelector.prototype = {
    initialize: function(txt, selDay, selMonth, selYear) {
        this.txt = $(txt);
        this.selDay = selDay;
        this.selMonth = selMonth;
        this.selYear = selYear;
        
        Event.observe(selDay, 'change', this.update.bindAsEventListener(this), true);
        Event.observe(selMonth, 'change', this.update.bindAsEventListener(this), true);
        Event.observe(selYear, 'change', this.update.bindAsEventListener(this), true);
    },
    update: function(evt) {
        var d = $F(this.selDay);
        var m = $F(this.selMonth);
        var y = $F(this.selYear);
        if (d && m && y)
            this.txt.value = y + '/' + m + '/' + d;
        else
            this.txt.value = '';
        
        if (Page_ValidationActive)    
            FireCustomValidation(this.txt);            
    }
}

/*------------------------------------------------------------------------------
Function:       FauxSelect()
Author:         Aaron Gustafson (aaron at easy-designs dot net)
Creation Date:  12 September 2006
Version:        0.2
Homepage:       http://code.google.com/p/easy-designs/wiki/FauxSelect
License:        MIT License (see homepage)
Note:           If you change or improve on this script, please let us know by
                emailing the author (above) with a link to your demo page.
------------------------------------------------------------------------------*/
// -- COLLECT & ENABLE THE FAUX-SELECTS -- //
var FauxSelectConductor = {
  // A list of all the faux-SELECTs
  list:       [],
  // The faux-select specific CSS styles
  cssFile:    'FauxSelect.css',
  // The layer for the faux-SELECT
  zindex:      10000,
  // The maximum size of the dropdown
  maxHeight:   300,
  // BODY height
  bodyHeight:  0,
  // "model" elements
  elements:   { li:  document.createElement( 'li' ),
                div: document.createElement( 'div' ),
                p:   document.createElement( 'p' ),
                ul:  document.createElement( 'ul' ) },
  initialize: function( params ){
    trace( 'FauxSelectConductor.initialize() ran' );

    // collect the params
    params = params || {};
    if( typeof( params.maxHeight ) != 'undefined' ) this.maxHeight = params.maxHeight;
    // set the BODY height
    this.bodyHeight = $( document.getElementsByTagName( 'body' )[0] ).getHeight() + 'px';

    // collect the SELECTs
    var selects = $A( document.getElementsByTagName( 'select' ) );
    trace( 'found '+selects.length+' SELECTs' );
    // loop through the collection
    selects.each( function( item, i ){
      // get the id
      var id = item.getAttribute( 'id' );
      // give the SELECT an ID if it doesn't have one
      if( id === false ){
        id = 'auto-ided-select-' + i;
        item.setAttribute( 'id', id );
      }
      // let us know when one is found
      trace( 'instantiating faux-select: "'+id+'"' );
      // make it into a FauxSelect
      this.list[id] = new FauxSelect( id );
    }.bind( this ) );
    trace( 'FauxSelectConductor.initialize() finished' );
  }
};

var FauxSelect = Class.create();
FauxSelect.prototype = {
  // the ID of the SELECT
  id:         false,
  // the original SELECT element
  select:     false,
  // the DIV containing the faux-SELECT
  container:  false,
  // the faux-SELECT UL
  faux:       false,
  // the faux-SELECT P (seen as the selected value)
  value:      false,
  // The closer DIV for this faux-SELECT
  closer:     false,
  // used to track faux-OPTION position (for keyboard use)
  last:       false,
  // type of SELECT (standard, multiple, or optgrouped)
  type:       'standard',
  // keep the faux-SELECT from closing? fixes a blur bug
  preventClose: false,
  initialize: function( id ){
    // let us know FauxSelect initialized
    trace( 'FauxSelect.initialize() ran and received the ID "'+id+'"' );

    // store the ID
    this.id = id;

    // store the SELECT node
    this.select = $( id );

    // -- BUILD THE FAUX-SELECT -- //
    // create the faux-SELECT UL
    this.faux = $( FauxSelectConductor.elements.ul.cloneNode( true ) );
    this.faux.setAttribute( 'id', 'replaces_'+id );
    this.faux.addClassName('faux-select');
    trace( 'built the faux' );

    /* set the width, based on the existing SELECT
       (subtracting any border or padding) */
    this.faux.style.width = (
      parseInt( this.select.getWidth() )
      // Subtract borders
      - parseInt( this.select.getStyle( 'border-left-width' ) )
      - parseInt( this.select.getStyle( 'border-right-width' ) )
      // Subtract padding
      - parseInt( this.select.getStyle( 'padding-left' ) )
      - parseInt( this.select.getStyle( 'padding-right' ) )
    ) + 'px';

    trace("Set the width to " + this.faux.style.width);
    
    // collect the children & make them enumerable
    var children = $A( this.select.childNodes );
    children.each( function( item, i ){
      if( item.nodeName.toUpperCase() == 'OPTION' ||
          item.nodeName.toUpperCase() == 'OPTGROUP' ){
        // build the faux-OPTION or faux-OPTGROUP
        var el = this.makeFake( item );
        // append it to the faux-SELECT
        this.faux.appendChild( el );
      }
    }.bind( this ) );

    /* append the faux-SELECT to the SELECT's parent, but keep it
       invisible because we don't want it to appear quite yet.
       We do need to append it though because we can't get it's
       height (which we'll need in a moment) without doing so */
    this.faux.style.visibility = 'hidden';
    this.select.parentNode.appendChild( this.faux );
    trace( 'appended the faux-SELECT' );

    // is this a multiple SELECT?
    if( this.select.getAttribute( 'multiple' ) ){
      trace( 'it\'s  a multiple' );
      /* special stuff happens when it's a multiple SELECT, we should
         CLASSify the faux-SELECT */
      this.faux.addClassName( 'multiple' );
      // set the FauxSelect object as a multiple
      this.type = 'multiple';
      /* set the height inline, making it the height of an OPTION
         in the original x the value of the SELECT's SIZE attribute */
      this.faux.style.height = (
        parseInt( this.select.getHeight() )
        // Subtract borders
        - parseInt( this.select.getStyle( 'border-top-width' ) )
        - parseInt( this.select.getStyle( 'border-bottom-width' ) )
        // Subtract padding
        - parseInt( this.select.getStyle( 'padding-top' ) )
        - parseInt( this.select.getStyle( 'padding-bottom' ) )
      ) + 'px'
      // slide it up the height of the SELECT we're replacing
      this.faux.style.marginTop = '-' + ( parseInt( this.faux.style.height ) ) + 'px';
      /* Safari doesn't show scrollbars if the height is
         less than 65px, so we need to force it */
      if( parseInt( this.faux.style.height ) < 65 ) this.faux.style.height = '65px';
    } else {
      //--- Create a container DIV
      this.container = $( FauxSelectConductor.elements.div.cloneNode( true ) );
      this.container.addClassName( 'faux-container' );
      // transfer the ID
      this.container.setAttribute( 'id', 'replaces_'+id );
      this.faux.removeAttribute( 'id' );
      // slide it up the height of the SELECT we're replacing
      this.container.style.marginTop = '-'+ this.select.getHeight() +'px';

      //--- create the value P
      this.value = $( FauxSelectConductor.elements.p.cloneNode( true ) );
      this.value.setAttribute( 'id', 'value_'+id );
      this.value.addClassName( 'faux-value' );
      // set the default selected to be the value
      this.value.appendChild( document.createTextNode(
        this.select.getElementsByTagName(
          'option'
        )[this.select.selectedIndex].firstChild.nodeValue
      ) );
      /* this will be the trigger to open the faux-SELECT,
         so we'll need an event handler */
      Event.observe( this.value, 'click',
                     this.clickValue.bind( this ), false );
      this.container.appendChild( this.value );

      // add the "closed" CLASS to the faux-SELECT
      this.faux.addClassName( 'closed' );
      // set up the height FX for the faux-SELECT so it can open
      this.faux.heightFX = new fx.Style(
        this.faux, 'height',
        { duration: 350,
          onComplete: this.flip.bind( this ) }
      );

      // get the original height of the UL for when it's open
      this.faux.openHeight = this.faux.getHeight();
      trace( 'the original height of the UL is ' + this.faux.openHeight );
      // baseline OPTGROUP height (0)
      if( this.type == 'optgrouped' ){
        var OGheight = 0;
        var fOpts = $A( this.faux.getElementsByTagName( 'li' ) );
        fOpts.each( function( item ){
          if( Element.hasClassName( item, 'optgroup' ) ){
            // add the faux-OPTGROUP's UL's height
            OGheight += $( item.getElementsByTagName( 'ul' )[0] ).getHeight();
          }
        } );
        trace( 'the OPTGROUP\'s collective height is '+ OGheight );
        this.faux.openHeight = this.faux.openHeight - OGheight;
      }
      /* if this faux-SELECT has a lot of OPTIONs, it could
         end up being overly tall, we need to trim it down
         to a reasonable height, based on whatever we set in
         the FauxSelectConductor */
      if( this.faux.openHeight > FauxSelectConductor.maxHeight ){
        // mark this as an overflowing faux-SELECT
        this.type = ( this.type == 'optgrouped' ) ? 'overflowing-optgrouped' : 'overflowing';
        // reset the height
        this.faux.openHeight = FauxSelectConductor.maxHeight;
      }
      this.faux.closedHeight = 0;
      // close the faux-SELECT
      this.faux.heightFX.custom( this.faux.openHeight, this.faux.closedHeight );

      // remove the faux-SELECT and re-append to our container
      this.faux.parentNode.removeChild( this.faux );
      this.container.appendChild( this.faux );
      this.select.parentNode.appendChild( this.container );

      // -- BUILD THE CLOSER -- //
      this.closer = $( FauxSelectConductor.elements.div.cloneNode( true ) );
      this.closer.addClassName( 'closer' );
      this.closer.style.height = FauxSelectConductor.bodyHeight;
      /* we will use this hidden div (which we will set to track
         the cursor) to close the faux-SELECT when you click outside of it */
      Event.observe( this.closer, 'click', this.close.bind( this ), false );

    }
    // show the ul
    this.faux.style.visibility = '';

    // -- HANDLE EVENTS ON THE REAL SELECT -- //
    // focus
    Event.observe( this.select, 'focus', this.focus.bind( this ), false );
    // blur
    Event.observe( this.select, 'blur', this.blur.bind( this ), false );
    // typing
    this.select.onkeyup = this.updateFaux.bindAsEventListener( this );
    // clicking (for Safari)
    this.select.onclick = this.updateFaux.bindAsEventListener( this );

    /* Bind a mousedown event to the faux-select to indicate when
       we click the menu. The blur event in some browsers will trigger
       when we try to scroll so we need to prevent the menu from closing. */
    Event.observe( this.faux, 'mousedown', this.clickUL.bind(this), false );

    // -- HIDE THE REAL SELECT -- //
    this.select.addClassName( 'replaced' );
  },

  // --- DOM Building Methods
  makeFake:   function( node ){
    trace( 'contructing a faux-'+node.nodeName.toUpperCase() );
    // clone the model LI
    var el = $( FauxSelectConductor.elements.li.cloneNode( true ) );
    if( node.nodeName.toUpperCase() == 'OPTION' ){
      // store the faux-OPTION's value
      el.val = node.getAttribute( 'value' );
      // set the faux-OPTION's text value
      el.appendChild( document.createTextNode( node.firstChild.nodeValue ) );
      // check for selected
      // TODO: this needs some massaging
      if( this.select.value.indexOf( el.val ) != -1 ) el.addClassName( 'selected' );
      // set the event handlers
      Event.observe( el, 'click', this.clickLI.bind( this ), false ); // click
      Event.observe( el, 'mouseover', this.mouseoverLI, false ); // mouseover
      Event.observe( el, 'mouseout',  this.mouseoutLI,  false ); // mouseout
    }else if( node.nodeName.toUpperCase() == 'OPTGROUP' ){
      // note that this is an OPTGROUP-organized SELECT
      this.type = 'optgrouped';
      // set the faux-OPTION's text value
      el.appendChild( document.createTextNode( node.getAttribute( 'label' ) ) );
      // set the class on the LI
      el.addClassName( 'optgroup' );
      // build the container UL
      var ul = $( FauxSelectConductor.elements.ul.cloneNode( true ) );
      // set the left-position
      ul.style.left = this.faux.style.width;
      // collect the children & make them enumerable
      var children = $A( node.childNodes );
      children.each( function( child ){
        if( child.nodeName.toUpperCase() == 'OPTION' ||
            child.nodeName.toUpperCase() == 'OPTGROUP' ){
          var element = this.makeFake( child );
          ul.appendChild( element );
        }
      }.bind( this ) );
      el.appendChild( ul );
      /* if this is IE6 or below, we need a mouseover event
         to trigger the optgroup to open */
      el.onmouseover = this.openOptgroup.bindAsEventListener( this );  // mouseover
    }
    return el;
  },

  // --- faux-SELECT Actions
  open:        function(){
    trace('open() UL#replaces_' + this.id);

    // Indicate the state of the faux-select by removing the
    //   closed class and adding opening
    this.faux.removeClassName( 'closed' );
    this.faux.addClassName( 'opening' );

    // Stop the effect if we're half way through.
    this.faux.heightFX.stop();

    // if this is an overflow scroll to the selected LI
    var heightLI = this.faux.firstChild.getHeight(); // get a sample height
    var top = heightLI * this.select.selectedIndex;
    if( this.type.indexOf( 'overflowing' ) != -1 &&
        ( this.faux.scrollTop > top ||
          this.faux.scrollTop + FauxSelectConductor.maxHeight < top + heightLI ) )
      this.faux.scrollTop = top;
    // Open the fauxSelect by invoking the effect
    this.faux.heightFX.custom(
      this.faux.getHeight(),
      this.faux.openHeight
    );

    // Set the z-index of the faux-SELECT container
    this.container.style.zIndex = FauxSelectConductor.zindex;
    // Set the z-index of the closer to one less than the faux-SELECT container
    this.closer.style.zIndex = FauxSelectConductor.zindex - 1;
    // Append the closer to the document
    document.getElementsByTagName( 'body' )[0].appendChild( this.closer );

    // Trigger the focus event on the select
    this.select.focus();
  },
  close:       function(){
    trace('close() UL#replaces_' + this.id);

    // Check if the menu is open and if it isn't return
    if( !this.faux.hasClassName( this.type + '-open' ) ) return;

    // Indicate the state of the faux-select by removing the
    // open class and adding closing
    this.faux.removeClassName( this.type + '-open' );
    this.faux.addClassName( 'closing' );

    // Stop the effect if we're half way through.
    this.faux.heightFX.stop();

    // Close the faux-SELECT with an effect
    this.faux.heightFX.custom(
        this.faux.getHeight(),
        this.faux.closedHeight
    );
    // Remove the closer
    this.closer.parentNode.removeChild( this.closer );

    // reset the z-indexes
    this.container.style.zIndex = this.closer.style.zIndex = false;


  },
  flip: function(){
    trace( 'flipping ' + this.id );
    // If it's opening close it otherwise open it
    if( this.faux.hasClassName( 'opening' ) ){
      // Mark it open
      this.faux.removeClassName( 'opening' );
      this.faux.addClassName( this.type + '-open' );

      // If this is an overflow, scroll to the selected LI
      var heightLI = $( this.faux.firstChild ).getHeight();
      var top = heightLI * this.select.selectedIndex;
      if( this.type == 'overflowing' && (
          this.faux.scrollTop > top || this.faux.scrollTop
          + FauxSelectConductor.maxHeight < top + heightLI ) ) {
        this.faux.scrollTop = top;
      }
    } else {
      // Mark it closed
      this.faux.removeClassName(  'closing' );
      this.faux.addClassName( 'closed' );

      // Ensure all the li elements have their
      // hover class removed. It can stick around
      // because we manually closed the faux-select
      $A( this.faux.childNodes ).each( function( child ){
        if( child.hasClassName( 'hover' ) ) child.removeClassName( 'hover' );
      } );
    }
  },
  openOptgroup:   function( e ){
    var el = Event.element( e );
    // close all faux-OPTGROUPs
    var siblings = el.parentNode.childNodes;
    this.closeOptgroups( siblings );
    // open this one
    el.addClassName( 'optHover' );
    // remove it's mouseover event
    el.onmouseover = null;
  },
  closeOptgroups: function( nodes ){
    trace( 'this.closeOptgroups() ran' );
    $A( nodes ).each( function( item ){
      // check for the optHover CLASS & remove it
      if( item.hasClassName( 'optHover' ) ) item.removeClassName( 'optHover' );
      item.onmouseover = this.openOptgroup.bindAsEventListener( this );  // mouseover
    }.bind( this ) );
  },

  // --- Faux-SELECT Events
  clickValue: function(){
    // Open/close the faux-select
    if( this.faux.hasClassName( this.type + '-open' ) ){
      // The faux-SELECT is open
      this.close();
    } else {
      // The faux-SELECT is closed
      this.open();
    }
  },
  clickUL: function() {
    trace('clickUL()');
    // Prevent closing after a click in the scroll bar.
    this.preventClose = true;
  },
  clickLI:     function( e ){
    var el = Event.element( e );
    trace( 'clicked a LI in UL#replaces_'+this.id );
    // is it a multiple SELECT?
    if( this.type == 'multiple' ){
      // find the current position
      var current;
      var children = $A( this.faux.getElementsByTagName( 'li' ) );
      children.each( function( item, i ){
        // select the current li
        if( item == el ) current = i;
      } );
      trace( 'current position:'+current );
      if( e.ctrlKey || e.metaKey ){
        /* a multiple SELECT has 3 basic behaviors,
           the default is the same as a normal SELECT,
           but if the CTRL key is held down, it changes */
        trace( 'CTRL modifier used' );
        if( !el.hasClassName( 'selected' ) ){
          // element was not previously selected - select it
          this.selectLI( el );
        } else {
          // element was previously selected - deselect it
          this.deselectLI( el );
        }
      }else if( e.shiftKey ){
        /* if the SHIFT key is held down, select everything
           from the previously selected element to the newly
           selected one */
        trace( 'SHIFT modifier used' );
        /* TODO: add logic for the SELECT to function with SHIFT
           Check fsObj.last value and find the new one
           (up or down) and then select all in between */
        if( this.last < current ){
          var start = this.last;
          var end = current;
        } else {
          var start = current;
          var end = this.last;
        }
        trace( 'starting to loop at ' + start + ' and ending at ' + end );
        for( var i=start; i<=end; i++ ){
          trace( 'checking li #'+i );
          if( !children[i].hasClassName( 'selected' ) ){
            // element was not previously selected - select it
            this.selectLI( children[i] );
          }
        }
      } else {
        // normal SELECT behavior
        this.deselectAll();
        this.selectLI( el );
      }
      // set the lastClick to this element
      this.last = current;
      this.select.focus();
    } else {
      // normal SELECT behavior
      var fOpts = $$( '#replaces_' + this.id + ' li' );
      // collect everything but faux-OPTGROUPs
      if( this.type.indexOf( 'optgrouped' ) != -1 ){
        fOpts = $A( fOpts ).findAll( function( item ){
          return item.className != 'optgroup';
        } );
      }
      this.deselectLI( fOpts[this.select.selectedIndex] );
      this.selectLI( el );
      if( this.type.indexOf( 'optgrouped' ) != -1 )
        this.closeOptgroups( el.parentNode.childNodes );
      this.close();
    }
  },
  mouseoverLI: function( e ){
    Event.element(e).addClassName( 'hover' );
  },
  mouseoutLI:  function( e ){
    Event.element(e).removeClassName( 'hover' );
  },

  // --- Faux-SELECT Housekeeping
  selectLI:    function( el, cancelLoop ){
    trace( 'selectLI() ran' );
    // "select" the faux-OPTION
    $( el ).addClassName( 'selected' );
    trace( 'setting new value to '+ el.val );
    if( this.type == 'multiple' &&
        cancelLoop !== true ){
      trace( 'looping' );
      // collect the children of the faux-SELECT
      var children = $A( this.select.getElementsByTagName( 'option' ) );
      // iterate through them
      children.each( function( item, i ){
        // select the matching OPTION
        if( item.getAttribute( 'value' ) == el.val ) item.selected = true;
      } );
    }
    if( this.type != 'multiple' ){
      // set the faux-SELECT's "value"
      this.select.value = el.val;
      // set the faux-SELECT's "value"
      this.value.firstChild.nodeValue = el.firstChild.nodeValue;
    }
  },
  deselectLI:  function( el, cancelLoop ){
    trace( 'deselectLI() ran' );
    el.removeClassName( 'selected' );
    if( this.type == 'multiple' &&
        cancelLoop !== true ){
      trace( 'looping' );
      // love those multiples
      // collect the children of the faux-SELECT
      var children = $A( this.select.getElementsByTagName( 'option' ) );
      // iterate through them
      children.each( function( item ){
        // select the matching OPTION
        if( item.getAttribute( 'value' ) == el.val ) item.selected = false;
      } );
    }
  },
  deselectAll: function( what ){
    trace( 'deselecting all' );
    if( what == 'real' ||
        typeof( what ) == 'undefined' ){
      // collect the children of the faux-SELECT
      var children = $A( this.select.getElementsByTagName( 'option' ) );
      // iterate through them
      children.each( function( item ){
        // deselect the OPTION
        item.selected = false;
      } );
    }
    if( what == 'faux' ||
        typeof( what ) == 'undefined' ){
      // collect the children of the faux-SELECT
      children = $A( this.faux.getElementsByTagName( 'li' ) );
      // iterate through them
      children.each( function( item ){
        // if the className exists, remove it
        if( !item.hasClassName( 'optgroup' ) ) this.deselectLI( item );
      }.bind( this ) );
    }
  },

  // --- Real SELECT Events
  focus:      function(){
    trace( 'focusing' );
    if( this.type == 'multiple' ){
      this.faux.addClassName( 'focused' );
    } else {
      this.value.addClassName( 'focused' );
    }
  },
  blur:       function(){
    trace( 'blurring' );
    if( this.type == 'multiple' ){
      this.faux.removeClassName( 'focused' );
    } else {
      this.value.removeClassName( 'focused' );
    }
    if( this.faux.hasClassName( this.type + '-open' ) &&
        !this.preventClose ) this.close();
    /* If preventClose was true, the call to blur wasn't the
       one we wanted. The next one will be so set preventClose
       back to false */
    this.preventClose = false;
  },
  updateFaux: function( e ){
    trace( 'keypress' );
    var el = Event.element( e );
    var fOpts = $$( '#replaces_' + this.id + ' li' );
    // remove any optgroups
    if( this.type.indexOf( 'optgrouped' ) != -1 ){
      fOpts = $A( fOpts ).findAll( function( item ){
        return item.className != 'optgroup';
      } );
    }
    if( this.type == 'multiple' ){
      var rOpts = $A( el.getElementsByTagName( 'option' ) );
      /* A multiple SELECT works in different ways in different browsers,
         so rather than tie into keycodes (with the exception of CTRL),
         we will just track the values each time and update the faux-SELECT
         accordingly. It may seem like overkill, but it is the best solution. */
      var selected = [];
      for( i=rOpts.length-1; i>=0; i-- ){
        if( rOpts[i].selected ){
          selected.push( rOpts[i].getAttribute( 'value' ) );
        }
      }
      trace( 'selected: '+selected.toString() );
      var posn = 0;
      fOpts.each( function( li, i ){
        if( selected.indexOf( li.val ) != -1 ){
          trace( 'selecting ' + li.val );
          this.selectLI( li, true );
          posn = i;
        } else {
          trace( 'deselecting ' + li.val );
          this.deselectLI( li, true );
        }
      }.bind( this ) );
    } else {
      trace( 'this is not a multiple' );
      /* special case for ALT+Up & ALT+Down allows opening of
         the faux-SELECT without updating the value with each
         keypress. To confirm a value change, ENTER must be
         pressed (see next conditional) */
      if( e.altKey &&
          ( e.keyCode == '38' ||
            e.keyCode == '40' ) ){
        this.clickValue();
        return;
      }
      /* special case for ENTER and ESC to close the faux-select */
      if( this.faux.hasClassName( this.type + '-open' ) &&
          ( e.keyCode == '13' ||
            e.keyCode == '27' ) ){
        this.close();
      }
      if( this.faux.hasClassName( this.type + '-open' ) ){
        var fOpt = false;
        // back
        if( e.keyCode == '37' ||
            e.keyCode == '38' ){
          if( this.select.selectedIndex > 0 )
            fOpt = fOpts[this.select.selectedIndex - 1];
        }
        // forward
        if( e.keyCode == '39' ||
            e.keyCode == '40' ){
          if( this.select.selectedIndex < fOpts.length )
            fOpt = fOpts[this.select.selectedIndex + 1];
        }
        // top
        if( e.keyCode == '33' ||
            e.keyCode == '36' ){
          fOpt = fOpts[0];
        }
        // bottom
        if( e.keyCode == '34' ||
            e.keyCode == '35' ){
          fOpt = fOpts[fOpts.length-1];
        }
        if( fOpt ){
          this.deselectLI( fOpts[this.select.selectedIndex] );
          this.selectLI( fOpt );
        }
      } else {
        this.deselectAll( 'faux' );
        this.selectLI( fOpts[el.selectedIndex] );
      }
    }
    // adjust the scroll if there is one
    if( this.type == 'multiple' ||
        ( this.faux.className.indexOf( 'overflowing' ) != -1 &&
          this.faux.hasClassName( this.type + '-open' ) ) ){
      trace( 'this faux-SELECT overflows' );
      var ulHeight = this.faux.getHeight();
      var liHeight = $( this.faux.firstChild ).getHeight();
      if( // going down
          ( ( el.selectedIndex+1 ) * liHeight >
            this.faux.scrollTop + ulHeight ) ||
          // going up
          ( ( el.selectedIndex * liHeight ) < this.faux.scrollTop ) ){
        this.faux.scrollTop = el.selectedIndex * liHeight;
      }
      // special case for going down
      if( this.type == 'multiple' &&
          ( e.keyCode == '39' ||
            e.keyCode == '40' ) ){
        if( ( posn + 1 ) * liHeight > this.faux.scrollTop + ulHeight )
          this.faux.scrollTop = ( posn + 1 ) * liHeight;
      }
    }
  }
};

//Bonobo.onStart(function() { FauxSelectConductor.initialize( { maxHeight: 300 } ); });

ï»¿var ImageSizer = Class.create({}, {
   
   initialize: function(elt) {
        this._elt = elt;
        if (elt.complete)
            this.loaded();
        else {
            elt.observe('load', this.loaded.bindAsEventListener(this));
            elt.observe('error', this.onError.bindAsEventListener(this));
        }
   },
   
   loaded: function(evt) {            
        var divHeight = parseInt(this._elt.up('div.photo').style.height);
        var imageHeight = this._elt.height;
        var diff = divHeight - imageHeight;
        var style = {marginTop:Math.abs(diff/2)+ 'px'};
             
        var divWidth = parseInt(this._elt.up('div.photo').style.width);
        var imageWidth = this._elt.width;
        var diff = divWidth - imageWidth;
        style.marginLeft = Math.abs(diff/2)+ 'px';
        this._elt.setStyle(style);               
   },
   
   onError: function() {
    
   }
});

ImageSizer.init = function() {    
    $$('.photo img').each(function(img){ img.sizer = new ImageSizer(img);});
    PostCallbacks.push(function() { ImageSizer.init(); });
}

Bonobo.onStart(ImageSizer.init);

ï»¿
var LocationSelector = Class.create();
LocationSelector.prototype = {
    initialize: function(controlId) {
        this.controlId = controlId;
        this.country = new Bonobo.Selector(controlId + '_cmbCountry');
        this.state = new Bonobo.Selector(controlId + '_cmbState');
        this.city = new Bonobo.Selector(controlId + '_cmbCity');
        Event.observe(controlId + '_cmbCountry', 'change', this.countryChanged.bindAsEventListener(this), true);
        Event.observe(controlId + '_cmbState', 'change', this.stateChanged.bindAsEventListener(this), true);
        var countryVal = this.country.selectedValue();
        var stateVal = this.state.selectedValue();
        var cityVal = this.city.selectedValue();
        if (countryVal != '' && $(controlId + '_cmbState').options.length <= 1) {
            this.countryChanged(null);
            if (stateVal && stateVal != '') {
                this.state.selectValue(stateVal);
                this.stateChanged(null);
                this.city.selectValue(cityVal);
            }
        }
    },
    countryChanged: function(evt) {
        if (this.country.getValue() == '') {
            this.state.setOptions([this.state.getOption(0)]);
            this.city.setOptions([this.city.getOption(0)]);
            return;
        }
        var ls = this;
        this.toggle();
        Anthem_CallBack(null, "Control", this.controlId, 'GetStates', 
            [this.country.getValue()], 
             function(result) {
		        if (result.error) return alert(result.error);
		        ls.state.setOptions([ls.state.getOption(0)].concat(result.value));
		        ls.city.select(0);
		        ls.toggle();
	        }, null, false, false);
    },
    stateChanged: function(evt) {
        if (this.state.getValue() == '') {
            this.city.setOptions([this.city.getOption(0)]);
            return;
        }
        var ls = this;
        this.toggle();
        Anthem_CallBack(null, "Control", this.controlId, 'GetCities', 
            [this.state.getValue()], 
             function(result) {
		        if (result.error) return alert(result.error);		      
		        ls.city.setOptions([ls.city.getOption(0)].concat(result.value));
		        ls.toggle();
	        }, null, false, false);    
    },
    toggle: function() {
        this.country.toggle();
        this.state.toggle();
        this.city.toggle();
    }
}

//(c) 2006 Valerio Proietti (http://mad4milk.net). MIT-style license.
//moo.fx.js - depends on prototype.js OR prototype.lite.js
//version 2.0
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('i 6=1r={};6.k=4(){};6.k.y={G:4(a){3.7=u.s({O:4(){},L:4(){},17:6.13.11,B:1j,T:\'1g\',w:1e,R:1d},a||{})},P:4(){i a=o W().K();9(a<3.I+3.7.B){3.16=a-3.I;3.E()}D{12(3.7.L.C(3,3.h),10);3.A();3.f=3.l}3.n()},E:4(){3.f=3.x(3.j,3.l)},x:4(a,b){i c=b-a;5 3.7.17(3.16,a,c,3.7.B)},A:4(){S(3.8);3.8=Q;5 3},r:4(a,b){9(!3.7.w)3.A();9(3.8)5;12(3.7.O.C(3,3.h),10);3.j=a;3.l=b;3.I=o W().K();3.8=1c(3.P.C(3),q.1b(1a/3.7.R));5 3},N:4(a,b){5 3.r(a,b)},M:4(a){3.f=a;3.n();5 3},19:4(){5 3.M(0)},z:4(e,p,v){9(p==\'H\'){9(v==0&&e.g.m!="15")e.g.m="15";D 9(e.g.m!="14")e.g.m="14";9(1q.1p)e.g.1o="1n(H="+v*1m+")";e.g.H=v}D e.g[p]=v+3.7.T},1l:4(a){9(!3.8)5 3;1k(3.8);S(3.8);3.8=Q;5 3}};6.Z=18.Y();6.Z.y=u.s(o 6.k(),{X:4(a,b,c){3.h=$(a);3.G(c);3.V=b.1i()},n:4(){3.z(3.h,3.V,3.f)}});6.U=18.Y();6.U.y=u.s(o 6.k(),{X:4(a,b){3.h=$(a);3.G(b);3.f={}},E:4(){F(p J 3.j)3.f[p]=3.x(3.j[p],3.l[p])},N:4(a){9(3.8&&3.7.w)5;i b={};i c={};F(p J a){b[p]=a[p][0];c[p]=a[p][1]}5 3.r(b,c)},n:4(){F(i p J 3.f)3.z(3.h,p,3.f[p])}});6.13={1h:4(t,b,c,d){5 c*t/d+b},11:4(t,b,c,d){5-c/2*(q.1f(q.1s*t/d)-1)+b}};',62,91,'|||this|function|return|Fx|options|timer|if||||||now|style|element|var|from|Base|to|visibility|increase|new||Math|_start|extend||Object||wait|compute|prototype|setStyle|clearTimer|duration|bind|else|setNow|for|setOptions|opacity|time|in|getTime|onComplete|set|custom|onStart|step|null|fps|clearInterval|unit|Styles|property|Date|initialize|create|Style||sineInOut|setTimeout|Transitions|visible|hidden|cTime|transition|Class|hide|1000|round|setInterval|50|true|cos|px|linear|camelize|500|clearTimeout|stop|100|alpha|filter|ActiveXObject|window|fx|PI'.split('|'),0,{}))
ï»¿var MultiFriendSelector = Class.create({}, {

    initialize: function(hdn, span, txt, container, raiseEvent) {
        this._raiseEvent = raiseEvent;
        this.hdn = $(hdn);
        this.span = $(span);
        this.txt = $(txt);
        this.container = container;

        this.template = new Template("<span class='last' title='#{fullname}' userid='#{userid}'>#{fullname}<a href='javascript:void(0)'>X</a></span>");

        var fn = this.remove.bindAsEventListener(this);
        this.span.select('a').each(function(a) { a.observe('click', fn); });
        this.hdn.value = this.span.select('span').map(function(s) { return s.readAttribute('userid'); }).join(',');
        this._placeholder = this.txt.readAttribute('placeholder');
        this.txt.onSelected = this.add.bind(this);
        this.checkPlaceholder();
        $(container).observe('click', function() { $(txt).focus(); });
    },
    remove: function(evt) {
        var span = evt.element().up('span');
        var userid = span.readAttribute('userid');
        this.hdn.value = this.hdn.value.sub('(^|,)' + userid + '(?=$|,)', '');
        span.remove();
        this.raiseEvent();
    },
    add: function(id, value, info) {
        this.txt.value = '';
        this.txt.focus();
        trace('adding friend ' + id);
        var arr = id.split('|', 2);
        var user = { fullname: value, userid: arr[0], firstname: arr[1] };
        if (!this.hdn.value.match('(^|,)' + user.userid + '(?=$|,)')) {
            this.span.select('span:last').each(function(s) { s.removeClassName('last'); });
            this.span.insert(this.template.evaluate(user));
            this.span.down('span[userid=' + user.userid + ']').down('a').observe('click', this.remove.bindAsEventListener(this));
            this.hdn.value += ',' + user.userid;
            this.raiseEvent();
        }
    },

    checkPlaceholder: function() {
        if (this.hdn.value == '')
            this.txt.writeAttribute('placeholder', this._placeholder);
        else
            this.txt.writeAttribute('placeholder', '');
        Placeholder.refresh();
    },

    raiseEvent: function() {
        this.checkPlaceholder();
        if (this._raiseEvent)
            Anthem_InvokeControlMethod(this.container, 'OnChange', null);
    }
});

ï»¿var NumericInput = Class.create();

NumericInput.prototype = {
    initialize: function(input) {        
        Event.observe($(input), 'keypress', this.checkInput.bindAsEventListener(this), false);
        //$(input).onkeypress = this.checkInput.bindAsEventListener(this);
    },
    checkInput: function(e) {
        var unicode = e.charCode ? e.charCode : e.keyCode;
        if (unicode != 8){ 
            if (unicode < 48 || unicode > 57 ) 
                return false;             
        }
    }    
}

var NumericInputs = [];
NumericInputs.add = function() {
    $A(arguments).each(function(arg) { NumericInputs[arg] = new NumericInput(arg); });
}

ï»¿
function pypRegistration(opts) {
    var emailAddr = $(opts.txtEmailAddress),
        doneButton = $(opts.btnDone),
        valEmailFacebook = $(opts.lblValEmailFacebook),
        valEmail = $(opts.lblValEmail),
        valFriends = $(opts.lblValFriends),
        valPimps = $(opts.lblValPimps),
        imgLoader = $(opts.imgLoader),
        _doneClicked = false;

    emailAddr.observe('keypress', function(evt) {
        if (evt.keyCode == 13) {
            window.setTimeout(function() { doneButton.focus(); }, 10);
            return false;
        }
    });

    emailAddr.observe('blur', AfterValidateEmail);
    
    emailAddr.observe('focus', function() {
        valEmailFacebook.innerHTML = "Use your Facebook login email address";
        valEmailFacebook.show();
    }).observe('blur', BeforeValidateEmail);

    $(opts.ctrlBestFriends + '_txtFriend_txt').observe('blur', toggleDone);
    $(opts.ctrlBestFriends + '_spanSelected').observe('click', toggleDone);
    $(opts.ctrlPimping + '_txtFriend_txt').observe('blur', toggleDone);
    $(opts.ctrlPimping + '_spanSelected').observe('click', toggleDone);

    function BeforeValidateEmail() {
        _doneClicked = false;
        if (valEmailFacebook.value != "Use your Facebook login email address"
               && emailAddr.value != "Type your Facebook email address here..."
               && emailAddr.value != "") {
            valEmail.innerHTML = "";
            valEmailFacebook.innerHTML = "Validating...";
            imgLoader.show();
            toggleDone();
            valEmailFacebook.setStyle({
                color: '#29BBEF'
            });
        }
        else {
            if (emailAddr.value == "") {
                valEmailFacebook.innerHTML = "";
                imgLoader.hide();
                valEmail.innerHTML = "This box is feeling empty :-(";
            }
        }
    }

    function AfterValidateEmail() {
        if (valEmailFacebook.value != "Use your Facebook login email address"
            && emailAddr.value != "Type your Facebook email address here..."
            && emailAddr.value != "") {
            valEmail.innerHTML = "";
            Anthem_InvokeControlMethod(opts.clientID, 'VerifyUser', [$F(opts.txtEmailAddress)],
                function(rsp) {
                    if (rsp.value == true) {
                        valEmailFacebook.innerHTML = "Well done for knowing your email address!";
                        valEmailFacebook.setStyle({ color: '#29BBEF' });
                        imgLoader.hide();
                        if (_doneClicked)
                            submit({});                        
                    }
                    else if (rsp.value == false) {
                        valEmailFacebook.innerHTML = "Nope, not it. You get ZERO for honesty! Use the email address you log into Facebook with.";
                        valEmailFacebook.setStyle({ color: '#29BBEF' });
                        imgLoader.hide();
                    }
                    toggleDone();
                }, null);
        } else {
            if (emailAddr.value == "") {
                valEmailFacebook.innerHTML = "";
                imgLoader.hide();
                valEmail.value = "This box is feeling empty :-(";
            }
        }
    }

    function toggleDone() {
        var noBestFriends = $(opts.ctrlBestFriends + '_spanSelected').select('span').length;
        var noPimps = $(opts.ctrlPimping + '_spanSelected').select('span').length;
        var friendPlaceholder = $(opts.ctrlBestFriends + '_txtFriend_txt').next('.placeholder');
        var pimpPlaceholder = $(opts.ctrlPimping + '_txtFriend_txt').next('.placeholder');

        var friendText = $(opts.ctrlBestFriends + '_txtFriend_txt');
        var pimpText = $(opts.ctrlPimping + '_txtFriend_txt');

        if (noBestFriends > 0) {
            valFriends.hide();
            friendPlaceholder.innerHTML = "";
            friendText.setAttribute('placeholder', '');
        }
        else {
            friendPlaceholder.innerHTML = "Just type their names..";
            friendText.setAttribute('placeholder', 'Just type their names..');
        }

        if (noPimps > 0) {
            valPimps.hide();
            pimpPlaceholder.innerHtml = "";
            pimpText.setAttribute('placeholder', '');
        }
        else {
            pimpPlaceholder.innerHtml = "Just type their names..";
            pimpText.setAttribute('placeholder', 'Just type their names..');
        }
    }

    function verifyFriends(control, label) {
        var ctrl = $(control + "_spanSelected");
        var lbl = $(label);
        if (ctrl.select('span').length == 0) {
            lbl.show();
            return 1;
        }
        else {
            lbl.hide();
            return 0;
        }
    }
    
    function verify() {
        var count = 0;
        count += verifyFriends(opts.ctrlBestFriends, valFriends);
        count += verifyFriends(opts.ctrlPimping, valPimps);

        if ($F(emailAddr) == '') {
            valEmail.show();
            count += 1;
        } else if (valEmailFacebook.innerHTML != "Well done for knowing your email address!") {
            valEmailFacebook.show();
            count += 1;
        }

        return count == 0;
    }

    doneButton.observe('click', submit);

    function submit(evt) {
        _doneClicked = true;
        if (verify()) {
            Anthem_FireCallBackEvent(doneButton, evt, doneButton.name, 
                '', false, '', '', '', false, null, null, null, true, true);
        };

        return false;
    }
}
ï»¿var PimpWall = Class.create({}, {
    initialize: function(container) {
        this._container = $(container);
        this._more = $(container).down('#pimpWallMore');
        this._popout = $(container).down('#pimpWallPopout');
        var wall = this;
        $(container).select('.pimp').each(function(div) {
            div.pimp = new PimpWall.Pimp(wall, div);
        });
        this._popout.observe('mousemove', this.onPopoutMove.bindAsEventListener(this));
        this._more.down('a.close').observe('click', this.hideMore.bindAsEventListener(this));
    },
    onPopoutMove: function(evt) {
        if (this._currentPimp) 
            this._currentPimp.checkPopout(evt.pointerX(), evt.pointerY());        
    },
    hidePopout: function() {
        this._popout.hide();
        this._currentPimp = null;
    },
    showPopout: function(pimp, text) {
        if (this._more.visible())
            return;
        if (text == '') {
            this._currentPimp = null;
            this._popout.hide();
            return;
        }            
        this._currentPimp = pimp;
        this._popout.down('.body').update(text);
        pimp.position(this._popout);                
    },
    showMore: function(text, elt) {
        this.hidePopout();
        this._more.down('.body').update(text);
        this._more.clonePosition(elt, {setWidth:false, setHeight:false, offsetLeft:68, offsetTop:-73});
        this._more.show();
    },
    hideMore: function(evt) {
        this._more.hide();
    }
});

PimpWall.Pimp = Class.create({}, {
    initialize: function(wall, div) {
        this._wall = wall;
        this._div = div;
        div.observe('mouseover', this.showPopout.bindAsEventListener(this));
        div.observe('mouseout', this.hidePopout.bindAsEventListener(this));        
        div.down('a.more').observe('click', this.showMore.bindAsEventListener(this));
    },
    showPopout: function(evt) {
        this._wall.showPopout(this, this._div.down('.comment').innerHTML);
    },
    hidePopout: function(evt) {
        this.checkPopout(evt.pointerX(), evt.pointerY());
    },
	checkPopout: function(posX, posY) {
		var bounds = this._div.getDimensions();
		var pos = this._div.cumulativeOffset();
		if (posX < pos.left || posX > pos.left + bounds.width
				|| posY < pos.top || posY > pos.top + bounds.height) {
			this._wall.hidePopout();
		}
	},
	position: function(popout) {
	    popout.clonePosition(this._div, {setWidth:false, setHeight:false, offsetLeft:68, offsetTop:-73});
	    popout.show();
	},
	showMore: function(evt) {
	    this._wall.showMore(this._div.down('div.more').innerHTML, this._div);
	}
});
ï»¿function supports_input_placeholder() {
    var i = document.createElement('input');
    return 'placeholder' in i;
}

Placeholder = Class.create({}, {
    initialize: function(elt) {
        Placeholder.items.push(this);
        if (supports_input_placeholder())
            return;
            
        this.elt = $(elt).observe('focus', this.onFocus.bindAsEventListener(this))
			.observe('blur', this.onBlur.bindAsEventListener(this));
        var opts = { className: 'placeholder', style: 'position:absolute;padding-left:' + this.elt.getStyle('padding-left') }
        this.overlay = new Element('div', opts);
        this.overlay.innerHTML = this.elt.getAttribute('placeholder');
        this.elt.insert({ after: this.overlay });
        var me = this;
        setTimeout(function() { me.position(); }, 10);

        this.overlay.observe('click', this.onFocus.bindAsEventListener(this));
        if ($F(elt) != '') {
            this.overlay.hide();
        }
    },
    position: function() {
        this.overlay.clonePosition(this.elt, { setWidth: false });
    },
    onFocus: function(evt) {
        if ($(this.elt).disabled)
            return;
        $(this.overlay).hide();
        try {
            $(this.elt).focus();
        } catch (ex) {
            this.overlay.show();
        }
    },
    onBlur: function(evt) {
        if ($F(this.elt).strip() == '') {
            this.overlay.innerHTML = $(this.elt).getAttribute('placeholder');
            $(this.overlay).clonePosition(this.elt);
            this.overlay.show();
        } else {
            this.overlay.hide();
        }
    }
});
Placeholder.create = function(elt) {
    elt = $(elt);
    if (!elt.thePlaceholder)
        elt.thePlaceholder = new Placeholder(elt);
}

Placeholder.init = function() {
    Placeholder.items.invoke('position');
    $$('textarea[placeholder]', 'input[placeholder]').each(Placeholder.create);
}
Bonobo.onStart(Placeholder.init);
Placeholder.position = function() {
	Placeholder.items.invoke('position');
}
Placeholder.refresh = function() { Placeholder.items.invoke('onBlur'); }
Placeholder.items = [];
ï»¿var PopupWindow = Class.create();
PopupWindow.prototype = {
    initialize: function(link, args) {
        this.popup = null;
        this.link = link;
        this.args = args;
        Event.observe(link, 'click', this.showPopup.bindAsEventListener(this), true);
    },
    showPopup: function(evt) {
        evt.stop();
        if (this.popup != null)
            this.popup.close();
        this.popup = window.open($(this.link).href, this.name, this.args);
        this.popup.focus && this.popup.focus();
    }
}

var PopupWindows = [];
PopupWindows.add = function(link, args) {
    this[link] = new PopupWindow(link, args);
}

Bonobo.onStart(function() {
    var lb = $('lb-dyn');

    function loadPopup(e) {
        loadingPopup();
        var t = $(this);
        var url = t.getAttribute('href');
        lightbox.show();
        lb.update('').show();
        new Ajax.Updater(lb, url, { evalScripts: true });
        e.stop();
        return false;
    }

    $$('a.lightbox').each(function(a) {
        $(a).observe('click', loadPopup);
    });

    showPopup = function(url) {
        loadingPopup();
        lightbox.show();
        lb.update('').show();
        new Ajax.Updater(lb, url, { evalScripts: true });
    }

    closePopup = function() {
        lb.hide();
        lightbox.close();
    }
});


loadingPopup = function() {
    var lb = $("lb-dyn"),
        l = $('lightbox');    

    l.immediateDescendants().each(function(d) { $(d).hide(); });
    lightbox.show();
    lb.update('').addClassName('loading');
    lb.show();
    PostCallbacks.push(function() { lb.removeClassName('loading'); });
}
ï»¿tabList = function(container) {    
    var container = $(container),
        tabLinks = container.select('.tabs a'),
        getLink = function(elt) { return elt.tagName == 'A' ? elt : elt.up('A'); },
        getTab = function(link) { return container.down('div#' + link.readAttribute('tab')); },
        deselect = function(link) { if(link.hasClassName('selected')) link.removeClassName('selected'); },
        select = function(link) { $(link).addClassName('selected'); },
        tabPanels = tabLinks.map(getTab),
        showTab = function(link) {
            tabPanels.invoke('hide');
            getTab(link).show();
            tabLinks.each(deselect);
            select(link);
        },
        tabClicked = function(e) {
            showTab(getLink(e.element()));
        };
    tabLinks.each(function(link) { link.observe('click', tabClicked); });
    showTab(container.down('.tabs a.selected'));
}
ï»¿var TagDisplay = Class.create();

TagDisplay.prototype = {
    initialize: function(selector, display, minSize, maxSize, maxTags) {
        Object.extend(this, {selector:selector,display:display,minSize:minSize,maxSize:maxSize,maxTags:maxTags});
        TagSelectors.oncreate.listen(this.setup.bindAsEventListener(this));
    },
    setup: function() {
        this.selector = TagSelectors[this.selector];
        this.selector.onchange.listen(this.update.bindAsEventListener(this));
    },
    update: function() {
        var vals = this.selector.getValues();
        var elt = $(this.display);
        elt.innerHTML = '';
        for(var i = 0; i < this.maxTags; i++) {
            if (i < vals.length) {
                var sp = document.createElement('span');
                sp.innerHTML = ( i > 0 ? ', ' : '') + vals[i];
                sp.style.fontSize = Math.round(this.minSize + (this.maxSize - this.minSize) * this.selector.getSize(vals[i])) + 'px';
                elt.appendChild(sp);
            }
        }
    }
}

var TagDisplays = [];
TagDisplays.create = function(selector, display, minSize, maxSize, maxTags) {
    TagDisplays[display] = new TagDisplay(selector, display, minSize, maxSize, maxTags);
}


ï»¿var TagSelector = Class.create();

TagSelector.prototype = {
    initialize: function(linkContainer, textContainer) {    
       
        this.onchange = new CustomEvent();
        this.links = $A($(linkContainer).getElementsByTagName('a'));        
        this.textContainer = textContainer;
        this.linkContainer = linkContainer;
        var fn = this.tagClicked.bindAsEventListener(this);
        var map = this.map = [];
        this.links.each(function(lnk) { 
            Event.observe(lnk, 'click', fn, false); 
            map[lnk.innerHTML] = lnk.getAttribute('popularity');
        });        
        Event.observe(this.textContainer, 'change', this.tagsChanged.bindAsEventListener(this), false);
    },
    tagClicked: function(evt) {
    
        var tag = Event.element(evt).innerHTML.trim();
        var vals = $A($F(this.textContainer).split(',')).invoke('trim').reject(function(s) { return s == ' ' || s.length == 0; });
        vals.contains(tag) ? vals.remove(tag) : vals.push(tag);
        $(this.textContainer).value = vals.join(', ');
        var ts = this;
        setTimeout(function() { ts.onchange.raise(); }, 100);
        return false;
    },
    tagsChanged: function(evt) {
        this.onchange.raise();
    },
    dispose: function() {
        Event.stopObserving(this.textContainer, 'change', this.tagsChanged.bindAsEventListener(this), false);
    },
    getValues: function() {
        return $A($F(this.textContainer).split(',')).invoke('trim').reject(function(s) { return s == ' ' || s.length == 0; });
    },
    getSize: function(value) {
        return this.map[value] || (this.map[value] = Math.random());
    }
}

var TagSelectors = [];
TagSelectors.create = function(id, linkContainer, textContainer) {
    
    if (this[id])
        this[id].dispose();
    var ts = new TagSelector(linkContainer, textContainer);
    this[id] = ts;
    $(linkContainer).tagSelector = ts;
    $(textContainer).tagSelector = ts;
    TagSelectors.oncreate.raise();
    return ts;
}
TagSelectors.oncreate = new CustomEvent();
ï»¿var Tooltips = [];
Tooltips.add = function(source, popup) {
    this[source] && this[source].destroy();
    this[source] = new Tooltip(source, popup);
}

