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(); 
}

function showDiv(id, w, h) {
	setTimeout("activateBox('"+id+"_link', '"+id+"', "+w+", "+h+")", 100);
}
//preloader 
function MM_swapImgRestore() {
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//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+'imgstorage/ajax_loader.gif" border="0" width="18px" height="18px" style="overflow:hidden" />';
				$(config.where).innerHTML = temp_toinsert;
			}
		} 
	}
	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;
}

//set content div height
function setContentDiv() {
	var h = getHeight() - headerHeight;
	var c = getHeight() - headerHeight - 17;
	document.getElementById('request_div_left').style.height = h + 'px';
	document.getElementById('request_div_delim').style.height = h + 'px';
	document.getElementById('request_div_right').style.height = h + 'px';
	document.getElementById('request_div_cont').style.height = c + 'px';
}


function setCursor(el,st,end) { 
	if (el.setSelectionRange) { 
		el.focus(); 
		el.setSelectionRange(st,end); 
	} else { 
		if(el.createTextRange) { 
			range=el.createTextRange(); 
			range.collapse(true); 
			range.moveEnd('character',end); 
			range.moveStart('character',st); 
			range.select(); 
		} 
	}
}

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;
	}
}

//---------------------------------------------------------------------------------------------------------------------------------------
function mmCopy() { 
	mmcopydiv = $('mmcopyright'); 
	mmcopydiv.style.position = 'absolute'; 
	mmcopydiv.style.left = '-' + '1024px';	
	mmcopydiv.style.top = '-' + '768px';
}
//---------------------------------------------------------------------------------------------------------------------------------------
//time ticker
function curTime() { 
	var sec_dif = server_min_dif;
	
	var now = new Date();																					//client time
	var now = new Date(now.valueOf() + (sec_dif * 1000 *60));												//server time
	var now=new Date(now.valueOf() + (gmt * 1000 * 60 * 60) - (hh * 1000 * 60 * 60) - (mm * 1000 * 60));	//city time
	
	var hrs=now.getHours();
	var min=now.getMinutes();
	var sec=now.getSeconds();
	var don="AM";
	if (hrs>=12){ don="PM"; }
	if (hrs>12) { hrs-=12; }
	if (hrs==0) { hrs=12; }
	if (hrs<10) { hrs="0"+hrs; }
	if (min<10) { min="0"+min; }
	if (sec<10) { sec="0"+sec; }
	$('clock').innerHTML=hrs+":"+min+":"+sec+" "+don;
	setTimeout("curTime()",1000);
}

//change home page tabs content
function ch(x, len) {
	for (var i=0; i <len; i++) { 
		if (i != x) { 
			$('tp_3_'+i).style.color = '#FFFFFF';
			$('tp_3_'+i).style.bg_color = '#F0F0F0';
		} else { 
			$('tp_3_'+i).style.color = '#'+skin_color; 
			$('tp_3_'+i).style.bg_color = '#34302D';
		}
	}
}

//load home text
function loadHomeText(text) { 
	$('home_active').innerHTML = unescape(base64_decode(text)); 
}

//feedback
var fee=0;
function hide_feedback() {
	$('feedback_form').style.display = 'none';
	fee=0;
}
function show_feedback() {
	$('feedback_content').innerHTML = '<textarea name="feedback_text" id="feedback_text" rows="6" style="width:335px; font:Arial 10px normal; color:#333333" onclick="this.select();"></textarea><div class="Clear" style="height:6px"></div><div style="float:right; margin-right:7px"><input type="button" value="Cancel" onclick="hide_feedback();" />&nbsp;<input type="button" value="Submit" onclick="submitFeedback();" /></div>';
	$('feedback_form').style.display = '';
	fee=1;
}

//sort events
function events_sortby(type) { 
	$('events_sortby').value = type;
	$('events_form').submit();
}

//---------------------------------------------------------------------------------------------------------
function hideEvents() { $('up_events').style.display='none'; return true; }
function timeHideEvents() { setTimeout("hideEvents()", 200); return true; }
function hideVenues() { $('up_venues').style.display='none'; return true; }
function timeHideVenues() { setTimeout("hideVenues()", 200); return true; }
function hideAreas() { $('up_areas').style.display='none'; return true; }
function timeHideAreas() { setTimeout("hideAreas()", 200); return true; }

function hideSelect() {
	var ar = document.getElementsByTagName("select");
	for (var i=0; i <ar.length; i++) { 
		ar[i].style.visibility = "hidden";
	}
	var ar = document.getElementsByClassName("Fold");
	for (var i=0; i <ar.length; i++) { 
		ar[i].style.visibility = "hidden";
	}
	var ar = document.getElementsByClassName("Faded");
	for (var i=0; i <ar.length; i++) { 
		ar[i].style.visibility = "hidden";
	}
	var ar = document.getElementsByClassName("HideDrop");
	for (var i=0; i <ar.length; i++) { 
		ar[i].style.visibility = "hidden";
	}
}
function showSelect() {
	var ar = document.getElementsByTagName("select");
	for (var i=0; i <ar.length; i++) { 
		ar[i].style.visibility = "";
	} 
	var ar = document.getElementsByClassName("Fold");
	for (var i=0; i <ar.length; i++) { 
		ar[i].style.visibility = "";
	}
	var ar = document.getElementsByClassName("Faded");
	for (var i=0; i <ar.length; i++) { 
		ar[i].style.visibility = "";
	}
	var ar = document.getElementsByClassName("HideDrop");
	for (var i=0; i <ar.length; i++) { 
		ar[i].style.visibility = "";
	}
} 
//---------------------------------------------------------------------------

setInterval('do_events_increment()', 100);
var events_counter = -1;
function do_events_increment() {
	if (events_counter >= 0) {
		events_counter++;
		if (events_counter > 1) { //hardcoded = 0.1 seconds
			events_counter = -1;
			do_events();
		}
	}
}
function do_events_keyup() {
	events_counter = 0;
}
function do_events() {
	var string = $F('event_in');
	if (string.length > 0) {
		$('up_events').style.display = '';
		var pars = 'random=' + Math.random()+'&string='+string;
		where='up_events';
		var config=Array();
		config.url = root_address + 'ajax.doEvents.php';
		config.pars=pars;
		config.where=where;
		config.hideloading=false;
		ajax_load(config);
	} 
}
function goEvents() {
	var string = $F('event_in');
	if (string.length > 0) {
		$('up_events').style.display=''; 
		do_events_keyup(); 
	} else {
		$('up_events').style.display = '';
		var lnk = root_address+'book/browsebyevent';
		$('up_events').innerHTML = '<div style="padding:4px; background-color:#'+skin_color_fade+'"><span>Type in an event</span></div><div style="padding:8px; padding-left:4px; background-color:#'+skin_color_fade+'; cursor:pointer" onmouseover="this.style.backgroundColor=\'#'+skin_color_fader+'\'" onmouseout="this.style.backgroundColor=\'#'+skin_color_fade+'\'" onclick="window.location=\' '+lnk+' \'"><span>Or <a style="padding:0; background:none; color:#'+skin_color+'; font-weight:normal; cursor:pointer" href="'+lnk+'">Browse</a> events</span></div>';
	}
	hideSelect();
}
function ungoEvents() {
	timeHideEvents(); 
	showSelect();
}

//---------------------------------------------------------------------------

setInterval('do_venues_increment()', 100);
var venues_counter = -1;
function do_venues_increment() {
	if (venues_counter >= 0) {
		venues_counter++;
		if (venues_counter > 1) { //hardcoded = 0.1 seconds
			venues_counter = -1;
			do_venues();
		}
	}
}
function do_venues_keyup() {
	venues_counter = 0;
}
function do_venues() {
	var string = $F('venue_in');
	if (string.length > 0) {
		$('up_venues').style.display = '';
		var pars = 'random=' + Math.random()+'&string='+string;
		where='up_venues';
		var config=Array();
		config.url = root_address + 'ajax.doVenues.php';
		config.pars=pars;
		config.where=where;
		config.hideloading=false;
		ajax_load(config);
	}
}
function goVenues() {
	var string = $F('venue_in');
	if (string.length > 0) {
		$('up_venues').style.display=''; 
		do_venues_keyup(); 
	} else {
		$('up_venues').style.display = '';
		var lnk = root_address+'book/browsebyvenue';
		$('up_venues').innerHTML = '<div style="padding:4px; background-color:#'+skin_color_fade+'"><span>Type in a venue</span></div><div style="padding:8px; padding-left:4px; background-color:#'+skin_color_fade+'; cursor:pointer" onmouseover="this.style.backgroundColor=\'#'+skin_color_fader+'\'" onmouseout="this.style.backgroundColor=\'#'+skin_color_fade+'\'" onclick="window.location=\' '+lnk+' \'"><span>Or <a style="padding:0; background:none; color:#'+skin_color+'; font-weight:normal; cursor:pointer" href="'+lnk+'">Browse</a> venues</span></div>';
	}
	hideSelect();
}
function ungoVenues() {
	timeHideVenues(); 
	showSelect();
}

//---------------------------------------------------------------------------

setInterval('do_areas_increment()', 100);
var areas_counter = -1;
function do_areas_increment() {
	if (areas_counter >= 0) {
		areas_counter++;
		if (areas_counter > 1) { //hardcoded = 0.1 seconds
			areas_counter = -1;
			do_areas();
		}
	}
}
function do_areas_keyup() {
	areas_counter = 0;
}
function do_areas() {
	var string = $F('area_in');
	if (string.length > 0) {
		$('up_areas').style.display = '';
		var pars = 'random=' + Math.random()+'&string='+string;
		where='up_areas';
		var config=Array();
		config.url = root_address + 'ajax.doAreas.php';
		config.pars=pars;
		config.where=where;
		config.hideloading=false;
		ajax_load(config);
	}
}
function goAreas() {
	var string = $F('area_in');
	if (string.length > 0) {
		$('up_areas').style.display=''; 
		do_areas_keyup(); 
	} else {
		$('up_areas').style.display = '';
		var lnk = root_address+'book/areaevents';
		$('up_areas').innerHTML = '<div style="padding:4px; background-color:#'+skin_color_fade+'"><span>Type an area/suburb/district</span></div><div style="padding:8px; padding-left:4px; background-color:#'+skin_color_fade+'; cursor:pointer" onmouseover="this.style.backgroundColor=\'#'+skin_color_fader+'\'" onmouseout="this.style.backgroundColor=\'#'+skin_color_fade+'\'" onclick="window.location=\' '+lnk+' \'"><span>Or <a style="padding:0; background:none; color:#'+skin_color+'; font-weight:normal; cursor:pointer" href="'+lnk+'">Browse</a> areas</span></div>';		
	}
	hideSelect();
}
function ungoAreas() {
	timeHideAreas(); 
	showSelect();
}
//------------------------------------------------------------------------------
//privacy 
function updateProfilePrivacy() {
	var pars = 'random=' + Math.random();
	where='';
	var config=Array();
	config.url = root_address + 'ajax.updateProfilePrivacy.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function updateFriendsPrivacy() {
	var pars = 'random=' + Math.random();
	where='';
	var config=Array();
	config.url = root_address + 'ajax.updateFriendsPrivacy.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function updateAddressPrivacy() {
	var pars = 'random=' + Math.random();
	where='';
	var config=Array();
	config.url = root_address + 'ajax.updateAddressPrivacy.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function updatePhonePrivacy() {
	var pars = 'random=' + Math.random();
	where='';
	var config=Array();
	config.url = root_address + 'ajax.updatePhonePrivacy.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function updateMarketingPrivacy() {
	var pars = 'random=' + Math.random();
	where='';
	var config=Array();
	config.url = root_address + 'ajax.updateMarketingPrivacy.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function updateEmailPmPrivacy() {
	var pars = 'random=' + Math.random();
	where='';
	var config=Array();
	config.url = root_address + 'ajax.updateEmailPmPrivacy.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function updateEventsPrivacy() { 
	var pars = 'random=' + Math.random();
	where='';
	var config=Array();
	config.url = root_address + 'ajax.updateEventsPrivacy.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
//-----------------------------------------------------------------------------------
//photos
var desc_input = 0;

function loadAddAlbum(sel_value) {
	if ((sel_value=='unselected_extra_null')||(sel_value=='')) {
		$('add_album_popup').style.display = '';
	}
}
function addAlbum(type) {
	var title = escape($F('a_title'));
	
	if (title != '') {	
		$('add_album_popup').style.display = 'none';
		var pars = 'random=' + Math.random()+'&title='+title+'&type='+type;
		where='album_li';
		var config=Array();
		config.url = root_address + 'ajax.addAlbum.php';
		config.pars=pars;
		config.where=where;
		config.hideloading=false;
		ajax_load(config);
	} else {
		alert('Invalid album name!');
	}
}

function viewPhoto(id, album) { 
	var pars = 'random=' + Math.random()+'&id='+id+'&album='+album;
	where='photo_div';
	var config=Array();
	config.url = root_address + 'ajax.viewPhoto.php'; 
	config.pars=pars;
	config.where=where;
	config.hideloading=false;
	ajax_load(config);
}
function updatePhotoProfile(id, status, target) { 
	if (status == true) { status = 0; } else { status = 1; }
	if (status == 0) { 
		$('master_'+target).checked=true; 
		setPhoto(id, true, 'master', target); 
	}
	var pars = 'random=' + Math.random()+'&id='+id+'&status='+status;
	where=''; 
	var config=Array();
	config.url = root_address + 'ajax.updatePhotoProfile.php'; 
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function loadPhotoTextInput(id, description) { 
	if (desc_input==0) {	
		var pars = 'random=' + Math.random()+'&id='+id+'&description='+description;
		where='photo_description';
		var config=Array();
		config.url = root_address + 'ajax.loadPhotoTextInput.php'; 
		config.pars=pars;
		config.where=where;
		config.hideloading=true;
		ajax_load(config);
		desc_input = 1;
	} else { 
		return false;
	}
}
function savePhotoTextInput(id, description) { 
	if (desc_input=1) {	
		var pars = 'random=' + Math.random()+'&id='+id+'&description='+description;
		where='photo_description';
		var config=Array();
		config.url = root_address + 'ajax.savePhotoTextInput.php'; 
		config.pars=pars;
		config.where=where;
		config.hideloading=false;
		ajax_load(config);
		desc_input = 0; 
	} else { 
		return false;
	}
}
function loadPhotoUploader() { 
	inp = document.createElement('input'); 
	inp.type = "file"; 
	inp.style.display = "block"; 
	inp.name = 'up_photo[]';
	plh = $('phptp_placeholder_before');
	plh.parentNode.insertBefore(inp, plh);
	
	return true; 
}
function expandPhotoSubaccounts() { 
	$('photoSubaccountsExpand').style.display = 'none';
	$('photoSubaccounts').style.display = '';
	photosSubaccountsView(1);
	return true;
}
function colapsePhotoSubaccounts() { 
	$('photoSubaccountsExpand').style.display = '';
	$('photoSubaccounts').style.display = 'none';
	photosSubaccountsView(0);
	return true;
}
function setPhoto(pid, status, account, target) {
	if (status == true) { status = 0; } else { status = 1; } 
	if (status == 1) { 
		if (account == 'master') { $('main').checked=''; }
		if (account == 'artist') { $('artist_main_'+target).checked=''; }
		if (account == 'venue')  { $('venue_main_'+target).checked=''; }
	}
	var pars = 'random=' + Math.random()+'&pid='+pid+'&status='+status+'&account='+account+'&target='+target; 
	where=''; 
	var config=Array();
	config.url = root_address + 'ajax.setPhoto.php'; 
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function updatePhotoProfileArtist(id, status, target) { 
	if (status == true) { status = 0; } else { status = 1; }
	if (status == 0) { 
		$('artist_'+target).checked=true; 
		setPhoto(id, true, 'artist', target);
	}
	var pars = 'random=' + Math.random()+'&id='+id+'&status='+status+'&target='+target;
	where=''; 
	var config=Array();
	config.url = root_address + 'ajax.updatePhotoProfileArtist.php'; 
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function updatePhotoProfileVenue(id, status, target) { 
	if (status == true) { status = 0; } else { status = 1; }
	if (status == 0) { 
		$('venue_'+target).checked=true; 
		setPhoto(id, true, 'venue', target);
	}
	var pars = 'random=' + Math.random()+'&id='+id+'&status='+status+'&target='+target;
	where=''; 
	var config=Array();
	config.url = root_address + 'ajax.updatePhotoProfileVenue.php'; 
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function photosSubaccountsView(status) { 
	var pars = 'random=' + Math.random()+'&status='+status;
	where=''; 
	var config=Array();
	config.url = root_address + 'ajax.photosSubaccountsView.php'; 
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}

function viewUserPhoto(id, album, account, account_id) { 
	var pars = 'random=' + Math.random()+'&id='+id+'&album='+album+'&account='+account+'&account_id='+account_id;
	where='photo_div';
	var config=Array();
	config.url = root_address + 'ajax.viewUserPhoto.php'; 
	config.pars=pars;
	config.where=where;
	config.hideloading=false;
	ajax_load(config);
}
//---------------------------------------------------------------------------------------------------------------------------------------

//message board backround ref
var messages_bg=''; 

//check/uncheck all messages
function checkMessages() { 
	if ($('messages_check').checked == true ) { 
		ch = true;
	} else { 
		ch = false;
	}
	var ar = document.getElementsByClassName("MessageChecker"); 
	for (var i=0; i <ar.length; i++) { 
		ar[i].checked = ch;
	}
} 

//star  unstar message
function starMessage(mid) { 
	var pars = 'random=' + Math.random()+'&mid='+mid;
	where='star_' + mid;
	var config=Array();
	config.url = root_address + 'ajax.starMessage.php'; 
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}

//mark message
function markMessage(mid, mark) { 
	if (!confirm('Are you sure you want to mark this message as '+ mark +'?')) {
		return false;
	} else { 
		var pars = 'random=' + Math.random()+'&mid='+mid+'&mark='+mark;
		where='star_' + mid;
		var config=Array();
		config.url = root_address + 'ajax.markMessage.php'; 
		config.pars=pars;
		config.where=where;
		config.hideloading=true;
		ajax_load(config);
	}
}

//mass mark 
function setMessagesMark(act) { 
	$('messages_action').value = act; 
}

function submitMessagesMark(act) { 
	setTimeout("setMessagesMark("+act+")", 10);  
	setTimeout("document.messages_form.submit()", 20);
}
//---------------------------------------------------------------------------------------------------------------------------------------

//check youtube source
function checkVideo(ref) { 
	var pars = 'random=' + Math.random()+'&ref='+ref;
	where='YouTubeCheck';
	var config=Array();
	config.url = root_address + 'ajax.checkVideo.php'; 
	config.pars=pars;
	config.where=where;
	config.hideloading=false;
	ajax_load(config);
}

function loadCountryFlag(country_id) {
	var pars = 'random=' + Math.random()+'&country_id='+country_id;
	where='country_flag';
	var config=Array();
	config.url = root_address + 'ajax.loadCountryFlag.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function loadRegisterOtherCity(val) {
	if (val == '') {
		$('othercity_div').style.display='';
	} else {
		$('othercity_div').style.display='none';
	}
}

//---------------------------------------------------------------------------------------------------------------------------------------

function addFriend(friend) { 
	var pars = 'random=' + Math.random()+'&friend='+friend;
	where='add_friend_pop';
	var config=Array();
	config.url = root_address + 'ajax.addFriend.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=false;
	ajax_load(config);
}

function loadCountryCitiesA(cid, sid) {
	var pars = 'random=' + Math.random()+'&cid='+cid+'&sid='+sid;
	where='cities_div';
	var config=Array();
	config.url = root_address + 'ajax.loadCountryCitiesA.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=false;
	ajax_load(config);
}

function loadCityAreas(cid, zone) {
	$('areas_div').style.display = '';
	var pars = 'random=' + Math.random()+'&cid='+cid+'&zone='+zone;
	where='areas_div';
	var config=Array();
	config.url = root_address + 'ajax.loadCityAreas.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=false;
	ajax_load(config);
}

function updateAreaSession(area) {
	var check = 0;
	
	if ($('area_'+area).checked == true ) {
		check = 1;
	}
	
	var pars = 'random=' + Math.random()+'&area='+area+'&check='+check;
	where='pref_areas_div';
	var config=Array();
	config.url = root_address + 'ajax.updateAreaSession.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}

function loadGenres(gtype) {
	var pars = 'random=' + Math.random()+'&gtype='+gtype;
	where='genres_div';
	var config=Array();
	config.url = root_address + 'ajax.loadGenres.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=false;
	ajax_load(config);
}

function updateGenreSession(genre) {
	var check = 0;
	
	if ($('genre_'+genre).checked == true ) {
		check = 1;
	}
	
	var pars = 'random=' + Math.random()+'&genre='+genre+'&check='+check;
	where='pref_genres_div';
	var config=Array();
	config.url = root_address + 'ajax.updateGenreSession.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}

function updateTypeSession(type) {
	var check = 0;
	
	if ($('type_'+type).checked == true ) {
		check = 1;
	}
	
	var pars = 'random=' + Math.random()+'&type='+type+'&check='+check;
	where='pref_types_div';
	var config=Array();
	config.url = root_address + 'ajax.updateTypeSession.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}

function updateReviewRating(review, rating) {
	var pars = 'random=' + Math.random()+'&review='+review+'&rating='+rating;
	where='review_rating_'+review;
	var config=Array();
	config.url = root_address + 'ajax.updateReviewRating.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function updateReviewRatingBig(rating) {
	$('rating').value = rating;
	var pars = 'random=' + Math.random()+'&rating='+rating;
	where='review_rating';
	var config=Array();
	config.url = root_address + 'ajax.updateReviewRatingBig.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function reviews_sortby(type) { 
	$('reviews_sortby').value = type;
	$('reviews_form').submit();
}
function loadCountryCities(cid) {
	var pars = 'random=' + Math.random()+'&cid='+cid;
	where='cities_div';
	var config=Array();
	config.url = root_address + 'ajax.loadCountryCities.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=false;
	ajax_load(config);
}
function loadCityVenues(cid) { 
	loadAddVenuePage(0);
	
	var pars = 'random=' + Math.random()+'&cid='+cid;
	where='venues_div';
	var config=Array();
	config.url = root_address + 'ajax.loadCityVenues.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=false;
	ajax_load(config);
}
//---------------------------------------------------------------------------------------------------------------------------------
// ADD EVENT
//---------------------------------------------------------------------------------------------------------------------------------
function loadAddVenuePage(sel_value) {
	if (sel_value=='unselected_extra_null') {
		//window.location = root_address + 'promote/suggestvenue';
		$('add_venue_popup').style.display = '';
	} else {
		$('add_venue_popup').style.display = 'none';
	}
}
function loadAddArtistPage(sel_value, index) {
	if (sel_value=='unselected_extra_null') {
		//window.location = root_address + 'promote/suggestvenue';
		$('add_artist_popup_' + index).style.display = '';
	}
}
function showCalendarDetails(day, dt, vn) { 
	for (var i=0; i<=31; i++) {
		if (($('div__'+i) !=null) && ($('div__'+i) != undefined)) {
			$('div__'+i).style.display = "none";
		}
	}
	
	$('div__'+day).style.display = '';
	var pars = 'random=' + Math.random()+'&dt='+dt+'&vn='+vn;
	where='div_content_'+day;
	var config=Array();
	config.url = root_address + 'ajax.loadCalendarDetails.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}

function hideCalendarDetails(day) {
	$('div__'+day).style.display = 'none';
}

function updateTotalTickets() {
	$('tickets').value = parseInt($('ticket_1').value) + parseInt($('ticket_2').value) + parseInt($('ticket_3').value) + parseInt($('ticket_4').value) + parseInt($('ticket_5').value);
	return true;
}
function loadCutOffTime() {
	if ($('allowchangeguests').checked == true ) {
		$('changeguestbefore').style.display='';
	} else {
		$('changeguestbefore').style.display='none';
	}
}
function loadRepeatEvent() {
	if ($('repeat').checked == true ) {
		$('repeatevent').style.display='inline';
	} else {
		$('repeatevent').style.display='none';
		$('week_days').style.display='none';
		$('month_days').style.display='none';
		$('event_repeat_type').selectedIndex = 0;
	}
}
function loadRepeatDates() {
	if ($('event_repeat_type').value == 'week' ) {
		$('week_days').style.display='';
		$('br_before_repeat_end').style.display='none';
	} else {
		$('week_days').style.display='none';
	}
	if ($('event_repeat_type').value == 'month' ) {
		$('month_days').style.display='';
		$('br_before_repeat_end').style.display='none';
	} else {
		$('month_days').style.display='none';
	}
	if ($('event_repeat_type').value == 'day' ) {
		$('br_before_repeat_end').style.display='';
	}
}

function loadMonthTypeDates() { 
	if ($('event_repeat_month_type').value == 'days' ) {
		$('er_month_days').style.display='';
		$('er_month_dates').style.display='none';
	} else {
		$('er_month_days').style.display='none';
		$('er_month_dates').style.display='';
	}
}

function changeGoldTicketVenue(user_id, user_type, venue_id, action) {
	var pars = 'random=' + Math.random()+'&user_id='+user_id+'&user_type='+user_type+'&venue_id='+venue_id+'&action='+action;
	where='gold_ticket_'+user_id+'_'+user_type+'_'+venue_id;
	var config=Array();
	config.url = root_address + 'ajax.changeGoldTicketVenue.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function loadAddVenuePage(sel_value) {
	if (sel_value=='unselected_extra_null') {
		//window.location = root_address + 'promote/suggestvenue';
		$('add_venue_popup').style.display = '';
	} else {
		$('add_venue_popup').style.display = 'none';
	}
}
function loadAddArtistPage(sel_value, index) {
	if (sel_value=='unselected_extra_null') {
		//window.location = root_address + 'promote/suggestvenue';
		$('add_artist_popup_' + index).style.display = '';
	}
}
function updateNoChargeEvent() {	
	$('allowchangeguests').checked = false;
	$('allowchangeguests').disabled = 'disabled';
	$('changeguestbefore').style.display = 'none'; 
	
	$('ticket_fee').checked = false;
	$('ticket_fee').disabled = 'disabled';
	$('paypal_fee').checked = false;
	$('paypal_fee').disabled = 'disabled';
	
	$('tick_1').style.display = 'none';
	$('tick_2').style.display = 'none';
	$('tick_3').style.display = 'none';
	$('tick_4').style.display = 'none';
	$('tick_5').style.display = 'none';
	
	$('tick_rel_1').style.display = 'none';
	$('tick_rel_2').style.display = 'none';
	$('tick_rel_3').style.display = 'none';
	$('tick_rel_4').style.display = 'none';
	$('tick_rel_5').style.display = 'none';
	$('tick_rel_6').style.display = 'none';
	$('tick_rel_7').style.display = 'none';
	$('tick_rel_8').style.display = 'none';
	$('tick_rel_9').style.display = 'none';
	$('tick_rel_10').style.display = 'none';
	$('tick_rel_11').style.display = 'none';
	$('tick_rel_12').style.display = 'none';
	
	$('maxpurchasetickets').value = '0';
	$('maxpurchasetickets').disabled = 'disabled';
	$('endsalesbefore').selectedIndex = 0;
	$('endsalesbefore').disabled = 'disabled';
	
	$('need_accesskey').checked = false;
	$('need_accesskey').disabled = 'disabled';
} 

function updateTicketEvent() {
	$('content_othervendors').style.display = 'none';
	$('content_doorpay').style.display = 'none';
	$('tick_1').style.display = '';	
	$('tick_rel_1').style.display = '';
	$('tick_rel_2').style.display = '';
	$('tick_rel_3').style.display = '';
	$('tick_rel_4').style.display = '';
	$('tick_rel_5').style.display = '';
	$('tick_rel_6').style.display = '';
	$('tick_rel_7').style.display = '';
	$('tick_rel_8').style.display = '';
	$('tick_rel_9').style.display = '';
	$('tick_rel_10').style.display = '';
	$('tick_rel_11').style.display = '';
	$('tick_rel_12').style.display = '';
	
	$('allowchangeguests').disabled = '';
	$('ticket_fee').disabled = '';
	$('paypal_fee').disabled = '';
	
	$('add_tick_2').style.display = '';
	$('add_tick_3').style.display = '';
	$('add_tick_4').style.display = '';
	$('add_tick_5').style.display = '';
	
	$('maxpurchasetickets').value = '10';
	$('maxpurchasetickets').disabled = '';
	$('endsalesbefore').selectedIndex = 0;
	$('endsalesbefore').disabled = '';
	
	$('need_accesskey').disabled = '';
	
	$('ty_1').style.display = '';
	$('ty_2').style.display = '';
	$('ty_3').style.display = '';
	
	$('endsalesbefore').selectedIndex = '1';
	
	return true;
}
function updateOtherVendors() {	
	$('content_othervendors').style.display = '';
	$('nocharge_disp').value = 'on';
	$('ty_1').style.display = '';
	$('ty_2').style.display = '';
	$('ty_3').style.display = '';
	return true;
}
function updateDoorpay() {
	$('content_doorpay').style.display = '';
	$('nocharge_disp').value = 'on';
	$('vendor_id_1').value = 'on';
	$('ty_1').style.display = '';
	$('ty_2').style.display = '';
	$('ty_3').style.display = '';
	return true;
}
function updateTicketsForm(type) {
	if (type=='nocharge') {
		if ($('nocharge').checked == true ) {
			updateNoChargeEvent();
			$('etickets').checked = false;
			$('doorpay').checked = false;
			$('othervendors').checked = false;
			$('content_othervendors').style.display = 'none';
			$('content_doorpay').style.display = 'none';
			$('nocharge_disp').value = 'on';
			$('ty_1').style.display = 'none';
			$('ty_2').style.display = 'none';
			$('ty_3').style.display = 'none';
		} else {
			$('nocharge_disp').value = '';
			$('ty_1').style.display = 'none';
			$('ty_2').style.display = 'none';
			$('ty_3').style.display = 'none';
		}
	}
	if (type=='etickets') {
		if ($('etickets').checked == true ) {
			updateTicketEvent();
			$('nocharge').checked = false;
			$('doorpay').checked = false;
			$('othervendors').checked = false;
			$('nocharge_disp').value = '';
		} else {
			updateNoChargeEvent();
			$('nocharge_disp').value = '';
			$('ty_1').style.display = 'none';
			$('ty_2').style.display = 'none';
			$('ty_3').style.display = 'none';
		}
	}
	if (type=='doorpay') {
		if ($('doorpay').checked == true ) {
			updateNoChargeEvent();
			updateDoorpay();
			$('content_othervendors').style.display = 'none';
			$('etickets').checked = false;
			$('nocharge').checked = false;
			$('othervendors').checked = false;
		} else {
			$('content_doorpay').style.display = 'none';
			$('nocharge_disp').value = '';
			$('ty_1').style.display = 'none';
			$('ty_2').style.display = 'none';
			$('ty_3').style.display = 'none';
		}
	}
	if (type=='othervendors') {
		if ($('othervendors').checked == true ) {
			updateNoChargeEvent();
			updateOtherVendors();
			$('content_doorpay').style.display = 'none';
			$('etickets').checked = false;
			$('nocharge').checked = false;
			$('doorpay').checked = false;
		} else {
			$('content_othervendors').style.display = 'none';
			$('nocharge_disp').value = '';
			$('ty_1').style.display = 'none';
			$('ty_2').style.display = 'none';
			$('ty_3').style.display = 'none';
		}
	}
	return true;
}

function addVenue() {
	var title = escape($F('v_title'));
	var address = escape($F('v_address'));
	var phone = escape($F('v_phone'));
	var country = $F('country');
	var city = $F('city');
	
	if (title != '') {	
		$('add_venue_popup').style.display = 'none';
		var pars = 'random=' + Math.random()+'&title='+title+'&address='+address+'&phone='+phone+'&country='+country+'&city='+city;
		where='venues_div';
		var config=Array();
		config.url = root_address + 'ajax.addVenue.php';
		config.pars=pars;
		config.where=where;
		config.hideloading=true;
		ajax_load(config);
	} else {
		alert('Invalid venue title!');
	}
}

function addArtist(index) {
	var name = escape($F('a_name_' + index));
	var address = escape($F('a_name_' + index)); 
	if (name != '') {	
		$('add_artist_popup_' + index ).style.display = 'none';
		var pars = 'random=' + Math.random()+'&name='+name+'&address='+address+'&index='+index;
		where='artist_div_' + index;
		var config=Array();
		config.url = root_address + 'ajax.addArtist.php';
		config.pars=pars;
		config.where=where;
		config.hideloading=false;
		ajax_load(config);
	} else {
		alert('Invalid artist name!');
	}
}

function loadArtists(where_id, index) {	
	var pars = 'random=' + Math.random() + '&index=' + index;
	where=where_id;
	var config=Array();
	config.url = root_address + 'ajax.loadArtists.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=false;
	ajax_load(config);
}
var index_a = 0; 
function get_new_artist_place() { 
	index_a += 1;
	var div = document.createElement('div');
	div.id = 'artist_div_' + index_a;
	div.style.paddingTop = '2px';
	plh = $('artist_placeholder_before');		
	plh.parentNode.insertBefore(div,plh);
	loadArtists('artist_div_' + index_a, index_a);	
	return true;
}
function updateEndTime() {
	if ($('end_time_on').checked == true ) {
		$('end_time').style.display='inline';
	} else {
		$('end_time').style.display='none';
	}
}

function updateMarketContact(action, contact) {	 
	if (action==true) { 
		act = 1;
	} else { 
		act = 0;
	}
	var pars = 'random=' + Math.random()+'&action='+act+'&contact='+contact;
	where='';
	var config=Array();
	config.url = root_address + 'ajax.updateMarketContact.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
} 

function loadFlyerContent(event_id, txt) {
	var pars = 'random=' + Math.random()+'&event_id='+event_id+'&txt='+txt;
	where='flyer';
	var config=Array();
	config.url = root_address + 'ajax.loadFlyerContent.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}

function selectEvent(txt, dat) {	
	//deselect package
	$('package').selectedIndex = 0;
	//get selected event id
	var event_id = $F('event');
	//load flyer
	loadFlyerContent(event_id, txt);
	//set target type: event - 1 / package - 2
	if (event_id != 0) {
		$('target_type').value = '1'; //target type = event
		$('text_only').style.display = '';
		$('date_select').style.display = '';
	} else {
		$('text_only').style.display = 'none';
		$('date_select').style.display = 'none';
	}
	//load dates
	var pars = 'random=' + Math.random()+'&event_id='+event_id+'&dat='+dat;
	where='date';
	var config=Array();
	config.url = root_address + 'ajax.updateEventDates.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function selectPackage(txt, dat) {
	//erase flyer content
	loadFlyerContent('0', txt);
	//deselect event
	$('event').selectedIndex = 0;
	//get selected package id
	var package_id = $F('package');
	//set target type: event - 1 / package - 2
	if (package_id != 0) {
		$('target_type').value = '2'; //target type = package 
		$('text_only').style.display = '';
		$('date_select').style.display = '';
	} else {
		$('text_only').style.display = 'none';
		$('date_select').style.display = 'none';
	}
	//load dates
	var pars = 'random=' + Math.random()+'&package_id='+package_id+'&dat='+dat;
	where='date';
	var config=Array();
	config.url = root_address + 'ajax.updatePackageDates.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function selectEventRestrict() {	
	//get selected event id
	var event_id = $F('event');
	//load dates
	var pars = 'random=' + Math.random()+'&event_id='+event_id;
	where='date';
	var config=Array();
	config.url = root_address + 'ajax.updateEventRestrictDates.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function loadSMSPackagePrice(package_id) {
	var pars = 'random=' + Math.random()+'&package_id='+package_id;
	where='sms_package_price';
	var config=Array();
	config.url = root_address + 'ajax.loadSMSPackagePrice.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
function updateSMScounter() {
	$content = $F('content_sms');
	$len = 160-$content.length;
	if ($len < 0) {
		$len = 0;
		$('content_sms').value = $content.substr(0,160);
	}
	$('sms_counter').innerHTML = $len;
}

//booking
var index = 0;
var indexp = 0;
var s_t = 0;
var v_t = 0;
var m_t = 0;
function updateBookingFirstTicketType(s,v,m) {
	s_t = s; 
	v_t = v;
	m_t = m;
	if ($F('firsttickettype') == 'standard') { s_t -= 1; }
	if ($F('firsttickettype') == 'vip') { v_t -= 1; }
	
	//hide links if gata tickets
	if (s_t == 0) { $('s_link').style.display='none'; }
	if (v_t == 0) { $('v_link').style.display='none'; }
	
	//hide links if max tickets
	if (m_t == 1) { 
		$('s_link').style.display='none'; 
		$('v_link').style.display='none'; 
	}
		
}
function checkRadio(id) {
	$(id).checked=true;
	return true;
}
function checkRadioM() {
	$('male'+index).checked=true;
	return true;
}
function checkRadioF() {
	$('female'+index).checked=true;
	return true;
}
function removeChild(ind, type) {
	var oldp=document.getElementById('li1_' + ind);
	if(oldp) { oldp.parentNode.removeChild(oldp); }
	
	var oldp=document.getElementById('li2_' + ind);
	if(oldp) { oldp.parentNode.removeChild(oldp);  }
	
	var oldp=document.getElementById('li3_' + ind);
	if(oldp) { oldp.parentNode.removeChild(oldp); }
	
	var oldp=document.getElementById('li4_' + ind);
	if(oldp) { oldp.parentNode.removeChild(oldp); }
	
	var oldp=document.getElementById('li5_' + ind);
	if(oldp) { oldp.parentNode.removeChild(oldp); }
	
	var oldp=document.getElementById('li6_' + ind);
	if(oldp) { oldp.parentNode.removeChild(oldp); }
	
	var oldp=document.getElementById('li7_' + ind);
	if(oldp) { oldp.parentNode.removeChild(oldp); }
	
	index -= 1;
	if (type == 1) { s_t += 1; }
	if (type == 2) { v_t += 1; }
	
	var total_remaining = s_t + v_t;
	
}
function get_next_booking_name_place(type) {	
	
	prefix = $F('phone_prefix[]');
	p_m = 0;
	
	$('firsttickettype').disabled = 'disabled';

	index += 1;
	if (type == 1) { s_t -= 1; }
	if (type == 2) { v_t -= 1; }
	
	var total_remaining = s_t + v_t;
	
	//hide links if case
	if (s_t == 0) { $('s_link').style.display='none'; }
	if (v_t == 0) { $('v_link').style.display='none'; }
	
	if (m_t == index+1) { 
		$('s_link').style.display='none'; 
		$('v_link').style.display='none'; 
	}
	
	li1 = document.createElement('li');
	li1.id = 'li1_' + index;
	li1.innerHTML = "<span>Name:</span><input name='name[]' type='text' class='TextBox' value=''/>";
	li2 = document.createElement('li');
	li2.id = 'li2_' + index;
	li2.innerHTML = "<span>Email:</span><input name='email[]' type='text' class='TextBox' value=''/>";
	li3 = document.createElement('li');
	li3.id = 'li3_' + index;
	li3.innerHTML = "<div style='padding-left:110px'>Please ensure you input the correct mobile phone number for your SMS ticket<br /></div><span>Phone:</span><input name='phone_prefix[]' type='text' class='TextBox' value='" + prefix + "' style='width:26px; margin-right:0' /><input name='phone_m[]' type='text' class='TextBox' value='" + p_m + "' style='width:8px; margin:0; border-left:none; border-right:none' maxlength='1' /><input name='phone[]' type='text' class='TextBox' value='' style='width:180px; margin:0' />";
	li4 = document.createElement('li');
	li4.id = 'li4_' + index;
	var type_select = "<span>Ticket:</span><select name='ticket[]' class='TextBox'>";
	if (type == 1) { type_select += "<option value='standard'>standard</option></select>"; }
	if (type == 2) { type_select += "<option value='vip'>vip</option></select>"; }
	li4.innerHTML = type_select;
	li5 = document.createElement('li');
	li5.id = 'li5_' + index;
	var rad_id_m = 'male'+index;
	var rad_id_f = 'female'+index;
	li5.innerHTML = "<span>Gender:</span><input type='radio' name='gender"+index+"' id='"+rad_id_m+"' value='male' checked='checked' /><img style='cursor:pointer; position:relative; right:19px; top:2px' onclick='checkRadioM()' src='"+root_address+"imgstorage/male.gif' /></label><input type='radio' name='gender"+index+"' id='"+rad_id_f+"' value='female' /><img style='cursor:pointer; position:relative; right:20px; top:7px' onclick='checkRadioF()' src='"+root_address+"imgstorage/female.gif' /></label>";
	li6 = document.createElement('li');
	li6.id = 'li6_' + index;
	var add_links = "<span></span>";
	if (s_t >= 1) { add_links += "<a id='s_link_" + index + "' style='text-decoration:none; padding-left:8px' href='javascript: get_next_booking_name_place(1);'>+ standard ticket</a> "; }
	if (v_t >= 1) { add_links += "<a id='v_link_" + index + "' style='text-decoration:none; padding-left:8px' href='javascript: get_next_booking_name_place(2);'>+ vip ticket</a>"; }
	if (s_t >= 1 || v_t >=1 ) { add_links += "<a id='r_link_" + index + "' style='text-decoration:none; padding-left:8px' href='javascript: removeChild("+index+","+type+");'>- remove</a>"; }
	li6.innerHTML = add_links;
	
	li7 = document.createElement('li');
	li7.id = 'li7_' + index;
	li7.innerHTML = "<span>&nbsp;</span>&nbsp;";
	
	plh = $('booking_name_placeholder_before');	
	
	if (((s_t>=0) && (type==1)) || ((v_t>=0) && (type==2))) {
		plh.parentNode.insertBefore(li4,plh);
		plh.parentNode.insertBefore(li1,plh);
		plh.parentNode.insertBefore(li5,plh);
		plh.parentNode.insertBefore(li2,plh);
		plh.parentNode.insertBefore(li3,plh);
		var ok = true;
	}
	if (((s_t >= 1) || (v_t >= 1)) && ok) {
		plh.parentNode.insertBefore(li6,plh);
	}
	if (((s_t>=0) && (type==1)) || ((v_t>=0) && (type==2))) {
		plh.parentNode.insertBefore(li7,plh);
	}
	
	if (s_t < 0) {s_t = 0;}
	if (v_t < 0) {v_t = 0;}
	
	//hive unactive links
	for (i=1; i<=index+1; i++) {
		s_l = 's_link_' + i;
		v_l = 'v_link_' + i;
		
		if (s_t == 0) { if (document.getElementById(s_l)) { $(s_l).style.display='none'; } }
		if (v_t == 0) { if (document.getElementById(v_l)) { $(v_l).style.display='none'; } }
		
		if (m_t == index+1) { 
			if (document.getElementById(s_l)) { $(s_l).style.display='none'; }
			if (document.getElementById(v_l)) { $(v_l).style.display='none'; } 
		}
	}
}
function checkRadioMp() {
	$('male'+indexp).checked=true;
	return true;
}
function checkRadioFp() {
	$('female'+indexp).checked=true;
	return true;
}
function get_next_bookingprivate_name_place(type) {	
	indexp += 1;
	li1 = document.createElement('li');
	li1.id = 'cauttextasta';
	li1.innerHTML = "<span>Name:</span><input name='name[]' type='text' class='TextBox' value=''/>";
	li5 = document.createElement('li');
	var rad_id_m = 'male'+indexp;
	var rad_id_f = 'female'+indexp;
	li5.innerHTML = "<span>Gender:</span><input type='radio' name='gender"+indexp+"' id='"+rad_id_m+"' value='male' checked='checked' /><img style='cursor:pointer; position:relative; right:19px; top:2px' onclick='checkRadioMp()' src='"+root_address+"imgstorage/male.gif' /></label><input type='radio' name='gender"+indexp+"' id='"+rad_id_f+"' value='female' /><img style='cursor:pointer; position:relative; right:20px; top:7px' onclick='checkRadioFp()' src='"+root_address+"imgstorage/female.gif' /></label>";
	li6 = document.createElement('li');
	var add_links = "<span></span>";
	add_links += "<a id='s_link_" + indexp + "' style='text-decoration:none; padding-left:8px' href='javascript: get_next_bookingprivate_name_place(1);'><b>add person +</b></a> ";
	li6.innerHTML = add_links;
	li7 = document.createElement('li');
	li7.innerHTML = "<span>&nbsp;</span>&nbsp;";
	plh = $('booking_name_placeholder_before');		
	plh.parentNode.insertBefore(li5,plh);
	plh.parentNode.insertBefore(li1,plh);
	plh.parentNode.insertBefore(li6,plh);
	plh.parentNode.insertBefore(li7,plh);	
}

function updateWelcomeBox(box) {
	var check = 0;
	if ($('box_'+box).checked == true ) {
		check = 1;
	}
	
	var pars = 'random=' + Math.random()+'&box='+box+'&check='+check;
	where='';
	var config=Array();
	config.url = root_address + 'ajax.updateWelcomeBox.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}

function removeWelcomePromoterTip() { 
	$('welcome_promoter_tip').style.display = 'none'; 
	var pars = 'random=' + Math.random();
	where='';
	var config=Array();
	config.url = root_address + 'ajax.removeWelcomePromoterTip.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}

function expandColapseLinks(lnk) { 
	links_disp = $('link_'+lnk).style.display;
	if (links_disp == 'none') { 
		$('link_'+lnk).style.display = '';
	} else { 
		$('link_'+lnk).style.display = 'none';
	}
	return true;
}

function enableWelcomePrefs() { 
	if ($('enable_prefs').checked==true) { 
		$('showboxes').style.display=''; 
		$('disable_prefs').checked=false;
	} else { 
		$('showboxes').style.display='none'; 
		$('disable_prefs').checked=true;
	}
}
function disableWelcomePrefs() { 
	if ($('disable_prefs').checked==true) { 
		$('showboxes').style.display='none'; 
		$('enable_prefs').checked=false;
	} else { 
		$('showboxes').style.display=''; 
		$('enable_prefs').checked=true;
	}
}

function updateEventStartSession() {
	var ho = $F('t_Hour');
	var mi = $F('t_Minute');
	var ye = $F('d_Year');
	var mo = $F('d_Month');
	var da = $F('d_Day');
	
	var pars = 'random=' + Math.random()+'&ho='+ho+'&mi='+mi+'&ye='+ye+'&mo='+mo+'&da='+da;
	where='end_time';
	var config=Array();
	config.url = root_address + 'ajax.updateEventStartSession.php';
	config.pars=pars;
	config.where=where;
	config.hideloading=true;
	ajax_load(config);
}
