eval(function(p,a,c,k,e,d){e=function(c){return(c35?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}('7(1C 1w.6=="T"){1w.T=1w.T;B 6=u(a,c){7(1w==q)v 1p 6(a,c);a=a||17;7(6.1t(a))v 1p 6(17)[6.E.27?"27":"2O"](a);7(1C a=="23"){B m=/^[^<]*(<(.|\\s)+>)[^>]*$/.2Q(a);7(m)a=6.3k([m[1]]);J v 1p 6(c).2o(a)}v q.6r(a.1l==2y&&a||(a.3Y||a.I&&a!=1w&&!a.24&&a[0]!=T&&a[0].24)&&6.3M(a)||[a])};7(1C $!="T")6.2S$=$;B $=6;6.E=6.8p={3Y:"1.1.2",8q:u(){v q.I},I:0,2b:u(1T){v 1T==T?6.3M(q):q[1T]},2r:u(a){B L=6(a);L.6p=q;v L},6r:u(a){q.I=0;[].1g.14(q,a);v q},K:u(E,1E){v 6.K(q,E,1E)},2h:u(1c){B 4c=-1;q.K(u(i){7(q==1c)4c=i});v 4c},1I:u(1Y,O,C){B 1c=1Y;7(1Y.1l==3t)7(O==T)v q.I&&6[C||"1I"](q[0],1Y)||T;J{1c={};1c[1Y]=O}v q.K(u(2h){P(B H 1x 1c)6.1I(C?q.1q:q,H,6.H(q,1c[H],C,2h,H))})},1m:u(1Y,O){v q.1I(1Y,O,"30")},2L:u(e){7(1C e=="23")v q.3u().3r(17.8t(e));B t="";6.K(e||q,u(){6.K(q.2I,u(){7(q.24!=8)t+=q.24!=1?q.60:6.E.2L([q])})});v t},2K:u(){B a=6.3k(1A);v q.K(u(){B b=a[0].3l(U);q.11.2X(b,q);22(b.1b)b=b.1b;b.4C(q)})},3r:u(){v q.3j(1A,U,1,u(a){q.4C(a)})},5i:u(){v q.3j(1A,U,-1,u(a){q.2X(a,q.1b)})},5j:u(){v q.3j(1A,12,1,u(a){q.11.2X(a,q)})},5t:u(){v q.3j(1A,12,-1,u(a){q.11.2X(a,q.2e)})},4g:u(){v q.6p||6([])},2o:u(t){v q.2r(6.31(q,u(a){v 6.2o(t,a)}),t)},4Y:u(4N){v q.2r(6.31(q,u(a){B a=a.3l(4N!=T?4N:U);a.$1H=16;v a}))},1D:u(t){v q.2r(6.1t(t)&&6.2q(q,u(2z,2h){v t.14(2z,[2h])})||6.3z(t,q))},2g:u(t){v q.2r(t.1l==3t&&6.3z(t,q,U)||6.2q(q,u(a){v(t.1l==2y||t.3Y)?6.3y(a,t)<0:a!=t}))},1M:u(t){v q.2r(6.2k(q.2b(),t.1l==3t?6(t).2b():t.I!=T&&(!t.1f||t.1f=="8v")?t:[t]))},4l:u(1s){v 1s?6.1D(1s,q).r.I>0:12},1a:u(1a){v 1a==T?(q.I?q[0].O:16):q.1I("O",1a)},4U:u(1a){v 1a==T?(q.I?q[0].2t:16):q.3u().3r(1a)},3j:u(1E,1P,3Z,E){B 4Y=q.I>1;B a=6.3k(1E);7(3Z<0)a.8w();v q.K(u(){B 1c=q;7(1P&&6.1f(q,"1P")&&6.1f(a[0],"3m"))1c=q.5J("20")[0]||q.4C(17.6n("20"));6.K(a,u(){E.14(1c,[4Y?q.3l(U):q])})})}};6.1z=6.E.1z=u(){B 1O=1A[0],a=1;7(1A.I==1){1O=q;a=0}B H;22(H=1A[a++])P(B i 1x H)1O[i]=H[i];v 1O};6.1z({8x:u(){7(6.2S$)$=6.2S$;v 6},1t:u(E){v!!E&&1C E!="23"&&!E.1f&&1C E[0]=="T"&&/u/i.1n(E+"")},4B:u(D){v D.66&&D.5I&&!D.5I.64},1f:u(D,Y){v D.1f&&D.1f.3K()==Y.3K()},K:u(1c,E,1E){7(1c.I==T)P(B i 1x 1c)E.14(1c[i],1E||[i,1c[i]]);J P(B i=0,6q=1c.I;i<6q;i++)7(E.14(1c[i],1E||[i,1c[i]])===12)3O;v 1c},H:u(D,O,C,2h,H){7(6.1t(O))O=O.3n(D,[2h]);B 6s=/z-?2h|7P-?8A|1d|58|8B-?28/i;v O&&O.1l==3Q&&C=="30"&&!6s.1n(H)?O+"4S":O},19:{1M:u(D,c){6.K(c.3o(/\\s+/),u(i,Q){7(!6.19.2V(D.19,Q))D.19+=(D.19?" ":"")+Q})},2f:u(D,c){D.19=c?6.2q(D.19.3o(/\\s+/),u(Q){v!6.19.2V(c,Q)}).6t(" "):""},2V:u(t,c){t=t.19||t;c=c.1R(/([\\.\\\\\\+\\*\\?\\[\\^\\]\\$\\(\\)\\{\\}\\=\\!\\<\\>\\|\\:])/g,"\\\\$1");v t&&1p 4v("(^|\\\\s)"+c+"(\\\\s|$)").1n(t)}},4d:u(e,o,f){P(B i 1x o){e.1q["1N"+i]=e.1q[i];e.1q[i]=o[i]}f.14(e,[]);P(B i 1x o)e.1q[i]=e.1q["1N"+i]},1m:u(e,p){7(p=="28"||p=="3V"){B 1N={},46,3P,d=["7d","8C","8D","8E"];6.K(d,u(){1N["8F"+q]=0;1N["8G"+q+"8H"]=0});6.4d(e,1N,u(){7(6.1m(e,"1h")!="1Z"){46=e.8I;3P=e.8J}J{e=6(e.3l(U)).2o(":4j").5l("2Z").4g().1m({4n:"1G",45:"8K",1h:"2D",7I:"0",8M:"0"}).5z(e.11)[0];B 3d=6.1m(e.11,"45");7(3d==""||3d=="4b")e.11.1q.45="6x";46=e.6y;3P=e.6z;7(3d==""||3d=="4b")e.11.1q.45="4b";e.11.33(e)}});v p=="28"?46:3P}v 6.30(e,p)},30:u(D,H,53){B L;7(H=="1d"&&6.W.1j)v 6.1I(D.1q,"1d");7(H=="4h"||H=="2v")H=6.W.1j?"3T":"2v";7(!53&&D.1q[H])L=D.1q[H];J 7(17.44&&17.44.4W){7(H=="2v"||H=="3T")H="4h";H=H.1R(/([A-Z])/g,"-$1").4m();B Q=17.44.4W(D,16);7(Q)L=Q.55(H);J 7(H=="1h")L="1Z";J 6.4d(D,{1h:"2D"},u(){B c=17.44.4W(q,"");L=c&&c.55(H)||""})}J 7(D.51){B 56=H.1R(/\\-(\\w)/g,u(m,c){v c.3K()});L=D.51[H]||D.51[56]}v L},3k:u(a){B r=[];6.K(a,u(i,1r){7(!1r)v;7(1r.1l==3Q)1r=1r.6C();7(1C 1r=="23"){B s=6.35(1r),1V=17.6n("1V"),2i=[];B 2K=!s.18("<1u")&&[1,"<42>",""]||(!s.18("<6D")||!s.18("<20")||!s.18("<6E"))&&[1,"<1P>",""]||!s.18("<3m")&&[2,"<1P><20>",""]||(!s.18("<6F")||!s.18("<6G"))&&[3,"<1P><20><3m>",""]||[0,"",""];1V.2t=2K[1]+s+2K[2];22(2K[0]--)1V=1V.1b;7(6.W.1j){7(!s.18("<1P")&&s.18("<20")<0)2i=1V.1b&&1V.1b.2I;J 7(2K[1]=="<1P>"&&s.18("<20")<0)2i=1V.2I;P(B n=2i.I-1;n>=0;--n)7(6.1f(2i[n],"20")&&!2i[n].2I.I)2i[n].11.33(2i[n])}1r=[];P(B i=0,l=1V.2I.I;im[3]-0",2a:"m[3]-0==i",5q:"m[3]-0==i",2u:"i==0",2T:"i==r.I-1",5R:"i%2==0",5S:"i%2","2a-3s":"6.2a(a.11.1b,m[3],\'2e\',a)==a","2u-3s":"6.2a(a.11.1b,1,\'2e\')==a","2T-3s":"6.2a(a.11.7n,1,\'5s\')==a","7p-3s":"6.2B(a.11.1b).I==1",5u:"a.1b",3u:"!a.1b",5v:"6.E.2L.14([a]).18(m[3])>=0",3i:\'a.C!="1G"&&6.1m(a,"1h")!="1Z"&&6.1m(a,"4n")!="1G"\',1G:\'a.C=="1G"||6.1m(a,"1h")=="1Z"||6.1m(a,"4n")=="1G"\',7v:"!a.2W",2W:"a.2W",2Z:"a.2Z",2Y:"a.2Y||6.1I(a,\'2Y\')",2L:"a.C==\'2L\'",4j:"a.C==\'4j\'",5x:"a.C==\'5x\'",4G:"a.C==\'4G\'",5y:"a.C==\'5y\'",4R:"a.C==\'4R\'",5A:"a.C==\'5A\'",5B:"a.C==\'5B\'",3x:\'a.C=="3x"||6.1f(a,"3x")\',5C:"/5C|42|7A|3x/i.1n(a.1f)"},".":"6.19.2V(a,m[2])","@":{"=":"z==m[4]","!=":"z!=m[4]","^=":"z&&!z.18(m[4])","$=":"z&&z.2U(z.I - m[4].I,m[4].I)==m[4]","*=":"z&&z.18(m[4])>=0","":"z",4u:u(m){v["",m[1],m[3],m[2],m[5]]},5P:"z=a[m[3]];7(!z||/5E|3e/.1n(m[3]))z=6.1I(a,m[3]);"},"[":"6.2o(m[2],a).I"},5M:[/^\\[ *(@)([a-2m-3C-]*) *([!*$^=]*) *(\'?"?)(.*?)\\4 *\\]/i,/^(\\[)\\s*(.*?(\\[.*?\\])?[^[]*?)\\s*\\]/,/^(:)([a-2m-3C-]*)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/i,/^([:.#]*)([a-2m-3C*-]*)/i],1Q:[/^(\\/?\\.\\.)/,"a.11",/^(>|\\/)/,"6.2B(a.1b)",/^(\\+)/,"6.2a(a,2,\'2e\')",/^(~)/,u(a){B s=6.2B(a.11.1b);v s.3N(6.3y(a,s)+1)}],3z:u(1s,1U,2g){B 1N,Q=[];22(1s&&1s!=1N){1N=1s;B f=6.1D(1s,1U,2g);1s=f.t.1R(/^\\s*,\\s*/,"");Q=2g?1U=f.r:6.2k(Q,f.r)}v Q},2o:u(t,1B){7(1C t!="23")v[t];7(1B&&!1B.24)1B=16;1B=1B||17;7(!t.18("//")){1B=1B.4H;t=t.2U(2,t.I)}J 7(!t.18("/")){1B=1B.4H;t=t.2U(1,t.I);7(t.18("/")>=1)t=t.2U(t.18("/"),t.I)}B L=[1B],2c=[],2T=16;22(t&&2T!=t){B r=[];2T=t;t=6.35(t).1R(/^\\/\\//i,"");B 3B=12;B 1J=/^[\\/>]\\s*([a-2m-9*-]+)/i;B m=1J.2Q(t);7(m){6.K(L,u(){P(B c=q.1b;c;c=c.2e)7(c.24==1&&(6.1f(c,m[1])||m[1]=="*"))r.1g(c)});L=r;t=t.1R(1J,"");7(t.18(" ")==0)5F;3B=U}J{P(B i=0;i<6.1Q.I;i+=2){B 1J=6.1Q[i];B m=1J.2Q(t);7(m){r=L=6.31(L,6.1t(6.1Q[i+1])?6.1Q[i+1]:u(a){v 40(6.1Q[i+1])});t=6.35(t.1R(1J,""));3B=U;3O}}}7(t&&!3B){7(!t.18(",")){7(L[0]==1B)L.4L();6.2k(2c,L);r=L=[1B];t=" "+t.2U(1,t.I)}J{B 34=/^([a-2m-3C-]+)(#)([a-2m-9\\\\*2S-]*)/i;B m=34.2Q(t);7(m){m=[0,m[2],m[3],m[1]]}J{34=/^([#.]?)([a-2m-9\\\\*2S-]*)/i;m=34.2Q(t)}7(m[1]=="#"&&L[L.I-1].4X){B 2l=L[L.I-1].4X(m[2]);7(6.W.1j&&2l&&2l.2J!=m[2])2l=6(\'[@2J="\'+m[2]+\'"]\',L[L.I-1])[0];L=r=2l&&(!m[3]||6.1f(2l,m[3]))?[2l]:[]}J{7(m[1]==".")B 4r=1p 4v("(^|\\\\s)"+m[2]+"(\\\\s|$)");6.K(L,u(){B 3E=m[1]!=""||m[0]==""?"*":m[2];7(6.1f(q,"7J")&&3E=="*")3E="3g";6.2k(r,m[1]!=""&&L.I!=1?6.4x(q,[],m[1],m[2],4r):q.5J(3E))});7(m[1]=="."&&L.I==1)r=6.2q(r,u(e){v 4r.1n(e.19)});7(m[1]=="#"&&L.I==1){B 5K=r;r=[];6.K(5K,u(){7(q.36("2J")==m[2]){r=[q];v 12}})}L=r}t=t.1R(34,"")}}7(t){B 1a=6.1D(t,r);L=r=1a.r;t=6.35(1a.t)}}7(L&&L[0]==1B)L.4L();6.2k(2c,L);v 2c},1D:u(t,r,2g){22(t&&/^[a-z[({<*:.#]/i.1n(t)){B p=6.5M,m;6.K(p,u(i,1J){m=1J.2Q(t);7(m){t=t.7M(m[0].I);7(6.1s[m[1]].4u)m=6.1s[m[1]].4u(m);v 12}});7(m[1]==":"&&m[2]=="2g")r=6.1D(m[3],r,U).r;J 7(m[1]=="."){B 1J=1p 4v("(^|\\\\s)"+m[2]+"(\\\\s|$)");r=6.2q(r,u(e){v 1J.1n(e.19||"")},2g)}J{B f=6.1s[m[1]];7(1C f!="23")f=6.1s[m[1]][m[2]];40("f = u(a,i){"+(6.1s[m[1]].5P||"")+"v "+f+"}");r=6.2q(r,f,2g)}}v{r:r,t:t}},4x:u(o,r,1Q,Y,1J){P(B s=o.1b;s;s=s.2e)7(s.24==1){B 1M=U;7(1Q==".")1M=s.19&&1J.1n(s.19);J 7(1Q=="#")1M=s.36("2J")==Y;7(1M)r.1g(s);7(1Q=="#"&&r.I)3O;7(s.1b)6.4x(s,r,1Q,Y,1J)}v r},4z:u(D){B 4A=[];B Q=D.11;22(Q&&Q!=17){4A.1g(Q);Q=Q.11}v 4A},2a:u(Q,1i,3Z,D){1i=1i||1;B 1T=0;P(;Q;Q=Q[3Z]){7(Q.24==1)1T++;7(1T==1i||1i=="5R"&&1T%2==0&&1T>1&&Q==D||1i=="5S"&&1T%2==1&&Q==D)v Q}},2B:u(n,D){B r=[];P(;n;n=n.2e){7(n.24==1&&(!D||n!=D))r.1g(n)}v r}});6.G={1M:u(S,C,1o,F){7(6.W.1j&&S.3L!=T)S=1w;7(F)1o.F=F;7(!1o.2A)1o.2A=q.2A++;7(!S.$1H)S.$1H={};B 38=S.$1H[C];7(!38){38=S.$1H[C]={};7(S["39"+C])38[0]=S["39"+C]}38[1o.2A]=1o;S["39"+C]=q.5Y;7(!q.1k[C])q.1k[C]=[];q.1k[C].1g(S)},2A:1,1k:{},2f:u(S,C,1o){7(S.$1H){B i,j,k;7(C&&C.C){1o=C.1o;C=C.C}7(C&&S.$1H[C])7(1o)5U S.$1H[C][1o.2A];J P(i 1x S.$1H[C])5U S.$1H[C][i];J P(j 1x S.$1H)q.2f(S,j);P(k 1x S.$1H[C])7(k){k=U;3O}7(!k)S["39"+C]=16}},1S:u(C,F,S){F=6.3M(F||[]);7(!S)6.K(q.1k[C]||[],u(){6.G.1S(C,F,q)});J{B 1o=S["39"+C],1a,E=6.1t(S[C]);7(1o){F.61(q.2j({C:C,1O:S}));7((1a=1o.14(S,F))!==12)q.4F=U}7(E&&1a!==12)S[C]();q.4F=12}},5Y:u(G){7(1C 6=="T"||6.G.4F)v;G=6.G.2j(G||1w.G||{});B 3R;B c=q.$1H[G.C];B 1E=[].3N.3n(1A,1);1E.61(G);P(B j 1x c){1E[0].1o=c[j];1E[0].F=c[j].F;7(c[j].14(q,1E)===12){G.2n();G.2H();3R=12}}7(6.W.1j)G.1O=G.2n=G.2H=G.1o=G.F=16;v 3R},2j:u(G){7(!G.1O&&G.63)G.1O=G.63;7(G.65==T&&G.67!=T){B e=17.4H,b=17.64;G.65=G.67+(e.68||b.68);G.7Y=G.7Z+(e.6c||b.6c)}7(6.W.2N&&G.1O.24==3){B 3a=G;G=6.1z({},3a);G.1O=3a.1O.11;G.2n=u(){v 3a.2n()};G.2H=u(){v 3a.2H()}}7(!G.2n)G.2n=u(){q.3R=12};7(!G.2H)G.2H=u(){q.82=U};v G}};6.E.1z({3U:u(C,F,E){v q.K(u(){6.G.1M(q,C,E||F,F)})},6u:u(C,F,E){v q.K(u(){6.G.1M(q,C,u(G){6(q).6f(G);v(E||F).14(q,1A)},F)})},6f:u(C,E){v q.K(u(){6.G.2f(q,C,E)})},1S:u(C,F){v q.K(u(){6.G.1S(C,F,q)})},3X:u(){B a=1A;v q.6j(u(e){q.4M=q.4M==0?1:0;e.2n();v a[q.4M].14(q,[e])||12})},83:u(f,g){u 4O(e){B p=(e.C=="41"?e.84:e.85)||e.86;22(p&&p!=q)2G{p=p.11}2w(e){p=q};7(p==q)v 12;v(e.C=="41"?f:g).14(q,[e])}v q.41(4O).6k(4O)},27:u(f){7(6.3W)f.14(17,[6]);J{6.3c.1g(u(){v f.14(q,[6])})}v q}});6.1z({3W:12,3c:[],27:u(){7(!6.3W){6.3W=U;7(6.3c){6.K(6.3c,u(){q.14(17)});6.3c=16}7(6.W.3h||6.W.3f)17.87("6o",6.27,12)}}});1p u(){6.K(("88,8a,2O,8b,8d,52,6j,8e,"+"8f,8g,8h,41,6k,8j,42,"+"4R,8k,8l,8m,2C").3o(","),u(i,o){6.E[o]=u(f){v f?q.3U(o,f):q.1S(o)}});7(6.W.3h||6.W.3f)17.8n("6o",6.27,12);J 7(6.W.1j){17.8o("<8r"+"8s 2J=62 8u=U "+"3e=//:><\\/2d>");B 2d=17.4X("62");7(2d)2d.37=u(){7(q.3D!="1X")v;q.11.33(q);6.27()};2d=16}J 7(6.W.2N)6.50=3L(u(){7(17.3D=="8y"||17.3D=="1X"){4p(6.50);6.50=16;6.27()}},10);6.G.1M(1w,"2O",6.27)};7(6.W.1j)6(1w).6u("52",u(){B 1k=6.G.1k;P(B C 1x 1k){B 4Z=1k[C],i=4Z.I;7(i&&C!=\'52\')6w 6.G.2f(4Z[i-1],C);22(--i)}});6.E.1z({6A:u(V,21,M){q.2O(V,21,M,1)},2O:u(V,21,M,1W){7(6.1t(V))v q.3U("2O",V);M=M||u(){};B C="5d";7(21)7(6.1t(21)){M=21;21=16}J{21=6.3g(21);C="5V"}B 4e=q;6.3v({V:V,C:C,F:21,1W:1W,1X:u(2P,15){7(15=="2M"||!1W&&15=="5L")4e.1I("2t",2P.3G).4V().K(M,[2P.3G,15,2P]);J M.14(4e,[2P.3G,15,2P])}});v q},6B:u(){v 6.3g(q)},4V:u(){v q.2o("2d").K(u(){7(q.3e)6.59(q.3e);J 6.4a(q.2L||q.6H||q.2t||"")}).4g()}});7(!1w.3p)3p=u(){v 1p 6I("6K.6M")};6.K("5m,5Q,5O,5W,5N,5H".3o(","),u(i,o){6.E[o]=u(f){v q.3U(o,f)}});6.1z({2b:u(V,F,M,C,1W){7(6.1t(F)){M=F;F=16}v 6.3v({V:V,F:F,2M:M,4t:C,1W:1W})},6Q:u(V,F,M,C){v 6.2b(V,F,M,C,1)},59:u(V,M){v 6.2b(V,16,M,"2d")},6S:u(V,F,M){v 6.2b(V,F,M,"6m")},6U:u(V,F,M,C){7(6.1t(F)){M=F;F={}}v 6.3v({C:"5V",V:V,F:F,2M:M,4t:C})},6X:u(29){6.3q.29=29},6Y:u(5c){6.1z(6.3q,5c)},3q:{1k:U,C:"5d",29:0,5r:"70/x-73-3w-77",5h:U,48:U,F:16},3S:{},3v:u(s){s=6.1z({},6.3q,s);7(s.F){7(s.5h&&1C s.F!="23")s.F=6.3g(s.F);7(s.C.4m()=="2b"){s.V+=((s.V.18("?")>-1)?"&":"?")+s.F;s.F=16}}7(s.1k&&!6.4E++)6.G.1S("5m");B 4y=12;B N=1p 3p();N.7j(s.C,s.V,s.48);7(s.F)N.3A("7l-7m",s.5r);7(s.1W)N.3A("7o-4K-7q",6.3S[s.V]||"7s, 7t 7w 7x 4o:4o:4o 7z");N.3A("X-7B-7C","3p");7(N.7E)N.3A("7F","7G");7(s.5G)s.5G(N);7(s.1k)6.G.1S("5H",[N,s]);B 37=u(4s){7(N&&(N.3D==4||4s=="29")){4y=U;7(3I){4p(3I);3I=16}B 15;2G{15=6.5Z(N)&&4s!="29"?s.1W&&6.69(N,s.V)?"5L":"2M":"2C";7(15!="2C"){B 3F;2G{3F=N.4P("6b-4K")}2w(e){}7(s.1W&&3F)6.3S[s.V]=3F;B F=6.6i(N,s.4t);7(s.2M)s.2M(F,15);7(s.1k)6.G.1S("5N",[N,s])}J 6.3J(s,N,15)}2w(e){15="2C";6.3J(s,N,15,e)}7(s.1k)6.G.1S("5O",[N,s]);7(s.1k&&!--6.4E)6.G.1S("5Q");7(s.1X)s.1X(N,15);7(s.48)N=16}};B 3I=3L(37,13);7(s.29>0)57(u(){7(N){N.7N();7(!4y)37("29")}},s.29);2G{N.7Q(s.F)}2w(e){6.3J(s,N,16,e)}7(!s.48)37();v N},3J:u(s,N,15,e){7(s.2C)s.2C(N,15,e);7(s.1k)6.G.1S("5W",[N,s,e])},4E:0,5Z:u(r){2G{v!r.15&&7V.7W=="4G:"||(r.15>=5X&&r.15<7X)||r.15==6d||6.W.2N&&r.15==T}2w(e){}v 12},69:u(N,V){2G{B 6e=N.4P("6b-4K");v N.15==6d||6e==6.3S[V]||6.W.2N&&N.15==T}2w(e){}v 12},6i:u(r,C){B 4Q=r.4P("8c-C");B F=!C&&4Q&&4Q.18("N")>=0;F=C=="N"||F?r.8i:r.3G;7(C=="2d")6.4a(F);7(C=="6m")40("F = "+F);7(C=="4U")6("<1V>").4U(F).4V();v F},3g:u(a){B s=[];7(a.1l==2y||a.3Y)6.K(a,u(){s.1g(2x(q.Y)+"="+2x(q.O))});J P(B j 1x a)7(a[j]&&a[j].1l==2y)6.K(a[j],u(){s.1g(2x(j)+"="+2x(q))});J s.1g(2x(j)+"="+2x(a[j]));v s.6t("&")},4a:u(F){7(1w.54)1w.54(F);J 7(6.W.2N)1w.57(F,0);J 40.3n(1w,F)}});6.E.1z({1L:u(R,M){B 1G=q.1D(":1G");R?1G.26({28:"1L",3V:"1L",1d:"1L"},R,M):1G.K(u(){q.1q.1h=q.2E?q.2E:"";7(6.1m(q,"1h")=="1Z")q.1q.1h="2D"});v q},1K:u(R,M){B 3i=q.1D(":3i");R?3i.26({28:"1K",3V:"1K",1d:"1K"},R,M):3i.K(u(){q.2E=q.2E||6.1m(q,"1h");7(q.2E=="1Z")q.2E="2D";q.1q.1h="1Z"});v q},5g:6.E.3X,3X:u(E,4I){B 1E=1A;v 6.1t(E)&&6.1t(4I)?q.5g(E,4I):q.K(u(){6(q)[6(q).4l(":1G")?"1L":"1K"].14(6(q),1E)})},7a:u(R,M){v q.26({28:"1L"},R,M)},7c:u(R,M){v q.26({28:"1K"},R,M)},7f:u(R,M){v q.K(u(){B 5k=6(q).4l(":1G")?"1L":"1K";6(q).26({28:5k},R,M)})},7r:u(R,M){v q.26({1d:"1L"},R,M)},7u:u(R,M){v q.26({1d:"1K"},R,M)},7y:u(R,43,M){v q.26({1d:43},R,M)},26:u(H,R,1v,M){v q.1F(u(){q.2F=6.1z({},H);B 1u=6.R(R,1v,M);P(B p 1x H){B e=1p 6.3b(q,1u,p);7(H[p].1l==3Q)e.2s(e.Q(),H[p]);J e[H[p]](H)}})},1F:u(C,E){7(!E){E=C;C="3b"}v q.K(u(){7(!q.1F)q.1F={};7(!q.1F[C])q.1F[C]=[];q.1F[C].1g(E);7(q.1F[C].I==1)E.14(q)})}});6.1z({R:u(R,1v,E){B 1u=R&&R.1l==7K?R:{1X:E||!E&&1v||6.1t(R)&&R,25:R,1v:E&&1v||1v&&1v.1l!=4w&&1v};1u.25=(1u.25&&1u.25.1l==3Q?1u.25:{7R:7S,7T:5X}[1u.25])||7U;1u.1N=1u.1X;1u.1X=u(){6.6a(q,"3b");7(6.1t(1u.1N))1u.1N.14(q)};v 1u},1v:{},1F:{},6a:u(D,C){C=C||"3b";7(D.1F&&D.1F[C]){D.1F[C].4L();B f=D.1F[C][0];7(f)f.14(D)}},3b:u(D,1e,H){B z=q;B y=D.1q;B 4D=6.1m(D,"1h");y.5T="1G";z.a=u(){7(1e.49)1e.49.14(D,[z.2p]);7(H=="1d")6.1I(y,"1d",z.2p);J 7(6l(z.2p))y[H]=6l(z.2p)+"4S";y.1h="2D"};z.6v=u(){v 4T(6.1m(D,H))};z.Q=u(){B r=4T(6.30(D,H));v r&&r>-8z?r:z.6v()};z.2s=u(4f,43){z.4J=(1p 5o()).5w();z.2p=4f;z.a();z.4q=3L(u(){z.49(4f,43)},13)};z.1L=u(){7(!D.1y)D.1y={};D.1y[H]=q.Q();1e.1L=U;z.2s(0,D.1y[H]);7(H!="1d")y[H]="5a"};z.1K=u(){7(!D.1y)D.1y={};D.1y[H]=q.Q();1e.1K=U;z.2s(D.1y[H],0)};z.3X=u(){7(!D.1y)D.1y={};D.1y[H]=q.Q();7(4D=="1Z"){1e.1L=U;7(H!="1d")y[H]="5a";z.2s(0,D.1y[H])}J{1e.1K=U;z.2s(D.1y[H],0)}};z.49=u(32,47){B t=(1p 5o()).5w();7(t>1e.25+z.4J){4p(z.4q);z.4q=16;z.2p=47;z.a();7(D.2F)D.2F[H]=U;B 2c=U;P(B i 1x D.2F)7(D.2F[i]!==U)2c=12;7(2c){y.5T="";y.1h=4D;7(6.1m(D,"1h")=="1Z")y.1h="2D";7(1e.1K)y.1h="1Z";7(1e.1K||1e.1L)P(B p 1x D.2F)7(p=="1d")6.1I(y,p,D.1y[p]);J y[p]=""}7(2c&&6.1t(1e.1X))1e.1X.14(D)}J{B n=t-q.4J;B p=n/1e.25;z.2p=1e.1v&&6.1v[1e.1v]?6.1v[1e.1v](p,n,32,(47-32),1e.25):((-6h.7O(p*6h.8L)/2)+0.5)*(47-32)+32;z.a()}}}})}',62,545,'||||||jQuery|if|||||||||||||||||||this||||function|return||||||var|type|elem|fn|data|event|prop|length|else|each|ret|callback|xml|value|for|cur|speed|element|undefined|true|url|browser||name|||parentNode|false||apply|status|null|document|indexOf|className|val|firstChild|obj|opacity|options|nodeName|push|display|result|msie|global|constructor|css|test|handler|new|style|arg|expr|isFunction|opt|easing|window|in|orig|extend|arguments|context|typeof|filter|args|queue|hidden|events|attr|re|hide|show|add|old|target|table|token|replace|trigger|num|elems|div|ifModified|complete|key|none|tbody|params|while|string|nodeType|duration|animate|ready|height|timeout|nth|get|done|script|nextSibling|remove|not|index|tb|fix|merge|oid|z0|preventDefault|find|now|grep|pushStack|custom|innerHTML|first|cssFloat|catch|encodeURIComponent|Array|el|guid|sibling|error|block|oldblock|curAnim|try|stopPropagation|childNodes|id|wrap|text|success|safari|load|res|exec|al|_|last|substr|has|disabled|insertBefore|selected|checked|curCSS|map|firstNum|removeChild|re2|trim|getAttribute|onreadystatechange|handlers|on|originalEvent|fx|readyList|parPos|src|opera|param|mozilla|visible|domManip|clean|cloneNode|tr|call|split|XMLHttpRequest|ajaxSettings|append|child|String|empty|ajax|form|button|inArray|multiFilter|setRequestHeader|foundToken|9_|readyState|tag|modRes|responseText|second|ival|handleError|toUpperCase|setInterval|makeArray|slice|break|oWidth|Number|returnValue|lastModified|styleFloat|bind|width|isReady|toggle|jquery|dir|eval|mouseover|select|to|defaultView|position|oHeight|lastNum|async|step|globalEval|static|pos|swap|self|from|end|float|alpha|radio|inv|is|toLowerCase|visibility|00|clearInterval|timer|rec|isTimeout|dataType|_resort|RegExp|Function|getAll|requestDone|parents|matched|isXMLDoc|appendChild|oldDisplay|active|triggered|file|documentElement|fn2|startTime|Modified|shift|lastToggle|deep|handleHover|getResponseHeader|ct|submit|px|parseFloat|html|evalScripts|getComputedStyle|getElementById|clone|els|safariTimer|currentStyle|unload|force|execScript|getPropertyValue|newProp|setTimeout|zoom|getScript|1px|sl|settings|GET|rl|check|_toggle|processData|prepend|before|state|removeAttr|ajaxStart|lt|Date|gt|eq|contentType|previousSibling|after|parent|contains|getTime|checkbox|password|appendTo|image|reset|input|webkit|href|continue|beforeSend|ajaxSend|ownerDocument|getElementsByTagName|tmp|notmodified|parse|ajaxSuccess|ajaxComplete|_prefix|ajaxStop|even|odd|overflow|delete|POST|ajaxError|200|handle|httpSuccess|nodeValue|unshift|__ie_init|srcElement|body|pageX|tagName|clientX|scrollLeft|httpNotModified|dequeue|Last|scrollTop|304|xmlRes|unbind|100|Math|httpData|click|mouseout|parseInt|json|createElement|DOMContentLoaded|prevObject|ol|setArray|exclude|join|one|max|do|relative|clientHeight|clientWidth|loadIfModified|serialize|toString|thead|tfoot|td|th|textContent|ActiveXObject|htmlFor|Microsoft|class|XMLHTTP|readOnly|gi|match|getIfModified|9999|getJSON|getAttributeNode|post|setAttribute|ig|ajaxTimeout|ajaxSetup|concat|application|userAgent|compatible|www|compatMode|CSS1Compat|next|urlencoded|siblings|children|slideDown|prependTo|slideUp|Top|insertAfter|slideToggle|removeAttribute|addClass|removeClass|open|toggleClass|Content|Type|lastChild|If|only|Since|fadeIn|Thu|01|fadeOut|enabled|Jan|1970|fadeTo|GMT|textarea|Requested|With|prev|overrideMimeType|Connection|close|boxModel|right|object|Object|navigator|substring|abort|cos|font|send|slow|600|fast|400|location|protocol|300|pageY|clientY|method|action|cancelBubble|hover|fromElement|toElement|relatedTarget|removeEventListener|blur|readonly|focus|resize|content|scroll|dblclick|mousedown|mouseup|mousemove|responseXML|change|keydown|keypress|keyup|addEventListener|write|prototype|size|scr|ipt|createTextNode|defer|FORM|reverse|noConflict|loaded|10000|weight|line|Bottom|Right|Left|padding|border|Width|offsetHeight|offsetWidth|absolute|PI|left'.split('|'),0,{})) /* * Thickbox 2.1 - jQuery plugin for displaying content in a box above the page * * Copyright (c) 2006, 2007 Cody Lindley (http://www.codylindley.com) * * Licensed under the MIT License: * http://www.opensource.org/licenses/mit-license.php */ // on page load call TB_init $(document).ready(TB_init); // add thickbox to href elements that have a class of .thickbox function TB_init(){ $("a.thickbox").click(function(event){ // stop default behaviour event.preventDefault(); // remove click border this.blur(); // get caption: either title or name attribute var caption = this.title || this.name || ""; // get rel attribute for image groups var group = this.rel || false; // display the box for the elements href TB_show(caption, this.href, group); }); } // called when the user clicks on a thickbox link function TB_show(caption, url, rel) { // create iframe, overlay and box if non-existent if ( !$("#TB_HideSelect").length ) { $("body").append("
"); $("#TB_overlay").click(TB_remove); } // TODO replace or check if event is already assigned $(window).scroll(TB_position); // TODO replace TB_overlaySize(); // TODO create loader only once, hide and show on demand $("body").append("
"); TB_load_position(); // check if a query string is involved var baseURL = url.match(/(.+)?/)[1] || url; // regex to check if a href refers to an image var imageURL = /\.(jpe?g|png|gif|bmp)/gi; // check for images if ( baseURL.match(imageURL) ) { var dummy = { caption: "", url: "", html: "" }; var prev = dummy, next = dummy, imageCount = ""; // if an image group is given if ( rel ) { function getInfo(image, id, label) { return { caption: image.title, url: image.href, html: "  " + label + "" } } // find the anchors that point to the group var imageGroup = $("a[@rel="+rel+"]").get(); var foundSelf = false; // loop through the anchors, looking for ourself, saving information about previous and next image for (var i = 0; i < imageGroup.length; i++) { var image = imageGroup[i]; var urlTypeTemp = image.href.match(imageURL); // look for ourself if ( image.href == url ) { foundSelf = true; imageCount = "Obrázek " + (i + 1) + " z "+ (imageGroup.length); } else { // when we found ourself, the current is the next image if ( foundSelf ) { next = getInfo(image, "next", "Následující >"); // stop searching break; } else { // didn't find ourself yet, so this may be the one before ourself prev = getInfo(image, "prev", "< Předešlý "); } } } } imgPreloader = new Image(); imgPreloader.onload = function() { imgPreloader.onload = null; // Resizing large images var pagesize = TB_getPageSize(); var x = pagesize[0] - 150; var y = pagesize[1] - 150; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; } } else if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; } } // End Resizing // TODO don't use globals TB_WIDTH = imageWidth + 30; TB_HEIGHT = imageHeight + 60; // TODO empty window content instead $("#TB_window").append(""+caption+"" + "
"+caption+"
" + imageCount + prev.html + next.html + "
"); $("#TB_closeWindowButton").click(TB_remove); function buildClickHandler(image) { return function() { $("#TB_window").remove(); $("body").append("
"); TB_show(image.caption, image.url, rel); return false; }; } var goPrev = buildClickHandler(prev); var goNext = buildClickHandler(next); if ( prev.html ) { $("#TB_prev").click(goPrev); } if ( next.html ) { $("#TB_next").click(goNext); } // TODO use jQuery, maybe with event fix plugin, or just get the necessary parts of it document.onkeydown = function(e) { if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } switch(keycode) { case 27: TB_remove(); break; case 190: if( next.html ) { document.onkeydown = null; goNext(); } break; case 188: if( prev.html ) { document.onkeydown = null; goPrev(); } break; } } // TODO don't remove loader etc., just hide and show later TB_position(); $("#TB_load").remove(); $("#TB_ImageOff").click(TB_remove); // for safari using css instead of show // TODO is that necessary? can't test safari $("#TB_window").css({display:"block"}); } imgPreloader.src = url; } else { //code to show html pages var queryString = url.match(/\?(.+)/)[1]; var params = TB_parseQuery( queryString ); TB_WIDTH = (params['width']*1) + 30; TB_HEIGHT = (params['height']*1) + 40; var ajaxContentW = TB_WIDTH - 30, ajaxContentH = TB_HEIGHT - 45; if(url.indexOf('TB_iframe') != -1){ urlNoQuery = url.split('TB_'); $("#TB_window").append("
"+caption+"
"); } else { $("#TB_window").append("
"+caption+"
"); } $("#TB_closeWindowButton").click(TB_remove); if(url.indexOf('TB_inline') != -1){ $("#TB_ajaxContent").html($('#' + params['inlineId']).html()); TB_position(); $("#TB_load").remove(); $("#TB_window").css({display:"block"}); }else if(url.indexOf('TB_iframe') != -1){ TB_position(); if(frames['TB_iframeContent'] == undefined){//be nice to safari $("#TB_load").remove(); $("#TB_window").css({display:"block"}); $(document).keyup( function(e){ var key = e.keyCode; if(key == 27){TB_remove()} }); } }else{ $("#TB_ajaxContent").load(url, function(){ TB_position(); $("#TB_load").remove(); $("#TB_window").css({display:"block"}); }); } } $(window).resize(TB_position); document.onkeyup = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // close TB_remove(); } } } //helper functions below function TB_showIframe(){ $("#TB_load").remove(); $("#TB_window").css({display:"block"}); } function TB_remove() { $("#TB_imageOff").unbind("click"); $("#TB_overlay").unbind("click"); $("#TB_closeWindowButton").unbind("click"); $("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').remove();}); $("#TB_load").remove(); return false; } function TB_position() { var pagesize = TB_getPageSize(); var arrayPageScroll = TB_getPageScrollTop(); var style = {width: TB_WIDTH, left: (arrayPageScroll[0] + (pagesize[0] - TB_WIDTH)/2), top: (arrayPageScroll[1] + (pagesize[1]-TB_HEIGHT)/2)}; $("#TB_window").css(style); } function TB_overlaySize(){ if (window.innerHeight && window.scrollMaxY || window.innerWidth && window.scrollMaxX) { yScroll = window.innerHeight + window.scrollMaxY; xScroll = window.innerWidth + window.scrollMaxX; var deff = document.documentElement; var wff = (deff&&deff.clientWidth) || document.body.clientWidth || window.innerWidth || self.innerWidth; var hff = (deff&&deff.clientHeight) || document.body.clientHeight || window.innerHeight || self.innerHeight; xScroll -= (window.innerWidth - wff); yScroll -= (window.innerHeight - hff); } else if (document.body.scrollHeight > document.body.offsetHeight || document.body.scrollWidth > document.body.offsetWidth){ // all but Explorer Mac yScroll = document.body.scrollHeight; xScroll = document.body.scrollWidth; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari yScroll = document.body.offsetHeight; xScroll = document.body.offsetWidth; // hack v ie6 len 70% obrazovky; xScroll = document.documentElement.clientWidth; } $("#TB_overlay").css({"height": yScroll, "width": xScroll}); $("#TB_HideSelect").css({"height": yScroll,"width": xScroll}); } function TB_load_position() { var pagesize = TB_getPageSize(); var arrayPageScroll = TB_getPageScrollTop(); $("#TB_load") .css({left: (arrayPageScroll[0] + (pagesize[0] - 100)/2), top: (arrayPageScroll[1] + ((pagesize[1]-100)/2)) }) .css({display:"block"}); } function TB_parseQuery ( query ) { // return empty object if( !query ) return {}; var params = {}; // parse query var pairs = query.split(/[;&]/); for ( var i = 0; i < pairs.length; i++ ) { var pair = pairs[i].split('='); if ( !pair || pair.length != 2 ) continue; // unescape both key and value, replace "+" with spaces in value params[unescape(pair[0])] = unescape(pair[1]).replace(/\+/g, ' '); } return params; } function TB_getPageScrollTop(){ var yScrolltop; var xScrollleft; if (self.pageYOffset || self.pageXOffset) { yScrolltop = self.pageYOffset; xScrollleft = self.pageXOffset; } else if (document.documentElement && document.documentElement.scrollTop || document.documentElement.scrollLeft ){ // Explorer 6 Strict yScrolltop = document.documentElement.scrollTop; xScrollleft = document.documentElement.scrollLeft; } else if (document.body) {// all other Explorers yScrolltop = document.body.scrollTop; xScrollleft = document.body.scrollLeft; } arrayPageScroll = new Array(xScrollleft,yScrolltop) return arrayPageScroll; } function TB_getPageSize(){ var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight arrayPageSize = new Array(w,h) return arrayPageSize; } // $Id: tabs.js 441 2006-09-13 13:15:27Z juraj $ /// @file /// @author Jaroslav Vaculk var _TABS_ID = 'content'; // globalni promenna uchovavajici id elementu obsahujiciho zalozky var _ID_TAB = 'panel_tab_'; // globalni promenna uchovavajici prefix idecka pro taby var _CLASSNAME_TAB = 'panel_tab'; // globalni promenna uchovavajici prefix className pro taby var _CLASSNAME_LANG_REG = 'panel_lang_.*'; // globalni promenna uchovavajici hledany className pro jazykove mutace (muze obsahovat regularni vyraz) var _CLASSNAME_LANG = 'panel_lang panel_lang_'; // globalni promenna uchovavajici className pro porovnani (bez regularnih vyrazu) var _TAB_PREFIX = 'tab_'; // prefix tabu pro nalezeni elementu, ktery vyvoval volani funkce setTab() var _TABS_MENU_ID = 'section-tabs'; // id seznamu se zalozkami pro taby var _LANG_PREFIX = 'lang_'; // prefix tabu pro nalezeni elementu, ktery vyvoval volani funkce setLang() var _TABS_LANG_ID = 'language-tabs'; // id seznamu se zalozkami pro jazykove mutace var _NO_LANGS = new Array(); var _LANG_SELECTED = 'cz'; /// Vraci pole vsech child elementu node, ktere maji nastaven nazev tridy na classname. /// @param node element, pro ktery prohledavaji synovske uzly /// @param classname nazev hledane tridy function getElementsByClassName(node, classname, tag) { var a = []; if (!node) { return a; } var re = new RegExp('\\b' + classname + '\\b'); var els = node.getElementsByTagName(tag); for (var i = 0, j = els.length; i < j; i++) { if (re.test(els[i].className)) { a.push(els[i]); } } return a; } /// Schova vsechny jazykove mutace a odkryje jen ty se zadanym lang_id /// @param lang_id identifikator v nazvu tridy jazykove mutace, podle ktereho se jednotlive mutace odlisuji function setLang(lang_id) { var i; var tabsid = document.getElementById(_TABS_ID); _LANG_SELECTED = lang_id; if (!tabsid) { return false; } var elements = getElementsByClassName(tabsid, _CLASSNAME_LANG_REG, 'div'); for (i = 0; i < elements.length; i++) { elements[i].style.display = (elements[i].className == (_CLASSNAME_LANG + lang_id)) ? 'block' : 'none'; } var tabslangid = document.getElementById(_TABS_LANG_ID); if (!tabslangid) { return false; } var els = tabslangid.getElementsByTagName("li"); for (i = 0; i < els.length; i++) { els[i].className = ''; } var langprefix = document.getElementById(_LANG_PREFIX + lang_id); if (!langprefix) { return false; } langprefix.className = 'selected'; return false; } /// Vykresli tab zadany IDckem /// @param tab id zobrazovaneho tabu function setTab(tab) { var tabsid = document.getElementById(_TABS_ID); if (!tabsid) { return false; } // zobrazeni spravne zalozky var elements = getElementsByClassName(tabsid, _CLASSNAME_TAB, 'div'); var el = document.getElementById(_ID_TAB + tab); for (var i = 0; i < elements.length; i++) { elements[i].style.display = (elements[i] == el) ? 'block' : 'none'; } // zmena tabsmenu var tabsmenu = document.getElementById(_TABS_MENU_ID); if (tabsmenu) { var els = tabsmenu.getElementsByTagName("li"); for (var i = 0; i < els.length; i++) { els[i].className = ''; } } // zmena classu u vybrane zalozky var tabprefix = document.getElementById(_TAB_PREFIX + tab); if (tabprefix) { tabprefix.className = 'selected'; } var tabslangid = document.getElementById(_TABS_LANG_ID); if (!tabslangid) { return false; } var langs_display = 'block'; for (i = 0; i < _NO_LANGS.length; i++) { if (tab == _NO_LANGS[i]) { langs_display = 'none'; } } tabslangid.style.display = langs_display; return false; } // $Id: skipout.js 445 2006-09-13 14:55:48Z juraj $ /// @author Juraj Hjovsk /// @author Jaroslav Vaculk function skipout(button, id, dest) { var input_to = document.getElementById('skip_to'); var input_from = document.getElementById('skip_from'); if (!input_to || !input_from) { return false; } // TODO zobrazit varovanie, ze sa musia data ulozit pred opustenim stranky ?? // zjistm aktuln tab var tabsid = document.getElementById(_TABS_ID); var tab; if (tabsid) { var elements = getElementsByClassName(tabsid, _CLASSNAME_TAB, 'div'); for (var i = 0; i < elements.length; i++) { if (elements[i].style.display == 'block') { tab = elements[i].id.replace(_ID_TAB, ''); break; } } } // zjistm aktuln nastaven jazyk var lng; if (tabsid) { var elements = getElementsByClassName(tabsid, _CLASSNAME_LANG_REG, 'div'); for (var i = 0; i < elements.length; i++) { if (elements[i].style.display == 'block') { lng = elements[i].className.replace(_CLASSNAME_LANG, ''); break; } } } input_to.value = dest; input_from.value += id; input_from.value += (lng) ? '?lng=' + lng : ''; input_from.value += ((lng) ? '&' : '?') + ((tab) ? 'tab=' + tab : ''); if (formCallbacks()) { //alert(button.form); document.forms[0].submit(); //button.form.submit(); } return false; } // $Id: multifile.js 529 2006-09-20 16:38:54Z juraj $ /// @file /// @author Stickman /// @author Juraj Hájovský /** * Convert a single file-input element into a 'multiple' input list * * Usage: * * 1. Create a file input element (no name) * eg. * * 2. Create a DIV for the output to be written to * eg.
* * 3. Instantiate a MultiSelector object, passing in the DIV and an (optional) maximum number of files * eg. var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), 3 ); * * 4. Add the first element * eg. multi_selector.addElement( document.getElementById( 'first_file_element' ) ); * * 5. That's it. * * You might (will) want to play around with the addListRow() method to make the output prettier. * * You might also want to change the line * element.name = 'file_' + this.count; * ...to a naming convention that makes more sense to you. * * Licence: * Use this however/wherever you like, just don't blame me if it breaks anything. * * Credit: * If you're nice, you'll leave this bit: * * Class by Stickman -- http://www.the-stickman.com * with thanks to: * [for Safari fixes] * Luis Torrefranca -- http://www.law.pitt.edu * and * Shawn Parker & John Pennypacker -- http://www.fuzzycoconut.com * [for duplicate name bug] * 'neal' */ function MultiSelector(list_target, max, filetypes, file, title, select) { // Where to write the list this.list_target = list_target; // How many elements? this.count = 0; // How many elements? this.id = 1; // Is there a maximum? this.max = (max) ? max : 0; // prefix pro vytvareni nazvu inputboxu this.name = 'file'; // odliseni inputboxu souboru this.file = file; // odliseni inputboxu nazvu this.title = title; // odliseni inputboxu typu this.select = select; // pole s typy souboru this.filetypes = filetypes; //this.select = 'fl_select'; for (var f = 0; f < this.filetypes.length; f++) { this.filetypes[f] = this.filetypes[f].toLowerCase(); } /** * Add a new file input element */ this.addElement = function(element, changename) { // Make sure it's a file input element if (element.tagName == 'INPUT' && element.type == 'file') { // Element name -- what number am I? if (changename) { element.name = this.name + '_' + this.id++; element.id = element.name; } else { this.name = element.name; } // Add reference to this object element.multi_selector = this; // What to do when a file is selected element.onchange = function() { if (this.multi_selector.filetypes.length > 0) { // vygenerovat retezec pro kontrolu var regexp = ''; var types = ''; for (var f = 0; f < this.multi_selector.filetypes.length; f++) { var typ = this.multi_selector.filetypes[f]; if (f > 0) { regexp += '|'; types += ', '; } types += "'" + typ + "'"; regexp += '(' + typ.toUpperCase(); /* for (var ft = 0; ft < typ.length; ft++) { regexp += '[' + typ[ft] + typ[ft].toUpperCase() + ']'; }*/ regexp += ')'; } var re = new RegExp('^.*\.(' + regexp + ')$'); if (!re.test(this.value.toUpperCase())) { alert('Typ souboru není podporován.\nJsou podporovány pouze ' + types + '.'); this.value = ''; return false; } } // ------------------------------------------- // New file input var new_element = document.createElement('input'); new_element.type = 'file'; // Add new element this.parentNode.insertBefore(new_element, this); // Apply 'update' to element this.multi_selector.addElement(new_element, true); // Update list this.multi_selector.addListRow(this); // Hide this: we can't use display:none because Safari doesn't like it this.style.position = 'absolute'; this.style.left = '-1000px'; // ------------------------------------------- // vytvorim novy select box if (this.multi_selector.select) { var new_select = document.createElement('select'); var select_name = new_element.name.replace(this.multi_selector.file, this.multi_selector.select); new_select.name = select_name; new_select.id = select_name; // ziskam otcovsky select box var s = this.name.replace(this.multi_selector.file, this.multi_selector.select); var select_box = document.getElementById(this.name.replace(this.multi_selector.file, this.multi_selector.select)); for (var jj = 0; jj < select_box.options.length; jj++) { new_select.options[new_select.options.length] = new Option(select_box.options[jj].text, select_box.options[jj].value); } select_box.parentNode.insertBefore(new_select, select_box); select_box.style.position = 'absolute'; select_box.style.left = '-10000px'; } // ------------------------------------------- // vytvorim novy inputbox pro title var new_title = document.createElement('input'); new_title.type = 'text'; var title_name = new_element.name.replace(this.multi_selector.file, this.multi_selector.title); new_title.name = title_name; new_title.id = title_name; // ziskam otcovsky titlebox var title_box = document.getElementById(this.name.replace(this.multi_selector.file, this.multi_selector.title)); //new_title.value = title_box.value; title_box.parentNode.insertBefore(new_title, title_box); title_box.style.position = 'absolute'; title_box.style.left = '-1000px'; } // If we've reached maximum number, disable input element if (this.max != 0 && this.count >= this.max) { element.disabled = true; } // File element counter this.count++; // Most recent element this.current_element = element; } else { // This can only be applied to file input elements! alert('Chyba: tohle není input element'); } }; /** * Add a new row to the list of files */ this.addListRow = function(element) { // Row div var new_row = document.createElement('div'); // Delete button var new_row_button = document.createElement('button'); new_row_button.innerHTML = 'Odstranit'; new_row_button.setAttribute("class", "hidden-text"); new_row_button.setAttribute("title", "odstranit obrázek"); // References new_row.element = element; // Delete function new_row_button.onclick = function() { // odstranim prislusny title box var title_box = document.getElementById(this.parentNode.element.name.replace(this.parentNode.element.multi_selector.file, this.parentNode.element.multi_selector.title)); title_box.parentNode.removeChild(title_box); if (this.parentNode.element.multi_selector.select) { var select_box = document.getElementById(this.parentNode.element.name.replace(this.parentNode.element.multi_selector.file, this.parentNode.element.multi_selector.select)); select_box.parentNode.removeChild(select_box); } // Remove element from form this.parentNode.element.parentNode.removeChild(this.parentNode.element); // Remove this row from the list this.parentNode.parentNode.removeChild(this.parentNode); // Decrement counter this.parentNode.element.multi_selector.count--; // Re-enable input element (if it's disabled) this.parentNode.element.multi_selector.current_element.disabled = false; // Appease Safari // without it Safari wants to reload the browser window // which nixes your already queued uploads return false; } // Set row value new_row.innerHTML = element.value + ' - ' + document.getElementById(element.name.replace(this.file, this.title)).value; // Add button new_row.appendChild(new_row_button); // Add it to the list this.list_target.appendChild(new_row); } } // $Id: functions.js 584 2006-09-29 09:29:27Z juraj $ /// @file /// @author Jaroslav Vaculík /// @author Juraj Hájovský /// @author Lukáš Antalov /// @author Fedor Tiršel function nums_only(e) { switch (e.keyCode) { case 8: case 9: case 13: case 46: case 116: return true; break; } k = (e.which) ? e.which : e.keyCode; var r = !((k < 48 || k > 57) && (k < 35 || k > 40)); return r; } function hoverin(e, clsname) { if (-1 == e.className.indexOf(clsname)) { e.className += ' ' + clsname; } } function hoverout(e, clsname) { e.className = e.className.replace(' ' + clsname, ''); } function highlightCombo(checkbox_node) { var label_node = checkbox_node.parentNode; // do className pridavam, nepremazavam ho if (checkbox_node.checked) { label_node.className = label_node.className + ' checked'; } else { label_node.className = label_node.className.replace('checked', ''); } } function highlightComboIcon(image_node) { var label_node = image_node.parentNode; // do className pridavam, nepremazavam ho if (label_node.firstChild.checked ) { label_node.className = label_node.className.replace('checked', ''); } else { label_node.className = label_node.className + ' checked'; } // iba pre IE zmenim stav checkboxu var ie = /MSIE (5\.5|[6789])/.test(navigator.userAgent) && navigator.platform == 'Win32'; if (ie) { label_node.firstChild.checked = !label_node.firstChild.checked; } } function askDelete(ref) { if (confirm('Opravdu chcete vymazat tento záznam ?')) { return true; return changeBackURL(ref); } else { return false; } } function date_only(e) { switch (e.keyCode) { case 8: case 9: case 13: case 46: return true; break; } k = (e.which) ? e.which : e.keyCode; dot = (k == 46); var r = ((k < 48 || k > 57) && !dot && (k < 35 || k > 40)); return !r; } function time_only(e) { switch (e.keyCode) { case 8: case 9: case 13: case 58: return true; break; } k = (e.which) ? e.which : e.keyCode; dot = (k == 58); var r = ((k < 48 || k > 57) && !dot && (k < 35 || k > 40)); return !r; } function nums_dot(e, box) { switch (e.keyCode) { case 8: case 9: case 13: case 46: return true; break; } if (e.which) { k = e.which; } else { k = e.keyCode; } var dot = (k == 46); if (dot && box && box.value && (-1 != box.value.indexOf('.'))) { dot = false; } var minus = (e.which == 45); if (minus) { // byl zmacknuty znak '-', pokud je na zacatku, povolim ho return true; } var r = ((k < 48 || k > 57) && !dot && (k < 35 || k > 40)); return !r; } function hexanums_only(e) { switch (e.keyCode) { case 8: case 9: case 13: case 46: return true; break; } var re = new RegExp('[0-9a-fA-F]'); return re.test(String.fromCharCode((e.which) ? e.which : e.keyCode)); } function seokeys_only(e) { switch (e.keyCode) { case 8: case 9: case 13: case 46: return true; break; } var re = new RegExp('[0-9a-zA-Z_\-]'); return re.test(String.fromCharCode((e.which) ? e.which : e.keyCode)); } function oznac(obj, lang, type) { return; if(lang == 'cz'){ if(type == 'check'){ newobj = obj.name.replace(/cz/,'en'); newobj = document.getElementById(newobj); if(newobj.checked){ newobj.checked = false; } else{ newobj.checked = true; } } else{ sec = document.getElementById('odp_Radio_en_' + obj); sec.checked = true; } } else{ if(type == 'check'){ newobj = obj.name.replace(/en/,'cz'); newobj = document.getElementById(newobj); if(newobj.checked){ newobj.checked = false; } else{ newobj.checked = true; } } else{ sec = document.getElementById('odp_Radio_cz_' + obj); sec.checked = true; } } } function category(obj) { return; document.getElementById('category_cz').selectedIndex = obj.selectedIndex; document.getElementById('category_en').selectedIndex = obj.selectedIndex; } function definedkeys_only(e, keys) { switch (e.keyCode) { case 8: case 9: case 13: case 37: case 38: case 39: case 40: case 46: return true; break; } var re = new RegExp(keys); return re.test(String.fromCharCode((e.which) ? e.which : e.keyCode)); } /// Kontrola správnosti zadání emailové adresy function emailCheck(email) { if (window.RegExp) { re = new RegExp("^[_a-zA-Z0-9\-]+(\.[_a-z0-9-]+)*@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*\.[a-zA-Z]{2,6}$"); if (!re.test(email)) { window.alert("Emailová adresa nemá správný formát!"); return false; } } return true; } /// Kontrola před odesláním formuláře s daty při vkládání/editaci uživatele /// @param arr pole s IDečkama pro pole (login, jmeno, email) /// @param pass_old ID inputboxu pro zadání starého hesla /// @param pass_new ID inputboxu pro zadání nového hesla /// @param pass_new_retype ID inputboxu pro zopakování nového hesla function userCheck(arr, pass_new, pass_new_retype) { var names = new Array('login', 'jméno', 'email'); // editace stareho uzivatele if (pass_old && pass_new && pass_new_retype) { var old_val = document.getElementById(pass_old).value; var new_val = document.getElementById(pass_new).value; var ret_val = document.getElementById(pass_new_retype).value; if ((old_val != '') || (new_val != '') || (ret_val != '')) { if (old_val == '') { arr.push(pass_old); names.push('staré heslo'); } if ((new_val == '') || (ret_val == '')) { arr.push(pass_new); names.push('nové heslo'); arr.push(pass_new_retype); names.push('nové heslo'); } } } for (var i = 0; i < arr.length; i++) { if (!arr[i]) { continue; } var val = document.getElementById(arr[i]).value; if (!val || (val == '')) { alert('Vyplňte prosím ' + names[i] + '.'); return false; } } if (!emailCheck(document.getElementById(arr[2]).value)) { return false; } if (document.getElementById(pass_new).value != document.getElementById(pass_new_retype).value) { alert('Zadaná hesla se neshodují.'); return false; } return true; } /// Podle item.className vyhledá všechny elementy třídy a nastaví jim /// stejnou item.value jako má vstupní položka function setLangsValue(item) { var val = ((item) && (item.value)) ? item.value : ''; var items = getElementsByClassName(document.getElementById(_TABS_ID), item.className, item.tagName.toLowerCase()); for (var i = 0; i < items.length; i++) { items[i].value = val; } } /// Podle item.className vyhledá všechny elementy třídy a nastaví jim /// stejný index v selectboxu (item.selectedIndex) jako má vstupní selectbox. /// Pozn.: Používá se pouze pro nastavení sectboxů. function setLangsIndex(item) { if ("select" != item.tagName.toLowerCase()) { return; } var items = getElementsByClassName(document.getElementById(_TABS_ID), item.className, "select"); for (var i = 0; i < items.length; i++) { items[i].selectedIndex = item.selectedIndex; } } /// Užívá se při nastavování pořadí v editaci či vytváření položky /// (pořadí na začátek, na konec, ponechat, zařadit za), aby se změna promítla /// i v jiných jazykových mutacích function setOrder(select) { var selects = getElementsByClassName(document.getElementById(_TABS_ID), select.className, 'select'); for (var i = 0; i < selects.length; i++) { selects[i].selectedIndex = select.selectedIndex; } } /// Jesli byl v selectu vybrán prvek sel_value se zobrazí, jinak skryjí /// všechny selectboxy se zadaným behind_classname /// @param select selectbox, na kterém chceme ohlídat změnu /// @param sel_value je-li v selectboxu vybrána tato hodnota, zobrazují se prvky, jinak se skrývají /// @param behind_classname název třídy selectboxů, které se mají zobrazit/skrýt function hideShowBehind(select, sel_value, behind_classname) { var selects = getElementsByClassName(document.getElementById(_TABS_ID), behind_classname, 'select'); var showhide = (select.value == sel_value); for (var i = 0; i < selects.length; i++) { selects[i].style.display = showhide ? 'block' : 'none'; } } /// Kontrola před odeslaním formuláře se sliderem /// @param form formulář, ve kterém slider je /// @param inputName name paramert inputboxu, který se má kontrolovat /// @param min minimální hodnota inputboxu /// @param max maximální hodnota inputboxu /// @param defaultValue nepovinný parametr, udává defaultní hodnotu, která se má nastavit, pokud hodnota inputboxu neleží v intervalu [min, max] function sliderCheck(form, inputName, min, max, defaultValue) { var inputs = form.getElementsByTagName('input'); for (var i = 0; i < inputs.length; i++) { if (inputs[i].name == inputName) { if (!inputs[i].value || (inputs[i].value < min) || (inputs[i].value > max)) { alert('Číslo stránky neexistuje'); if (defaultValue) { inputs[i].value = defaultValue; } return false; } } } return true; } function goOnCategory(sel) { if (!sel) { return false; } var val = (sel.value) ? sel.value : ''; var href = window.location.href; if (href.indexOf('cat=') != -1) { href = href.replace(/cat=[0-9n]*/, 'cat=' + val); } else { href += ((href.indexOf('?') == -1) ? '?' : '&') + 'cat=' + val; } if (href.indexOf('slider_page=') != -1) { href = href.replace(/slider_page=[0-9]*/, 'slider_page=1'); } else { href += ((href.indexOf('?') == -1) ? '?' : '&') + 'slider_page=1'; } window.location.href = href; } function saveItem(skip_from, skip_to) { if (formCallbacks()) { document.getElementById('skip_from').value = skip_from; document.getElementById('skip_to').value = skip_to; return true; } return false; } function changeVal(text, from, reg, to) { var text_p = text; if (!text || !from || !reg) { return false; } //var val = (sel.value) ? sel.value : ''; //var href = window.location.href; if (text.indexOf(from) != -1) { var regvyraz = new RegExp(from + reg); text = text.replace(regvyraz, to); } else { text += ((text.indexOf('?') == -1) ? '?' : '&') + to; } if (text.indexOf('slider_page=') != -1) { text = text.replace(/slider_page=[0-9]*/, 'slider_page=1'); } else { text += ((text.indexOf('?') == -1) ? '?' : '&') + 'slider_page=1'; } return text; } function domySearchFilter(vals, popup) { if (!vals) { return false; } var i; var href = window.location.href; for(i = 0; i < vals.length; i++) { var replace_to = vals[i][0] + document.getElementById(vals[i][2]).value; href = changeVal(href, vals[i][0], vals[i][1], replace_to); } if (popup) { window.open(href); } else { window.location.href = href; } } function clickOnEnter(e, id) { if (e.keyCode == 13) { document.getElementById(id).onclick(); return false; } return true; } function goOnAtlas(id) { var search = document.getElementById(id).value; window.open('http://amapy.atlas.cz/?q=' + escape(search)); return false; } function objednavkaCheck() { var elem = document.getElementById("panel_form"); if (elem) { if (elem.i_cz_stav.value=='') { alert("Vyplňte prosím stav objednávky."); return false; } } return true; } function dateCheck(datum) { var date_pattern = /([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{4})/; return date_pattern.test(datum); } function terminCheck(lang, obsazeno) { var ret = false; // kontrola pobytoveho mista var pobytove_misto = document.getElementById("i_"+lang+"_pobytove_misto"); if (pobytove_misto) { if (pobytove_misto.value=='0') { alert("Vyberte prosím pobytové místo."); return false; } } // kontrola datumu var dat1 = document.getElementById("i_"+lang+"_start_at"); var dat2 = document.getElementById("i_"+lang+"_end_at"); if (dat1 && dat2) { dat1 = dat1.value; dat2 = dat2.value; if (dateCheck(dat1) && dateCheck(dat2)) { ret = true; } else { alert("Zadané datum nemá požadovaný tvar (DD.MM.RRRR)."); return false; } } // kontrola poctu volnych mist a kapacity var kapacita = document.getElementById("i_"+lang+"_kapacita"); if (ret && kapacita) { kapacita = kapacita.value; obsazeno = parseInt(obsazeno); if (kapacita volnych_mist) && (volnych_mist != -1)) { alert('Pro tento termín je pouze ' + volnych_mist + ' volných míst.\nVámi požadovaných ' + (pocet_deti+pocet_dospelych) + ' proto nelze objednat.'); return false; } } else { return false; } return true; } function terminyReset(vals) { if (!vals) { return false; } var i; var href = window.location.href; var elem; for(i = 0; i < vals.length; i++) { var replace_to = vals[i][0]; if (elem) { document.getElementById(vals[i][2]).value = ''; } href = changeVal(href, vals[i][0], vals[i][1], replace_to); } window.location.href = href; } /// @author Lukáš Antalov /// Posleme formular do noveho okna kde ho ulozime /// a hned na to vygenerujeme poziadavok podla jazyka /// povodny formular zase upravim aby nedochazdalo /// ku koliziam id pri vkladani function previewItem() { form = document.forms[0]; action = form.action; // backup form.target = 'preview_window'; form.action = action + '?lang_preview=' + _LANG_SELECTED; form.submit(); // obnovime a osetrime udaje form.action = action.replace('/new', '/save'); form.target = '_self'; // odstranime z inputov subory na upload elem = form.elements; for(i = 0; i < elem.length; i++) { if(elem[i].type == 'file') { elem[i].value = ''; } } mf = getElementsByClassName(form, 'files_lists', 'div'); for(i = 0; i < mf.length; i++) { mf[i].innerHTML = ''; } return false; } function banka_cena_check() { var castka = document.getElementById("i_" + _LANG_SELECTED + "_castka"); var cena_radku_faktury = document.getElementById("i_" + _LANG_SELECTED + "_cena_radku_faktury"); if (!castka || !cena_radku_faktury) { return false; } if (Math.round(castka.value) != Math.round(cena_radku_faktury.value)) { var answer = confirm("Vkládaná částka (" + Math.round(castka.value) + " Kč) a částka pro daný řádek faktury (" + Math.round(cena_radku_faktury.value) + " Kč) jsou různé.\nChcete přesto pokračovat?"); if (answer){ return true; } else { return false; } } return true; } function prirazka_change(prirazka) { prirazka=prirazka.value; var castka = document.getElementById("i_" + _LANG_SELECTED + "_castka"); var castkaFinall = document.getElementById("i_" + _LANG_SELECTED + "_perex"); if (!castka || !castkaFinall) { return false; } castka = castka.value; castka = castka * 1; // conversion to float // vypocet + zaokrouhleni na dve des.mista castkaFinall.value = Math.round(((castka/100*prirazka) + castka) * 100) / 100; } function castka_change(castka) { castka=castka.value; var castkaFinall = document.getElementById("i_" + _LANG_SELECTED + "_perex"); var prirazka = document.getElementById("i_" + _LANG_SELECTED + "_title"); if (!castkaFinall || !prirazka) { return false; } prirazka = prirazka.value; castka = castka * 1; // conversion to float // vypocet + zaokrouhleni na dve des.mista castkaFinall.value = Math.round(((castka/100*prirazka) + castka) * 100) / 100; } function castka_finall_change(castkaFinall) { castkaFinall=castkaFinall.value; var castka = document.getElementById("i_" + _LANG_SELECTED + "_castka"); var prirazka = document.getElementById("i_" + _LANG_SELECTED + "_title"); if (!castka || !prirazka) { return false; } castka=castka.value; castka = castka * 1; // conversion to float // vypocet + zaokrouhleni na dve des.mista prirazka.value = Math.round((((castkaFinall*100) / castka)-100) * 100) / 100; } function faktura_close(fakturovano, uhrazeno, elem, id, target) { if (fakturovano=="0,- Kč") { var answer = confirm("Faktura neobsahuje žádné položky (fakturováno " + fakturovano + ") a neměla by být proto uzavřena.\nChcete přesto pokračovat?"); } else { var answer = confirm("Fakturovaná částka (" + fakturovano + ") a uhrazená částka (" + uhrazeno + ") se liší.\nChcete přesto pokračovat?"); } if (answer){ skipout(elem, id, target); } else { return false; } } function cislo_faktury_check() { elem = document.getElementById('i_cz_cislo_faktury_ok'); if (elem) { if (elem.value=='t') { return true; } else { alert('Faktura s tímto číslem je již obsazená.'); return false; } } else { return false; } } // $Id$ function wikiSelectImg(e) { if (!e.value) { return false; } alert(e.value); return false; } function NwWikiEditor(t) { window.undefined = window.undefined; this.m_init = false; this.m_target = t ? document.getElementById(t) : t; this.m_client = navigator.userAgent.toLowerCase(); // Get client info this.m_gecko = ( (this.m_client.indexOf('gecko') != -1) && (this.m_client.indexOf('spoofer') == -1) && (this.m_client.indexOf('khtml') == -1) && (this.m_client.indexOf('netscape/7.0') == -1) ); this.insertImg = function(e) { if (!e || !e.value) { return false; } var alt = prompt('Zadejte popis obrázku', e.options[e.selectedIndex].text); if (!alt) { return false; } var prefix = 'img'; var odpoved = confirm('Chcete vložit pouze náhled obrázku ?\nPůvodní obrázek sa zobrazí po kliknutí na náhled.'); if (!odpoved) { prefix = 'deco'; } this.addCode('[' + prefix + '-right:' + e.value + ' ' + alt + ']', ''); e.selectedIndex = 0; return false; } this.insertFile = function(e) { if (!e || !e.value) { return false; } var title = prompt('Zadejte popis souboru', e.options[e.selectedIndex].text); if (!title) { return false; } this.addCode('[url:' + e.value + ' ' + title + ']', ''); e.selectedIndex = 0; return false; } this.insertEmail = function() { var email = prompt('Zadejte e-mailo', 'nobody@example.org'); if (!email) { return false; } var name = prompt('Zadejte jméno', 'Jan Novák'); if (!name) { name = email; } this.addCode('[mailto:' + email + ' ' + name + ']', ''); return false; } this.insertUrl = function() { var url = prompt('Zadejte URL', 'www.example.com'); if (!url) { return false; } var name = prompt('Zadejte popis', 'Příklad'); if (!name) { name = url; } this.addCode('[http://' + url + ' ' + name + ']', ''); return false; } this.addCode = function(tag_open, tag_close) { var area = this.m_target; if (tag_close == undefined) { tag_close = tag_open; } // MSIE if (document.selection && !this.m_gecko) { var theSelection = document.selection.createRange().text; area.focus(); if (theSelection.charAt(theSelection.length - 1) == " ") { // vypustenie medzier theSelection = theSelection.substring(0, theSelection.length - 1); document.selection.createRange().text = tag_open + theSelection + tag_close + " "; } else { document.selection.createRange().text = tag_open + theSelection + tag_close; } // Gecko } else if (area.selectionStart || area.selectionStart == '0') { var pos_start = area.selectionStart; var pos_end = area.selectionEnd; var scrolltop = area.scrollTop; var content = (area.value).substring(pos_start, pos_end); if (content.charAt(content.length - 1) == " ") { // vypustenie medzier subst = tag_open + content.substring(0, (content.length - 1)) + tag_close + " "; } else { subst = tag_open + content + tag_close; } area.value = area.value.substring(0, pos_start) + subst + area.value.substring(pos_end, area.value.length); area.focus(); var cPos = pos_start + (tag_open.length + content.length + tag_close.length); area.selectionStart = cPos; area.selectionEnd = cPos; area.scrollTop = scrolltop; } // prenastavenie kurzoru if (area.createTextRange) { area.caretPos = document.selection.createRange().duplicate(); } return false; } } /* Simple AJAX Code-Kit (SACK) v1.6.1 */ /* 2005 Gregory Wild-Smith */ /* www.twilightuniverse.com */ /* Software licenced under a modified X11 licence, see documentation or authors website for more details */ function sack(file) { this.xmlhttp = null; this.resetData = function() { this.method = "POST"; this.queryStringSeparator = "?"; this.argumentSeparator = "&"; this.URLString = ""; this.encodeURIString = true; this.execute = false; this.element = null; this.elementObj = null; this.requestFile = file; this.vars = new Object(); this.responseStatus = new Array(2); }; this.resetFunctions = function() { this.onLoading = function() { }; this.onLoaded = function() { }; this.onInteractive = function() { }; this.onCompletion = function() { }; this.onError = function() { }; this.onFail = function() { }; }; this.reset = function() { this.resetFunctions(); this.resetData(); }; this.createAJAX = function() { try { this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e1) { try { this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) { this.xmlhttp = null; } } if (!this.xmlhttp) { if (typeof XMLHttpRequest != "undefined") { this.xmlhttp = new XMLHttpRequest(); } else { this.failed = true; } } }; this.setVar = function(name, value){ this.vars[name] = Array(value, false); }; this.encVar = function(name, value, returnvars) { if (true == returnvars) { return Array(encodeURIComponent(name), encodeURIComponent(value)); } else { this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true); } } this.processURLString = function(string, encode) { encoded = encodeURIComponent(this.argumentSeparator); regexp = new RegExp(this.argumentSeparator + "|" + encoded); varArray = string.split(regexp); for (i = 0; i < varArray.length; i++){ urlVars = varArray[i].split("="); if (true == encode){ this.encVar(urlVars[0], urlVars[1]); } else { this.setVar(urlVars[0], urlVars[1]); } } } this.createURLString = function(urlstring) { if (this.encodeURIString && this.URLString.length) { this.processURLString(this.URLString, true); } if (urlstring) { if (this.URLString.length) { this.URLString += this.argumentSeparator + urlstring; } else { this.URLString = urlstring; } } // prevents caching of URLString this.setVar("rndval", new Date().getTime()); urlstringtemp = new Array(); for (key in this.vars) { if (false == this.vars[key][1] && true == this.encodeURIString) { encoded = this.encVar(key, this.vars[key][0], true); delete this.vars[key]; this.vars[encoded[0]] = Array(encoded[1], true); key = encoded[0]; } urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0]; } if (urlstring){ this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator); } else { this.URLString += urlstringtemp.join(this.argumentSeparator); } } this.runResponse = function() { eval(this.response); } this.runAJAX = function(urlstring) { if (this.failed) { this.onFail(); } else { this.createURLString(urlstring); if (this.element) { this.elementObj = document.getElementById(this.element); } if (this.xmlhttp) { var self = this; if (this.method == "GET") { totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString; this.xmlhttp.open(this.method, totalurlstring, true); } else { this.xmlhttp.open(this.method, this.requestFile, true); try { this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") } catch (e) { } } this.xmlhttp.onreadystatechange = function() { switch (self.xmlhttp.readyState) { case 1: self.onLoading(); break; case 2: self.onLoaded(); break; case 3: self.onInteractive(); break; case 4: self.response = self.xmlhttp.responseText; self.responseXML = self.xmlhttp.responseXML; self.responseStatus[0] = self.xmlhttp.status; self.responseStatus[1] = self.xmlhttp.statusText; if (self.execute) { self.runResponse(); } if (self.elementObj) { elemNodeName = self.elementObj.nodeName; elemNodeName.toLowerCase(); if (elemNodeName == "input" || elemNodeName == "select" || elemNodeName == "option" || elemNodeName == "textarea") { self.elementObj.value = self.response; } else { self.elementObj.innerHTML = self.response; } } if (self.responseStatus[0] == "200") { self.onCompletion(); } else { self.onError(); } self.URLString = ""; break; } }; this.xmlhttp.send(this.URLString); } } }; this.reset(); this.createAJAX(); } // $Id: functions.js 500 2006-09-19 12:44:20Z juraj $ /// @file /// @author Jaroslav Vaculík // vytvorim ajax objekt // var ajax = new sack(); function checkLogin(inp_login, id) { var ajax = new sack(); var query = 'login=' + inp_login.value + '&id=' + inp_login.id + '&user=' + id; ajax.method = 'GET'; ajax.requestFile = '/rs/ajax/checklogin'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function checkClientLogin(input, section, id, login) { var ajax = new sack(); if (input.value == '') return; var query = 'login=' + input.value + '&id=' + input.id + '&user=' + id + '§ion=' + section; ajax.method = 'GET'; ajax.requestFile = '/rs/ajax/checkclientlogin'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } var _REDIRECT_TO = ''; function redirect() { if (_REDIRECT_TO) { window.location.href = _REDIRECT_TO; } } function changeBackURL(ref) { var ajax = new sack(); if (!ref) { return false; } _REDIRECT_TO = ref.href; var lng = ref.href.replace(/.*lng=([a-zA-Z]+).*/, '$1'); if (ref.href == lng) { lng = 'cz'; } var reference = window.location.href.replace(/.*\/rs\/(.*)/, '$1'); if (reference.indexOf('lng=') == -1) { reference += ((reference.indexOf('?') == -1) ? '?' : '&') + 'lng=' + lng; } else { reference = reference.replace(/(.*lng=)[a-zA-Z]*(.*)/, '$1' + lng + '$2'); } var query = 'url=' + escape(reference); ajax.method = 'POST'; ajax.requestFile = '/rs/ajax/changeurl'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = redirect; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax return false; } function druh_pobytu_change(elem) { var ajax = new sack(); var query = 'druh_pobytu=' + elem.value; ajax.method = 'GET'; ajax.requestFile = '/rs/obj_term/druh_pobytu_change'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function pobytova_mista_change(elem1) { var ajax = new sack(); var query = 'pobytova_mista=' + elem1.value; ajax.method = 'GET'; ajax.requestFile = '/rs/obj_term/pobytova_mista_change'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function pobytova_mista_change_2(elem1) { var ajax = new sack(); var query = 'pobytova_mista=' + elem1.value; ajax.method = 'GET'; ajax.requestFile = '/rs/obj_term/pobytova_mista_change'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function termin_change(termin) { var ajax = new sack(); var query = 'termin=' + termin.value; ajax.method = 'GET'; ajax.requestFile = '/rs/obj_term/termin_change'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function skola_change(skola) { var ajax = new sack(); var query = 'skola=' + skola.value; ajax.method = 'GET'; ajax.requestFile = '/rs/obj_term/skola_change'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function faktury_skola_change(skola) { var ajax = new sack(); var query = 'skola=' + skola.value; ajax.method = 'GET'; ajax.requestFile = '/rs/fa_radky/skola_change'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function faktury_obj_termin_change(obj_termin) { var ajax = new sack(); var query = 'obj_termin=' + obj_termin.value; ajax.method = 'GET'; ajax.requestFile = '/rs/fa_radky/obj_termin_change'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function banka_typ_change(typ) { var ajax = new sack(); var query = 'typ=' + typ.value; ajax.method = 'GET'; ajax.requestFile = '/rs/banka/typ_change'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function banka_transakce_change(val) { var ajax = new sack(); var query = 'transakce=' + val.value; ajax.method = 'GET'; ajax.requestFile = '/rs/banka/transakce_change'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function banka_faktura_change(faktura) { var ajax = new sack(); var query = 'faktura=' + faktura.value; ajax.method = 'GET'; ajax.requestFile = '/rs/banka/faktura_change'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function banka_radek_change(radek) { var ajax = new sack(); var query = 'radek=' + radek.value; ajax.method = 'GET'; ajax.requestFile = '/rs/banka/radek_change'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function vydane_faktury_skola_change(skola) { var ajax = new sack(); var query = 'skola=' + skola.value; ajax.method = 'GET'; ajax.requestFile = '/rs/zalo_vyd/skola_change'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function objednavky_zakaznik_change(elem, sekce) { var ajax = new sack(); var query = 'zakaznik=' + elem.value; ajax.method = 'GET'; ajax.requestFile = '/rs/' + sekce + '/zakaznik_change'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function fakturovana_polozka_change(elem) { var ajax = new sack(); var query = 'polozka=' + elem.value; ajax.method = 'GET'; ajax.requestFile = '/rs/fa_radky/fakturovana_polozka_change'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function ajax_cislo_vyd_faktury_check(id) { var cislo = document.getElementById("i_" + _LANG_SELECTED + "_cislo_faktury"); if (!cislo) { return false; } else { cislo = cislo.value; } var ajax = new sack(); var query = 'cislo=' + cislo + '&id=' + id; ajax.method = 'GET'; ajax.requestFile = '/rs/zalo_vyd/cislo_vyd_faktury_check'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function ajax_cislo_pri_faktury_check(id) { var cislo = document.getElementById("i_" + _LANG_SELECTED + "_cislo_faktury"); if (!cislo) { return false; } else { cislo = cislo.value; } var ajax = new sack(); var query = 'cislo=' + cislo + '&id=' + id; ajax.method = 'GET'; ajax.requestFile = '/rs/zalo_pri/cislo_pri_faktury_check'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } function ajax_cislo_dobropis_faktury_check(id) { var cislo = document.getElementById("i_" + _LANG_SELECTED + "_cislo_faktury"); if (!cislo) { return false; } else { cislo = cislo.value; } var ajax = new sack(); var query = 'cislo=' + cislo + '&id=' + id; ajax.method = 'GET'; ajax.requestFile = '/rs/dobropis/cislo_dobropis_faktury_check'; // nastavim skript, ktery ma vygenerovat odezvu ajax.onCompletion = ajax.runResponse; // po skonceni se zavola funkce ajax.runResponse ajax.runAJAX(query); // spustim ajax } /* Copyright (c) 2005 Tim Taylor Consulting Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ var ToolMan = { events : function() { if (!ToolMan._eventsFactory) throw "ToolMan Events module isn't loaded"; return ToolMan._eventsFactory }, css : function() { if (!ToolMan._cssFactory) throw "ToolMan CSS module isn't loaded"; return ToolMan._cssFactory }, coordinates : function() { if (!ToolMan._coordinatesFactory) throw "ToolMan Coordinates module isn't loaded"; return ToolMan._coordinatesFactory }, drag : function() { if (!ToolMan._dragFactory) throw "ToolMan Drag module isn't loaded"; return ToolMan._dragFactory }, dragsort : function() { if (!ToolMan._dragsortFactory) throw "ToolMan DragSort module isn't loaded"; return ToolMan._dragsortFactory }, helpers : function() { return ToolMan._helpers }, cookies : function() { if (!ToolMan._cookieOven) throw "ToolMan Cookie module isn't loaded"; return ToolMan._cookieOven }, junkdrawer : function() { return ToolMan._junkdrawer } } ToolMan._helpers = { map : function(array, func) { for (var i = 0, n = array.length; i < n; i++) func(array[i]) }, nextItem : function(item, nodeName) { if (item == null) return var next = item.nextSibling while (next != null) { if (next.nodeName == nodeName) return next next = next.nextSibling } return null }, previousItem : function(item, nodeName) { var previous = item.previousSibling while (previous != null) { if (previous.nodeName == nodeName) return previous previous = previous.previousSibling } return null }, moveBefore : function(item1, item2) { var parent = item1.parentNode parent.removeChild(item1) parent.insertBefore(item1, item2) }, moveAfter : function(item1, item2) { var parent = item1.parentNode parent.removeChild(item1) parent.insertBefore(item1, item2 ? item2.nextSibling : null) } } /** * scripts without a proper home * * stuff here is subject to change unapologetically and without warning */ ToolMan._junkdrawer = { serializeList : function(list) { var items = list.getElementsByTagName(TAG_NAME) var array = new Array() for (var i = 0, n = items.length; i < n; i++) { var item = items[i] array.push(ToolMan.junkdrawer()._identifier(item)) } return array.join('|') }, inspectListOrder : function(id) { alert(ToolMan.junkdrawer().serializeList(document.getElementById(id))) }, restoreListOrder : function(listID) { var list = document.getElementById(listID) if (list == null) return var cookie = ToolMan.cookies().get("list-" + listID) if (!cookie) return; var IDs = cookie.split('|') var items = ToolMan.junkdrawer()._itemsByID(list) for (var i = 0, n = IDs.length; i < n; i++) { var itemID = IDs[i] if (itemID in items) { var item = items[itemID] list.removeChild(item) list.insertBefore(item, null) } } }, _identifier : function(item) { var trim = ToolMan.junkdrawer().trim var identifier identifier = trim(item.getAttribute("id")) if (identifier != null && identifier.length > 0) return identifier; identifier = trim(item.getAttribute("itemID")) if (identifier != null && identifier.length > 0) return identifier; // FIXME: strip out special chars or make this an MD5 hash or something return trim(item.innerHTML) }, _itemsByID : function(list) { var array = new Array() var items = list.getElementsByTagName(TAG_NAME) for (var i = 0, n = items.length; i < n; i++) { var item = items[i] array[ToolMan.junkdrawer()._identifier(item)] = item } return array }, trim : function(text) { if (text == null) return null return text.replace(/^(\s+)?(.*\S)(\s+)?$/, '$2') } } /* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */ ToolMan._eventsFactory = { fix : function(event) { if (!event) event = window.event if (event.target) { if (event.target.nodeType == 3) event.target = event.target.parentNode } else if (event.srcElement) { event.target = event.srcElement } return event }, register : function(element, type, func) { if (element.addEventListener) { element.addEventListener(type, func, false) } else if (element.attachEvent) { if (!element._listeners) element._listeners = new Array() if (!element._listeners[type]) element._listeners[type] = new Array() var workaroundFunc = function() { func.apply(element, new Array()) } element._listeners[type][func] = workaroundFunc element.attachEvent('on' + type, workaroundFunc) } }, unregister : function(element, type, func) { if (element.removeEventListener) { element.removeEventListener(type, func, false) } else if (element.detachEvent) { if (element._listeners && element._listeners[type] && element._listeners[type][func]) { element.detachEvent('on' + type, element._listeners[type][func]) } } } } /* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */ // TODO: write unit tests ToolMan._cssFactory = { readStyle : function(element, property) { if (element.style[property]) { return element.style[property] } else if (element.currentStyle) { return element.currentStyle[property] } else if (document.defaultView && document.defaultView.getComputedStyle) { var style = document.defaultView.getComputedStyle(element, null) return style.getPropertyValue(property) } else { return null } } } /* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */ /* FIXME: assumes position styles are specified in 'px' */ ToolMan._coordinatesFactory = { create : function(x, y) { // FIXME: Safari won't parse 'throw' and aborts trying to do anything with this file //if (isNaN(x) || isNaN(y)) throw "invalid x,y: " + x + "," + y return new _ToolManCoordinate(this, x, y) }, origin : function() { return this.create(0, 0) }, /* * FIXME: Safari 1.2, returns (0,0) on absolutely positioned elements */ topLeftPosition : function(element) { var left = parseInt(ToolMan.css().readStyle(element, "left")) var left = isNaN(left) ? 0 : left var top = parseInt(ToolMan.css().readStyle(element, "top")) var top = isNaN(top) ? 0 : top return this.create(left, top) }, bottomRightPosition : function(element) { return this.topLeftPosition(element).plus(this._size(element)) }, topLeftOffset : function(element) { var offset = this._offset(element) var parent = element.offsetParent while (parent) { offset = offset.plus(this._offset(parent)) parent = parent.offsetParent } return offset }, bottomRightOffset : function(element) { return this.topLeftOffset(element).plus( this.create(element.offsetWidth, element.offsetHeight)) }, scrollOffset : function() { if (window.pageXOffset) { return this.create(window.pageXOffset, window.pageYOffset) } else if (document.documentElement) { return this.create( document.body.scrollLeft + document.documentElement.scrollLeft, document.body.scrollTop + document.documentElement.scrollTop) } else if (document.body.scrollLeft >= 0) { return this.create(document.body.scrollLeft, document.body.scrollTop) } else { return this.create(0, 0) } }, clientSize : function() { if (window.innerHeight >= 0) { return this.create(window.innerWidth, window.innerHeight) } else if (document.documentElement) { return this.create(document.documentElement.clientWidth, document.documentElement.clientHeight) } else if (document.body.clientHeight >= 0) { return this.create(document.body.clientWidth, document.body.clientHeight) } else { return this.create(0, 0) } }, /** * mouse coordinate relative to the window (technically the * browser client area) i.e. the part showing your page * * NOTE: in Safari the coordinate is relative to the document */ mousePosition : function(event) { event = ToolMan.events().fix(event) return this.create(event.clientX, event.clientY) }, /** * mouse coordinate relative to the document */ mouseOffset : function(event) { event = ToolMan.events().fix(event) if (event.pageX >= 0 || event.pageX < 0) { return this.create(event.pageX, event.pageY) } else if (event.clientX >= 0 || event.clientX < 0) { return this.mousePosition(event).plus(this.scrollOffset()) } }, _size : function(element) { /* TODO: move to a Dimension class */ return this.create(element.offsetWidth, element.offsetHeight) }, _offset : function(element) { return this.create(element.offsetLeft, element.offsetTop) } } function _ToolManCoordinate(factory, x, y) { this.factory = factory this.x = isNaN(x) ? 0 : x this.y = isNaN(y) ? 0 : y } _ToolManCoordinate.prototype = { toString : function() { return "(" + this.x + "," + this.y + ")" }, plus : function(that) { return this.factory.create(this.x + that.x, this.y + that.y) }, minus : function(that) { return this.factory.create(this.x - that.x, this.y - that.y) }, min : function(that) { return this.factory.create( Math.min(this.x , that.x), Math.min(this.y , that.y)) }, max : function(that) { return this.factory.create( Math.max(this.x , that.x), Math.max(this.y , that.y)) }, constrainTo : function (one, two) { var min = one.min(two) var max = one.max(two) return this.max(min).min(max) }, distance : function (that) { return Math.sqrt(Math.pow(this.x - that.x, 2) + Math.pow(this.y - that.y, 2)) }, reposition : function(element) { element.style["top"] = this.y + "px" element.style["left"] = this.x + "px" } } /* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */ ToolMan._dragFactory = { createSimpleGroup : function(element, handle) { handle = handle ? handle : element var group = this.createGroup(element) group.setHandle(handle) group.transparentDrag() group.onTopWhileDragging() return group }, createGroup : function(element) { var group = new _ToolManDragGroup(this, element) var position = ToolMan.css().readStyle(element, 'position') if (position == 'static') { element.style["position"] = 'relative' } else if (position == 'absolute') { /* for Safari 1.2 */ ToolMan.coordinates().topLeftOffset(element).reposition(element) } // TODO: only if ToolMan.isDebugging() group.register('draginit', this._showDragEventStatus) group.register('dragmove', this._showDragEventStatus) group.register('dragend', this._showDragEventStatus) return group }, _showDragEventStatus : function(dragEvent) { window.status = dragEvent.toString() }, constraints : function() { return this._constraintFactory }, _createEvent : function(type, event, group) { return new _ToolManDragEvent(type, event, group) } } function _ToolManDragGroup(factory, element) { this.factory = factory this.element = element this._handle = null this._thresholdDistance = 0 this._transforms = new Array() // TODO: refactor into a helper object, move into events.js this._listeners = new Array() this._listeners['draginit'] = new Array() this._listeners['dragstart'] = new Array() this._listeners['dragmove'] = new Array() this._listeners['dragend'] = new Array() } _ToolManDragGroup.prototype = { /* * TODO: * - unregister(type, func) * - move custom event listener stuff into Event library * - keyboard nudging of "selected" group */ setHandle : function(handle) { var events = ToolMan.events() handle.toolManDragGroup = this events.register(handle, 'mousedown', this._dragInit) handle.onmousedown = function() { return false } if (this.element != handle) events.unregister(this.element, 'mousedown', this._dragInit) }, register : function(type, func) { this._listeners[type].push(func) }, addTransform : function(transformFunc) { this._transforms.push(transformFunc) }, verticalOnly : function() { this.addTransform(this.factory.constraints().vertical()) }, horizontalOnly : function() { this.addTransform(this.factory.constraints().horizontal()) }, setThreshold : function(thresholdDistance) { this._thresholdDistance = thresholdDistance }, transparentDrag : function(opacity) { var opacity = typeof(opacity) != "undefined" ? opacity : 0.75; var originalOpacity = ToolMan.css().readStyle(this.element, "opacity") this.register('dragstart', function(dragEvent) { var element = dragEvent.group.element element.style.opacity = opacity if (element.style.filter || (TAG_NAME == 'li')) { element.style.filter = 'alpha(opacity=' + (opacity * 100) + ')' } }) this.register('dragend', function(dragEvent) { var element = dragEvent.group.element element.style.opacity = originalOpacity if (element.style.filter) { element.style.filter = 'alpha(opacity=100)' } }) }, onTopWhileDragging : function(zIndex) { var zIndex = typeof(zIndex) != "undefined" ? zIndex : 100000; var originalZIndex = ToolMan.css().readStyle(this.element, "z-index") this.register('dragstart', function(dragEvent) { dragEvent.group.element.style.zIndex = zIndex }) this.register('dragend', function(dragEvent) { dragEvent.group.element.style.zIndex = originalZIndex }) }, _dragInit : function(event) { event = ToolMan.events().fix(event) var group = document.toolManDragGroup = this.toolManDragGroup var dragEvent = group.factory._createEvent('draginit', event, group) group._isThresholdExceeded = false group._initialMouseOffset = dragEvent.mouseOffset group._grabOffset = dragEvent.mouseOffset.minus(dragEvent.topLeftOffset) ToolMan.events().register(document, 'mousemove', group._drag) document.onmousemove = function() { return false } ToolMan.events().register(document, 'mouseup', group._dragEnd) group._notifyListeners(dragEvent) }, _drag : function(event) { event = ToolMan.events().fix(event) var coordinates = ToolMan.coordinates() var group = this.toolManDragGroup if (!group) return var dragEvent = group.factory._createEvent('dragmove', event, group) var newTopLeftOffset = dragEvent.mouseOffset.minus(group._grabOffset) // TODO: replace with DragThreshold object if (!group._isThresholdExceeded) { var distance = dragEvent.mouseOffset.distance(group._initialMouseOffset) if (distance < group._thresholdDistance) return group._isThresholdExceeded = true group._notifyListeners( group.factory._createEvent('dragstart', event, group)) } for (i in group._transforms) { var transform = group._transforms[i] newTopLeftOffset = transform(newTopLeftOffset, dragEvent) } var dragDelta = newTopLeftOffset.minus(dragEvent.topLeftOffset) var newTopLeftPosition = dragEvent.topLeftPosition.plus(dragDelta) newTopLeftPosition.reposition(group.element) dragEvent.transformedMouseOffset = newTopLeftOffset.plus(group._grabOffset) group._notifyListeners(dragEvent) var errorDelta = newTopLeftOffset.minus(coordinates.topLeftOffset(group.element)) if (errorDelta.x != 0 || errorDelta.y != 0) { coordinates.topLeftPosition(group.element).plus(errorDelta).reposition(group.element) } }, _dragEnd : function(event) { event = ToolMan.events().fix(event) var group = this.toolManDragGroup if (TAG_NAME == 'tr') { // zavolat ajax pro ulozeni poradi v pripade, ze se poradi zmenilo } if (group && group.factory) { var dragEvent = group.factory._createEvent('dragend', event, group) group._notifyListeners(dragEvent) this.toolManDragGroup = null ToolMan.events().unregister(document, 'mousemove', group._drag) document.onmousemove = null ToolMan.events().unregister(document, 'mouseup', group._dragEnd) } else { this.toolManDragGroup = null document.onmousemove = null } }, _notifyListeners : function(dragEvent) { var listeners = this._listeners[dragEvent.type] for (i in listeners) { listeners[i](dragEvent) } } } function _ToolManDragEvent(type, event, group) { this.type = type this.group = group this.mousePosition = ToolMan.coordinates().mousePosition(event) this.mouseOffset = ToolMan.coordinates().mouseOffset(event) this.transformedMouseOffset = this.mouseOffset this.topLeftPosition = ToolMan.coordinates().topLeftPosition(group.element) this.topLeftOffset = ToolMan.coordinates().topLeftOffset(group.element) } _ToolManDragEvent.prototype = { toString : function() { return ""; return "mouse: " + this.mousePosition + this.mouseOffset + " " + "xmouse: " + this.transformedMouseOffset + " " + "left,top: " + this.topLeftPosition + this.topLeftOffset } } ToolMan._dragFactory._constraintFactory = { vertical : function() { return function(coordinate, dragEvent) { var x = dragEvent.topLeftOffset.x return coordinate.x != x ? coordinate.factory.create(x, coordinate.y) : coordinate } }, horizontal : function() { return function(coordinate, dragEvent) { var y = dragEvent.topLeftOffset.y return coordinate.y != y ? coordinate.factory.create(coordinate.x, y) : coordinate } } } /* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */ ToolMan._dragsortFactory = { makeSortable : function(item) { var group = ToolMan.drag().createSimpleGroup(item) group.register('dragstart', this._onDragStart) group.register('dragmove', this._onDragMove) group.register('dragend', this._onDragEnd) return group }, /** * Iterates over a list's items, making them sortable, applying * optional functions to each item. * * example: makeListSortable(myList, myFunc1, myFunc2, ... , myFuncN) */ makeListSortable : function(list) { var helpers = ToolMan.helpers() var coordinates = ToolMan.coordinates() var items = list.getElementsByTagName(TAG_NAME) helpers.map(items, function(item) { var dragGroup = dragsort.makeSortable(item) dragGroup.setThreshold(4) var min, max dragGroup.addTransform(function(coordinate, dragEvent) { return coordinate.constrainTo(min, max) }) dragGroup.register('dragstart', function() { var items = list.getElementsByTagName(TAG_NAME) min = max = coordinates.topLeftOffset(items[0]) for (var i = 1, n = items.length; i < n; i++) { var offset = coordinates.topLeftOffset(items[i]) min = min.min(offset) max = max.max(offset) } }) }) for (var i = 1, n = arguments.length; i < n; i++) helpers.map(items, arguments[i]) }, _onDragStart : function(dragEvent) { }, _onDragMove : function(dragEvent) { var helpers = ToolMan.helpers() var coordinates = ToolMan.coordinates() var item = dragEvent.group.element var xmouse = dragEvent.transformedMouseOffset var moveTo = null var previous = helpers.previousItem(item, item.nodeName) while (previous != null) { var bottomRight = coordinates.bottomRightOffset(previous) if (xmouse.y <= bottomRight.y && xmouse.x <= bottomRight.x) { moveTo = previous } previous = helpers.previousItem(previous, item.nodeName) } if (moveTo != null) { helpers.moveBefore(item, moveTo) return } var next = helpers.nextItem(item, item.nodeName) while (next != null) { var topLeft = coordinates.topLeftOffset(next) if (topLeft.y <= xmouse.y && topLeft.x <= xmouse.x) { moveTo = next } next = helpers.nextItem(next, item.nodeName) } if (moveTo != null) { helpers.moveBefore(item, helpers.nextItem(moveTo, item.nodeName)) return } }, _onDragEnd : function(dragEvent) { ToolMan.coordinates().create(0, 0).reposition(dragEvent.group.element) } } // $Id: tool-man.js 504 2006-09-20 13:50:24Z juraj $ /// @file /// @author Jaroslav Vaculík /** * Nastavi input pole a zmeni obrazek visibility pro fotku. (zobrazi/skryje fotku) */ function setVisibility(image, name) { var inp = document.getElementById(name); var search = inp.value; inp.value = (inp.value == 'icon_hide') ? 'icon_show' : 'icon_hide'; image.src = image.src.replace(search + '.png', inp.value + '.png'); } function markAsDeleteCheck(parClassName, itemClassname) { var parents = getElementsByClassName(document.getElementById('panel_form'), parClassName, 'ul'); var inputs; var i; var j; for (i = 0; i < parents.length; i++) { inputs = getElementsByClassName(parents[i], itemClassname, 'input'); for (j = 0; j < inputs.length; j++) { if (inputs[j].checked) { return confirm('Máte označeny položky ke smazání, chcete je skutečně odstranit?'); } } } return true; } function photosCheck(galClassName, itemClassName) { var galeries = getElementsByClassName(document.getElementById('panel_form'), galClassName, 'ul'); var inputs; var i; var j; for (i = 0; i < galeries.length; i++) { inputs = getElementsByClassName(galeries[i], itemClassName, 'input'); for (j = 0; j < inputs.length; j++) { if (inputs[j].checked) { return confirm('Máte označeny fotografie ke smazání, chcete je skutečně odstranit?'); } } } /* var new_files = getElementsByClassName(document.getElementById('panel_form'), 'i_.._file.*', 'input'); var types_patterns = new Array('[Jj][Pp][Gg]', '[Gg][Ii][Ff]', '[Pp][Nn][Gg]'); for (i = 0; i < new_files.length; i++) { //inputs = getElementsByClassName(galeries[i], 'ft_drop', 'input'); } */ return true; } // nastaveni fotogalerie var ESCAPE = 27; var ENTER = 13; var TAB = 9; var TAG_NAME = 'li'; var coordinates = ToolMan.coordinates() var dragsort = ToolMan.dragsort() function noenter(e) { return !(e && e.keyCode == 13); } function setHandle(item) { item.toolManDragGroup.setHandle(findHandle(item)) } function findHandle(item) { var children = item.getElementsByTagName("div") for (var i = 0; i < children.length; i++) { var child = children[i] if (child.getAttribute("class") == null) continue if (child.getAttribute("class").indexOf("handle") >= 0) return child } return item } function join(prefix, name, isDoubleClick) { var view = document.getElementById(prefix + name + "_View") view.editor = document.getElementById(prefix + name + "_Edit") var showEditor = function(event) { event = fixEvent(event) var view = this var editor = view.editor if (!editor) return true if (editor.currentView != null) { editor.blur() } editor.currentView = view if (editor.nodeName == 'TEXTAREA') { editor.style['width'] = view.offsetWidth + "px" editor.style['height'] = view.offsetHeight + "px" } //editor.value = view.innerHTML editor.value = view.value editor.style['visibility'] = 'visible' view.style['visibility'] = 'hidden' editor.focus() return false } if (isDoubleClick) { view.ondblclick = showEditor } else { view.onclick = showEditor } view.editor.onblur = function(event) { event = fixEvent(event) var editor = event.target var view = editor.currentView if (!editor.abandonChanges) view.value = editor.value editor.abandonChanges = false editor.style['visibility'] = 'hidden' //editor.value = '' // fixes firefox 1.0 bug view.style['visibility'] = 'visible' editor.currentView = null return true } view.editor.onkeydown = function(event) { event = fixEvent(event) var editor = event.target if ((event.keyCode == TAB) || (event.keyCode == ENTER)) { editor.blur() return false } } view.editor.onkeyup = function(event) { event = fixEvent(event) var editor = event.target if (event.keyCode == ESCAPE) { editor.abandonChanges = true editor.blur() return false } else if ((event.keyCode == TAB) || (event.keyCode == ENTER)) { return false } else { return true } } // TODO: this method is duplicated elsewhere function fixEvent(event) { if (!event) event = window.event if (event.target) { if (event.target.nodeType == 3) event.target = event.target.parentNode } else if (event.srcElement) { event.target = event.srcElement } return event } } /* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo * ----------------------------------------------------------- * * The DHTML Calendar, version 1.0 "It is happening again" * * Details and latest version at: * www.dynarch.com/projects/calendar * * This script is developed by Dynarch.com. Visit us at www.dynarch.com. * * This script is distributed under the GNU Lesser General Public License. * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html */ Calendar=function(firstDayOfWeek,dateStr,onSelected,onClose){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=onSelected||null;this.onClose=onClose||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof firstDayOfWeek=="number"?firstDayOfWeek:Calendar._FD;this.showsOtherMonths=false;this.dateStr=dateStr;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined")Calendar._SDN_len=3;var ar=new Array();for(var i=8;i>0;){ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len);}Calendar._SDN=ar;if(typeof Calendar._SMN_len=="undefined")Calendar._SMN_len=3;ar=new Array();for(var i=12;i>0;){ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len);}Calendar._SMN=ar;}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(el){var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft)SL=el.scrollLeft;if(is_div&&el.scrollTop)ST=el.scrollTop;var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};if(el.offsetParent){var tmp=this.getAbsolutePos(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}return r;};Calendar.isRelated=function(el,evt){var related=evt.relatedTarget;if(!related){var type=evt.type;if(type=="mouseover"){related=evt.fromElement;}else if(type=="mouseout"){related=evt.toElement;}}while(related){if(related==el){return true;}related=related.parentNode;}return false;};Calendar.removeClass=function(el,className){if(!(el&&el.className)){return;}var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=className){ar[ar.length]=cls[i];}}el.className=ar.join(" ");};Calendar.addClass=function(el,className){Calendar.removeClass(el,className);el.className+=" "+className;};Calendar.getElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.currentTarget;while(f.nodeType!=1||/^div$/i.test(f.tagName))f=f.parentNode;return f;};Calendar.getTargetElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.target;while(f.nodeType!=1)f=f.parentNode;return f;};Calendar.stopEvent=function(ev){ev||(ev=window.event);if(Calendar.is_ie){ev.cancelBubble=true;ev.returnValue=false;}else{ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent=function(el,evname,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};Calendar.removeEvent=function(el,evname,func){if(el.detachEvent){el.detachEvent("on"+evname,func);}else if(el.removeEventListener){el.removeEventListener(evname,func,true);}else{el["on"+evname]=null;}};Calendar.createElement=function(type,parent){var el=null;if(document.createElementNS){el=document.createElementNS("http://www.w3.org/1999/xhtml",type);}else{el=document.createElement(type);}if(typeof parent!="undefined"){parent.appendChild(el);}return el;};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true);}}};Calendar.findMonth=function(el){if(typeof el.month!="undefined"){return el;}else if(typeof el.parentNode.month!="undefined"){return el.parentNode;}return null;};Calendar.findYear=function(el){if(typeof el.year!="undefined"){return el;}else if(typeof el.parentNode.year!="undefined"){return el.parentNode;}return null;};Calendar.showMonthsCombo=function(){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var mc=cal.monthsCombo;if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}if(cal.activeMonth){Calendar.removeClass(cal.activeMonth,"active");}var mon=cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon,"active");cal.activeMonth=mon;var s=mc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var mcw=mc.offsetWidth;if(typeof mcw=="undefined")mcw=50;s.left=(cd.offsetLeft+cd.offsetWidth-mcw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";};Calendar.showYearsCombo=function(fwd){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var yc=cal.yearsCombo;if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}if(cal.activeYear){Calendar.removeClass(cal.activeYear,"active");}cal.activeYear=null;var Y=cal.date.getFullYear()+(fwd?1:-1);var yr=yc.firstChild;var show=false;for(var i=12;i>0;--i){if(Y>=cal.minYear&&Y<=cal.maxYear){yr.innerHTML=Y;yr.year=Y;yr.style.display="block";show=true;}else{yr.style.display="none";}yr=yr.nextSibling;Y+=fwd?cal.yearStep:-cal.yearStep;}if(show){var s=yc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var ycw=yc.offsetWidth;if(typeof ycw=="undefined")ycw=50;s.left=(cd.offsetLeft+cd.offsetWidth-ycw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false;}if(cal.timeout){clearTimeout(cal.timeout);}var el=cal.activeDiv;if(!el){return false;}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev);}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev);}};Calendar.tableMouseOver=function(ev){var cal=Calendar._C;if(!cal){return;}var el=cal.activeDiv;var target=Calendar.getTargetElement(ev);if(target==el||target.parentNode==el){Calendar.addClass(el,"hilite active");Calendar.addClass(el.parentNode,"rowhilite");}else{if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2)))Calendar.removeClass(el,"active");Calendar.removeClass(el,"hilite");Calendar.removeClass(el.parentNode,"rowhilite");}ev||(ev=window.event);if(el.navtype==50&&target!=el){var pos=Calendar.getAbsolutePos(el);var w=el.offsetWidth;var x=ev.clientX;var dx;var decrease=true;if(x>pos.x+w){dx=x-pos.x-w;decrease=false;}else dx=pos.x-x;if(dx<0)dx=0;var range=el._range;var current=el._current;var count=Math.floor(dx/10)%range.length;for(var i=range.length;--i>=0;)if(range[i]==current)break;while(count-->0)if(decrease){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();}var mon=Calendar.findMonth(target);if(mon){if(mon.month!=cal.date.getMonth()){if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}Calendar.addClass(mon,"hilite");cal.hilitedMonth=mon;}else if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}var year=Calendar.findYear(target);if(year){if(year.year!=cal.date.getFullYear()){if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}Calendar.addClass(year,"hilite");cal.hilitedYear=year;}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown=function(ev){if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){return Calendar.stopEvent(ev);}};Calendar.calDragIt=function(ev){var cal=Calendar._C;if(!(cal&&cal.dragging)){return false;}var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posX=ev.pageX;posY=ev.pageY;}cal.hideShowCovered();var st=cal.element.style;st.left=(posX-cal.xOffs)+"px";st.top=(posY-cal.yOffs)+"px";return Calendar.stopEvent(ev);};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false;}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false;}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300)with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver);}else addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver);addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp);}else if(cal.isPopup){cal._dragStart(ev);}if(el.navtype==-1||el.navtype==1){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout("Calendar.showMonthsCombo()",250);}else if(el.navtype==-2||el.navtype==2){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250);}else{cal.timeout=null;}return Calendar.stopEvent(ev);};Calendar.dayMouseDblClick=function(ev){Calendar.cellClick(Calendar.getElement(ev),ev||window.event);if(Calendar.is_ie){document.selection.empty();}};Calendar.dayMouseOver=function(ev){var el=Calendar.getElement(ev);if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){return false;}if(el.ttip){if(el.ttip.substr(0,1)=="_"){el.ttip=el.caldate.print(el.calendar.ttDateFormat)+el.ttip.substr(1);}el.calendar.tooltips.innerHTML=el.ttip;}if(el.navtype!=300){Calendar.addClass(el,"hilite");if(el.caldate){Calendar.addClass(el.parentNode,"rowhilite");}}return Calendar.stopEvent(ev);};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled)return false;removeClass(el,"hilite");if(el.caldate)removeClass(el.parentNode,"rowhilite");if(el.calendar)el.calendar.tooltips.innerHTML=_TT["SEL_DATE"];return stopEvent(ev);}};Calendar.cellClick=function(el,ev){var cal=el.calendar;var closing=false;var newdate=false;var date=null;if(typeof el.navtype=="undefined"){if(cal.currentDateEl){Calendar.removeClass(cal.currentDateEl,"selected");Calendar.addClass(el,"selected");closing=(cal.currentDateEl==el);if(!closing){cal.currentDateEl=el;}}cal.date.setDateOnly(el.caldate);date=cal.date;var other_month=!(cal.dateClicked=!el.otherMonth);if(!other_month&&!cal.currentDateEl)cal._toggleMultipleDate(new Date(date));else newdate=!el.disabled;if(other_month)cal._init(cal.firstDayOfWeek,date);}else{if(el.navtype==200){Calendar.removeClass(el,"hilite");cal.callCloseHandler();return;}date=new Date(cal.date);if(el.navtype==0)date.setDateOnly(new Date());cal.dateClicked=false;var year=date.getFullYear();var mon=date.getMonth();function setMonth(m){var day=date.getDate();var max=date.getMonthDays(m);if(day>max){date.setDate(max);}date.setMonth(m);};switch(el.navtype){case 400:Calendar.removeClass(el,"hilite");var text=Calendar._TT["ABOUT"];if(typeof text!="undefined"){text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";}else{text="Help and about box text is not translated into this language.\n"+"If you know this language and you feel generous please update\n"+"the corresponding file in \"lang\" subdir to match calendar-en.js\n"+"and send it back to to get it into the distribution ;-)\n\n"+"Thank you!\n"+"http://dynarch.com/mishoo/calendar.epl\n";}alert(text);return;case-2:if(year>cal.minYear){date.setFullYear(year-1);}break;case-1:if(mon>0){setMonth(mon-1);}else if(year-->cal.minYear){date.setFullYear(year);setMonth(11);}break;case 1:if(mon<11){setMonth(mon+1);}else if(year=0;)if(range[i]==current)break;if(ev&&ev.shiftKey){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();return;case 0:if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){return false;}break;}if(!date.equalsTo(cal.date)){cal.setDate(date);newdate=true;}else if(el.navtype==0)newdate=closing=true;}if(newdate){ev&&cal.callHandler();}if(closing){Calendar.removeClass(el,"hilite");ev&&cal.callCloseHandler();}};Calendar.prototype.create=function(_par){var parent=null;if(!_par){parent=document.getElementsByTagName("body")[0];this.isPopup=true;}else{parent=_par;this.isPopup=false;}this.date=this.dateStr?new Date(this.dateStr):new Date();var table=Calendar.createElement("table");this.table=table;table.cellSpacing=0;table.cellPadding=0;table.calendar=this;Calendar.addEvent(table,"mousedown",Calendar.tableMouseDown);var div=Calendar.createElement("div");this.element=div;div.className="calendar";if(this.isPopup){div.style.position="absolute";div.style.display="none";}div.appendChild(table);var thead=Calendar.createElement("thead",table);var cell=null;var row=null;var cal=this;var hh=function(text,cs,navtype){cell=Calendar.createElement("td",row);cell.colSpan=cs;cell.className="button";if(navtype!=0&&Math.abs(navtype)<=2)cell.className+=" nav";Calendar._add_evs(cell);cell.calendar=cal;cell.navtype=navtype;cell.innerHTML="
"+text+"
";return cell;};row=Calendar.createElement("tr",thead);var title_length=6;(this.isPopup)&&--title_length;(this.weekNumbers)&&++title_length;hh("?",1,400).ttip=Calendar._TT["INFO"];this.title=hh("",title_length,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";hh("×",1,200).ttip=Calendar._TT["CLOSE"];}row=Calendar.createElement("tr",thead);row.className="headrow";this._nav_py=hh("«",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=hh("‹",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=hh(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=hh("›",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=hh("»",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];row=Calendar.createElement("tr",thead);row.className="daynames";if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.className="name wn";cell.innerHTML=Calendar._TT["WK"];}for(var i=7;i>0;--i){cell=Calendar.createElement("td",row);if(!i){cell.navtype=100;cell.calendar=this;Calendar._add_evs(cell);}}this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;this._displayWeekdays();var tbody=Calendar.createElement("tbody",table);this.tbody=tbody;for(i=6;i>0;--i){row=Calendar.createElement("tr",tbody);if(this.weekNumbers){cell=Calendar.createElement("td",row);}for(var j=7;j>0;--j){cell=Calendar.createElement("td",row);cell.calendar=this;Calendar._add_evs(cell);}}if(this.showsTime){row=Calendar.createElement("tr",tbody);row.className="time";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;cell.innerHTML=Calendar._TT["TIME"]||" ";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=this.weekNumbers?4:3;(function(){function makeTimePart(className,init,range_start,range_end){var part=Calendar.createElement("span",cell);part.className=className;part.innerHTML=init;part.calendar=cal;part.ttip=Calendar._TT["TIME_PART"];part.navtype=50;part._range=[];if(typeof range_start!="number")part._range=range_start;else{for(var i=range_start;i<=range_end;++i){var txt;if(i<10&&range_end>=10)txt='0'+i;else txt=''+i;part._range[part._range.length]=txt;}}Calendar._add_evs(part);return part;};var hrs=cal.date.getHours();var mins=cal.date.getMinutes();var t12=!cal.time24;var pm=(hrs>12);if(t12&&pm)hrs-=12;var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);var span=Calendar.createElement("span",cell);span.innerHTML=":";span.className="colon";var M=makeTimePart("minute",mins,0,59);var AP=null;cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;if(t12)AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"]);else cell.innerHTML=" ";cal.onSetTime=function(){var pm,hrs=this.date.getHours(),mins=this.date.getMinutes();if(t12){pm=(hrs>=12);if(pm)hrs-=12;if(hrs==0)hrs=12;AP.innerHTML=pm?"pm":"am";}H.innerHTML=(hrs<10)?("0"+hrs):hrs;M.innerHTML=(mins<10)?("0"+mins):mins;};cal.onUpdateTime=function(){var date=this.date;var h=parseInt(H.innerHTML,10);if(t12){if(/pm/i.test(AP.innerHTML)&&h<12)h+=12;else if(/am/i.test(AP.innerHTML)&&h==12)h=0;}var d=date.getDate();var m=date.getMonth();var y=date.getFullYear();date.setHours(h);date.setMinutes(parseInt(M.innerHTML,10));date.setFullYear(y);date.setMonth(m);date.setDate(d);this.dateClicked=false;this.callHandler();};})();}else{this.onSetTime=this.onUpdateTime=function(){};}var tfoot=Calendar.createElement("tfoot",table);row=Calendar.createElement("tr",tfoot);row.className="footrow";cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);cell.className="ttip";if(this.isPopup){cell.ttip=Calendar._TT["DRAG_TO_MOVE"];cell.style.cursor="move";}this.tooltips=cell;div=Calendar.createElement("div",this.element);this.monthsCombo=div;div.className="combo";for(i=0;i0;--i){var yr=Calendar.createElement("div");yr.className=Calendar.is_ie?"label-IEfix":"label";div.appendChild(yr);}this._init(this.firstDayOfWeek,this.date);parent.appendChild(this.element);};Calendar._keyEvent=function(ev){var cal=window._dynarch_popupCalendar;if(!cal||cal.multiple)return false;(Calendar.is_ie)&&(ev=window.event);var act=(Calendar.is_ie||ev.type=="keypress"),K=ev.keyCode;if(ev.ctrlKey){switch(K){case 37:act&&Calendar.cellClick(cal._nav_pm);break;case 38:act&&Calendar.cellClick(cal._nav_py);break;case 39:act&&Calendar.cellClick(cal._nav_nm);break;case 40:act&&Calendar.cellClick(cal._nav_ny);break;default:return false;}}else switch(K){case 32:Calendar.cellClick(cal._nav_now);break;case 27:act&&cal.callCloseHandler();break;case 37:case 38:case 39:case 40:if(act){var prev,x,y,ne,el,step;prev=K==37||K==38;step=(K==37||K==39)?1:7;function setVars(){el=cal.currentDateEl;var p=el.pos;x=p&15;y=p>>4;ne=cal.ar_days[y][x];};setVars();function prevMonth(){var date=new Date(cal.date);date.setDate(date.getDate()-step);cal.setDate(date);};function nextMonth(){var date=new Date(cal.date);date.setDate(date.getDate()+step);cal.setDate(date);};while(1){switch(K){case 37:if(--x>=0)ne=cal.ar_days[y][x];else{x=6;K=38;continue;}break;case 38:if(--y>=0)ne=cal.ar_days[y][x];else{prevMonth();setVars();}break;case 39:if(++x<7)ne=cal.ar_days[y][x];else{x=0;K=40;continue;}break;case 40:if(++ythis.maxYear){year=this.maxYear;date.setFullYear(year);}this.firstDayOfWeek=firstDayOfWeek;this.date=new Date(date);var month=date.getMonth();var mday=date.getDate();var no_days=date.getMonthDays();date.setDate(1);var day1=(date.getDay()-this.firstDayOfWeek)%7;if(day1<0)day1+=7;date.setDate(-day1);date.setDate(date.getDate()+1);var row=this.tbody.firstChild;var MN=Calendar._SMN[month];var ar_days=this.ar_days=new Array();var weekend=Calendar._TT["WEEKEND"];var dates=this.multiple?(this.datesCells={}):null;for(var i=0;i<6;++i,row=row.nextSibling){var cell=row.firstChild;if(this.weekNumbers){cell.className="day wn";cell.innerHTML=date.getWeekNumber();cell=cell.nextSibling;}row.className="daysrow";var hasdays=false,iday,dpos=ar_days[i]=[];for(var j=0;j<7;++j,cell=cell.nextSibling,date.setDate(iday+1)){iday=date.getDate();var wday=date.getDay();cell.className="day";cell.pos=i<<4|j;dpos[j]=cell;var current_month=(date.getMonth()==month);if(!current_month){if(this.showsOtherMonths){cell.className+=" othermonth";cell.otherMonth=true;}else{cell.className="emptycell";cell.innerHTML=" ";cell.disabled=true;continue;}}else{cell.otherMonth=false;hasdays=true;}cell.disabled=false;cell.innerHTML=this.getDateText?this.getDateText(date,iday):iday;if(dates)dates[date.print("%Y%m%d")]=cell;if(this.getDateStatus){var status=this.getDateStatus(date,year,month,iday);if(this.getDateToolTip){var toolTip=this.getDateToolTip(date,year,month,iday);if(toolTip)cell.title=toolTip;}if(status===true){cell.className+=" disabled";cell.disabled=true;}else{if(/disabled/i.test(status))cell.disabled=true;cell.className+=" "+status;}}if(!cell.disabled){cell.caldate=new Date(date);cell.ttip="_";if(!this.multiple&¤t_month&&iday==mday&&this.hiliteToday){cell.className+=" selected";this.currentDateEl=cell;}if(date.getFullYear()==TY&&date.getMonth()==TM&&iday==TD){cell.className+=" today";cell.ttip+=Calendar._TT["PART_TODAY"];}if(weekend.indexOf(wday.toString())!=-1)cell.className+=cell.otherMonth?" oweekend":" weekend";}}if(!(hasdays||this.showsOtherMonths))row.className="emptyrow";}this.title.innerHTML=Calendar._MN[month]+", "+year;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates();};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var i in this.multiple){var cell=this.datesCells[i];var d=this.multiple[i];if(!d)continue;if(cell)cell.className+=" selected";}}};Calendar.prototype._toggleMultipleDate=function(date){if(this.multiple){var ds=date.print("%Y%m%d");var cell=this.datesCells[ds];if(cell){var d=this.multiple[ds];if(!d){Calendar.addClass(cell,"selected");this.multiple[ds]=date;}else{Calendar.removeClass(cell,"selected");delete this.multiple[ds];}}}};Calendar.prototype.setDateToolTipHandler=function(unaryFunction){this.getDateToolTip=unaryFunction;};Calendar.prototype.setDate=function(date){if(!date.equalsTo(this.date)){this._init(this.firstDayOfWeek,date);}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date);};Calendar.prototype.setFirstDayOfWeek=function(firstDayOfWeek){this._init(firstDayOfWeek,this.date);this._displayWeekdays();};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(unaryFunction){this.getDateStatus=unaryFunction;};Calendar.prototype.setRange=function(a,z){this.minYear=a;this.maxYear=z;};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat));}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this);}this.hideShowCovered();};Calendar.prototype.destroy=function(){var el=this.element.parentNode;el.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null;};Calendar.prototype.reparent=function(new_parent){var el=this.element;el.parentNode.removeChild(el);new_parent.appendChild(el);};Calendar._checkCalendar=function(ev){var calendar=window._dynarch_popupCalendar;if(!calendar){return false;}var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null&&el!=calendar.element;el=el.parentNode);if(el==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(ev);}};Calendar.prototype.show=function(){var rows=this.table.getElementsByTagName("tr");for(var i=rows.length;i>0;){var row=rows[--i];Calendar.removeClass(row,"rowhilite");var cells=row.getElementsByTagName("td");for(var j=cells.length;j>0;){var cell=cells[--j];Calendar.removeClass(cell,"hilite");Calendar.removeClass(cell,"active");}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar);}this.hideShowCovered();};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar);}this.element.style.display="none";this.hidden=true;this.hideShowCovered();};Calendar.prototype.showAt=function(x,y){var s=this.element.style;s.left=x+"px";s.top=y+"px";this.show();};Calendar.prototype.showAtElement=function(el,opts){var self=this;var p=Calendar.getAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true;}function fixPosition(box){if(box.x<0)box.x=0;if(box.y<0)box.y=0;var cp=document.createElement("div");var s=cp.style;s.position="absolute";s.right=s.bottom=s.width=s.height="0px";document.body.appendChild(cp);var br=Calendar.getAbsolutePos(cp);document.body.removeChild(cp);if(Calendar.is_ie){br.y+=document.body.scrollTop;br.x+=document.body.scrollLeft;}else{br.y+=window.scrollY;br.x+=window.scrollX;}var tmp=box.x+box.width-br.x;if(tmp>0)box.x-=tmp;tmp=box.y+box.height-br.y;if(tmp>0)box.y-=tmp;};this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var w=self.element.offsetWidth;var h=self.element.offsetHeight;self.element.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1);}switch(valign){case "T":p.y-=h;break;case "B":p.y+=el.offsetHeight;break;case "C":p.y+=(el.offsetHeight-h)/2;break;case "t":p.y+=el.offsetHeight-h;break;case "b":break;}switch(halign){case "L":p.x-=w;break;case "R":p.x+=el.offsetWidth;break;case "C":p.x+=(el.offsetWidth-w)/2;break;case "l":p.x+=el.offsetWidth-w;break;case "r":break;}p.width=w;p.height=h+40;self.monthsCombo.style.display="none";fixPosition(p);self.showAt(p.x,p.y);};if(Calendar.is_khtml)setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10);else Calendar.continuation_for_the_fucking_khtml_browser();};Calendar.prototype.setDateFormat=function(str){this.dateFormat=str;};Calendar.prototype.setTtDateFormat=function(str){this.ttDateFormat=str;};Calendar.prototype.parseDate=function(str,fmt){if(!fmt)fmt=this.dateFormat;this.setDate(Date.parseDate(str,fmt));};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera)return;function getVisib(obj){var value=obj.style.visibility;if(!value){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml)value=document.defaultView. getComputedStyle(obj,"").getPropertyValue("visibility");else value='';}else if(obj.currentStyle){value=obj.currentStyle.visibility;}else value='';}return value;};var tags=new Array("applet","iframe","select");var el=this.element;var p=Calendar.getAbsolutePos(el);var EX1=p.x;var EX2=el.offsetWidth+EX1;var EY1=p.y;var EY2=el.offsetHeight+EY1;for(var k=tags.length;k>0;){var ar=document.getElementsByTagName(tags[--k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];p=Calendar.getAbsolutePos(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if(this.hidden||(CX1>EX2)||(CX2EY2)||(CY229)?1900:2000);break;case "%b":case "%B":for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break;}}break;case "%H":case "%I":case "%k":case "%l":hr=parseInt(a[i],10);break;case "%P":case "%p":if(/pm/i.test(a[i])&&hr<12)hr+=12;else if(/am/i.test(a[i])&&hr>=12)hr-=12;break;case "%M":min=parseInt(a[i],10);break;}}if(isNaN(y))y=today.getFullYear();if(isNaN(m))m=today.getMonth();if(isNaN(d))d=today.getDate();if(isNaN(hr))hr=today.getHours();if(isNaN(min))min=today.getMinutes();if(y!=0&&m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);y=0;m=-1;d=0;for(i=0;i31&&y==0){y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);}else if(d==0){d=a[i];}}if(y==0)y=today.getFullYear();if(m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);return today;};Date.prototype.getMonthDays=function(month){var year=this.getFullYear();if(typeof month=="undefined"){month=this.getMonth();}if(((0==(year%4))&&((0!=(year%100))||(0==(year%400))))&&month==1){return 29;}else{return Date._MD[month];}};Date.prototype.getDayOfYear=function(){var now=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var then=new Date(this.getFullYear(),0,0,0,0,0);var time=now-then;return Math.floor(time/Date.DAY);};Date.prototype.getWeekNumber=function(){var d=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var DoW=d.getDay();d.setDate(d.getDate()-(DoW+6)%7+3);var ms=d.valueOf();d.setMonth(0);d.setDate(4);return Math.round((ms-d.valueOf())/(7*864e5))+1;};Date.prototype.equalsTo=function(date){return((this.getFullYear()==date.getFullYear())&&(this.getMonth()==date.getMonth())&&(this.getDate()==date.getDate())&&(this.getHours()==date.getHours())&&(this.getMinutes()==date.getMinutes()));};Date.prototype.setDateOnly=function(date){var tmp=new Date(date);this.setDate(1);this.setFullYear(tmp.getFullYear());this.setMonth(tmp.getMonth());this.setDate(tmp.getDate());};Date.prototype.print=function(str){var m=this.getMonth();var d=this.getDate();var y=this.getFullYear();var wn=this.getWeekNumber();var w=this.getDay();var s={};var hr=this.getHours();var pm=(hr>=12);var ir=(pm)?(hr-12):hr;var dy=this.getDayOfYear();if(ir==0)ir=12;var min=this.getMinutes();var sec=this.getSeconds();s["%a"]=Calendar._SDN[w];s["%A"]=Calendar._DN[w];s["%b"]=Calendar._SMN[m];s["%B"]=Calendar._MN[m];s["%C"]=1+Math.floor(y/100);s["%d"]=(d<10)?("0"+d):d;s["%e"]=d;s["%H"]=(hr<10)?("0"+hr):hr;s["%I"]=(ir<10)?("0"+ir):ir;s["%j"]=(dy<100)?((dy<10)?("00"+dy):("0"+dy)):dy;s["%k"]=hr;s["%l"]=ir;s["%m"]=(m<9)?("0"+(1+m)):(1+m);s["%M"]=(min<10)?("0"+min):min;s["%n"]="\n";s["%p"]=pm?"PM":"AM";s["%P"]=pm?"pm":"am";s["%s"]=Math.floor(this.getTime()/1000);s["%S"]=(sec<10)?("0"+sec):sec;s["%t"]="\t";s["%U"]=s["%W"]=s["%V"]=(wn<10)?("0"+wn):wn;s["%u"]=w+1;s["%w"]=w;s["%y"]=(''+y).substr(2,2);s["%Y"]=y;s["%%"]="%";var re=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml)return str.replace(re,function(par){return s[par]||par;});var a=str.match(re);for(var i=0;i= 0;) { var d = params.multiple[i]; var ds = d.print("%Y%m%d"); cal.multiple[ds] = d; } } cal.showsOtherMonths = params.showOthers; cal.yearStep = params.step; cal.setRange(params.range[0], params.range[1]); cal.params = params; cal.setDateStatusHandler(params.dateStatusFunc); cal.setDateText = params.dateText; cal.setDateFormat(dateFmt); if (mustCreate) cal.create(); cal.refresh(); if (!params.position) cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); else cal.showAt(params.position[0], params.position[1]); return false; }; return cal; }; /* $Id: dom.js 490 2006-09-15 16:04:05Z juraj $ find actual version of this library at: http://www.fczbkk.com/js/dom/ */ // library for cross-browser event management evt = { // attach event add : function(obj, evType, fn, useCapture) { // Opera hack if (window.opera && (obj == window)) { obj = document; } if (obj.addEventListener){ obj.addEventListener(evType, fn, useCapture); return true; } else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } }, // remove event remove : function(obj, evType, fn, useCapture) { // Opera hack if (window.opera && (obj == window)) { obj = document; } if (obj.removeEventListener) { obj.removeEventListener(evType, fn, useCapture); return true; } else if (obj.detachEvent) { var r = obj.detachEvent("on"+evType, fn); return r; } else { return false; } }, // fix for IE event model fix : function(e) { if (typeof e == 'undefined') e = window.event; if (typeof e.target == 'undefined') e.target = e.srcElement; if (typeof e.layerX == 'undefined') e.layerX = e.offsetX; if (typeof e.layerY == 'undefined') e.layerY = e.offsetY; if ((typeof e.which == 'undefined') && e.keyCode) e.which = e.keyCode; // thanx to KKL2401 for preventDefault hack if (!e.preventDefault) e.preventDefault = function() { e.returnValue = false; } return e; } } // library for working with multiple classes var cls = { // vrati pole obsahujuce vsetky triedy daneho elementu get : function (elm) { if (elm && elm.tagName) { var classes = []; if (elm.className) { // na zaklade Centiho upozornenia o divnej interpretacii v Opere var cl = elm.className.replace(/\s+/g, " "); classes = cl.split(" "); } return classes; } return false; }, // vrati true, ak element obsahuje triedu has : function (elm, cl) { if ((actCl = cls.get(elm)) && (typeof(cl) == "string")) { for (var i = 0; i < actCl.length; i++) { if (actCl[i] == cl) { return true; } } } return false; }, // prida triedu elementu add : function (elm, cl) { if ((actCl = cls.get(elm)) && (typeof(cl) == "string")) { if (!cls.has(elm, cl)) { elm.className += (actCl.length > 0) ? " " + cl : cl; } return true; } return false; }, // odstrani triedu z elementu remove : function (elm, cl) { if ((actCl = cls.get(elm)) && (typeof(cl) == "string")) { tempCl = ""; for (var i = 0; i < actCl.length; i++) { if (actCl[i] != cl) { if (tempCl != "") {tempCl += " ";} tempCl += actCl[i]; } elm.className = tempCl; } return true; } return false; }, // nahradi staru triedu elementu novou, ak stara neexistuje, prida novu replace : function (elm, oldCl, newCl) { if ((actCl = cls.get(elm)) && (typeof(oldCl) == "string") && (typeof(newCl) == "string")) { tempCl = ""; if (cls.has(elm, newCl)) { cls.remove(elm, oldCl); } else if (cls.has(elm, oldCl)) { for (var i = 0; i < actCl.length; i++) { if (tempCl != "") {tempCl += " ";} tempCl += (actCl[i] == oldCl) ? newCl : actCl[i]; } elm.className = tempCl; } else { cls.add(elm, newCl); } return true; } return false; } } /* $Id: tree.js 529 2006-09-20 16:38:54Z juraj $ tree (version 3.5) by Riki "Fczbkk" Fridrich, 2002 http://www.fczbkk.com/ mailto:riki@fczbkk.com You should find latest version of this script and documentation at http://www.fczbkk.com/js/tree/ */ // object holding all functions and variables tree = { /* ------------------ user customization starts here ------------------ */ // classes used in HTML document to mark important elements classRoot : "tree", // ULs with this class will be transformed into trees classDefault : "default", // LIs with this class will be expanded by default classLast : "last", // this class will be added to all last branches of the tree // (this is good for easier CSS formatting of the tree) // paths to images used in tree nodes nodeExpand : "/rs/theme/img/tree/plus.gif", // image of expandable node nodeExpandAlt : "[+] ", nodeCollapse : "/rs/theme/img/tree/minus.gif", // image of collapsable node nodeCollapseAlt : "[-] ", nodeNone : "/rs/theme/img/tree/none.gif", // image for node without children nodeNoneAlt : "[.] ", /* ------------------ user customization ends here ------------------ */ // initialisation of the tree init : function() { // find all unordered lists marked as trees var uls = tree.getElementsByClassName(document, tree.classRoot, "ul"); for (var i = 0; i < uls.length; i++) { // find all last branches of the tree and mark them tree.markLast(uls[i]); var uls2 = uls[i].getElementsByTagName("ul"); for (var j = 0; j < uls2.length; j++) { tree.markLast(uls2[j]); } // ad node pictures to all branches var lis = uls[i].getElementsByTagName("li"); for (var j = 0; j < lis.length; j++) { tree.addNode(lis[j]); } // collapse all branches at the start tree.collapseAll(uls[i]); // find default branches and expand them var def = tree.getElementsByClassName(uls[i], tree.classDefault, "li"); for (var j = 0; j < def.length; j++) { var path = new Array(); var step = def[j]; while (step != uls[i]) { if (step.tagName == "LI") { tree.expand(step); } step = step.parentNode; } } } }, // adds node picture at the beginning of all branches addNode : function(elm) { var uls = elm.getElementsByTagName("ul"); var image = document.createElement("img"); if (uls.length > 0) { image.src = tree.nodeExpand; image.alt = tree.nodeExpandAlt; evt.add(image, "click", tree.changeState); } else { image.src = tree.nodeNone; image.alt = tree.nodeNoneAlt; } elm.removeChild(elm.firstChild); elm.insertBefore(image, elm.firstChild); }, // gets the actual state of branch and changes it changeState : function(e) { e = evt.fix(e); var obj = (e.currentTarget) ? e.currentTarget : e.target; while (obj.tagName != "LI") { obj = obj.parentNode; } if (obj.state == "collapsed") { tree.expand(obj); } else { tree.collapse(obj); } }, // expands given branch expand : function(elm) { var uls = elm.getElementsByTagName("ul"); for (var i = 0; i < uls.length; i++) { if (uls[i].parentNode == elm) { uls[i].style.display = "block"; uls[i].parentNode.state = "expanded"; elm.firstChild.src = tree.nodeCollapse; elm.firstChild.alt = tree.nodeCollapseAlt; } } }, // collapses given branch collapse : function(elm) { var uls = elm.getElementsByTagName("ul"); for (var i = 0; i < uls.length; i++) { if (uls[i].parentNode == elm) { uls[i].style.display = "none"; uls[i].parentNode.state = "collapsed"; elm.firstChild.src = tree.nodeExpand; elm.firstChild.alt = tree.nodeExpandAlt; } } }, // collapses all branches in the given tree collapseAll : function(elm) { if (elm.tagName == "LI") {tree.expand(elm);} var lis = elm.getElementsByTagName("li"); for (var i = 0; i < lis.length; i++) { tree.collapse(lis[i]); } }, // expands all branches in the given tree expandAll : function(elm) { if (elm.tagName == "LI") {tree.expand(elm);} var lis = elm.getElementsByTagName("li"); for (var i = 0; i < lis.length; i++) { tree.expand(lis[i]); } }, // marks the last branch in the given branch as last markLast : function(elm) { var lis = elm.getElementsByTagName("li"); var i = lis.length - 1; while (lis[i].parentNode != elm) {i--;} cls.add(lis[i], tree.classLast); }, // returns all elements with given class, that are children of given source element // attribute tagName is not required, but it speeds up the function a bit getElementsByClassName : function(srcElm, clName, tName) { foundElements = []; tName = (tName) ? tName.toUpperCase() : "*"; allElements = srcElm.getElementsByTagName(tName); for (var i = 0; i < allElements.length; i++) { if (cls.has(allElements[i], clName)) { foundElements[foundElements.length] = allElements[i]; } } return foundElements; } }; // initialisation of the script on load evt.add(window, "load", tree.init);