eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('d P={4u:\'1.4.0\',3w:\'(?:<4Y.*?>)((\\n|\\r|.)*?)(?:<\\/4Y>)\',2p:7(){},K:7(x){c x}};d 17={1a:7(){c 7(){6.1J.2m(6,J)}}};d 19=q o();o.B=7(4y,1b){E(2T 2F 1b){4y[2T]=1b[2T]}c 4y};o.1H=7(U){1i{f(U==2h)c\'2h\';f(U==1M)c\'1M\';c U.1H?U.1H():U.3f()}1p(e){f(e 75 6W)c\'...\';23 e}};5B.u.1c=7(){d 3C=6,1W=$A(J),U=1W.5n();c 7(){c 3C.2m(U,1W.3H($A(J)))}};5B.u.73=7(U){d 3C=6;c 7(z){c 3C.72(U,z||1X.z)}};o.B(7T.u,{7F:7(){d 3U=6.3f(16);f(6<16)c\'0\'+3U;c 3U},57:7(){c 6+1},7R:7(l){$R(0,6,Y).O(l);c 6}});d 56={55:7(){d 3r;E(d i=0;i<J.v;i++){d 5C=J[i];1i{3r=5C();1s}1p(e){}}c 3r}};d 5z=17.1a();5z.u={1J:7(Z,1B){6.Z=Z;6.1B=1B;6.3b=1d;6.2k()},2k:7(){6r(6.2l.1c(6),6.1B*4L)},2l:7(){f(!6.3b){1i{6.3b=Y;6.Z()}7O{6.3b=1d}}}};7 $(){d M=q 1u();E(d i=0;i<J.v;i++){d 5=J[i];f(3M 5==\'7C\')5=G.7t(5);f(J.v==1)c 5;M.Q(5)}c M}o.B(4r.u,{5P:7(){c 6.3J(/<\\/?[^>]+>/7r,\'\')},3E:7(){c 6.3J(q 3v(P.3w,\'5u\'),\'\')},52:7(){d 5w=q 3v(P.3w,\'5u\');d 5E=q 3v(P.3w,\'7o\');c(6.1L(5w)||[]).1x(7(5x){c(5x.1L(5E)||[\'\',\'\'])[1]})},3p:7(){c 6.52().1x(4f)},7y:7(){d 1m=G.4d(\'1m\');d 2i=G.7w(6);1m.66(2i);c 1m.2W},7x:7(){d 1m=G.4d(\'1m\');1m.2W=6.5P();c 1m.2q[0]?1m.2q[0].50:\'\'},5e:7(){d 5M=6.1L(/^\\??(.*)$/)[1].2M(\'&\');c 5M.30({},7(4N,5L){d 1j=5L.2M(\'=\');4N[1j[0]]=1j[1];c 4N})},1P:7(){c 6.2M(\'\')},3D:7(){d 2d=6.2M(\'-\');f(2d.v==1)c 2d[0];d 4p=6.5q(\'-\')==0?2d[0].5K(0).3n()+2d[0].5r(1):2d[0];E(d i=1,5H=2d.v;i<5H;i++){d s=2d[i];4p+=s.5K(0).3n()+s.5r(1)}c 4p},1H:7(){c"\'"+6.3J(\'\\\\\',\'\\\\\\\\\').3J("\'",\'\\\\\\\'\')+"\'"}});4r.u.7u=4r.u.5e;d $1s=q o();d $3t=q o();d 1n={O:7(l){d t=0;1i{6.1Z(7(g){1i{l(g,t++)}1p(e){f(e!=$3t)23 e}})}1p(e){f(e!=$1s)23 e}},7p:7(l){d N=Y;6.O(7(g,t){N=N&&!!(l||P.K)(g,t);f(!N)23 $1s});c N},7n:7(l){d N=Y;6.O(7(g,t){f(N=!!(l||P.K)(g,t))23 $1s});c N},2S:7(l){d T=[];6.O(7(g,t){T.Q(l(g,t))});c T},5j:7(l){d N;6.O(7(g,t){f(l(g,t)){N=g;23 $1s}});c N},5i:7(l){d T=[];6.O(7(g,t){f(l(g,t))T.Q(g)});c T},7s:7(5m,l){d T=[];6.O(7(g,t){d 5f=g.3f();f(5f.1L(5m))T.Q((l||P.K)(g,t))});c T},1A:7(U){d 4K=1d;6.O(7(g){f(g==U){4K=Y;23 $1s}});c 4K},30:7(3q,l){6.O(7(g,t){3q=l(3q,g,t)});c 3q},7N:7(1z){d 1W=$A(J).7P(1);c 6.2S(7(g){c g[1z].2m(g,1W)})},7Q:7(l){d N;6.O(7(g,t){g=(l||P.K)(g,t);f(g>=(N||g))N=g});c N},7S:7(l){d N;6.O(7(g,t){g=(l||P.K)(g,t);f(g<=(N||g))N=g});c N},7M:7(l){d 4J=[],4B=[];6.O(7(g,t){((l||P.K)(g,t)?4J:4B).Q(g)});c[4J,4B]},2N:7(2T){d T=[];6.O(7(g,t){T.Q(g[2T])});c T},7G:7(l){d T=[];6.O(7(g,t){f(!l(g,t))T.Q(g)});c T},7E:7(l){c 6.2S(7(g,t){c{g:g,42:l(g,t)}}).7H(7(14,3s){d a=14.42,b=3s.42;c a<b?-1:a>b?1:0}).2N(\'g\')},1P:7(){c 6.2S(P.K)},7K:7(){d l=P.K,1W=$A(J);f(3M 1W.5g()==\'7\')l=1W.7J();d 5k=[6].3H(1W).1x($A);c 6.1x(7(g,t){l(g=5k.2N(t));c g})},1H:7(){c\'#<1n:\'+6.1P().1H()+\'>\'}};o.B(1n,{1x:1n.2S,5W:1n.5j,1k:1n.5i,74:1n.1A,76:1n.1P});d $A=1u.70=7(2J){f(!2J)c[];f(2J.1P){c 2J.1P()}1T{d T=[];E(d i=0;i<2J.v;i++)T.Q(2J[i]);c T}};o.B(1u.u,1n);1u.u.5o=1u.u.3Y;o.B(1u.u,{1Z:7(l){E(d i=0;i<6.v;i++)l(6[i])},69:7(){6.v=0;c 6},6Y:7(){c 6[0]},5g:7(){c 6[6.v-1]},78:7(){c 6.1k(7(g){c g!=2h||g!=1M})},5l:7(){c 6.30([],7(5h,g){c 5h.3H(g.5X==1u?g.5l():[g])})},58:7(){d 4h=$A(J);c 6.1k(7(g){c!4h.1A(g)})},5q:7(U){E(d i=0;i<6.v;i++)f(6[i]==U)c i;c-1},3Y:7(5p){c(5p!==1d?6:6.1P()).5o()},5n:7(){d N=6[0];E(d i=0;i<6.v-1;i++)6[i]=6[i+1];6.v--;c N},1H:7(){c\'[\'+6.1x(o.1H).1I(\', \')+\']\'}});d 4Q={1Z:7(l){E(1K 2F 6){d g=6[1K];f(3M g==\'7\')3t;d 1j=[1K,g];1j.1K=1K;1j.g=g;l(1j)}},7a:7(){c 6.2N(\'1K\')},4h:7(){c 6.2N(\'g\')},7l:7(2I){c $H(2I).30($H(6),7(4o,1j){4o[1j.1K]=1j.g;c 4o})},7c:7(){c 6.1x(7(1j){c 1j.1x(4E).1I(\'=\')}).1I(\'&\')},1H:7(){c\'#<4Q:{\'+6.1x(7(1j){c 1j.1x(o.1H).1I(\': \')}).1I(\', \')+\'}>\'}};7 $H(U){d 2I=o.B({},U||{});o.B(2I,1n);o.B(2I,4Q);c 2I}3m=17.1a();o.B(3m.u,1n);o.B(3m.u,{1J:7(1V,2g,2z){6.1V=1V;6.2g=2g;6.2z=2z},1Z:7(l){d g=6.1V;2r{l(g);g=g.57()}1Q(6.1A(g))},1A:7(g){f(g<6.1V)c 1d;f(6.2z)c g<6.2g;c g<=6.2g}});d $R=7(1V,2g,2z){c q 3m(1V,2g,2z)};d I={4j:7(){c 56.55(7(){c q 53(\'7q.54\')},7(){c q 53(\'8R.54\')},7(){c q 5J()})||1d},4v:0};I.2B={34:[],1Z:7(l){6.34.1Z(l)},5d:7(4g){f(!6.1A(4g))6.34.Q(4g)},8P:7(59){6.34=6.34.58(59)},3L:7(Z,24,D,2D){6.O(7(33){f(33[Z]&&3M 33[Z]==\'7\'){1i{33[Z].2m(33,[24,D,2D])}1p(e){}}})}};o.B(I.2B,1n);I.2B.5d({5c:7(){I.4v++},1w:7(){I.4v--}});I.3A=7(){};I.3A.u={3x:7(k){6.k={1z:\'4n\',4x:Y,25:\'\'};o.B(6.k,k||{})},32:7(){c 6.D.2V==2h||6.D.2V==0||(6.D.2V>=8U&&6.D.2V<8O)},8N:7(){c!6.32()}};I.35=17.1a();I.35.5G=[\'8H\',\'8G\',\'8F\',\'8X\',\'4A\'];I.35.u=o.B(q I.3A(),{1J:7(1f,k){6.D=I.4j();6.3x(k);6.24(1f)},24:7(1f){d 25=6.k.25||\'\';f(25.v>0)25+=\'&8J=\';1i{6.1f=1f;f(6.k.1z==\'8M\'&&25.v>0)6.1f+=(6.1f.1L(/\\?/)?\'&\':\'?\')+25;I.2B.3L(\'5c\',6,6.D);6.D.8K(6.k.1z,6.1f,6.k.4x);f(6.k.4x){6.D.5F=6.5I.1c(6);2U((7(){6.4e(1)}).1c(6),10)}6.5a();d 18=6.k.5b?6.k.5b:25;6.D.96(6.k.1z==\'4n\'?18:1M)}1p(e){6.2Y(e)}},5a:7(){d 1O=[\'X-94-8Z\',\'5J\',\'X-P-4u\',P.4u];f(6.k.1z==\'4n\'){1O.Q(\'5O-1Y\',\'90/x-91-L-93\');f(6.D.92)1O.Q(\'8I\',\'8D\')}f(6.k.1O)1O.Q.2m(1O,6.k.1O);E(d i=0;i<1O.v;i+=2)6.D.8a(1O[i],1O[i+1])},5I:7(){d 2G=6.D.2G;f(2G!=1)6.4e(6.D.2G)},4O:7(w){1i{c 6.D.88(w)}1p(e){}},5Q:7(){1i{c 4f(6.4O(\'X-87\'))}1p(e){}},5N:7(){1i{c 4f(6.D.3k)}1p(e){6.2Y(e)}},4e:7(2G){d z=I.35.5G[2G];d D=6.D,2D=6.5Q();f(z==\'4A\'){1i{(6.k[\'2K\'+6.D.2V]||6.k[\'2K\'+(6.32()?\'8b\':\'8E\')]||P.2p)(D,2D)}1p(e){6.2Y(e)}f((6.4O(\'5O-1Y\')||\'\').1L(/^2i\\/8e/i))6.5N()}1i{(6.k[\'2K\'+z]||P.2p)(D,2D);I.2B.3L(\'2K\'+z,6,D,2D)}1p(e){6.2Y(e)}f(z==\'4A\')6.D.5F=P.2p},2Y:7(4F){(6.k.5v||P.2p)(6,4F);I.2B.3L(\'5v\',6,4F)}});I.4G=17.1a();o.B(o.B(I.4G.u,I.35.u),{1J:7(1q,1f,k){6.3R={2O:1q.2O?$(1q.2O):$(1q),3h:1q.3h?$(1q.3h):(1q.2O?1M:$(1q))};6.D=I.4j();6.3x(k);d 1w=6.k.1w||P.2p;6.k.1w=(7(D,U){6.5t();1w(D,U)}).1c(6);6.24(1f)},5t:7(){d 3c=6.32()?6.3R.2O:6.3R.3h;d 31=6.D.3k;f(!6.k.3p)31=31.3E();f(3c){f(6.k.5y){q 6.k.5y(3c,31)}1T{m.4R(3c,31)}}f(6.32()){f(6.1w)2U(6.1w.1c(6),10)}}});I.5D=17.1a();I.5D.u=o.B(q I.3A(),{1J:7(1q,1f,k){6.3x(k);6.1w=6.k.1w;6.1B=(6.k.1B||2);6.2o=(6.k.2o||1);6.49={};6.1q=1q;6.1f=1f;6.1V()},1V:7(){6.k.1w=6.5A.1c(6);6.2l()},6m:7(){6.49.1w=2h;81(6.4Z);(6.1w||P.2p).2m(6,J)},5A:7(24){f(6.k.2o){6.2o=(24.3k==6.5R?6.2o*6.k.2o:1);6.5R=24.3k}6.4Z=2U(6.2l.1c(6),6.2o*6.1B*4L)},2l:7(){6.49=q I.4G(6.1q,6.1f,6.k)}});G.8u=7(1e,4U){d 4T=($(4U)||G.18).4c(\'*\');c $A(4T).30([],7(M,4s){f(4s.1e.1L(q 3v("(^|\\\\s)"+1e+"(\\\\s|$)")))M.Q(4s);c M})};f(!1X.m){d m=q o()}o.B(m,{4m:7(5){c $(5).h.2f!=\'3F\'},6D:7(){E(d i=0;i<J.v;i++){d 5=$(J[i]);m[m.4m(5)?\'51\':\'4S\'](5)}},51:7(){E(d i=0;i<J.v;i++){d 5=$(J[i]);5.h.2f=\'3F\'}},4S:7(){E(d i=0;i<J.v;i++){d 5=$(J[i]);5.h.2f=\'\'}},3I:7(5){5=$(5);5.2c.8A(5)},4R:7(5,4M){$(5).2W=4M.3E();2U(7(){4M.3p()},10)},8s:7(5){5=$(5);c 5.29},3B:7(5){c q m.3e(5)},8l:7(5,1e){f(!(5=$(5)))c;c m.3B(5).1A(1e)},8k:7(5,1e){f(!(5=$(5)))c;c m.3B(5).6a(1e)},8j:7(5,1e){f(!(5=$(5)))c;c m.3B(5).3I(1e)},8m:7(5){5=$(5);E(d i=0;i<5.2q.v;i++){d 3u=5.2q[i];f(3u.8n==3&&!/\\S/.6L(3u.50))m.3I(3u)}},8q:7(5){c $(5).2W.1L(/^\\s*$/)},4X:7(5){5=$(5);d x=5.x?5.x:5.28,y=5.y?5.y:5.2a;1X.4X(x,y)},1D:7(5,h){5=$(5);d g=5.h[h.3D()];f(!g){f(G.4l&&G.4l.4V){d 4D=G.4l.4V(5,1M);g=4D?4D.8p(h):1M}1T f(5.4W){g=5.4W[h.3D()]}}f(1X.6I&&[\'14\',\'1h\',\'3s\',\'6G\'].1A(h))f(m.1D(5,\'W\')==\'4C\')g=\'5s\';c g==\'5s\'?1M:g},8T:7(5,h){5=$(5);E(w 2F h)5.h[w.3D()]=h[w]},8o:7(5){5=$(5);f(m.1D(5,\'2f\')!=\'3F\')c{1U:5.2n,1R:5.29};d 1S=5.h;d 6z=1S.4P;d 6F=1S.W;1S.4P=\'2X\';1S.W=\'2b\';1S.2f=\'\';d 6A=5.6O;d 6B=5.6E;1S.2f=\'3F\';1S.W=6F;1S.4P=6z;c{1U:6A,1R:6B}},8r:7(5){5=$(5);d 4i=m.1D(5,\'W\');f(4i==\'4C\'||!4i){5.4I=Y;5.h.W=\'3g\';f(1X.6I){5.h.1h=0;5.h.14=0}}},8i:7(5){5=$(5);f(5.4I){5.4I=2h;5.h.W=5.h.1h=5.h.14=5.h.6G=5.h.3s=\'\'}},8t:7(5){5=$(5);f(5.36)c;5.36=5.h.3K;f((m.1D(5,\'3K\')||\'4m\')!=\'2X\')5.h.3K=\'2X\'},8B:7(5){5=$(5);f(5.36)c;5.h.3K=5.36;5.36=2h}});d 6C=q o();6C.2f=m.6D;19.15=7(2L){6.2L=2L};19.15.u={1J:7(5,2u){6.5=$(5);6.2u=2u.3E();f(6.2L&&6.5.6P){1i{6.5.6P(6.2L,6.2u)}1p(e){f(6.5.1y.2j()==\'4H\'){6.2A(6.6S())}1T{23 e}}}1T{6.22=6.5.8C.8z();f(6.2x)6.2x();6.2A([6.22.8y(6.2u)])}2U(7(){2u.3p()},10)},6S:7(){d 1m=G.4d(\'1m\');1m.2W=\'<6R><4H>\'+6.2u+\'</4H></6R>\';c $A(1m.2q[0].2q[0].2q)}};d 15=q o();15.6V=17.1a();15.6V.u=o.B(q 19.15(\'8v\'),{2x:7(){6.22.8w(6.5)},2A:7(21){21.O((7(20){6.5.2c.3V(20,6.5)}).1c(6))}});15.5S=17.1a();15.5S.u=o.B(q 19.15(\'8x\'),{2x:7(){6.22.6K(6.5);6.22.6x(Y)},2A:7(21){21.3Y(1d).O((7(20){6.5.3V(20,6.5.8h)}).1c(6))}});15.6T=17.1a();15.6T.u=o.B(q 19.15(\'8g\'),{2x:7(){6.22.6K(6.5);6.22.6x(6.5)},2A:7(21){21.O((7(20){6.5.66(20)}).1c(6))}});15.64=17.1a();15.64.u=o.B(q 19.15(\'82\'),{2x:7(){6.22.83(6.5)},2A:7(21){21.O((7(20){6.5.2c.3V(20,6.5.84)}).1c(6))}});m.3e=17.1a();m.3e.u={1J:7(5){6.5=$(5)},1Z:7(l){6.5.1e.2M(/\\s+/).1k(7(w){c w.v>0}).1Z(l)},3S:7(1e){6.5.1e=1e},6a:7(43){f(6.1A(43))c;6.3S(6.1P().3H(43).1I(\' \'))},3I:7(4a){f(!6.1A(4a))c;6.3S(6.1k(7(1e){c 1e!=4a}).1I(\' \'))},3f:7(){c 6.1P().1I(\' \')}};o.B(m.3e.u,1n);d 5V={69:7(){E(d i=0;i<J.v;i++)$(J[i]).g=\'\'},48:7(5){$(5).48()},80:7(){E(d i=0;i<J.v;i++)f($(J[i]).g==\'\')c 1d;c Y},1k:7(5){$(5).1k()},5U:7(5){5=$(5);5.48();f(5.1k)5.1k()}};d C={2Z:7(L){d M=C.2C($(L));d 45=q 1u();E(d i=0;i<M.v;i++){d 44=C.m.2Z(M[i]);f(44)45.Q(44)}c 45.1I(\'&\')},2C:7(L){L=$(L);d M=q 1u();E(1y 2F C.m.2s){d 47=L.4c(1y);E(d j=0;j<47.v;j++)M.Q(47[j])}c M},7Z:7(L,3o,w){L=$(L);d 3G=L.4c(\'2t\');f(!3o&&!w)c 3G;d 3P=q 1u();E(d i=0;i<3G.v;i++){d 2t=3G[i];f((3o&&2t.1Y!=3o)||(w&&2t.w!=w))3t;3P.Q(2t)}c 3P},7V:7(L){d M=C.2C(L);E(d i=0;i<M.v;i++){d 5=M[i];5.7W();5.3Q=\'Y\'}},7X:7(L){d M=C.2C(L);E(d i=0;i<M.v;i++){d 5=M[i];5.3Q=\'\'}},6y:7(L){c C.2C(L).5W(7(5){c 5.1Y!=\'2X\'&&!5.3Q&&[\'2t\',\'1k\',\'3N\'].1A(5.1y.2j())})},7Y:7(L){5V.5U(C.6y(L))},5T:7(L){$(L).5T()}};C.m={2Z:7(5){5=$(5);d 1z=5.1y.2j();d 1E=C.m.2s[1z](5);f(1E){d 1K=4E(1E[0]);f(1K.v==0)c;f(1E[1].5X!=1u)1E[1]=[1E[1]];c 1E[1].1x(7(g){c 1K+\'=\'+4E(g)}).1I(\'&\')}},1r:7(5){5=$(5);f(5){d 1z=5.1y.2j();d 1E=C.m.2s[1z](5);f(1E)c 1E[1]}}};C.m.2s={2t:7(5){6p(5.1Y.2j()){1o\'85\':1o\'2X\':1o\'6w\':1o\'2i\':c C.m.2s.3N(5);1o\'6s\':1o\'6t\':c C.m.2s.5Y(5)}c 1d},5Y:7(5){f(5.86)c[5.w,5.g]},3N:7(5){c[5.w,5.g]},1k:7(5){c C.m.2s[5.1Y==\'1k-6u\'?\'60\':\'6d\'](5)},60:7(5){d g=\'\',1N,t=5.8d;f(t>=0){1N=5.k[t];g=1N.g;f(!g&&!(\'g\'2F 1N))g=1N.2i}c[5.w,g]},6d:7(5){d g=q 1u();E(d i=0;i<5.v;i++){d 1N=5.k[i];f(1N.8f){d 3l=1N.g;f(!3l&&!(\'g\'2F 1N))3l=1N.2i;g.Q(3l)}}c[5.w,g]}};d $F=C.m.1r;19.3d=7(){};19.3d.u={1J:7(5,1B,Z){6.1B=1B;6.5=$(5);6.Z=Z;6.2H=6.1r();6.2k()},2k:7(){6r(6.2l.1c(6),6.1B*4L)},2l:7(){d g=6.1r();f(6.2H!=g){6.Z(6.5,g);6.2H=g}}};C.m.3j=17.1a();C.m.3j.u=o.B(q 19.3d(),{1r:7(){c C.m.1r(6.5)}});C.3j=17.1a();C.3j.u=o.B(q 19.3d(),{1r:7(){c C.2Z(6.5)}});19.26=7(){};19.26.u={1J:7(5,Z){6.5=$(5);6.Z=Z;6.2H=6.1r();f(6.5.1y.2j()==\'L\')6.6q();1T 6.2k(6.5)},4w:7(){d g=6.1r();f(6.2H!=g){6.Z(6.5,g);6.2H=g}},6q:7(){d M=C.2C(6.5);E(d i=0;i<M.v;i++)6.2k(M[i])},2k:7(5){f(5.1Y){6p(5.1Y.2j()){1o\'6s\':1o\'6t\':1l.3i(5,\'89\',6.4w.1c(6));1s;1o\'6w\':1o\'2i\':1o\'3N\':1o\'1k-6u\':1o\'1k-8Y\':1l.3i(5,\'95\',6.4w.1c(6));1s}}}};C.m.26=17.1a();C.m.26.u=o.B(q 19.26(),{1r:7(){c C.m.1r(6.5)}});C.26=17.1a();C.26.u=o.B(q 19.26(),{1r:7(){c C.2Z(6.5)}});f(!1X.1l){d 1l=q o()}o.B(1l,{97:8,8W:9,8L:13,8V:27,7U:37,8S:38,8Q:39,8c:40,71:46,5:7(z){c z.V||z.77},6Z:7(z){c(((z.6k)&&(z.6k==1))||((z.6l)&&(z.6l==1)))},7h:7(z){c z.7k||(z.7f+(G.3y.2w||G.18.2w))},7d:7(z){c z.7b||(z.79+(G.3y.2v||G.18.2v))},6m:7(z){f(z.6j){z.6j();z.7j()}1T{z.3r=1d;z.7i=Y}},7g:7(z,1y){d 5=1l.5(z);1Q(5.2c&&(!5.1y||(5.1y.3n()!=1y.3n())))5=5.2c;c 5},1G:1d,6e:7(5,w,1C,1t){f(!6.1G)6.1G=[];f(5.6i){6.1G.Q([5,w,1C,1t]);5.6i(w,1C,1t)}1T f(5.4z){6.1G.Q([5,w,1C,1t]);5.4z(\'2K\'+w,1C)}},6v:7(){f(!1l.1G)c;E(d i=0;i<1l.1G.v;i++){1l.6f.2m(6,1l.1G[i]);1l.1G[i][0]=1M}1l.1G=1d},3i:7(5,w,1C,1t){d 5=$(5);1t=1t||1d;f(w==\'6g\'&&(3Z.6h.1L(/3T|3X|41/)||5.4z))w=\'6n\';6.6e(5,w,1C,1t)},6f:7(5,w,1C,1t){d 5=$(5);1t=1t||1d;f(w==\'6g\'&&(3Z.6h.1L(/3T|3X|41/)||5.3W))w=\'6n\';f(5.6o){5.6o(w,1C,1t)}1T f(5.3W){5.3W(\'2K\'+w,1C)}}});1l.3i(1X,\'7e\',1l.6v,1d);d 2e={6c:Y,4b:7(){6.62=1X.7I||G.3y.2w||G.18.2w||0;6.63=1X.7m||G.3y.2v||G.18.2v||0},61:7(5){d 12=0,11=0;2r{12+=5.2v||0;11+=5.2w||0;5=5.2c}1Q(5);c[11,12]},2Q:7(5){1i{d 12=0,11=0;2r{12+=5.2a||0;11+=5.28||0;5=5.1F}1Q(5);c[11,12]}1p(e){c[0,0]}},6U:7(5){d 12=0,11=0;2r{12+=5.2a||0;11+=5.28||0;5=5.1F;f(5){p=m.1D(5,\'W\');f(p==\'3g\'||p==\'2b\')1s}}1Q(5);c[11,12]},1F:7(5){f(5.1F)c 5.1F;f(5==G.18)c 5;1Q((5=5.2c)&&5!=G.18)f(m.1D(5,\'W\')!=\'4C\')c 5;c G.18},7L:7(5,x,y){f(6.6c)c 6.5Z(5,x,y);6.2P=x;6.2R=y;6.1v=6.2Q(5);c(y>=6.1v[1]&&y<6.1v[1]+5.29&&x>=6.1v[0]&&x<6.1v[0]+5.2n)},5Z:7(5,x,y){d 4q=6.61(5);6.2P=x+4q[0]-6.62;6.2R=y+4q[1]-6.63;6.1v=6.2Q(5);c(6.2R>=6.1v[1]&&6.2R<6.1v[1]+5.29&&6.2P>=6.1v[0]&&6.2P<6.1v[0]+5.2n)},7v:7(3z,5){f(!3z)c 0;f(3z==\'7A\')c((6.1v[1]+5.29)-6.2R)/5.29;f(3z==\'7B\')c((6.1v[0]+5.2n)-6.2P)/5.2n},6b:7(1b,V){1b=$(1b);V=$(V);V.h.W=\'2b\';d 2E=6.2Q(1b);V.h.1h=2E[1]+\'1g\';V.h.14=2E[0]+\'1g\';V.h.1U=1b.2n+\'1g\';V.h.1R=1b.29+\'1g\'},4k:7(4t){d 12=0,11=0;d 5=4t;2r{12+=5.2a||0;11+=5.28||0;f(5.1F==G.18)f(m.1D(5,\'W\')==\'2b\')1s}1Q(5=5.1F);5=4t;2r{12-=5.2v||0;11-=5.2w||0}1Q(5=5.2c);c[11,12]},6b:7(1b,V){d k=o.B({68:Y,67:Y,65:Y,6Q:Y,2a:0,28:0},J[2]||{});1b=$(1b);d p=2e.4k(1b);V=$(V);d 2y=[0,0];d 3a=1M;f(m.1D(V,\'W\')==\'2b\'){3a=2e.1F(V);2y=2e.4k(3a)}f(3a==G.18){2y[0]-=G.18.28;2y[1]-=G.18.2a}f(k.68)V.h.14=(p[0]-2y[0]+k.28)+\'1g\';f(k.67)V.h.1h=(p[1]-2y[1]+k.2a)+\'1g\';f(k.65)V.h.1U=1b.2n+\'1g\';f(k.6Q)V.h.1R=1b.29+\'1g\'},7z:7(5){5=$(5);f(5.h.W==\'2b\')c;2e.4b();d 2E=2e.6U(5);d 1h=2E[1];d 14=2E[0];d 1U=5.6O;d 1R=5.6E;5.6M=14-3O(5.h.14||0);5.6H=1h-3O(5.h.1h||0);5.6J=5.h.1U;5.6N=5.h.1R;5.h.W=\'2b\';5.h.1h=1h+\'1g\';5.h.14=14+\'1g\';5.h.1U=1U+\'1g\';5.h.1R=1R+\'1g\'},7D:7(5){5=$(5);f(5.h.W==\'3g\')c;2e.4b();5.h.W=\'3g\';d 1h=3O(5.h.1h||0)-(5.6H||0);d 14=3O(5.h.14||0)-(5.6M||0);5.h.1h=1h+\'1g\';5.h.14=14+\'1g\';5.h.1R=5.6N;5.h.1U=5.6J}};f(/3T|3X|41/.6L(3Z.6X)){2e.2Q=7(5){d 12=0,11=0;2r{12+=5.2a||0;11+=5.28||0;f(5.1F==G.18)f(m.1D(5,\'W\')==\'2b\')1s;5=5.1F}1Q(5);c[11,12]}}',62,566,'|||||element|this|function|||||return|var||if|value|style|||options|iterator|Element||Object||new|||index|prototype|length|name|||event||extend|Form|transport|for||document||Ajax|arguments||form|elements|result|each|Prototype|push|||results|object|target|position||true|callback||valueL|valueT||left|Insertion||Class|body|Abstract|create|source|bind|false|className|url|px|top|try|pair|select|Event|div|Enumerable|case|catch|container|getValue|break|useCapture|Array|offset|onComplete|map|tagName|method|include|frequency|observer|getStyle|parameter|offsetParent|observers|inspect|join|initialize|key|match|null|opt|requestHeaders|toArray|while|height|els|else|width|start|args|window|type|_each|fragment|fragments|range|throw|request|parameters|EventObserver||offsetLeft|offsetHeight|offsetTop|absolute|parentNode|oStringList|Position|display|end|undefined|text|toLowerCase|registerCallback|onTimerEvent|apply|offsetWidth|decay|emptyFunction|childNodes|do|Serializers|input|content|scrollTop|scrollLeft|initializeRange|delta|exclusive|insertContent|Responders|getElements|json|offsets|in|readyState|lastValue|hash|iterable|on|adjacency|split|pluck|success|xcomp|cumulativeOffset|ycomp|collect|property|setTimeout|status|innerHTML|hidden|dispatchException|serialize|inject|response|responseIsSuccess|responder|responders|Request|_overflow||||parent|currentlyExecuting|receiver|TimedObserver|ClassNames|toString|relative|failure|observe|Observer|responseText|optValue|ObjectRange|toUpperCase|typeName|evalScripts|memo|returnValue|right|continue|node|RegExp|ScriptFragment|setOptions|documentElement|mode|Base|classNames|__method|camelize|stripScripts|none|inputs|concat|remove|replace|overflow|dispatch|typeof|textarea|parseFloat|matchingInputs|disabled|containers|set|Konqueror|digits|insertBefore|detachEvent|Safari|reverse|navigator||KHTML|criteria|classNameToAdd|queryComponent|queryComponents||tagElements|focus|updater|classNameToRemove|prepare|getElementsByTagName|createElement|respondToReadyState|eval|responderToAdd|values|pos|getTransport|page|defaultView|visible|post|mergedHash|camelizedString|offsetcache|String|child|forElement|Version|activeRequestCount|onElementEvent|asynchronous|destination|attachEvent|Complete|falses|static|css|encodeURIComponent|exception|Updater|tbody|_madePositioned|trues|found|1000|html|params|header|visibility|Hash|update|show|children|parentElement|getComputedStyle|currentStyle|scrollTo|script|timer|nodeValue|hide|extractScripts|ActiveXObject|XMLHTTP|these|Try|succ|without|responderToRemove|setRequestHeaders|postBody|onCreate|register|toQueryParams|stringValue|last|array|findAll|detect|collections|flatten|pattern|shift|_reverse|inline|indexOf|substring|auto|updateContent|img|onException|matchAll|scriptTag|insertion|PeriodicalExecuter|updateComplete|Function|lambda|PeriodicalUpdater|matchOne|onreadystatechange|Events|len|onStateChange|XMLHttpRequest|charAt|pairString|pairs|evalResponse|Content|stripTags|evalJSON|lastText|Top|reset|activate|Field|find|constructor|inputSelector|withinIncludingScrolloffsets|selectOne|realOffset|deltaX|deltaY|After|setWidth|appendChild|setTop|setLeft|clear|add|clone|includeScrollOffsets|selectMany|_observeAndCache|stopObserving|keypress|appVersion|addEventListener|preventDefault|which|button|stop|keydown|removeEventListener|switch|registerFormCallbacks|setInterval|checkbox|radio|one|unloadCache|password|collapse|findFirstElement|originalVisibility|originalWidth|originalHeight|Toggle|toggle|clientHeight|originalPosition|bottom|_originalTop|opera|_originalWidth|selectNodeContents|test|_originalLeft|_originalHeight|clientWidth|insertAdjacentHTML|setHeight|table|contentFromAnonymousTable|Bottom|positionedOffset|Before|RangeError|userAgent|first|isLeftClick|from|KEY_DELETE|call|bindAsEventListener|member|instanceof|entries|srcElement|compact|clientY|keys|pageY|toQueryString|pointerY|unload|clientX|findElement|pointerX|cancelBubble|stopPropagation|pageX|merge|pageYOffset|any|im|all|Msxml2|gi|grep|getElementById|parseQuery|overlap|createTextNode|unescapeHTML|escapeHTML|absolutize|vertical|horizontal|string|relativize|sortBy|toColorPart|reject|sort|pageXOffset|pop|zip|within|partition|invoke|finally|slice|max|times|min|Number|KEY_LEFT|disable|blur|enable|focusFirstElement|getInputs|present|clearTimeout|afterEnd|setStartAfter|nextSibling|submit|checked|JSON|getResponseHeader|click|setRequestHeader|Success|KEY_DOWN|selectedIndex|javascript|selected|beforeEnd|firstChild|undoPositioned|removeClassName|addClassName|hasClassName|cleanWhitespace|nodeType|getDimensions|getPropertyValue|empty|makePositioned|getHeight|makeClipping|getElementsByClassName|beforeBegin|setStartBefore|afterBegin|createContextualFragment|createRange|removeChild|undoClipping|ownerDocument|close|Failure|Loaded|Loading|Uninitialized|Connection|_|open|KEY_RETURN|get|responseIsFailure|300|unregister|KEY_RIGHT|Microsoft|KEY_UP|setStyle|200|KEY_ESC|KEY_TAB|Interactive|multiple|With|application|www|overrideMimeType|urlencoded|Requested|change|send|KEY_BACKSPACE'.split('|'),0,{}))
/*
Created By: Chris Campbell
Website: http://particletree.com
Date: 2/1/2006

Adapted By: Simon de Haan
Website: http://blog.eight.nl
Date: 21/2/2006

Inspired by the lightbox implementation found at http://www.huddletogether.com/projects/lightbox/
And the lightbox gone wild by ParticleTree at http://particletree.com/features/lightbox-gone-wild/

*/

/*-------------------------------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, 'load', initialize, false);
Event.observe(window, 'load', getBrowserInfo, false);
Event.observe(window, 'unload', Event.unloadCache, false);

var lightbox = Class.create();

lightbox.prototype = {

	yPos : 0,
	xPos : 0,

	initialize: function(ctrl) {
		this.content = ctrl.rel;
		Event.observe(ctrl, 'click', this.activate.bindAsEventListener(this), false);
		ctrl.onclick = function(){return false;};
	},
	
	// Turn everything on - mainly the IE fixes
	activate: function(){
		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 = document.getElementsByTagName('select');
		for(i = 0; i < selects.length; i++) {
			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;
		$(this.content).style.display = display;
		if(display != 'none') this.actions();		
	},
	
	// Search through new links within the lightbox, and attach click event
	actions: function(){
		lbActions = document.getElementsByClassName('lbAction');

		for(i = 0; i < lbActions.length; i++) {
			Event.observe(lbActions[i], 'click', this[lbActions[i].rel].bindAsEventListener(this), false);
			lbActions[i].onclick = function(){return false;};
		}

	},
	
	// Example of creating your own functionality once lightbox is initiated
	deactivate: function(){
		if (browser == "Internet Explorer"){
			this.setScroll(0,this.yPos); 
			this.prepareIE('auto', 'auto');
			this.hideSelects("visible");
		}
		
		this.displayLightbox("none");
	}
}

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

// Onload, make all links that need to trigger a lightbox active

function initialize(){
	addLightboxMarkup();
	lbox = document.getElementsByClassName('lbOn');
	for(i = 0; i < lbox.length; i++) {
		valid = new lightbox(lbox[i]);
	}
}

// Add in markup necessary to make this work. Basically two divs:
// Overlay holds the shadow
// Lightbox is the centered square that the content is put into.
function addLightboxMarkup() {

	bod 				= document.getElementsByTagName('body')[0];

	overlay 			= document.createElement('div');
	overlay.id			= 'overlay';

	bod.appendChild(overlay);
}

function activateBox(elem, div, width, height) { 
	addLightboxMarkup();
	var box = $(elem);
	var popup = new lightbox(box); 
	popup.activate(); 
	$(div).style.width = width;
	$(div).style.height = height;
	$(div).style.top  = (getHeight() - height)/2 + 'px';
	$(div).style.left = (getWidth() - width)/2 + 'px'; 
	$('overlay').style.height =  getPageHeight() + 'px';
}
function deactivateBox(elem) { 
	var box = $(elem);
	var popup = new lightbox(box); 
	popup.deactivate(); 
}if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;//is being called on load / refresh only, not within navigation
function all_initialize() {
	htmlhistory_initialize();
	h = location.hash; //get index.php?(#.*)
	h = h.substring(1, h.length);
	htmlhistory_goto(h);
}
//htmlhistory
function htmlhistory_initialize() {
	dhtmlHistory.initialize();
	dhtmlHistory.addListener(htmlhistory_historychange);
}
function htmlhistory_add(hash, data) {
	dhtmlHistory.add(hash, data);
}
function htmlhistory_historychange(newLocation, historyData) {
	htmlhistory_goto(newLocation, historyData);
}
//ajax requests
function error_filler(t, where, url) {
	$(where).innerHTML = '<div style="font-family:lucida console,courier new;font-size:12px;color:#990000;background-color:#ffcccc;margin:0px;padding:10px;border:1px solid #660000;">Error <b>' + t.status + '</b> in <b>' + url + '</b>: <b>' + t.statusText + '</b></div>';
}
function ajax_load(config) { //url, pars, where, evalonsuccess, hideloading
	if ((config.where != '') && (typeof(config.where) != 'undefined')) {
		if ($(config.where) != null) {
			if (config.hideloading == true) {
				//do nothing
			} else { 
				the_loading_div = $(config.where);
				temp_toinsert = '<img src="'+root_address+'images/ajax_loader.gif" border="0" width="18px" height="18px" style="overflow:hidden" />';
				$(config.where).innerHTML = temp_toinsert;
			}
		} else {
			//alert('id="' + config.where + '" not found. cannot load "' + config.url + '"');
		}
	}
	var myAjax = new Ajax.Request(
		config.url,
		{
			method: 'get',
			parameters: 'w='+encodeURIComponent(rewrites)+'&ajax=true&random=' + Math.random() + '&' + config.pars,
			onSuccess: function(t) {
				if (config.where != '') {
					$(config.where).innerHTML = t.responseText;
				}
				eval(config.onsuccess);
				t.responseText.evalScripts();
			},
			onFailure: function(t) {
				error_filler(t, config.where, config.url);
			}
		}
	);
}
function request(requrl, pars, where, hideloading) {
	if (pars) {
		pars = '&' + pars;
	} else {
		pars = '';
	}
	ajax_load({
		url: root_address + 'request.php',
		pars: query_string + '&request=' + requrl + pars,
		where: where,
		hideloading: true
	});
}
function request_submit(pars) { //url, form, pars, history, where
	if (pars.form) {
		request(pars.url, Form.serialize(pars.form), pars.where);
	} else if (pars.pars) {
		request(pars.url, pars.pars, pars.where);
	} else {
		alert('Please provide .form or .pars');
	}
	if (pars.history) htmlhistory_add(pars.history);
}

function base64_encode( data ) {   
    
	var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    var o1, o2, o3, h1, h2, h3, h4, bits, i=0, enc='';
 
    do { // pack three octets into four hexets
        o1 = data.charCodeAt(i++);
        o2 = data.charCodeAt(i++);
        o3 = data.charCodeAt(i++);
 
        bits = o1<<16 | o2<<8 | o3;
 
        h1 = bits>>18 & 0x3f;
        h2 = bits>>12 & 0x3f;
        h3 = bits>>6 & 0x3f;
        h4 = bits & 0x3f;
 
        // use hexets to index into b64, and append result to encoded string
        enc += b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
    } while (i < data.length);
 
    switch( data.length % 3 ){
        case 1:
            enc = enc.slice(0, -2) + '==';
        break;
        case 2:
            enc = enc.slice(0, -1) + '=';
        break;
    }
 
    return enc;
}

function base64_decode( data ) {
  
    var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    var o1, o2, o3, h1, h2, h3, h4, bits, i=0, enc='';
 
    do {  // unpack four hexets into three octets using index points in b64
        h1 = b64.indexOf(data.charAt(i++));
        h2 = b64.indexOf(data.charAt(i++));
        h3 = b64.indexOf(data.charAt(i++));
        h4 = b64.indexOf(data.charAt(i++));
 
        bits = h1<<18 | h2<<12 | h3<<6 | h4;
 
        o1 = bits>>16 & 0xff;
        o2 = bits>>8 & 0xff;
        o3 = bits & 0xff;
 
        if (h3 == 64)      enc += String.fromCharCode(o1);
        else if (h4 == 64) enc += String.fromCharCode(o1, o2);
        else               enc += String.fromCharCode(o1, o2, o3);
    } while (i < data.length);
 
    return enc;
}

//get window width
function getWidth() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  
  return myWidth;
}

//get window height
function getHeight() {
  var myHeight = 0;
  if( typeof( window.innerHeight ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }

  return myHeight;
}

//get page height
function getPageHeight() {
  return document.body.offsetHeight;
}

function paginateAjax(page, session_hash) {
	var pars = 'random=' + Math.random()+'&page='+page+'&session_hash='+session_hash;
	where='pagination_ajax_response';
	var config=Array();
	config.url = root_address + 'ajax.pagination.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}

function setLanguage(lang) {
	var address = root_address + 'language/' + lang + '/' + base64_encode(this_address);
	window.location = address; 
	return true; 
} 

function updateRating(rating, table, prefix, target, div, size, session_hash) {
	var pars = 'random=' + Math.random()+'&rating='+rating+'&table='+table+'&prefix='+prefix+'&target='+target+'&div='+div+'&size='+size+'&session_hash='+session_hash;
	where=div;
	var config=Array();
	config.url = root_address + 'ajax.rating.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}

function postComment(input, output, table, prefix, target, blank, update, limit, session_hash) {
	var content = escape($F(input)); 
	var pars = 'random=' + Math.random()+'&content='+content+'&table='+table+'&prefix='+prefix+'&target='+target+'&input='+input+'&output='+output+'&blank='+blank+'&update='+update+'&limit='+limit+'&session_hash='+session_hash;
	where=output;
	var config=Array();
	config.url = root_address + 'ajax.postComment.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}

function checkEnter(e) { 	//e is event object passed from function invocation
	var characterCode;  	// literal character code will be stored in this variable
	if (e && e.which) { 	//if which property of event object is supported (NN4)
		e = e;
		characterCode = e.which; 	//character code is contained in NN4's which property
	} else { 
		e = event;
		characterCode = e.keyCode; 	//character code is contained in IE's keyCode property
	}

	if (characterCode == 13) { 		//if generated character code is equal to ascii 13 (if enter key) 
		return true; 
	} else{
		return false;
	}
}

//---------------------------------------------------------------------------------------------------------------------------------------

//message board backround ref
var messages_bg='';

function selectPaymentType(type) {
	if (type=='PayPal') { 
		window.location = root_address + 'paymentpaypal';
	} 
	return true;
}

var all_cats=0;
var all_cats_free=0;

function expandColapseCategories() { 
	all_categories_display = $('all_categories').style.display;
	if (all_categories_display == 'none') { 
		$('all_categories').style.display = '';
	} else { 
		$('all_categories').style.display = 'none';
	}
	return true;
}

function expandColapseSoft(category) { 
	all_soft_display = $('all_soft_'+category).style.display;
	if (all_soft_display == 'none') { 
		$('all_soft_'+category).style.display = '';
	} else { 
		$('all_soft_'+category).style.display = 'none';
	}
	return true;
}

function expandColapseCategoriesFree() { 
	all_categories_free_display = $('all_categories_free').style.display;
	if (all_categories_free_display == 'none') { 
		$('all_categories_free').style.display = '';
	} else { 
		$('all_categories_free').style.display = 'none';
	}
	return true;
}

function expandColapseSoftFree(category) { 
	all_soft_free_display = $('all_soft_free_'+category).style.display;
	if (all_soft_free_display == 'none') { 
		$('all_soft_free_'+category).style.display = '';
	} else { 
		$('all_soft_free_'+category).style.display = 'none';
	}
	return true;
}


function loadSoftDetails(soft, redirect, session_hash) { 
	if (redirect=='go') { 
		$('center_layout').innerHTML = '<h2>Soft</h2><div class="content"><div id="soft_details"></div></div>';
	}
	
	var pars = 'random=' + Math.random() + '&soft=' + soft + '&session_hash=' + session_hash;
	where='soft_details';
	var config=Array();
	config.url = root_address + 'ajax.loadSoftDetails.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=false;
	ajax_load(config);
}

function expandColapseWebsites() { 
	top_websites_display = $('top_websites').style.display;
	if (top_websites_display == 'none') { 
		$('top_websites').style.display = '';
	} else { 
		$('top_websites').style.display = 'none';
	}
	return true;
}

function expandColapseTopDownloads() { 
	top_downloads_display = $('top_downloads').style.display;
	if (top_downloads_display == 'none') { 
		$('top_downloads').style.display = '';
	} else { 
		$('top_downloads').style.display = 'none';
	}
	return true;
}

function expandColapseGoldDownloads() { 
	gold_downloads_display = $('gold_downloads').style.display;
	if (gold_downloads_display == 'none') { 
		$('gold_downloads').style.display = '';
	} else { 
		$('gold_downloads').style.display = 'none';
	}
	return true;
}

function clearSearchField() { 
	if ($F('g_search') == 'Search') {
		$('g_search').value = '';
	}
	return true;
}

function fillSearchField() { 
	if ($F('g_search') == '') {
		$('g_search').value = 'Search';
	}
	return true;
}

function checkSearchEnter(e) { 	//e is event object passed from function invocation 
	if (checkEnter(e)) { //(if enter key) 
		document.location = root_address + 'search/target/'+encodeURIComponent($F('g_search').replace(/[^0-9a-z_]+/ig, '-'))+'';
		return false; 
	} else{
		return true;
	}
}

//-------------------------------------------------------------------------------------------------
function CheckForm(f,elem) {
	if (f.from.value == "") {
		alert("Please enter your email address.");
		f.from.focus();
		return false;
	} else { 
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address = f.from.value;
		if(reg.test(address) == false) {
			alert('Invalid email address');
			return false;
		} else { 
			deactivateBox(elem);
		}
	}
	return true;
} 