// Labels for Ajax javascripts
// $Id: labels.js 41776 2009-04-29 09:10:45Z bas $
//

window.labels								= new Object();

window.labels["main"] 						= new Object();
window.labels["main"]["loading"]			= "loading...";

/* autocomplete */
window.labels["autocomplete"] 				= new Object();
window.labels["autocomplete"]["cancel"]		= "Annuler ";

/* annotations */
window.labels["annotations"] 				= new Object();
window.labels["annotations"]["makeactor"]	= "Make a new person";
window.labels["annotations"]["popuptitle"]	= "Tag person";
window.labels["annotations"]["needtologin"]	= "You need to log in";
window.labels["annotations"]["addingactor"]	= "Adding person";
window.labels["annotations"]["actoralreadyadded"]	= "Person is already tagged.";
window.labels["annotations"]["wasaproblem"]	= "There was a problem, please try again";

/* sortable */
window.labels["sortable"]	 				= new Object();

/* lightbox */
window.labels["lightbox"]					= new Object();
window.labels["lightbox"]["cancel"]			= "Annuler ";
window.labels["lightbox"]["save"]			= "Sauvegarder";

/* editatonce */
window.labels["editatonce"] 				= new Object();
window.labels["editatonce"]["saving"]		= "Sauvegarde en cours";

/* editinplace */
window.labels["editinplace"] 				= new Object();
window.labels["editinplace"]["cancel"]		= "Annuler ";
window.labels["editinplace"]["save"]		= "Sauvegarder";
window.labels["editinplace"]["onempty"]		= ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ";
window.labels["editinplace"]["saving"]		= "Sauvegarde en cours";
window.labels["editinplace"]["fetching"]	= "Attrayant â€¦";
window.labels["editinplace"]["validate"]			= new Object();
window.labels["editinplace"]["validate"]["msg"]		= "Please enter valid information";
window.labels["editinplace"]["validate"]["out"]		= "Value out of range";
window.labels["editinplace"]["validate"]["integer"]	= "Saisissez des nombres en utilisant les chiffres de 0 Ã  9 uniquement. Par exempleÂ : â€˜1200â€™ (pas â€˜1,200â€™, â€˜1.200â€™ ni â€˜1200 USDâ€™)";
window.labels["editinplace"]["validate"]["float"]	= "Saisissez des nombres en utilisant les chiffres de 0 Ã  9 uniquement. Par exempleÂ : â€˜1200â€™ (pas â€˜1,200â€™, â€˜1.200â€™ ni â€˜1200 USDâ€™)";

/* unlink */
window.labels["unlink"] 					= new Object();
window.labels["unlink"]["cancel"]			= "Non";
window.labels["unlink"]["yes"]				= "Oui";
window.labels["unlink"]["confirm"]			= "Retirer";
window.labels["unlink"]["title"]			= "Retirer cet Ã©lÃ©ment";

/* shoutbox */
window.labels['shoutbox'] 					= new Object();
window.labels['shoutbox']['away']	  		= "You seem to be away from this window. Shutting down shoutbox.";
window.labels['shoutbox']['changed']		= "The default conversation for this page has changed. Refreshing in a few seconds.";
window.labels['shoutbox']['noconv']			= "No conversation exists for this thing yet.";
window.labels['shoutbox']['emptytext']		= "Text is empty. You need to type something";
window.labels['shoutbox']['votedthis']		= "Voted this:";
window.labels['shoutbox']['showsms']		= "Show SMS";
window.labels['shoutbox']['hidesms']		= "Hide SMS";


/* wysiwyg */
window.labels['wysiwyg'] 					= new Object();
window.labels['wysiwyg']['add_link']		= "Add the link";
window.labels['wysiwyg']['add_youtube']		= "Add youtube code";
window.labels['wysiwyg']['add_title']		= "add the title of the link";
window.labels["wysiwyg"]['cancel']			= "Annuler ";
window.labels["wysiwyg"]['ok']				= "OK ";
window.labels["wysiwyg"]['youtube_expl']	= "You can find the YouTube code in the link, for example http://www.youtube.com/watch?v=nogDHP0gl9M, gives the code nogDHP0gl9M. Youhave to copy the movie code between = and before the &.";

window.labels['wysiwyg']['buttons']				= new Object();
window.labels['wysiwyg']['buttons']['italic'] 	= "italic";
window.labels['wysiwyg']['buttons']['bold'] 	= "bold";
window.labels['wysiwyg']['buttons']['link']	 	= "link";
window.labels['wysiwyg']['buttons']['youtube']	= "youtube";
window.labels['wysiwyg']['buttons']['h1'] 		= "huge head";
window.labels['wysiwyg']['buttons']['h2'] 		= "medium head";
window.labels['wysiwyg']['buttons']['h3'] 		= "subhead";
window.labels['wysiwyg']['buttons']['h4'] 		= "small subhead";

// 
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(k(D){c A=D.fn.26;D.fn.26=k(){D("*",b).2d(b).3O("26");l A.1G(b,1H)};k C(E){k G(H){c I=H.2v;l(I.56!="4i"&&I.h2!="30")}c F=G(E);(F&&D.1R(D.h1(E,"4e"),k(){l(F=G(b))}));l F}D.1Q(D.h3[":"],{1t:k(F,G,E){l D.1t(F,E[3])},h4:k(F,G,E){c H=F.2q.6Q();l(F.h5>=0&&(("a"==H&&F.di)||(/1k|54|8q|59/.1q(H)&&"30"!=F.6f&&!F.1Y))&&C(F))}});D.8F={h0:8,gZ:20,gV:gU,gW:17,gX:46,gY:40,h6:35,h7:13,hg:27,hf:36,hh:45,hi:37,hj:bn,he:hd,h9:h8,ha:hb,hc:gT,gS:gA,gz:34,gB:33,gC:gD,gy:39,gx:16,gs:32,gr:9,gt:38};k B(I,E,J,H){k G(L){c K=D[I][E][L]||[];l(2n K=="4L"?K.7e(/,?\\s+/):K)}c F=G("de");if(H.1C==1&&2n H[0]=="4L"){F=F.4u(G("cL"))}l(D.gu(J,F)!=-1)}D.4b=k(E,F){c G=E.7e(".")[0];E=E.7e(".")[1];D.fn[E]=k(K){c I=(2n K=="4L"),J=9j.5f.ef.24(1H,1);if(I&&K.gw(0,1)=="aY"){l b}if(I&&B(G,E,K,J)){c H=D.1t(b[0],E);l(H?H[K].1G(H,J):2w)}l b.1R(k(){c L=D.1t(b,E);(!L&&!I&&D.1t(b,E,1w D[G][E](b,K)));(L&&I&&D.7V(L[K])&&L[K].1G(L,J))})};D[G][E]=k(I,J){c H=b;b.69=E;b.aq=D[G][E].gv||E;b.cJ=G+"-"+E;b.q=D.1Q({},D.4b.5v,D[G][E].5v,D.cK&&D.cK.3Q(I)[E],J);b.18=D(I).3c("cd."+E,k(M,K,L){l H.5r(K,L)}).3c("aa."+E,k(L,K){l H.az(K)}).3c("26",k(){l H.6o()});b.6H()};D[G][E].5f=D.1Q({},D.4b.5f,F);D[G][E].cL="7c"};D.4b.5f={6H:k(){},6o:k(){b.18.5I(b.69)},7c:k(G,H){c F=G,E=b;if(2n G=="4L"){if(H===2w){l b.az(G)}F={};F[G]=H}D.1R(F,k(I,J){E.5r(I,J)})},az:k(E){l b.q[E]},5r:k(E,F){b.q[E]=F;if(E=="1Y"){b.18[F?"1I":"2k"](b.cJ+"-1Y")}},et:k(){b.5r("1Y",1g)},eE:k(){b.5r("1Y",1m)},gE:k(F,H,G){c E=(F==b.aq?F:b.aq+F);H=H||D.6K.gF({6f:E,1d:b.18[0]});l b.18.3O(E,[H,G],b.q[F])}};D.4b.5v={1Y:1g};D.p={2u:{2d:k(F,E,I){c H=D.p[F].5f;29(c G in I){H.5q[G]=H.5q[G]||[];H.5q[G].7K([E,I[G]])}},24:k(E,G,F){c I=E.5q[G];if(!I){l}29(c H=0;H<I.1C;H++){if(E.q[I[H][0]]){I[H][1].1G(E.18,F)}}}},8A:{},Z:k(E){if(D.p.8A[E]){l D.p.8A[E]}c F=D(\'<1p 22="p-gO">\').1I(E).Z({1c:"2i",u:"-cI",t:"-cI",56:"8k"}).3T("2g");D.p.8A[E]=!!((!(/3q|4s/).1q(F.Z("2j"))||(/^[1-9]/).1q(F.Z("15"))||(/^[1-9]/).1q(F.Z("v"))||!(/4i/).1q(F.Z("bz"))||!(/5w|eY\\(0, 0, 0, 0\\)/).1q(F.Z("6I"))));9O{D("2g").3Q(0).bh(F.3Q(0))}9U(G){}l D.p.8A[E]},7z:k(E){l D(E).3r("5d","cH").Z("cF","4i").3c("cG.p",k(){l 1g})},gN:k(E){l D(E).3r("5d","gP").Z("cF","").3M("cG.p")},8t:k(H,E){if(D(H).Z("2V")=="30"){l 1g}c G=(E&&E=="t")?"2z":"2A",F=1g;if(H[G]>0){l 1m}H[G]=1;F=(H[G]>0);H[G]=0;l F}};D.p.4r={8Y:k(){c E=b;b.18.3c("9H."+b.69,k(F){l E.ba(F)});if(D.2y.4d){b.cM=b.18.3r("5d");b.18.3r("5d","cH")}b.gQ=1g},8V:k(){b.18.3M("."+b.69);(D.2y.4d&&b.18.3r("5d",b.cM))},ba:k(G){(b.5i&&b.7R(G));b.9x=G;c E=b,H=(G.gR==1),F=(2n b.q.7W=="4L"?D(G.1d).6s().2d(G.1d).e1(b.q.7W).1C:1g);if(!H||F||!b.7G(G)){l 1m}b.99=!b.q.7U;if(!b.99){b.gM=eD(k(){E.99=1m},b.q.7U)}if(b.ak(G)&&b.aA(G)){b.5i=(b.6R(G)!==1g);if(!b.5i){G.9f();l 1m}}b.aH=k(I){l E.cN(I)};b.ax=k(I){l E.7R(I)};D(1n).3c("cT."+b.69,b.aH).3c("cU."+b.69,b.ax);l 1g},cN:k(E){if(D.2y.4d&&!E.59){l b.7R(E)}if(b.5i){b.62(E);l 1g}if(b.ak(E)&&b.aA(E)){b.5i=(b.6R(b.9x,E)!==1g);(b.5i?b.62(E):b.7R(E))}l!b.5i},7R:k(E){D(1n).3M("cT."+b.69,b.aH).3M("cU."+b.69,b.ax);if(b.5i){b.5i=1g;b.6O(E)}l 1g},ak:k(E){l(1i.2c(1i.3A(b.9x.3z-E.3z),1i.3A(b.9x.3u-E.3u))>=b.q.6a)},aA:k(E){l b.99},6R:k(E){},62:k(E){},6O:k(E){},7G:k(E){l 1m}};D.p.4r.5v={7W:1e,6a:1,7U:0}})(1u);(k(A){A.4b("p.1Z",A.1Q({},A.p.4r,{cS:k(C){c B=!b.q.1x||!A(b.q.1x,b.18).1C?1m:1g;A(b.q.1x,b.18).6W("*").cn().1R(k(){if(b==C.1d){B=1m}});l B},cR:k(){c C=b.q;c B=A.7V(C.1j)?A(C.1j.1G(b.18[0],[e])):(C.1j=="89"?b.18.89():b.18);if(!B.6s("2g").1C){B.3T((C.3T=="1J"?b.18[0].4e:C.3T))}if(B[0]!=b.18[0]&&!(/(4I|2i)/).1q(B.Z("1c"))){B.Z("1c","2i")}l B},6H:k(){if(b.q.1j=="cb"&&!(/^(?:r|a|f)/).1q(b.18.Z("1c"))){b.18[0].2v.1c="1O"}(b.q.7o&&b.18.1I(b.q.7o+"-1Z"));(b.q.1Y&&b.18.1I("p-1Z-1Y"));b.8Y()},7G:k(B){c C=b.q;if(b.1j||C.1Y||A(B.1d).is(".p-1l-1x")){l 1g}b.1x=b.cS(B);if(!b.1x){l 1g}l 1m},6R:k(D){c E=b.q;b.1j=b.cR();if(A.p.2F){A.p.2F.4x=b}b.3X={t:(1h(b.18.Z("7Z"),10)||0),u:(1h(b.18.Z("8r"),10)||0)};b.4h=b.1j.Z("1c");b.1b=b.18.1b();b.1b={u:b.1b.u-b.3X.u,t:b.1b.t-b.3X.t};b.1b.2N={t:D.3z-b.1b.t,u:D.3u-b.1b.u};b.cP();b.5b=b.1j.5b();c B=b.5b.1b();if(b.5b[0]==1n.2g&&A.2y.gH){B={u:0,t:0}}b.1b.1J={u:B.u+(1h(b.5b.Z("6Y"),10)||0),t:B.t+(1h(b.5b.Z("6F"),10)||0)};if(b.4h=="1O"){c C=b.18.1c();b.1b.1O={u:C.u-(1h(b.1j.Z("u"),10)||0)+b.6l.2A(),t:C.t-(1h(b.1j.Z("t"),10)||0)+b.6i.2z()}}1o{b.1b.1O={u:0,t:0}}b.2U=b.bE(D);b.bU();if(E.cO){b.cQ(E.cO)}A.1Q(b,{bT:(b.4h=="2i"&&(!b.6l[0].4X||(/(1V|2g)/i).1q(b.6l[0].4X))),bK:(b.4h=="2i"&&(!b.6i[0].4X||(/(1V|2g)/i).1q(b.6i[0].4X))),bR:b.6l[0]!=b.5b[0]&&!(b.6l[0]==1n&&(/(2g|1V)/i).1q(b.5b[0].4X)),bB:b.6i[0]!=b.5b[0]&&!(b.6i[0]==1n&&(/(2g|1V)/i).1q(b.5b[0].4X))});if(E.1U){b.cE()}b.2e("2p",D);b.bU();if(A.p.2F&&!E.cD){A.p.2F.9W(b,D)}b.1j.1I("p-1Z-a4");b.62(D);l 1m},cP:k(){b.6l=k(B){do{if(/3q|5B/.1q(B.Z("2V"))||(/3q|5B/).1q(B.Z("2V-y"))){l B}B=B.1J()}4j(B[0].4e);l A(1n)}(b.1j);b.6i=k(B){do{if(/3q|5B/.1q(B.Z("2V"))||(/3q|5B/).1q(B.Z("2V-x"))){l B}B=B.1J()}4j(B[0].4e);l A(1n)}(b.1j)},cQ:k(B){if(B.t!=2w){b.1b.2N.t=B.t+b.3X.t}if(B.4g!=2w){b.1b.2N.t=b.2T.v-B.4g+b.3X.t}if(B.u!=2w){b.1b.2N.u=B.u+b.3X.u}if(B.4q!=2w){b.1b.2N.u=b.2T.15-B.4q+b.3X.u}},bU:k(){b.2T={v:b.1j.3l(),15:b.1j.3n()}},cE:k(){c E=b.q;if(E.1U=="1J"){E.1U=b.1j[0].4e}if(E.1U=="1n"||E.1U=="4W"){b.1U=[0-b.1b.1O.t-b.1b.1J.t,0-b.1b.1O.u-b.1b.1J.u,A(E.1U=="1n"?1n:4W).v()-b.1b.1O.t-b.1b.1J.t-b.2T.v-b.3X.t-(1h(b.18.Z("7b"),10)||0),(A(E.1U=="1n"?1n:4W).15()||1n.2g.4e.a2)-b.1b.1O.u-b.1b.1J.u-b.2T.15-b.3X.u-(1h(b.18.Z("7i"),10)||0)]}if(!(/^(1n|4W|1J)$/).1q(E.1U)){c C=A(E.1U)[0];c D=A(E.1U).1b();c B=(A(C).Z("2V")!="30");b.1U=[D.t+(1h(A(C).Z("6F"),10)||0)-b.1b.1O.t-b.1b.1J.t,D.u+(1h(A(C).Z("6Y"),10)||0)-b.1b.1O.u-b.1b.1J.u,D.t+(B?1i.2c(C.dh,C.5G):C.5G)-(1h(A(C).Z("6F"),10)||0)-b.1b.1O.t-b.1b.1J.t-b.2T.v-b.3X.t-(1h(b.18.Z("7b"),10)||0),D.u+(B?1i.2c(C.a2,C.5E):C.5E)-(1h(A(C).Z("6Y"),10)||0)-b.1b.1O.u-b.1b.1J.u-b.2T.15-b.3X.u-(1h(b.18.Z("7i"),10)||0)]}},4F:k(C,D){if(!D){D=b.1c}c B=C=="2i"?1:-1;l{u:(D.u+b.1b.1O.u*B+b.1b.1J.u*B-(b.4h=="4I"||b.bT||b.bR?0:b.6l.2A())*B+(b.4h=="4I"?A(1n).2A():0)*B+b.3X.u*B),t:(D.t+b.1b.1O.t*B+b.1b.1J.t*B-(b.4h=="4I"||b.bK||b.bB?0:b.6i.2z())*B+(b.4h=="4I"?A(1n).2z():0)*B+b.3X.t*B)}},bE:k(E){c F=b.q;c B={u:(E.3u-b.1b.2N.u-b.1b.1O.u-b.1b.1J.u+(b.4h=="4I"||b.bT||b.bR?0:b.6l.2A())-(b.4h=="4I"?A(1n).2A():0)),t:(E.3z-b.1b.2N.t-b.1b.1O.t-b.1b.1J.t+(b.4h=="4I"||b.bK||b.bB?0:b.6i.2z())-(b.4h=="4I"?A(1n).2z():0))};if(!b.2U){l B}if(b.1U){if(B.t<b.1U[0]){B.t=b.1U[0]}if(B.u<b.1U[1]){B.u=b.1U[1]}if(B.t>b.1U[2]){B.t=b.1U[2]}if(B.u>b.1U[3]){B.u=b.1U[3]}}if(F.2X){c D=b.2U.u+1i.3f((B.u-b.2U.u)/F.2X[1])*F.2X[1];B.u=b.1U?(!(D<b.1U[1]||D>b.1U[3])?D:(!(D<b.1U[1])?D-F.2X[1]:D+F.2X[1])):D;c C=b.2U.t+1i.3f((B.t-b.2U.t)/F.2X[0])*F.2X[0];B.t=b.1U?(!(C<b.1U[0]||C>b.1U[2])?C:(!(C<b.1U[0])?C-F.2X[0]:C+F.2X[0])):C}l B},62:k(B){b.1c=b.bE(B);b.3I=b.4F("2i");b.1c=b.2e("5x",B)||b.1c;if(!b.q.2f||b.q.2f!="y"){b.1j[0].2v.t=b.1c.t+"2J"}if(!b.q.2f||b.q.2f!="x"){b.1j[0].2v.u=b.1c.u+"2J"}if(A.p.2F){A.p.2F.5x(b,B)}l 1g},6O:k(C){c D=1g;if(A.p.2F&&!b.q.cD){c D=A.p.2F.6q(b,C)}if((b.q.6d=="hk"&&!D)||(b.q.6d=="hl"&&D)||b.q.6d===1m||(A.7V(b.q.6d)&&b.q.6d.24(b.18,D))){c B=b;A(b.1j).2a(b.2U,1h(b.q.hX,10)||hW,k(){B.2e("2M",C);B.bW()})}1o{b.2e("2M",C);b.bW()}l 1g},bW:k(){b.1j.2k("p-1Z-a4");if(b.q.1j!="cb"&&!b.7T){b.1j.26()}b.1j=1e;b.7T=1g},5q:{},83:k(B){l{1j:b.1j,1c:b.1c,a0:b.3I,q:b.q}},2e:k(C,B){A.p.2u.24(b,C,[B,b.83()]);if(C=="5x"){b.3I=b.4F("2i")}l b.18.3O(C=="5x"?C:"5x"+C,[B,b.83()],b.q[C])},6o:k(){if(!b.18.1t("1Z")){l}b.18.5I("1Z").3M(".1Z").2k("p-1Z p-1Z-a4 p-1Z-1Y");b.8V()}}));A.1Q(A.p.1Z,{5v:{3T:"1J",2f:1g,7W:":1k",7U:0,6a:1,1j:"cb",5C:"4s",7o:"p"}});A.p.2u.2d("1Z","2j",{2p:k(D,C){c B=A("2g");if(B.Z("2j")){C.q.c9=B.Z("2j")}B.Z("2j",C.q.2j)},2M:k(C,B){if(B.q.c9){A("2g").Z("2j",B.q.c9)}}});A.p.2u.2d("1Z","2W",{2p:k(D,C){c B=A(C.1j);if(B.Z("2W")){C.q.ce=B.Z("2W")}B.Z("2W",C.q.2W)},2M:k(C,B){if(B.q.ce){A(B.1j).Z("2W",B.q.ce)}}});A.p.2u.2d("1Z","2E",{2p:k(D,C){c B=A(C.1j);if(B.Z("2E")){C.q.c8=B.Z("2E")}B.Z("2E",C.q.2E)},2M:k(C,B){if(B.q.c8){A(B.1j).Z("2E",B.q.c8)}}});A.p.2u.2d("1Z","7J",{2p:k(C,B){A(B.q.7J===1m?"8l":B.q.7J).1R(k(){A(\'<1p 22="p-1Z-7J" 2v="8O: #i0;"></1p>\').Z({v:b.5G+"2J",15:b.5E+"2J",1c:"2i",2E:"0.hV",2W:cy}).Z(A(b).1b()).3T("2g")})},2M:k(C,B){A("1p.p-1Z-7J").1R(k(){b.4e.bh(b)})}});A.p.2u.2d("1Z","5B",{2p:k(D,C){c E=C.q;c B=A(b).1t("1Z");E.4Z=E.4Z||20;E.51=E.51||20;B.4G=k(F){do{if(/3q|5B/.1q(F.Z("2V"))||(/3q|5B/).1q(F.Z("2V-y"))){l F}F=F.1J()}4j(F[0].4e);l A(1n)}(b);B.4S=k(F){do{if(/3q|5B/.1q(F.Z("2V"))||(/3q|5B/).1q(F.Z("2V-x"))){l F}F=F.1J()}4j(F[0].4e);l A(1n)}(b);if(B.4G[0]!=1n&&B.4G[0].4X!="9G"){B.c7=B.4G.1b()}if(B.4S[0]!=1n&&B.4S[0].4X!="9G"){B.c2=B.4S.1b()}},5x:k(E,D){c F=D.q,C=1g;c B=A(b).1t("1Z");if(B.4G[0]!=1n&&B.4G[0].4X!="9G"){if((B.c7.u+B.4G[0].5E)-E.3u<F.4Z){B.4G[0].2A=C=B.4G[0].2A+F.51}if(E.3u-B.c7.u<F.4Z){B.4G[0].2A=C=B.4G[0].2A-F.51}}1o{if(E.3u-A(1n).2A()<F.4Z){C=A(1n).2A(A(1n).2A()-F.51)}if(A(4W).15()-(E.3u-A(1n).2A())<F.4Z){C=A(1n).2A(A(1n).2A()+F.51)}}if(B.4S[0]!=1n&&B.4S[0].4X!="9G"){if((B.c2.t+B.4S[0].5G)-E.3z<F.4Z){B.4S[0].2z=C=B.4S[0].2z+F.51}if(E.3z-B.c2.t<F.4Z){B.4S[0].2z=C=B.4S[0].2z-F.51}}1o{if(E.3z-A(1n).2z()<F.4Z){C=A(1n).2z(A(1n).2z()-F.51)}if(A(4W).v()-(E.3z-A(1n).2z())<F.4Z){C=A(1n).2z(A(1n).2z()+F.51)}}if(C!==1g){A.p.2F.9W(B,E)}}});A.p.2u.2d("1Z","53",{2p:k(D,C){c B=A(b).1t("1Z");B.3V=[];A(C.q.53.4n!=9d?(C.q.53.i1||":1t(1Z)"):C.q.53).1R(k(){c F=A(b);c E=F.1b();if(b!=B.18[0]){B.3V.7K({a1:b,v:F.3l(),15:F.3n(),u:E.u,t:E.t})}})},5x:k(P,K){c E=A(b).1t("1Z");c Q=K.q.i2||20;c O=K.a0.t,N=O+E.2T.v,D=K.a0.u,C=D+E.2T.15;29(c M=E.3V.1C-1;M>=0;M--){c L=E.3V[M].t,J=L+E.3V[M].v,I=E.3V[M].u,R=I+E.3V[M].15;if(!((L-Q<O&&O<J+Q&&I-Q<D&&D<R+Q)||(L-Q<O&&O<J+Q&&I-Q<C&&C<R+Q)||(L-Q<N&&N<J+Q&&I-Q<D&&D<R+Q)||(L-Q<N&&N<J+Q&&I-Q<C&&C<R+Q))){if(E.3V[M].9I){(E.q.53.cr&&E.q.53.cr.24(E.18,1e,A.1Q(E.83(),{ct:E.3V[M].a1})))}E.3V[M].9I=1g;8P}if(K.q.cs!="ib"){c B=1i.3A(I-C)<=Q;c S=1i.3A(R-D)<=Q;c G=1i.3A(L-N)<=Q;c H=1i.3A(J-O)<=Q;if(B){K.1c.u=E.4F("1O",{u:I-E.2T.15,t:0}).u}if(S){K.1c.u=E.4F("1O",{u:R,t:0}).u}if(G){K.1c.t=E.4F("1O",{u:0,t:L-E.2T.v}).t}if(H){K.1c.t=E.4F("1O",{u:0,t:J}).t}}c F=(B||S||G||H);if(K.q.cs!="ic"){c B=1i.3A(I-D)<=Q;c S=1i.3A(R-C)<=Q;c G=1i.3A(L-O)<=Q;c H=1i.3A(J-N)<=Q;if(B){K.1c.u=E.4F("1O",{u:I,t:0}).u}if(S){K.1c.u=E.4F("1O",{u:R-E.2T.15,t:0}).u}if(G){K.1c.t=E.4F("1O",{u:0,t:L}).t}if(H){K.1c.t=E.4F("1O",{u:0,t:J-E.2T.v}).t}}if(!E.3V[M].9I&&(B||S||G||H||F)){(E.q.53.53&&E.q.53.53.24(E.18,1e,A.1Q(E.83(),{ct:E.3V[M].a1})))}E.3V[M].9I=(B||S||G||H||F)}}});A.p.2u.2d("1Z","cq",{2p:k(D,C){c B=A(b).1t("1Z");B.9F=[];A(C.q.cq).1R(k(){if(A.1t(b,"c3")){c E=A.1t(b,"c3");B.9F.7K({1F:E,cp:E.q.6d});E.i8();E.2e("9r",D,B)}})},2M:k(D,C){c B=A(b).1t("1Z");A.1R(B.9F,k(){if(b.1F.7m){b.1F.7m=0;B.7T=1m;b.1F.7T=1g;if(b.cp){b.1F.q.6d=1m}b.1F.6O(D);b.1F.18.3O("i3",[D,A.1Q(b.1F.p(),{i5:B.18})],b.1F.q.i6);b.1F.q.1j=b.1F.q.by}1o{b.1F.2e("8Z",D,B)}})},5x:k(F,E){c D=A(b).1t("1Z"),B=b;c C=k(K){c H=K.t,J=H+K.v,I=K.u,G=I+K.15;l(H<(b.3I.t+b.1b.2N.t)&&(b.3I.t+b.1b.2N.t)<J&&I<(b.3I.u+b.1b.2N.u)&&(b.3I.u+b.1b.2N.u)<G)};A.1R(D.9F,k(G){if(C.24(D,b.1F.hO)){if(!b.1F.7m){b.1F.7m=1;b.1F.3G=A(B).89().3T(b.1F.18).1t("c3-a1",1m);b.1F.q.by=b.1F.q.1j;b.1F.q.1j=k(){l E.1j[0]};F.1d=b.1F.3G[0];b.1F.7G(F,1m);b.1F.6R(F,1m,1m);b.1F.1b.2N.u=D.1b.2N.u;b.1F.1b.2N.t=D.1b.2N.t;b.1F.1b.1J.t-=D.1b.1J.t-b.1F.1b.1J.t;b.1F.1b.1J.u-=D.1b.1J.u-b.1F.1b.1J.u;D.2e("hu",F)}if(b.1F.3G){b.1F.62(F)}}1o{if(b.1F.7m){b.1F.7m=0;b.1F.7T=1m;b.1F.q.6d=1g;b.1F.6O(F,1m);b.1F.q.1j=b.1F.q.by;b.1F.3G.26();if(b.1F.cm){b.1F.cm.26()}D.2e("hn",F)}}})}});A.p.2u.2d("1Z","7n",{2p:k(D,B){c C=A.hm(A(B.q.7n.ho)).hp(k(F,E){l(1h(A(F).Z("2W"),10)||B.q.7n.1W)-(1h(A(E).Z("2W"),10)||B.q.7n.1W)});A(C).1R(k(E){b.2v.2W=B.q.7n.1W+E});b[0].2v.2W=B.q.7n.1W+C.1C}})})(1u);(k(A){A.4b("p.3L",{5r:k(B,C){if(B=="3J"){b.q.3J=C&&A.7V(C)?C:k(D){l D.is(3J)}}1o{A.4b.5f.5r.1G(b,1H)}},6H:k(){c C=b.q,B=C.3J;b.4M=0;b.6g=1;b.q.3J=b.q.3J&&A.7V(b.q.3J)?b.q.3J:k(D){l D.is(B)};b.8n={v:b.18[0].5G,15:b.18[0].5E};A.p.2F.6h[b.q.5C]=A.p.2F.6h[b.q.5C]||[];A.p.2F.6h[b.q.5C].7K(b);(b.q.7o&&b.18.1I(b.q.7o+"-3L"))},5q:{},p:k(B){l{1Z:(B.3G||B.18),1j:B.1j,1c:B.1c,a0:B.3I,q:b.q,18:b.18}},6o:k(){c B=A.p.2F.6h[b.q.5C];29(c C=0;C<B.1C;C++){if(B[C]==b){B.hz(C,1)}}b.18.2k("p-3L-1Y").5I("3L").3M(".3L")},b3:k(C){c B=A.p.2F.4x;if(!B||(B.3G||B.18)[0]==b.18[0]){l}if(b.q.3J.24(b.18,(B.3G||B.18))){A.p.2u.24(b,"4P",[C,b.p(B)]);b.18.3O("hA",[C,b.p(B)],b.q.4P)}},aZ:k(C){c B=A.p.2F.4x;if(!B||(B.3G||B.18)[0]==b.18[0]){l}if(b.q.3J.24(b.18,(B.3G||B.18))){A.p.2u.24(b,"b5",[C,b.p(B)]);b.18.3O("hJ",[C,b.p(B)],b.q.b5)}},cv:k(E,B){c C=B||A.p.2F.4x;if(!C||(C.3G||C.18)[0]==b.18[0]){l 1g}c D=1g;b.18.6W(":1t(3L)").hI(".p-1Z-a4").1R(k(){c F=A.1t(b,"3L");if(F.q.cC&&A.p.73(C,A.1Q(F,{1b:F.18.1b()}),F.q.9T)){D=1m;l 1g}});if(D){l 1g}if(b.q.3J.24(b.18,(C.3G||C.18))){A.p.2u.24(b,"6q",[E,b.p(C)]);b.18.3O("6q",[E,b.p(C)],b.q.6q);l b.18}l 1g},cu:k(C){c B=A.p.2F.4x;A.p.2u.24(b,"9r",[C,b.p(B)]);if(B){b.18.3O("hL",[C,b.p(B)],b.q.9r)}},cB:k(C){c B=A.p.2F.4x;A.p.2u.24(b,"8Z",[C,b.p(B)]);if(B){b.18.3O("hM",[C,b.p(B)],b.q.8Z)}}});A.1Q(A.p.3L,{5v:{1Y:1g,9T:"73",5C:"4s",7o:"p"}});A.p.73=k(I,E,J){if(!E.1b){l 1g}c D=(I.3I||I.1c.2i).t,C=D+I.2T.v,K=(I.3I||I.1c.2i).u,H=K+I.2T.15;c F=E.1b.t,B=F+E.8n.v,L=E.1b.u,G=L+E.8n.15;63(J){1s"hG":l(F<D&&C<B&&L<K&&H<G);1z;1s"73":l(F<D+(I.2T.v/2)&&C-(I.2T.v/2)<B&&L<K+(I.2T.15/2)&&H-(I.2T.15/2)<G);1z;1s"hB":l(F<((I.3I||I.1c.2i).t+(I.6U||I.1b.2N).t)&&((I.3I||I.1c.2i).t+(I.6U||I.1b.2N).t)<B&&L<((I.3I||I.1c.2i).u+(I.6U||I.1b.2N).u)&&((I.3I||I.1c.2i).u+(I.6U||I.1b.2N).u)<G);1z;1s"hE":l((K>=L&&K<=G)||(H>=L&&H<=G)||(K<L&&H>G))&&((D>=F&&D<=B)||(C>=F&&C<=B)||(D<F&&C>B));1z;4s:l 1g;1z}};A.p.2F={4x:1e,6h:{"4s":[]},9W:k(E,H){c B=A.p.2F.6h[E.q.5C];c F=H?H.6f:1e;c G=(E.3G||E.18).6W(":1t(3L)").cn();co:29(c D=0;D<B.1C;D++){if(B[D].q.1Y||(E&&!B[D].q.3J.24(B[D].18,(E.3G||E.18)))){8P}29(c C=0;C<G.1C;C++){if(G[C]==B[D].18[0]){B[D].8n.15=0;8P co}}B[D].8J=B[D].18.Z("56")!="4i";if(!B[D].8J){8P}B[D].1b=B[D].18.1b();B[D].8n={v:B[D].18[0].5G,15:B[D].18[0].5E};if(F=="fk"||F=="fw"){B[D].cu.24(B[D],H)}}},6q:k(B,C){c D=1g;A.1R(A.p.2F.6h[B.q.5C],k(){if(!b.q){l}if(!b.q.1Y&&b.8J&&A.p.73(B,b,b.q.9T)){D=b.cv.24(b,C)}if(!b.q.1Y&&b.8J&&b.q.3J.24(b.18,(B.3G||B.18))){b.6g=1;b.4M=0;b.cB.24(b,C)}});l D},5x:k(B,C){if(B.q.fL){A.p.2F.9W(B,C)}A.1R(A.p.2F.6h[B.q.5C],k(){if(b.q.1Y||b.cA||!b.8J){l}c D=A.p.73(B,b,b.q.9T);c G=!D&&b.4M==1?"6g":(D&&b.4M==0?"4M":1e);if(!G){l}c F;if(b.q.cC){c E=b.18.6s(":1t(3L):eq(0)");if(E.1C){F=A.1t(E[0],"3L");F.cA=(G=="4M"?1:0)}}if(F&&G=="4M"){F.4M=0;F.6g=1;F.aZ.24(F,C)}b[G]=1;b[G=="6g"?"4M":"6g"]=0;b[G=="4M"?"b3":"aZ"].24(b,C);if(F&&G=="6g"){F.6g=0;F.4M=1;F.b3.24(F,C)}})}};A.p.2u.2d("3L","92",{9r:k(C,B){A(b).1I(B.q.92)},8Z:k(C,B){A(b).2k(B.q.92)},6q:k(C,B){A(b).2k(B.q.92)}});A.p.2u.2d("3L","8X",{4P:k(C,B){A(b).1I(B.q.8X)},b5:k(C,B){A(b).2k(B.q.8X)},6q:k(C,B){A(b).2k(B.q.8X)}})})(1u);(k(A){A.4b("p.1l",A.1Q({},A.p.4r,{6H:k(){c L=b,M=b.q;c P=b.18.Z("1c");b.aT=b.18;b.18.1I("p-1l").Z({1c:/66/.1q(P)?"1O":P});A.1Q(M,{8x:!!(M.4Q),1j:M.1j||M.3S||M.2a?M.1j||"fT":1e,5D:M.5D===1m?"p-1l-8z-1x":M.5D});c H="aO cw #g0";M.cV={"p-1l":{56:"8k"},"p-1l-1x":{1c:"2i",8O:"#cz",dV:"0.aO"},"p-1l-n":{2j:"n-2h",15:"4a",t:"2m",4g:"2m",aP:H},"p-1l-s":{2j:"s-2h",15:"4a",t:"2m",4g:"2m",b4:H},"p-1l-e":{2j:"e-2h",v:"4a",u:"2m",4q:"2m",aX:H},"p-1l-w":{2j:"w-2h",v:"4a",u:"2m",4q:"2m",aW:H},"p-1l-3g":{2j:"3g-2h",v:"4a",15:"4a",aX:H,b4:H},"p-1l-3h":{2j:"3h-2h",v:"4a",15:"4a",b4:H,aW:H},"p-1l-3x":{2j:"3x-2h",v:"4a",15:"4a",aX:H,aP:H},"p-1l-3k":{2j:"3k-2h",v:"4a",15:"4a",aW:H,aP:H}};M.aL={"p-1l-1x":{8O:"#cz",br:"aO cw #fZ",15:"cx",v:"cx"},"p-1l-n":{2j:"n-2h",u:"2m",t:"45%"},"p-1l-s":{2j:"s-2h",4q:"2m",t:"45%"},"p-1l-e":{2j:"e-2h",4g:"2m",u:"45%"},"p-1l-w":{2j:"w-2h",t:"2m",u:"45%"},"p-1l-3g":{2j:"3g-2h",4g:"2m",4q:"2m"},"p-1l-3h":{2j:"3h-2h",t:"2m",4q:"2m"},"p-1l-3k":{2j:"3k-2h",t:"2m",u:"2m"},"p-1l-3x":{2j:"3x-2h",4g:"2m",u:"2m"}};M.aQ=b.18[0].2q;if(M.aQ.2I(/fS|8q|1k|54|59|8y/i)){c C=b.18;if(/1O/.1q(C.Z("1c"))&&A.2y.8B){C.Z({1c:"1O",u:"3q",t:"3q"})}C.8L(A(\'<1p 22="p-8G"	2v="2V: 30;"></1p>\').Z({1c:C.Z("1c"),v:C.3l(),15:C.3n(),u:C.Z("u"),t:C.Z("t")}));c J=b.18;b.18=b.18.1J();b.18.1t("1l",b);b.18.Z({7Z:J.Z("7Z"),8r:J.Z("8r"),7b:J.Z("7b"),7i:J.Z("7i")});J.Z({7Z:0,8r:0,7b:0,7i:0});if(A.2y.ee&&M.9f){J.Z("2h","4i")}M.5y=J.Z({1c:"66",fW:1,56:"8k"});b.18.Z({6b:J.Z("6b")});b.8M()}if(!M.2K){M.2K=!A(".p-1l-1x",b.18).1C?"e,s,3g":{n:".p-1l-n",e:".p-1l-e",s:".p-1l-s",w:".p-1l-w",3g:".p-1l-3g",3h:".p-1l-3h",3x:".p-1l-3x",3k:".p-1l-3k"}}if(M.2K.4n==9d){M.2W=M.2W||cy;if(M.2K=="g8"){M.2K="n,e,s,w,3g,3h,3x,3k"}c O=M.2K.7e(",");M.2K={};c I={1x:"1c: 2i; 56: 4i; 2V:30;",n:"u: 6e; v:2x%;",e:"4g: 6e; 15:2x%;",s:"4q: 6e; v:2x%;",w:"t: 6e; 15:2x%;",3g:"4q: 6e; 4g: 2m;",3h:"4q: 6e; t: 2m;",3x:"u: 6e; 4g: 2m;",3k:"u: 6e; t: 2m;"};29(c Q=0;Q<O.1C;Q++){c N=A.eV(O[Q]),K=M.cV,G="p-1l-"+N,E=!A.p.Z(G)&&!M.5D,R=A.p.Z("p-1l-8z-1x"),S=A.1Q(K[G],K["p-1l-1x"]),D=A.1Q(M.aL[G],!R?M.aL["p-1l-1x"]:{});c T=/3h|3g|3x|3k/.1q(N)?{2W:++M.2W}:{};c B=(E?I[N]:""),F=A([\'<1p 22="p-1l-1x \',G,\'" 2v="\',B,I.1x,\'"></1p>\'].8e("")).Z(T);M.2K[N]=".p-1l-"+N;b.18.5e(F.Z(E?S:{}).Z(M.5D?D:{}).1I(M.5D?"p-1l-8z-1x":"").1I(M.5D))}if(M.5D){b.18.1I("p-1l-8z").Z(!A.p.Z("p-1l-8z")?{}:{})}}b.cW=k(Y){Y=Y||b.18;29(c U in M.2K){if(M.2K[U].4n==9d){M.2K[U]=A(M.2K[U],b.18).2R()}if(M.5w){M.2K[U].Z({2E:0})}if(b.18.is(".p-8G")&&M.aQ.2I(/8q|1k|54|59/i)){c W=A(M.2K[U],b.18),X=0;X=/3h|3x|3k|3g|n|s/.1q(U)?W.3n():W.3l();c V=["dP",/3x|3k|n/.1q(U)?"gl":/3g|3h|s/.1q(U)?"fR":/^e$/.1q(U)?"gi":"gh"].8e("");if(!M.5w){Y.Z(V,X)}b.8M()}if(!A(M.2K[U]).1C){8P}}};b.cW(b.18);M.7k=A(".p-1l-1x",L.18);if(M.7z){M.7k.1R(k(U,V){A.p.7z(V)})}M.7k.ge(k(){if(!M.9l){if(b.8E){c U=b.8E.2I(/p-1l-(3g|3h|3x|3k|n|e|s|w)/i)}L.2f=M.2f=U&&U[1]?U[1]:"3g"}});if(M.dg){M.7k.2s();A(L.18).1I("p-1l-aU").gf(k(){A(b).2k("p-1l-aU");M.7k.2R()},k(){if(!M.9l){A(b).1I("p-1l-aU");M.7k.2s()}})}b.8Y()},5q:{},p:k(){l{aT:b.aT,18:b.18,1j:b.1j,1c:b.1c,1r:b.1r,q:b.q,4o:b.4o,2U:b.2U}},2e:k(C,B){A.p.2u.24(b,C,[B,b.p()]);if(C!="2h"){b.18.3O(["2h",C].8e(""),[B,b.p()],b.q[C])}},6o:k(){c C=b.18,B=C.ac(".p-1l").3Q(0);b.8V();c D=k(E){A(E).2k("p-1l p-1l-1Y").5I("1l").3M(".1l").6W(".p-1l-1x").26()};D(C);if(C.is(".p-8G")&&B){C.1J().5e(A(B).Z({1c:C.Z("1c"),v:C.3l(),15:C.3n(),u:C.Z("u"),t:C.Z("t")})).4m().26();D(B)}},7G:k(D){if(b.q.1Y){l 1g}c B=1g;29(c C in b.q.2K){if(A(b.q.2K[C])[0]==D.1d){B=1m}}if(!B){l 1g}l 1m},6R:k(H){c C=b.q,I=b.18.1c(),B=b.18,F=k(M){l 1h(M,10)||0},E=A.2y.4d&&A.2y.8m<7;C.9l=1m;C.aS={u:A(1n).2A(),t:A(1n).2z()};if(B.is(".p-1Z")||(/2i/).1q(B.Z("1c"))){c K=A.2y.4d&&!C.1U&&(/2i/).1q(B.Z("1c"))&&!(/1O/).1q(B.1J().Z("1c"));c J=K?C.aS.u:0,D=K?C.aS.t:0;B.Z({1c:"2i",u:(I.u+J),t:(I.t+D)})}if(A.2y.8B&&/1O/.1q(B.Z("1c"))){B.Z({1c:"1O",u:"3q",t:"3q"})}b.dj();c L=F(b.1j.Z("t")),G=F(b.1j.Z("u"));if(C.1U){L+=A(C.1U).2z()||0;G+=A(C.1U).2A()||0}b.1b=b.1j.1b();b.1c={t:L,u:G};b.1r=C.1j||E?{v:B.3l(),15:B.3n()}:{v:B.v(),15:B.15()};b.4o=C.1j||E?{v:B.3l(),15:B.3n()}:{v:B.v(),15:B.15()};b.2U={t:L,u:G};b.6m={v:B.3l()-B.v(),15:B.3n()-B.15()};b.dl={t:H.3z,u:H.3u};C.4Q=(2n C.4Q=="7Q")?C.4Q:((b.4o.v/b.4o.15)||1);if(C.be){A("2g").Z("2j",b.2f+"-2h")}b.2e("2p",H);l 1m},62:k(I){c C=b.1j,D=b.q,J={},M=b,E=b.dl,K=b.2f;c N=(I.3z-E.t)||0,L=(I.3u-E.u)||0;c H=b.4V[K];if(!H){l 1g}c G=H.1G(b,[I,N,L]),F=A.2y.4d&&A.2y.8m<7,B=b.6m;if(D.8x||I.97){G=b.dm(G,I)}G=b.dk(G,I);b.2e("2h",I);C.Z({u:b.1c.u+"2J",t:b.1c.t+"2J",v:b.1r.v+"2J",15:b.1r.15+"2J"});if(!D.1j&&D.5y){b.8M()}b.bj(G);b.18.3O("2h",[I,b.p()],b.q.2h);l 1g},6O:k(I){b.q.9l=1g;c E=b.q,H=k(M){l 1h(M,10)||0},K=b;if(E.1j){c D=E.5y,C=D&&(/8q/i).1q(D.3Q(0).2q),B=C&&A.p.8t(D.3Q(0),"t")?0:K.6m.15,G=C?0:K.6m.v;c L={v:(K.1r.v-G),15:(K.1r.15-B)},F=(1h(K.18.Z("t"),10)+(K.1c.t-K.2U.t))||1e,J=(1h(K.18.Z("u"),10)+(K.1c.u-K.2U.u))||1e;if(!E.2a){b.18.Z(A.1Q(L,{u:J,t:F}))}if(E.1j&&!E.2a){b.8M()}}if(E.be){A("2g").Z("2j","3q")}b.2e("2M",I);if(E.1j){b.1j.26()}l 1g},bj:k(B){c C=b.q;b.1b=b.1j.1b();if(B.t){b.1c.t=B.t}if(B.u){b.1c.u=B.u}if(B.15){b.1r.15=B.15}if(B.v){b.1r.v=B.v}},dm:k(D,E){c F=b.q,G=b.1c,C=b.1r,B=b.2f;if(D.15){D.v=(C.15*F.4Q)}1o{if(D.v){D.15=(C.v/F.4Q)}}if(B=="3h"){D.t=G.t+(C.v-D.v);D.u=1e}if(B=="3k"){D.u=G.u+(C.15-D.15);D.t=G.t+(C.v-D.v)}l D},dk:k(H,J){c E=b.1j,F=b.q,P=F.8x||J.97,M=b.2f,N=H.v&&F.9p&&F.9p<H.v,D=H.15&&F.96&&F.96<H.15,I=H.v&&F.7S&&F.7S>H.v,O=H.15&&F.7X&&F.7X>H.15;if(I){H.v=F.7S}if(O){H.15=F.7X}if(N){H.v=F.9p}if(D){H.15=F.96}c C=b.2U.t+b.4o.v,L=b.1c.u+b.1r.15;c G=/3h|3k|w/.1q(M),B=/3k|3x|n/.1q(M);if(I&&G){H.t=C-F.7S}if(N&&G){H.t=C-F.9p}if(O&&B){H.u=L-F.7X}if(D&&B){H.u=L-F.96}c K=!H.v&&!H.15;if(K&&!H.t&&H.u){H.u=1e}1o{if(K&&!H.u&&H.t){H.t=1e}}l H},8M:k(){c F=b.q;if(!F.5y){l}c D=F.5y,C=b.1j||b.18;if(!F.7x){c B=[D.Z("6Y"),D.Z("9A"),D.Z("93"),D.Z("6F")],E=[D.Z("eJ"),D.Z("fc"),D.Z("f2"),D.Z("fb")];F.7x=A.9V(B,k(G,I){c H=1h(G,10)||0,J=1h(E[I],10)||0;l H+J})}D.Z({15:(C.15()-F.7x[0]-F.7x[2])+"2J",v:(C.v()-F.7x[1]-F.7x[3])+"2J"})},dj:k(){c C=b.18,E=b.q;b.bo=C.1b();if(E.1j){b.1j=b.1j||A(\'<1p 2v="2V:30;"></1p>\');c B=A.2y.4d&&A.2y.8m<7,F=(B?1:0),D=(B?2:-1);b.1j.1I(E.1j).Z({v:C.3l()+D,15:C.3n()+D,1c:"2i",t:b.bo.t-F+"2J",u:b.bo.u-F+"2J",2W:++E.2W});b.1j.3T("2g");if(E.7z){A.p.7z(b.1j.3Q(0))}}1o{b.1j=C}},4V:{e:k(D,C,B){l{v:b.4o.v+C}},w:k(F,C,B){c G=b.q,D=b.4o,E=b.2U;l{t:E.t+C,v:D.v-C}},n:k(F,C,B){c G=b.q,D=b.4o,E=b.2U;l{u:E.u+B,15:D.15-B}},s:k(D,C,B){l{15:b.4o.15+B}},3g:k(D,C,B){l A.1Q(b.4V.s.1G(b,1H),b.4V.e.1G(b,[D,C,B]))},3h:k(D,C,B){l A.1Q(b.4V.s.1G(b,1H),b.4V.w.1G(b,[D,C,B]))},3x:k(D,C,B){l A.1Q(b.4V.n.1G(b,1H),b.4V.e.1G(b,[D,C,B]))},3k:k(D,C,B){l A.1Q(b.4V.n.1G(b,1H),b.4V.w.1G(b,[D,C,B]))}}}));A.1Q(A.p.1l,{5v:{7W:":1k",6a:1,7U:0,9f:1m,5w:1g,7S:10,7X:10,4Q:1g,7z:1m,be:1m,dg:1g,5D:1g}});A.p.2u.2d("1l","1U",{2p:k(I,J){c G=J.q,M=A(b).1t("1l"),E=M.18;c C=G.1U,F=(C jS A)?C.3Q(0):(/1J/.1q(C))?E.1J().3Q(0):C;if(!F){l}M.bc=A(F);if(/1n/.1q(C)||C==1n){M.7M={t:0,u:0};M.9Z={t:0,u:0};M.7F={18:A(1n),t:0,u:0,v:A(1n).v(),15:A(1n).15()||1n.2g.4e.a2}}1o{M.7M=A(F).1b();M.9Z=A(F).1c();M.a6={15:A(F).9u(),v:A(F).9z()};c K=M.7M,B=M.a6.15,H=M.a6.v,D=(A.p.8t(F,"t")?F.dh:H),L=(A.p.8t(F)?F.a2:B);M.7F={18:F,t:K.t,u:K.u,v:D,15:L}}},2h:k(H,J){c E=J.q,N=A(b).1t("1l"),C=N.a6,K=N.7M,G=N.1r,I=N.1c,M=E.8x||H.97,B={u:0,t:0},D=N.bc;if(D[0]!=1n&&/66/.1q(D.Z("1c"))){B=N.9Z}if(I.t<(E.1j?K.t:B.t)){N.1r.v=N.1r.v+(E.1j?(N.1c.t-K.t):(N.1c.t-B.t));if(M){N.1r.15=N.1r.v/E.4Q}N.1c.t=E.1j?K.t:B.t}if(I.u<(E.1j?K.u:0)){N.1r.15=N.1r.15+(E.1j?(N.1c.u-K.u):N.1c.u);if(M){N.1r.v=N.1r.15*E.4Q}N.1c.u=E.1j?K.u:0}c F=(E.1j?N.1b.t-K.t:(N.1c.t-B.t))+N.6m.v,L=(E.1j?N.1b.u-K.u:N.1c.u)+N.6m.15;if(F+N.1r.v>=N.7F.v){N.1r.v=N.7F.v-F;if(M){N.1r.15=N.1r.v/E.4Q}}if(L+N.1r.15>=N.7F.15){N.1r.15=N.7F.15-L;if(M){N.1r.v=N.1r.15*E.4Q}}},2M:k(G,I){c D=I.q,L=A(b).1t("1l"),H=L.1c,J=L.7M,B=L.9Z,C=L.bc;c F=A(L.1j),M=F.1b(),K=F.9z(),E=F.9u();if(D.1j&&!D.2a&&/1O/.1q(C.Z("1c"))){A(b).Z({t:(M.t-J.t),u:(M.u-J.u),v:K,15:E})}if(D.1j&&!D.2a&&/66/.1q(C.Z("1c"))){A(b).Z({t:B.t+(M.t-J.t),u:B.u+(M.u-J.u),v:K,15:E})}}});A.p.2u.2d("1l","2X",{2h:k(H,J){c D=J.q,L=A(b).1t("1l"),G=L.1r,E=L.4o,F=L.2U,K=L.2f,I=D.8x||H.97;D.2X=2n D.2X=="7Q"?[D.2X,D.2X]:D.2X;c C=1i.3f((G.v-E.v)/(D.2X[0]||1))*(D.2X[0]||1),B=1i.3f((G.15-E.15)/(D.2X[1]||1))*(D.2X[1]||1);if(/^(3g|s|e)$/.1q(K)){L.1r.v=E.v+C;L.1r.15=E.15+B}1o{if(/^(3x)$/.1q(K)){L.1r.v=E.v+C;L.1r.15=E.15+B;L.1c.u=F.u-B}1o{if(/^(3h)$/.1q(K)){L.1r.v=E.v+C;L.1r.15=E.15+B;L.1c.t=F.t-C}1o{L.1r.v=E.v+C;L.1r.15=E.15+B;L.1c.u=F.u-B;L.1c.t=F.t-C}}}}});A.p.2u.2d("1l","2a",{2M:k(I,K){c F=K.q,L=A(b).1t("1l");c E=F.5y,C=E&&(/8q/i).1q(E.3Q(0).2q),B=C&&A.p.8t(E.3Q(0),"t")?0:L.6m.15,H=C?0:L.6m.v;c D={v:(L.1r.v-H),15:(L.1r.15-B)},G=(1h(L.18.Z("t"),10)+(L.1c.t-L.2U.t))||1e,J=(1h(L.18.Z("u"),10)+(L.1c.u-L.2U.u))||1e;L.18.2a(A.1Q(D,J&&G?{u:J,t:G}:{}),{1S:F.kc||"98",2t:F.ke||"b1",bY:k(){c M={v:1h(L.18.Z("v"),10),15:1h(L.18.Z("15"),10),u:1h(L.18.Z("u"),10),t:1h(L.18.Z("t"),10)};if(E){E.Z({v:M.v,15:M.15})}L.bj(M);L.2e("2a",I)}})}});A.p.2u.2d("1l","3S",{2p:k(E,D){c F=D.q,B=A(b).1t("1l"),G=F.5y,C=B.1r;if(!G){B.3S=B.18.89()}1o{B.3S=G.89()}B.3S.Z({2E:0.25,56:"8k",1c:"1O",15:C.15,v:C.v,6b:0,t:0,u:0}).1I("p-1l-3S").1I(2n F.3S=="4L"?F.3S:"");B.3S.3T(B.1j)},2h:k(D,C){c E=C.q,B=A(b).1t("1l"),F=E.5y;if(B.3S){B.3S.Z({1c:"1O",15:B.1r.15,v:B.1r.v})}},2M:k(D,C){c E=C.q,B=A(b).1t("1l"),F=E.5y;if(B.3S&&B.1j){B.1j.3Q(0).bh(B.3S.3Q(0))}}});A.p.2u.2d("1l","4w",{2p:k(D,C){c E=C.q,B=A(b).1t("1l"),F=k(G){A(G).1R(k(){A(b).1t("1l-bk",{v:1h(A(b).v(),10),15:1h(A(b).15(),10),t:1h(A(b).Z("t"),10),u:1h(A(b).Z("u"),10)})})};if(2n(E.4w)=="5j"){if(E.4w.1C){E.4w=E.4w[0];F(E.4w)}1o{A.1R(E.4w,k(G,H){F(G)})}}1o{F(E.4w)}},2h:k(F,E){c G=E.q,B=A(b).1t("1l"),D=B.4o,I=B.2U;c H={15:(B.1r.15-D.15)||0,v:(B.1r.v-D.v)||0,u:(B.1c.u-I.u)||0,t:(B.1c.t-I.t)||0},C=k(J,K){A(J).1R(k(){c N=A(b).1t("1l-bk"),M={},L=K&&K.1C?K:["v","15","u","t"];A.1R(L||["v","15","u","t"],k(O,Q){c P=(N[Q]||0)+(H[Q]||0);if(P&&P>=0){M[Q]=P||1e}});A(b).Z(M)})};if(2n(G.4w)=="5j"){A.1R(G.4w,k(J,K){C(J,K)})}1o{C(G.4w)}},2M:k(C,B){A(b).5I("1l-bk-2p")}})})(1u);(k(A){A.fn.bg=A.fn.bg||k(B){l b.1R(k(){A(b).6s(B).eq(0).bJ(b).26()})};A.4b("p.3E",{5q:{},p:k(B){l{q:b.q,1x:b.1P,1y:b.q.2f!="5a"||!b.q.2f?1i.3f(b.1y(1e,b.q.2f=="4N"?"y":"x")):{x:1i.3f(b.1y(1e,"x")),y:1i.3f(b.1y(1e,"y"))},7B:b.dr()}},2e:k(C,B){A.p.2u.24(b,C,[B,b.p()]);b.18.3O(C=="9Q"?C:"9Q"+C,[B,b.p()],b.q[C])},6o:k(){b.18.2k("p-3E p-3E-1Y").5I("3E").3M(".3E");if(b.1x&&b.1x.1C){b.1x.bg("a");b.1x.1R(k(){A(b).1t("4r").8V()})}b.bf&&b.bf.26()},5r:k(B,C){A.4b.5f.5r.1G(b,1H);if(/1W|2c|6n/.1q(B)){b.bm()}if(B=="7B"){C?b.1x.1C==2&&b.bs():b.du()}},6H:k(){c B=b;b.18.1I("p-3E");b.bm();b.1x=A(b.q.1x,b.18);if(!b.1x.1C){B.1x=B.bf=A(B.q.2K||[0]).9V(k(){c D=A("<1p/>").1I("p-3E-1x").3T(B.18);if(b.id){D.3r("id",b.id)}l D[0]})}c C=k(D){b.18=A(D);b.18.1t("4r",b);b.q=B.q;b.18.3c("9H",k(){if(B.1P){b.dn(B.1P)}B.6X(b,1m)});b.8Y()};A.1Q(C.5f,A.p.4r,{6R:k(D){l B.cl.24(B,D,b.18[0])},6O:k(D){l B.df.24(B,D,b.18[0])},62:k(D){l B.aM.24(B,D,b.18[0])},7G:k(){l 1m},6x:k(D){b.ba(D)}});A(b.1x).1R(k(){1w C(b)}).8L(\'<a di="#" 2v="jW:4i;br:4i;"></a>\').1J().3c("2N",k(){l 1g}).3c("5g",k(D){B.6X(b.bl)}).3c("dn",k(D){B.dx(b.bl)}).3c("8R",k(D){if(!B.q.jR){l B.dw(D.8F,b.bl)}});b.18.3c("9H.3E",k(D){B.dv.1G(B,[D]);B.1P.1t("4r").6x(D);B.9k=B.9k+1});A.1R(b.q.2K||[],k(E,D){B.8H(D.2p,E,1m)});if(!4K(b.q.dq)){b.8H(b.q.dq,0,1m)}b.5K=A(b.1x[0]);if(b.1x.1C==2&&b.q.7B){b.bs()}},bm:k(){c B=b.18[0],C=b.q;b.5P={v:b.18.3l(),15:b.18.3n()};A.1Q(C,{2f:C.2f||(B.5G<B.5E?"4N":"9w"),2c:!4K(1h(C.2c,10))?{x:1h(C.2c,10),y:1h(C.2c,10)}:({x:C.2c&&C.2c.x||2x,y:C.2c&&C.2c.y||2x}),1W:!4K(1h(C.1W,10))?{x:1h(C.1W,10),y:1h(C.1W,10)}:({x:C.1W&&C.1W.x||0,y:C.1W&&C.1W.y||0})});C.5U={x:C.2c.x-C.1W.x,y:C.2c.y-C.1W.y};C.2Q={x:C.2Q&&C.2Q.x||1h(C.2Q,10)||(C.6n?C.5U.x/(C.6n.x||1h(C.6n,10)||C.5U.x):0),y:C.2Q&&C.2Q.y||1h(C.2Q,10)||(C.6n?C.5U.y/(C.6n.y||1h(C.6n,10)||C.5U.y):0)}},dw:k(I,B){c D=I;if(/(33|34|35|36|37|38|39|40)/.1q(D)){c F=b.q,C,H;if(/(35|36)/.1q(D)){C=(D==35)?F.2c.x:F.1W.x;H=(D==35)?F.2c.y:F.1W.y}1o{c G=/(34|37|40)/.1q(D)?"-=":"+=";c E=/(37|38|39|40)/.1q(D)?"8W":"dt";C=G+b[E]("x");H=G+b[E]("y")}b.8H({x:C,y:H},B);l 1g}l 1m},6X:k(B,C){b.1P=A(B).1I("p-3E-1x-77");if(C){b.1P.1J()[0].5g()}},dx:k(B){A(B).2k("p-3E-1x-77");if(b.1P&&b.1P[0]==B){b.5K=b.1P;b.1P=1e}},dv:k(C){c D=[C.3z,C.3u];c B=1g;b.1x.1R(k(){if(b==C.1d){B=1m}});if(B||b.q.1Y||!(b.1P||b.5K)){l}if(!b.1P&&b.5K){b.6X(b.5K,1m)}b.1b=b.18.1b();b.8H({y:b.52(C.3u-b.1b.u-b.1P[0].5E/2,"y"),x:b.52(C.3z-b.1b.t-b.1P[0].5G/2,"x")},1e,!b.q.6a)},bs:k(){if(b.4J){l}b.4J=A("<1p></1p>").1I("p-3E-7B").Z({1c:"2i"}).3T(b.18);b.9K()},du:k(){b.4J.26();b.4J=1e},9K:k(){c C=b.q.2f=="4N"?"u":"t";c B=b.q.2f=="4N"?"15":"v";b.4J.Z(C,(1h(A(b.1x[0]).Z(C),10)||0)+b.6G(0,b.q.2f=="4N"?"y":"x")/2);b.4J.Z(B,(1h(A(b.1x[1]).Z(C),10)||0)-(1h(A(b.1x[0]).Z(C),10)||0))},dr:k(){l b.4J?b.52(1h(b.4J.Z(b.q.2f=="4N"?"15":"v"),10),b.q.2f=="4N"?"y":"x"):1e},ds:k(){l b.1x.dH(b.1P[0])},1y:k(B,D){if(b.1x.1C==1){b.1P=b.1x}if(!D){D=b.q.2f=="4N"?"y":"x"}c C=A(B!=2w&&B!==1e?b.1x[B]||B:b.1P);if(C.1t("4r").9M){l 1h(C.1t("4r").9M[D],10)}1o{l 1h(((1h(C.Z(D=="x"?"t":"u"),10)/(b.5P[D=="x"?"v":"15"]-b.6G(B,D)))*b.q.5U[D])+b.q.1W[D],10)}},52:k(C,B){l b.q.1W[B]+(C/(b.5P[B=="x"?"v":"15"]-b.6G(1e,B)))*b.q.5U[B]},3Y:k(C,B){l((C-b.q.1W[B])/b.q.5U[B])*(b.5P[B=="x"?"v":"15"]-b.6G(1e,B))},8D:k(D,C){if(b.4J){if(b.1P[0]==b.1x[0]&&D>=b.3Y(b.1y(1),C)){D=b.3Y(b.1y(1,C)-b.8W(C),C)}if(b.1P[0]==b.1x[1]&&D<=b.3Y(b.1y(0),C)){D=b.3Y(b.1y(0,C)+b.8W(C),C)}}if(b.q.2K){c B=b.q.2K[b.ds()];if(D<b.3Y(B.1W,C)){D=b.3Y(B.1W,C)}1o{if(D>b.3Y(B.2c,C)){D=b.3Y(B.2c,C)}}}l D},8K:k(C,B){if(C>=b.5P[B=="x"?"v":"15"]-b.6G(1e,B)){C=b.5P[B=="x"?"v":"15"]-b.6G(1e,B)}if(C<=0){C=0}l C},6G:k(B,C){l A(B!=2w&&B!==1e?b.1x[B]:b.1P)[0]["1b"+(C=="x"?"k2":"k0")]},8W:k(B){l b.q.2Q[B]||1},dt:k(B){l 10},cl:k(C,B){c D=b.q;if(D.1Y){l 1g}b.5P={v:b.18.3l(),15:b.18.3n()};if(!b.1P){b.6X(b.5K,1m)}b.1b=b.18.1b();b.b9=b.1P.1b();b.6U={u:C.3u-b.b9.u,t:C.3z-b.b9.t};b.9k=b.1y();b.2e("2p",C);b.aM(C,B);l 1m},df:k(B){b.2e("2M",B);if(b.9k!=b.1y()){b.2e("9E",B)}b.6X(b.1P,1m);l 1g},aM:k(E,C){c F=b.q;c B={u:E.3u-b.1b.u-b.6U.u,t:E.3z-b.1b.t-b.6U.t};if(!b.1P){b.6X(b.5K,1m)}B.t=b.8K(B.t,"x");B.u=b.8K(B.u,"y");if(F.2Q.x){c D=b.52(B.t,"x");D=1i.3f(D/F.2Q.x)*F.2Q.x;B.t=b.3Y(D,"x")}if(F.2Q.y){c D=b.52(B.u,"y");D=1i.3f(D/F.2Q.y)*F.2Q.y;B.u=b.3Y(D,"y")}B.t=b.8D(B.t,"x");B.u=b.8D(B.u,"y");if(F.2f!="4N"){b.1P.Z({t:B.t})}if(F.2f!="9w"){b.1P.Z({u:B.u})}b.1P.1t("4r").9M={x:1i.3f(b.52(B.t,"x"))||0,y:1i.3f(b.52(B.u,"y"))||0};if(b.4J){b.9K()}b.2e("9Q",E);l 1g},8H:k(F,C,I){c G=b.q;b.5P={v:b.18.3l(),15:b.18.3n()};if(C==2w&&!b.1P&&b.1x.1C!=1){l 1g}if(C==2w&&!b.1P){C=0}if(C!=2w){b.1P=b.5K=A(b.1x[C]||C)}if(F.x!==2w&&F.y!==2w){c B=F.x,H=F.y}1o{c B=F,H=F}if(B!==2w&&B.4n!=8p){c E=/^\\-\\=/.1q(B),D=/^\\+\\=/.1q(B);if(E||D){B=b.1y(1e,"x")+1h(B.8c(E?"=":"+=",""),10)}1o{B=4K(1h(B,10))?2w:1h(B,10)}}if(H!==2w&&H.4n!=8p){c E=/^\\-\\=/.1q(H),D=/^\\+\\=/.1q(H);if(E||D){H=b.1y(1e,"y")+1h(H.8c(E?"=":"+=",""),10)}1o{H=4K(1h(H,10))?2w:1h(H,10)}}if(G.2f!="4N"&&B!==2w){if(G.2Q.x){B=1i.3f(B/G.2Q.x)*G.2Q.x}B=b.3Y(B,"x");B=b.8K(B,"x");B=b.8D(B,"x");G.2a?b.1P.2M().2a({t:B},(1i.3A(1h(b.1P.Z("t"))-B))*(!4K(1h(G.2a))?G.2a:5)):b.1P.Z({t:B})}if(G.2f!="9w"&&H!==2w){if(G.2Q.y){H=1i.3f(H/G.2Q.y)*G.2Q.y}H=b.3Y(H,"y");H=b.8K(H,"y");H=b.8D(H,"y");G.2a?b.1P.2M().2a({u:H},(1i.3A(1h(b.1P.Z("u"))-H))*(!4K(1h(G.2a))?G.2a:5)):b.1P.Z({u:H})}if(b.4J){b.9K()}b.1P.1t("4r").9M={x:1i.3f(b.52(B,"x"))||0,y:1i.3f(b.52(H,"y"))||0};if(!I){b.2e("2p",1e);b.2e("2M",1e);b.2e("9E",1e);b.2e("9Q",1e)}}});A.p.3E.de="1y";A.p.3E.5v={1x:".p-3E-1x",6a:1,2a:1g}})(1u);(k($){c 6k="19";k 8Q(){b.cY=1g;b.7C=1e;b.5k=[];b.6w=1g;b.67=1g;b.ay="p-19-1p";b.ai="p-19-2S";b.an="p-19-5e";b.5l="p-19-6x";b.au="p-19-kS";b.av="p-19-7a";b.ae="p-19-1Y";b.bQ="p-19-5d";b.9m="p-19-4x-1N";b.bF=[];b.bF[""]={dW:"kR",dY:"kI 6S 4x 1a",dZ:"d2",dU:"d2 kw 9E",5N:"&#bX;kx",e6:"6u 6S d3 1K",5M:"&#bX;&#bX;",e5:"6u 6S d3 1E",65:"kt&#aK;",e4:"6u 6S 7h 1K",5Z:"&#aK;&#aK;",eK:"6u 6S 7h 1E",6L:"kp",e2:"6u 6S 4x 1K",3e:["kq","kr","ks","kJ","d1","kF","kG","kH","kE","kD","kA","kB"],4A:["kC","kb","jP","iP","d1","iQ","iR","iS","iO","iN","iJ","iK"],e7:"6u a d0 1K",ep:"6u a d0 1E",dF:"iL",8h:"iM iT 6S 1E",3y:["iU","j1","j2","j3","j0","iZ","iV"],3F:["iW","iX","iY","iI","iH","iq","ir"],9b:["it","iu","ip","jQ","ij","ik","il"],9a:"im 8j as iv 5W 1N",6z:"cX 8j, M d",6C:"9c/dd/6B",3H:0,2C:"cX a 1a",3P:1g};b.3C={6N:"5g",4f:"2R",bP:{},57:1e,86:"",5S:"...",7g:"",d4:1g,8w:1m,ap:1g,7L:1g,61:1g,6J:1g,ar:1g,dL:1m,eu:1m,7O:1g,ev:"-10:+10",8f:1m,7d:1g,5Q:1g,8g:1g,9g:b.8T,3K:"+10",2D:1g,dQ:b.6z,2b:1e,2l:1e,1S:"94",8i:1e,8b:1e,68:1e,en:1e,8s:1e,el:1,9J:0,5p:1,5o:12,3U:1g,8C:" - ",8N:"",7v:""};$.1Q(b.3C,b.bF[""]);b.1X=$(\'<1p id="\'+b.ay+\'" 2v="56: 4i;"></1p>\')}$.1Q(8Q.5f,{4D:"iw",ah:k(){if(b.cY){iD.ah.1G("",1H)}},iE:k(1B){72(b.3C,1B||{});l b},es:k(1d,1B){c 7f=1e;29(95 in b.3C){c 91=1d.iF("1a:"+95);if(91){7f=7f||{};9O{7f[95]=iG(91)}9U(d7){7f[95]=91}}}c 2q=1d.2q.6Q();c 2S=(2q=="1p"||2q=="5O");if(!1d.id){1d.id="dp"+(++b.b6)}c h=b.aJ($(1d),2S);h.1B=$.1Q({},1B||{},7f||{});if(2q=="1k"){b.cZ(1d,h)}1o{if(2S){b.dc(1d,h)}}},aJ:k(1d,2S){c id=1d[0].id.8c(/([:\\[\\]\\.])/g,"\\\\\\\\$1");l{id:id,1k:1d,3t:0,3d:0,3p:0,1M:0,1T:0,2S:2S,1X:(!2S?b.1X:$(\'<1p 22="\'+b.ai+\'"></1p>\'))}},cZ:k(1d,h){c 1k=$(1d);if(1k.5F(b.4D)){l}c 86=b.1f(h,"86");c 3P=b.1f(h,"3P");if(86){1k[3P?"db":"bJ"](\'<5O 22="\'+b.an+\'">\'+86+"</5O>")}c 6N=b.1f(h,"6N");if(6N=="5g"||6N=="5a"){1k.5g(b.7D)}if(6N=="59"||6N=="5a"){c 5S=b.1f(h,"5S");c 7g=b.1f(h,"7g");c 6x=$(b.1f(h,"d4")?$("<8y/>").1I(b.5l).3r({bD:7g,d5:5S,88:5S}):$(\'<59 6f="59"></59>\').1I(b.5l).1V(7g==""?5S:$("<8y/>").3r({bD:7g,d5:5S,88:5S})));1k[3P?"db":"bJ"](6x);6x.2N(k(){if($.19.6w&&$.19.7p==1d){$.19.5s()}1o{$.19.7D(1d)}l 1g})}1k.1I(b.4D).8R(b.9o).d6(b.a9).3c("cd.19",k(6K,64,1y){h.1B[64]=1y}).3c("aa.19",k(6K,64){l b.1f(h,64)});$.1t(1d,6k,h)},dc:k(1d,h){c bN=$(1d);if(bN.5F(b.4D)){l}bN.1I(b.4D).5e(h.1X).3c("cd.19",k(6K,64,1y){h.1B[64]=1y}).3c("aa.19",k(6K,64){l b.1f(h,64)});$.1t(1d,6k,h);b.aB(h,b.aI(h));b.4y(h)},iz:k(h){c 2Z=b.79(h);h.1X.v(2Z[1]*$(".p-19",h.1X[0]).v())},iA:k(1k,d9,68,1B,2P){c h=b.da;if(!h){c id="dp"+(++b.b6);b.4U=$(\'<1k 6f="4T" id="\'+id+\'" 1r="1" 2v="1c: 2i; u: -eO;"/>\');b.4U.8R(b.9o);$("2g").5e(b.4U);h=b.da=b.aJ(b.4U,1g);h.1B={};$.1t(b.4U[0],6k,h)}72(h.1B,1B||{});b.4U.6p(d9);b.3W=(2P?(2P.1C?2P:[2P.3z,2P.3u]):1e);if(!b.3W){c 9B=4W.9z||1n.44.c1||1n.2g.c1;c 9S=4W.9u||1n.44.bu||1n.2g.bu;c 71=1n.44.2z||1n.2g.2z;c 6M=1n.44.2A||1n.2g.2A;b.3W=[(9B/2)-2x+71,(9S/2)-bC+6M]}b.4U.Z("t",b.3W[0]+"2J").Z("u",b.3W[1]+"2J");h.1B.68=68;b.67=1m;b.1X.1I(b.au);b.7D(b.4U[0]);if($.8d){$.8d(b.1X)}$.1t(b.4U[0],6k,h);l b},jB:k(1d){c $1d=$(1d);if(!$1d.5F(b.4D)){l}c 2q=1d.2q.6Q();$.5I(1d,6k);if(2q=="1k"){$1d.7l("."+b.an).26().4m().7l("."+b.5l).26().4m().2k(b.4D).3M("5g",b.7D).3M("8R",b.9o).3M("d6",b.a9)}1o{if(2q=="1p"||2q=="5O"){$1d.2k(b.4D).ck()}}},jD:k(1d){c $1d=$(1d);if(!$1d.5F(b.4D)){l}c 2q=1d.2q.6Q();if(2q=="1k"){1d.1Y=1g;$1d.7l("59."+b.5l).1R(k(){b.1Y=1g}).4m().7l("8y."+b.5l).Z({2E:"1.0",2j:""})}1o{if(2q=="1p"||2q=="5O"){$1d.ac("."+b.ae).26()}}b.5k=$.9V(b.5k,k(1y){l(1y==1d?1e:1y)})},jz:k(1d){c $1d=$(1d);if(!$1d.5F(b.4D)){l}c 2q=1d.2q.6Q();if(2q=="1k"){1d.1Y=1m;$1d.7l("59."+b.5l).1R(k(){b.1Y=1m}).4m().7l("8y."+b.5l).Z({2E:"0.5",2j:"4s"})}1o{if(2q=="1p"||2q=="5O"){c 2S=$1d.ac("."+b.ai);c 1b=2S.1b();c 9D={t:0,u:0};2S.6s().1R(k(){if($(b).Z("1c")=="1O"){9D=$(b).1b();l 1g}});$1d.ju(\'<1p 22="\'+b.ae+\'" 2v="\'+($.2y.4d?"8O-8o: 5w; ":"")+"v: "+2S.v()+"2J; 15: "+2S.15()+"2J; t: "+(1b.t-9D.t)+"2J; u: "+(1b.u-9D.u)+\'2J;"></1p>\')}}b.5k=$.9V(b.5k,k(1y){l(1y==1d?1e:1y)});b.5k[b.5k.1C]=1d},dy:k(1d){if(!1d){l 1g}29(c i=0;i<b.5k.1C;i++){if(b.5k[i]==1d){l 1m}}l 1g},3i:k(1d){9O{l $.1t(1d,6k)}9U(d7){7y"eX 1F 1t 29 b 19"}},jx:k(1d,3b,1y){c 1B=3b||{};if(2n 3b=="4L"){1B={};1B[3b]=1y}c h=b.3i(1d);if(h){if(b.7C==h){b.5s(1e)}72(h.1B,1B);c 1a=1w 1A();72(h,{2Y:1e,4k:1e,4v:1e,2L:1e,3t:1a.2o(),3d:1a.2B(),3p:1a.23(),31:1a.2o(),3v:1a.2B(),3j:1a.23(),1M:1a.2B(),1T:1a.23()});b.4y(h)}},jE:k(1d){c h=b.3i(1d);if(h){b.4y(h)}},jF:k(1d,1a,4O){c h=b.3i(1d);if(h){b.aB(h,1a,4O);b.4y(h);b.bx(h)}},jM:k(1d){c h=b.3i(1d);if(h&&!h.2S){b.aj(h)}l(h?b.aE(h):1e)},9o:k(e){c h=$.19.3i(e.1d);c 58=1m;if($.19.6w){63(e.8F){1s 9:$.19.5s(1e,"");1z;1s 13:$.19.bS(e.1d,h.3d,h.3p,$("3D.p-19-7q-6r-4P",h.1X)[0]);l 1g;1z;1s 27:$.19.5s(1e,$.19.1f(h,"1S"));1z;1s 33:$.19.3N(e.1d,(e.3m?-$.19.1f(h,"5o"):-$.19.1f(h,"5p")),"M");1z;1s 34:$.19.3N(e.1d,(e.3m?+$.19.1f(h,"5o"):+$.19.1f(h,"5p")),"M");1z;1s 35:if(e.3m){$.19.ao(e.1d)}58=e.3m;1z;1s 36:if(e.3m){$.19.am(e.1d)}58=e.3m;1z;1s 37:if(e.3m){$.19.3N(e.1d,-1,"D")}58=e.3m;1z;1s 38:if(e.3m){$.19.3N(e.1d,-7,"D")}58=e.3m;1z;1s 39:if(e.3m){$.19.3N(e.1d,+1,"D")}58=e.3m;1z;1s 40:if(e.3m){$.19.3N(e.1d,+7,"D")}58=e.3m;1z;4s:58=1g}}1o{if(e.8F==36&&e.3m){$.19.7D(b)}1o{58=1g}}if(58){e.9f();e.jN()}},a9:k(e){c h=$.19.3i(e.1d);c 5u=$.19.eL($.19.1f(h,"6C"));c aw=9d.jO(e.d8==2w?e.8F:e.d8);l e.3m||(aw<" "||!5u||5u.8a(aw)>-1)},7D:k(1k){1k=1k.1d||1k;if(1k.2q.6Q()!="1k"){1k=$("1k",1k.4e)[0]}if($.19.dy(1k)||$.19.7p==1k){l}c h=$.19.3i(1k);c 8b=$.19.1f(h,"8b");72(h.1B,(8b?8b.1G(1k,[1k,h]):{}));$.19.5s(1e,"");$.19.7p=1k;$.19.aj(h);if($.19.67){1k.1y=""}if(!$.19.3W){$.19.3W=$.19.aN(1k);$.19.3W[1]+=1k.5E}c 3w=1g;$(1k).6s().1R(k(){3w|=$(b).Z("1c")=="4I";l!3w});if(3w&&$.2y.8B){$.19.3W[0]-=1n.44.2z;$.19.3W[1]-=1n.44.2A}c 1b={t:$.19.3W[0],u:$.19.3W[1]};$.19.3W=1e;h.2Y=1e;h.1X.Z({1c:"2i",56:"8k",u:"-jK"});$.19.4y(h);h.1X.v($.19.79(h)[1]*$(".p-19",h.1X[0])[0].5G);1b=$.19.cj(h,1b,3w);h.1X.Z({1c:($.19.67&&$.8d?"66":(3w?"4I":"2i")),56:"4i",t:1b.t+"2J",u:1b.u+"2J"});if(!h.2S){c 4f=$.19.1f(h,"4f")||"2R";c 1S=$.19.1f(h,"1S");c 6Z=k(){$.19.6w=1m;if($.2y.4d&&1h($.2y.8m,10)<7){$("8l.p-19-bI").Z({v:h.1X.v()+4,15:h.1X.15()+4})}};if($.1v&&$.1v[4f]){h.1X.2R(4f,$.19.1f(h,"bP"),1S,6Z)}1o{h.1X[4f](1S,6Z)}if(1S==""){6Z()}if(h.1k[0].6f!="30"){h.1k[0].5g()}$.19.7C=h}},4y:k(h){c bV={v:h.1X.v()+4,15:h.1X.15()+4};h.1X.ck().5e(b.dX(h)).6W("8l.p-19-bI").Z({v:bV.v,15:bV.15});c 2Z=b.79(h);h.1X[(2Z[0]!=1||2Z[1]!=1?"2d":"26")+"ci"]("p-19-js");h.1X[(b.1f(h,"3P")?"2d":"26")+"ci"]("p-19-jd");if(h.1k&&h.1k[0].6f!="30"){$(h.1k[0]).5g()}},cj:k(h,1b,3w){c 2P=h.1k?b.aN(h.1k[0]):1e;c 9B=4W.9z||1n.44.c1;c 9S=4W.9u||1n.44.bu;c 71=1n.44.2z||1n.2g.2z;c 6M=1n.44.2A||1n.2g.2A;if(b.1f(h,"3P")||(1b.t+h.1X.v()-71)>9B){1b.t=1i.2c((3w?0:71),2P[0]+(h.1k?h.1k.v():0)-(3w?71:0)-h.1X.v()-(3w&&$.2y.8B?1n.44.2z:0))}1o{1b.t-=(3w?71:0)}if((1b.u+h.1X.15()-6M)>9S){1b.u=1i.2c((3w?0:6M),2P[1]-(3w?6M:0)-(b.67?0:h.1X.15())-(3w&&$.2y.8B?1n.44.2A:0))}1o{1b.u-=(3w?6M:0)}l 1b},aN:k(6A){4j(6A&&(6A.6f=="30"||6A.jo!=1)){6A=6A.jp}c 1c=$(6A).1b();l[1c.t,1c.u]},5s:k(1k,1S){c h=b.7C;if(!h||(1k&&h!=$.1t(1k,6k))){l}c 3U=b.1f(h,"3U");if(3U&&h.5A){b.90("#"+h.id,b.6D(h,h.31,h.3v,h.3j))}h.5A=1g;if(b.6w){1S=(1S!=1e?1S:b.1f(h,"1S"));c 4f=b.1f(h,"4f");c 6Z=k(){$.19.aF(h)};if(1S!=""&&$.1v&&$.1v[4f]){h.1X.2s(4f,$.19.1f(h,"bP"),1S,6Z)}1o{h.1X[(1S==""?"2s":(4f=="jn"?"jm":(4f=="ji"?"jj":"2s")))](1S,6Z)}if(1S==""){b.aF(h)}c 8s=b.1f(h,"8s");if(8s){8s.1G((h.1k?h.1k[0]:1e),[(h.1k?h.1k.6p():""),h])}b.6w=1g;b.7p=1e;h.1B.7a=1e;if(b.67){b.4U.Z({1c:"2i",t:"0",u:"-eO"});if($.8d){$.jl();$("2g").5e(b.1X)}}b.67=1g}b.7C=1e},aF:k(h){h.1X.2k(b.au).3M(".p-19");$("."+b.av,h.1X).26()},eg:k(6K){if(!$.19.7C){l}c $1d=$(6K.1d);if(($1d.6s("#"+$.19.ay).1C==0)&&!$1d.5F($.19.4D)&&!$1d.5F($.19.5l)&&$.19.6w&&!($.19.67&&$.8d)){$.19.5s(1e,"")}},3N:k(id,1b,4H){c 1d=$(id);c h=b.3i(1d[0]);b.a7(h,1b,4H);b.4y(h)},am:k(id){c 1d=$(id);c h=b.3i(1d[0]);if(b.1f(h,"ar")&&h.31){h.3t=h.31;h.1M=h.3d=h.3v;h.1T=h.3p=h.3j}1o{c 1a=1w 1A();h.3t=1a.2o();h.1M=h.3d=1a.2B();h.1T=h.3p=1a.23()}b.80(h);b.3N(1d)},cc:k(id,54,4H){c 1d=$(id);c h=b.3i(1d[0]);h.9t=1g;h["7P"+(4H=="M"?"f4":"f1")]=h["jk"+(4H=="M"?"f4":"f1")]=1h(54.q[54.jr].1y,10);b.80(h);b.3N(1d)},ca:k(id){c 1d=$(id);c h=b.3i(1d[0]);if(h.1k&&h.9t&&!$.2y.4d){h.1k[0].5g()}h.9t=!h.9t},dD:k(id,1N){c 1d=$(id);c h=b.3i(1d[0]);h.1B.3H=1N;b.4y(h)},bS:k(id,1K,1E,3D){if($(3D).5F(b.bQ)){l}c 1d=$(id);c h=b.3i(1d[0]);c 3U=b.1f(h,"3U");if(3U){h.5A=!h.5A;if(h.5A){$(".p-19 3D",h.1X).2k(b.9m);$(3D).1I(b.9m)}}h.3t=h.31=$("a",3D).1V();h.3d=h.3v=1K;h.3p=h.3j=1E;if(h.5A){h.4k=h.4v=h.2L=1e}1o{if(3U){h.4k=h.31;h.4v=h.3v;h.2L=h.3j}}b.90(id,b.6D(h,h.31,h.3v,h.3j));if(h.5A){h.2Y=1w 1A(h.3j,h.3v,h.31);b.4y(h)}1o{if(3U){h.3t=h.31=h.2Y.2o();h.3d=h.3v=h.2Y.2B();h.3p=h.3j=h.2Y.23();h.2Y=1e;if(h.2S){b.4y(h)}}}},ao:k(id){c 1d=$(id);c h=b.3i(1d[0]);if(b.1f(h,"ap")){l}h.5A=1g;h.4k=h.4v=h.2L=h.2Y=1e;b.90(1d,"")},90:k(id,48){c 1d=$(id);c h=b.3i(1d[0]);48=(48!=1e?48:b.6D(h));if(b.1f(h,"3U")&&48){48=(h.2Y?b.6D(h,h.2Y):48)+b.1f(h,"8C")+48}if(h.1k){h.1k.6p(48)}b.bx(h);c 68=b.1f(h,"68");if(68){68.1G((h.1k?h.1k[0]:1e),[48,h])}1o{if(h.1k){h.1k.6x("9E")}}if(h.2S){b.4y(h)}1o{if(!h.5A){b.5s(1e,b.1f(h,"1S"));b.7p=h.1k[0];if(2n(h.1k[0])!="5j"){h.1k[0].5g()}b.7p=1e}}},bx:k(h){c 8N=b.1f(h,"8N");if(8N){c 7v=b.1f(h,"7v");c 1a=b.aE(h);48=(ed(1a)?(!1a[0]&&!1a[1]?"":b.4R(7v,1a[0],b.43(h))+b.1f(h,"8C")+b.4R(7v,1a[1]||1a[0],b.43(h))):b.4R(7v,1a,b.43(h)));$(8N).1R(k(){$(b).6p(48)})}},jq:k(1a){c 1N=1a.7t();l[(1N>0&&1N<6),""]},8T:k(1a){c 4z=1w 1A(1a.23(),1a.2B(),1a.2o(),(1a.jh()/-60));c 78=1w 1A(4z.23(),1-1,4);c 3H=78.7t()||7;78.9N(78.2o()+1-3H);if(3H<4&&4z<78){4z.9N(4z.2o()-3);l $.19.8T(4z)}1o{if(4z>1w 1A(4z.23(),12-1,28)){3H=1w 1A(4z.23()+1,1-1,4).7t()||7;if(3H>4&&(4z.7t()||7)<3H-3){l 1}}}l 1i.jg(((4z-78)/j9)/7)+1},6z:k(1a,h){l $.19.4R($.19.1f(h,"6z"),1a,$.19.43(h))},ad:k(2H,1y,1B){if(2H==1e||1y==1e){7y"ag 1H"}1y=(2n 1y=="5j"?1y.b0():1y+"");if(1y==""){l 1e}c 3K=(1B?1B.3K:1e)||b.3C.3K;c 3F=(1B?1B.3F:1e)||b.3C.3F;c 3y=(1B?1B.3y:1e)||b.3C.3y;c 4A=(1B?1B.4A:1e)||b.3C.4A;c 3e=(1B?1B.3e:1e)||b.3C.3e;c 1E=-1;c 1K=-1;c 1N=-1;c 6t=-1;c 3R=1g;c 41=k(2I){c 3B=(2r+1<2H.1C&&2H.2O(2r+1)==2I);if(3B){2r++}l 3B};c 7H=k(2I){41(2I);c bq=(2I=="@"?14:(2I=="y"?4:(2I=="o"?3:2)));c 1r=bq;c 5m=0;4j(1r>0&&4p<1y.1C&&1y.2O(4p)>="0"&&1y.2O(4p)<="9"){5m=5m*10+1h(1y.2O(4p++),10);1r--}if(1r==bq){7y"eX 7Q at 1c "+4p}l 5m};c bw=k(2I,9s,9X){c 84=(41(2I)?9X:9s);c 1r=0;29(c j=0;j<84.1C;j++){1r=1i.2c(1r,84[j].1C)}c 3b="";c eW=4p;4j(1r>0&&4p<1y.1C){3b+=1y.2O(4p++);29(c i=0;i<84.1C;i++){if(3b==84[i]){l i+1}}1r--}7y"j8 3b at 1c "+eW};c 9Y=k(){if(1y.2O(4p)!=2H.2O(2r)){7y"j7 3R at 1c "+4p}4p++};c 4p=0;29(c 2r=0;2r<2H.1C;2r++){if(3R){if(2H.2O(2r)=="\'"&&!41("\'")){3R=1g}1o{9Y()}}1o{63(2H.2O(2r)){1s"d":1N=7H("d");1z;1s"D":bw("D",3F,3y);1z;1s"o":6t=7H("o");1z;1s"m":1K=7H("m");1z;1s"M":1K=bw("M",4A,3e);1z;1s"y":1E=7H("y");1z;1s"@":c 1a=1w 1A(7H("@"));1E=1a.23();1K=1a.2B()+1;1N=1a.2o();1z;1s"\'":if(41("\'")){9Y()}1o{3R=1m}1z;4s:9Y()}}}if(1E<2x){1E+=1w 1A().23()-1w 1A().23()%2x+(1E<=3K?0:-2x)}if(6t>-1){1K=1;1N=6t;do{c bp=b.6y(1E,1K-1);if(1N<=bp){1z}1K++;1N-=bp}4j(1m)}c 1a=1w 1A(1E,1K-1,1N);if(1a.23()!=1E||1a.2B()+1!=1K||1a.2o()!=1N){7y"ag 1a"}l 1a},j6:"6B-9c-dd",ja:"D, dd M 6B",jb:"6B-9c-dd",jf:"D, d M y",je:"8j, dd-M-y",jc:"D, d M y",jt:"D, d M 6B",jJ:"D, d M 6B",jI:"D, d M y",jH:"@",jG:"6B-9c-dd",4R:k(2H,1a,1B){if(!1a){l""}c 3F=(1B?1B.3F:1e)||b.3C.3F;c 3y=(1B?1B.3y:1e)||b.3C.3y;c 4A=(1B?1B.4A:1e)||b.3C.4A;c 3e=(1B?1B.3e:1e)||b.3C.3e;c 41=k(2I){c 3B=(2r+1<2H.1C&&2H.2O(2r+1)==2I);if(3B){2r++}l 3B};c 9i=k(2I,1y,eN){c 5m=""+1y;if(41(2I)){4j(5m.1C<eN){5m="0"+5m}}l 5m};c af=k(2I,1y,9s,9X){l(41(2I)?9X[1y]:9s[1y])};c 4l="";c 3R=1g;if(1a){29(c 2r=0;2r<2H.1C;2r++){if(3R){if(2H.2O(2r)=="\'"&&!41("\'")){3R=1g}1o{4l+=2H.2O(2r)}}1o{63(2H.2O(2r)){1s"d":4l+=9i("d",1a.2o(),2);1z;1s"D":4l+=af("D",1a.7t(),3F,3y);1z;1s"o":c 6t=1a.2o();29(c m=1a.2B()-1;m>=0;m--){6t+=b.6y(1a.23(),m)}4l+=9i("o",6t,3);1z;1s"m":4l+=9i("m",1a.2B()+1,2);1z;1s"M":4l+=af("M",1a.2B(),4A,3e);1z;1s"y":4l+=(41("y")?1a.23():(1a.eM()%2x<10?"0":"")+1a.eM()%2x);1z;1s"@":4l+=1a.4c();1z;1s"\'":if(41("\'")){4l+="\'"}1o{3R=1m}1z;4s:4l+=2H.2O(2r)}}}}l 4l},eL:k(2H){c 5u="";c 3R=1g;29(c 2r=0;2r<2H.1C;2r++){if(3R){if(2H.2O(2r)=="\'"&&!41("\'")){3R=1g}1o{5u+=2H.2O(2r)}}1o{63(2H.2O(2r)){1s"d":1s"m":1s"y":1s"@":5u+="jL";1z;1s"D":1s"M":l 1e;1s"\'":if(41("\'")){5u+="\'"}1o{3R=1m}1z;4s:5u+=2H.2O(2r)}}}l 5u},1f:k(h,3b){l h.1B[3b]!==2w?h.1B[3b]:b.3C[3b]},aj:k(h){c 6C=b.1f(h,"6C");c 5J=h.1k?h.1k.6p().7e(b.1f(h,"8C")):1e;h.4k=h.4v=h.2L=1e;c 1a=57=b.aI(h);if(5J.1C>0){c 1B=b.43(h);if(5J.1C>1){1a=b.ad(6C,5J[1],1B)||57;h.4k=1a.2o();h.4v=1a.2B();h.2L=1a.23()}9O{1a=b.ad(6C,5J[0],1B)||57}9U(e){b.ah(e);1a=57}}h.3t=1a.2o();h.1M=h.3d=1a.2B();h.1T=h.3p=1a.23();h.31=(5J[0]?1a.2o():0);h.3v=(5J[0]?1a.2B():0);h.3j=(5J[0]?1a.23():0);b.a7(h)},aI:k(h){c 1a=b.81(b.1f(h,"57"),1w 1A());c 2b=b.5z(h,"1W",1m);c 2l=b.5z(h,"2c");1a=(2b&&1a<2b?2b:1a);1a=(2l&&1a>2l?2l:1a);l 1a},81:k(1a,57){c fg=k(1b){c 1a=1w 1A();1a.dI(1a.dO()+1b);l 1a};c fi=k(1b,aD){c 1a=1w 1A();c 1E=1a.23();c 1K=1a.2B();c 1N=1a.2o();c a8=/([+-]?[0-9]+)\\s*(d|D|w|W|m|M|y|Y)?/g;c 3B=a8.6P(1b);4j(3B){63(3B[2]||"d"){1s"d":1s"D":1N+=1h(3B[1],10);1z;1s"w":1s"W":1N+=1h(3B[1],10)*7;1z;1s"m":1s"M":1K+=1h(3B[1],10);1N=1i.1W(1N,aD(1E,1K));1z;1s"y":1s"Y":1E+=1h(3B[1],10);1N=1i.1W(1N,aD(1E,1K));1z}3B=a8.6P(1b)}l 1w 1A(1E,1K,1N)};1a=(1a==1e?57:(2n 1a=="4L"?fi(1a,b.6y):(2n 1a=="7Q"?(4K(1a)?57:fg(1a)):1a)));l(1a&&1a.b0()=="ag 1A"?57:1a)},aB:k(h,1a,4O){c 5T=!(1a);c fd=h.3d;c dz=h.3p;1a=b.81(1a,1w 1A());h.3t=h.31=1a.2o();h.1M=h.3d=h.3v=1a.2B();h.1T=h.3p=h.3j=1a.23();if(b.1f(h,"3U")){if(4O){4O=b.81(4O,1e);h.4k=4O.2o();h.4v=4O.2B();h.2L=4O.23()}1o{h.4k=h.31;h.4v=h.3v;h.2L=h.3j}}if(fd!=h.3d||dz!=h.3p){b.80(h)}b.a7(h);if(h.1k){h.1k.6p(5T?"":b.6D(h)+(!b.1f(h,"3U")?"":b.1f(h,"8C")+b.6D(h,h.4k,h.4v,h.2L)))}},aE:k(h){c 9y=(!h.3j||(h.1k&&h.1k.6p()=="")?1e:1w 1A(h.3j,h.3v,h.31));if(b.1f(h,"3U")){l[h.2Y||9y,(!h.2L?h.2Y||9y:1w 1A(h.2L,h.4v,h.4k))]}1o{l 9y}},dX:k(h){c 5X=1w 1A();5X=1w 1A(5X.23(),5X.2B(),5X.2o());c 2D=b.1f(h,"2D");c 2C=b.1f(h,"2C")||"&#bH;";c 3P=b.1f(h,"3P");c 5T=(b.1f(h,"ap")?"":\'<1p 22="p-19-5T"><a 4E="1u.19.ao(\\\'#\'+h.id+"\');\\""+b.3Z(2D,h.id,b.1f(h,"dY"),2C)+">"+b.1f(h,"dW")+"</a></1p>");c bA=\'<1p 22="p-19-jw">\'+(3P?"":5T)+\'<1p 22="p-19-jv"><a 4E="1u.19.5s();"\'+b.3Z(2D,h.id,b.1f(h,"dU"),2C)+">"+b.1f(h,"dZ")+"</a></1p>"+(3P?5T:"")+"</1p>";c 7a=b.1f(h,"7a");c 8w=b.1f(h,"8w");c 7L=b.1f(h,"7L");c 61=b.1f(h,"61");c 6J=b.1f(h,"6J");c 2Z=b.79(h);c 9J=b.1f(h,"9J");c 5p=b.1f(h,"5p");c 5o=b.1f(h,"5o");c dB=(2Z[0]!=1||2Z[1]!=1);c 9e=(!h.31?1w 1A(jy,9,9):1w 1A(h.3j,h.3v,h.31));c 2b=b.5z(h,"1W",1m);c 2l=b.5z(h,"2c");c 1M=h.1M-9J;c 1T=h.1T;if(1M<0){1M+=12;1T--}if(2l){c 82=1w 1A(2l.23(),2l.2B()-2Z[1]+1,2l.2o());82=(2b&&82<2b?2b:82);4j(1w 1A(1T,1M,1)>82){1M--;if(1M<0){1M=11;1T--}}}c 5N=b.1f(h,"5N");5N=(!61?5N:b.4R(5N,1w 1A(1T,1M-5p,1),b.43(h)));c 5M=(6J?b.1f(h,"5M"):"");5M=(!61?5M:b.4R(5M,1w 1A(1T,1M-5o,1),b.43(h)));c 8S=\'<1p 22="p-19-8S">\'+(b.c6(h,-1,1T,1M)?(6J?"<a 4E=\\"1u.19.3N(\'#"+h.id+"\', -"+5o+", \'M\');\\""+b.3Z(2D,h.id,b.1f(h,"e5"),2C)+">"+5M+"</a>":"")+"<a 4E=\\"1u.19.3N(\'#"+h.id+"\', -"+5p+", \'M\');\\""+b.3Z(2D,h.id,b.1f(h,"e6"),2C)+">"+5N+"</a>":(7L?"":"<5Y>"+5M+"</5Y><5Y>"+5N+"</5Y>"))+"</1p>";c 65=b.1f(h,"65");65=(!61?65:b.4R(65,1w 1A(1T,1M+5p,1),b.43(h)));c 5Z=(6J?b.1f(h,"5Z"):"");5Z=(!61?5Z:b.4R(5Z,1w 1A(1T,1M+5o,1),b.43(h)));c 7h=\'<1p 22="p-19-7h">\'+(b.c6(h,+1,1T,1M)?"<a 4E=\\"1u.19.3N(\'#"+h.id+"\', +"+5p+", \'M\');\\""+b.3Z(2D,h.id,b.1f(h,"e4"),2C)+">"+65+"</a>"+(6J?"<a 4E=\\"1u.19.3N(\'#"+h.id+"\', +"+5o+", \'M\');\\""+b.3Z(2D,h.id,b.1f(h,"eK"),2C)+">"+5Z+"</a>":""):(7L?"":"<5Y>"+65+"</5Y><5Y>"+5Z+"</5Y>"))+"</1p>";c 6L=b.1f(h,"6L");c al=(b.1f(h,"ar")&&h.31?9e:5X);6L=(!61?6L:b.4R(6L,al,b.43(h)));c 1V=(7a?\'<1p 22="\'+b.av+\'">\'+7a+"</1p>":"")+(8w&&!h.2S?bA:"")+\'<1p 22="p-19-jC">\'+(3P?7h:8S)+(b.c5(h,al)?\'<1p 22="p-19-4x"><a 4E="1u.19.am(\\\'#\'+h.id+"\');\\""+b.3Z(2D,h.id,b.1f(h,"e2"),2C)+">"+6L+"</a></1p>":"")+(3P?8S:7h)+"</1p>";c 3H=b.1f(h,"3H");c 8f=b.1f(h,"8f");c 3y=b.1f(h,"3y");c 3F=b.1f(h,"3F");c 9b=b.1f(h,"9b");c 3e=b.1f(h,"3e");c 8i=b.1f(h,"8i");c 7d=b.1f(h,"7d");c 5Q=b.1f(h,"5Q");c 8g=b.1f(h,"8g");c 9g=b.1f(h,"9g")||b.8T;c 8h=b.1f(h,"8h");c 4Y=(2D?b.1f(h,"9a")||2C:"");c 6z=b.1f(h,"dQ")||b.6z;c 4O=h.4k?1w 1A(h.2L,h.4v,h.4k):9e;29(c 6v=0;6v<2Z[0];6v++){29(c 76=0;76<2Z[1];76++){c 7j=1w 1A(1T,1M,h.3t);1V+=\'<1p 22="p-19-jA-1K\'+(76==0?" p-19-1w-6v":"")+\'">\'+b.dJ(h,1M,1T,2b,2l,7j,6v>0||76>0,2D,2C,3e)+\'<dM 22="p-19" j5="0" j4="0"><dA><9q 22="p-19-88-6v">\'+(8g?"<3D"+b.3Z(2D,h.id,8h,2C)+">"+b.1f(h,"dF")+"</3D>":"");29(c 5n=0;5n<7;5n++){c 1N=(5n+3H)%7;c 9a=(4Y.8a("8j")>-1?4Y.8c(/8j/,3y[1N]):4Y.8c(/D/,3F[1N]));1V+="<3D"+((5n+3H+6)%7>=5?\' 22="p-19-5W-4m-6r"\':"")+">"+(!8f?"<5O":"<a 4E=\\"1u.19.dD(\'#"+h.id+"\', "+1N+\');"\')+b.3Z(2D,h.id,9a,2C)+\' 88="\'+3y[1N]+\'">\'+9b[1N]+(8f?"</a>":"</5O>")+"</3D>"}1V+="</9q></dA><dN>";c bO=b.6y(1T,1M);if(1T==h.3p&&1M==h.3d){h.3t=1i.1W(h.3t,bO)}c 9h=(b.eb(1T,1M)-3H+7)%7;c 8u=1w 1A(1T,1M,1-9h);c 7u=1w 1A(1T,1M,1-9h);c 3s=7u;c dC=(dB?6:1i.iy((9h+bO)/7));29(c bM=0;bM<dC;bM++){1V+=\'<9q 22="p-19-7q-6v">\'+(8g?\'<3D 22="p-19-5W-76"\'+b.3Z(2D,h.id,8h,2C)+">"+9g(3s)+"</3D>":"");29(c 5n=0;5n<7;5n++){c 87=(8i?8i.1G((h.1k?h.1k[0]:1e),[3s]):[1m,""]);c 5R=(3s.2B()!=1M);c 5d=5R||!87[0]||(2b&&3s<2b)||(2l&&3s>2l);1V+=\'<3D 22="p-19-7q-6r\'+((5n+3H+6)%7>=5?" p-19-5W-4m-6r":"")+(5R?" p-19-ix-1K":"")+(3s.4c()==7j.4c()&&1M==h.3d?" p-19-7q-6r-4P":"")+(5d?" "+b.bQ:"")+(5R&&!5Q?"":" "+87[1]+(3s.4c()>=9e.4c()&&3s.4c()<=4O.4c()?" "+b.9m:"")+(3s.4c()==5X.4c()?" p-19-5X":""))+\'"\'+((!5R||5Q)&&87[2]?\' 88="\'+87[2]+\'"\':"")+(5d?(7d?" ch=\\"1u(b).1J().1I(\'p-19-5W-4P\');\\" cf=\\"1u(b).1J().2k(\'p-19-5W-4P\');\\"":""):" ch=\\"1u(b).1I(\'p-19-7q-6r-4P\')"+(7d?".1J().1I(\'p-19-5W-4P\')":"")+";"+(!2D||(5R&&!5Q)?"":"1u(\'#p-19-4Y-"+h.id+"\').1V(\'"+(6z.1G((h.1k?h.1k[0]:1e),[3s,h])||2C)+"\');")+"\\" cf=\\"1u(b).2k(\'p-19-7q-6r-4P\')"+(7d?".1J().2k(\'p-19-5W-4P\')":"")+";"+(!2D||(5R&&!5Q)?"":"1u(\'#p-19-4Y-"+h.id+"\').1V(\'"+2C+"\');")+\'" 4E="1u.19.bS(\\\'#\'+h.id+"\',"+1M+","+1T+\', b);"\')+">"+(5R?(5Q?3s.2o():"&#bH;"):(5d?3s.2o():"<a>"+3s.2o()+"</a>"))+"</3D>";8u.9N(8u.2o()+1);7u.dI(7u.dO()+1);3s=(8u>7u?8u:7u)}1V+="</9q>"}1M++;if(1M>11){1M=0;1T++}1V+="</dN></dM></1p>"}}1V+=(2D?\'<1p 2v="5T: 5a;"></1p><1p id="p-19-4Y-\'+h.id+\'" 22="p-19-4Y">\'+2C+"</1p>":"")+(!8w&&!h.2S?bA:"")+\'<1p 2v="5T: 5a;"></1p>\'+($.2y.4d&&1h($.2y.8m,10)<7&&!h.2S?\'<8l bD="iB:1g;" 22="p-19-bI"></8l>\':"");l 1V},dJ:k(h,1M,1T,2b,2l,7j,bG,2D,2C,3e){2b=(h.2Y&&2b&&7j<2b?7j:2b);c 7O=b.1f(h,"7O");c 1V=\'<1p 22="p-19-iC">\';c 6V="";if(bG||!b.1f(h,"dL")){6V+=3e[1M]+"&#bH;"}1o{c ez=(2b&&2b.23()==1T);c ex=(2l&&2l.23()==1T);6V+=\'<54 22="p-19-1w-1K" eh="1u.19.cc(\\\'#\'+h.id+"\', b, \'M\');\\" 4E=\\"1u.19.ca(\'#"+h.id+"\');\\""+b.3Z(2D,h.id,b.1f(h,"e7"),2C)+">";29(c 1K=0;1K<12;1K++){if((!ez||1K>=2b.2B())&&(!ex||1K<=2l.2B())){6V+=\'<7c 1y="\'+1K+\'"\'+(1K==1M?\' 7P="7P"\':"")+">"+3e[1K]+"</7c>"}}6V+="</54>"}if(!7O){1V+=6V}if(bG||!b.1f(h,"eu")){1V+=1T}1o{c 5V=b.1f(h,"ev").7e(":");c 1E=0;c 2L=0;if(5V.1C!=2){1E=1T-10;2L=1T+10}1o{if(5V[0].2O(0)=="+"||5V[0].2O(0)=="-"){1E=2L=1w 1A().23();1E+=1h(5V[0],10);2L+=1h(5V[1],10)}1o{1E=1h(5V[0],10);2L=1h(5V[1],10)}}1E=(2b?1i.2c(1E,2b.23()):1E);2L=(2l?1i.1W(2L,2l.23()):2L);1V+=\'<54 22="p-19-1w-1E" eh="1u.19.cc(\\\'#\'+h.id+"\', b, \'Y\');\\" 4E=\\"1u.19.ca(\'#"+h.id+"\');\\""+b.3Z(2D,h.id,b.1f(h,"ep"),2C)+">";29(;1E<=2L;1E++){1V+=\'<7c 1y="\'+1E+\'"\'+(1E==1T?\' 7P="7P"\':"")+">"+1E+"</7c>"}1V+="</54>"}if(7O){1V+=6V}1V+="</1p>";l 1V},3Z:k(2D,id,4T,2C){l(2D?" ch=\\"1u(\'#p-19-4Y-"+id+"\').1V(\'"+(4T||2C)+"\');\\" cf=\\"1u(\'#p-19-4Y-"+id+"\').1V(\'"+2C+"\');\\"":"")},a7:k(h,1b,4H){c 1E=h.1T+(4H=="Y"?1b:0);c 1K=h.1M+(4H=="M"?1b:0);c 1N=1i.1W(h.3t,b.6y(1E,1K))+(4H=="D"?1b:0);c 1a=1w 1A(1E,1K,1N);c 2b=b.5z(h,"1W",1m);c 2l=b.5z(h,"2c");1a=(2b&&1a<2b?2b:1a);1a=(2l&&1a>2l?2l:1a);h.3t=1a.2o();h.1M=h.3d=1a.2B();h.1T=h.3p=1a.23();if(4H=="M"||4H=="Y"){b.80(h)}},80:k(h){c bZ=b.1f(h,"en");if(bZ){bZ.1G((h.1k?h.1k[0]:1e),[h.3p,h.3d+1,h])}},79:k(h){c 2Z=b.1f(h,"el");l(2Z==1e?[1,1]:(2n 2Z=="7Q"?[1,2Z]:2Z))},5z:k(h,ek,ei){c 1a=b.81(b.1f(h,ek+"1A"),1e);if(1a){1a.ku(0);1a.kv(0);1a.kP(0);1a.kL(0)}l(!ei||!h.2Y?1a:(!1a||h.2Y>1a?h.2Y:1a))},6y:k(1E,1K){l 32-1w 1A(1E,1K,32).2o()},eb:k(1E,1K){l 1w 1A(1E,1K,1).7t()},c6:k(h,1b,ea,e9){c 2Z=b.79(h);c 1a=1w 1A(ea,e9+(1b<0?1b:2Z[1]),1);if(1b<0){1a.9N(b.6y(1a.23(),1a.2B()))}l b.c5(h,1a)},c5:k(h,1a){c 7r=(!h.2Y?1e:1w 1A(h.3p,h.3d,h.3t));7r=(7r&&h.2Y<7r?h.2Y:7r);c 2b=7r||b.5z(h,"1W");c 2l=b.5z(h,"2c");l((!2b||1a>=2b)&&(!2l||1a<=2l))},43:k(h){c 3K=b.1f(h,"3K");3K=(2n 3K!="4L"?3K:1w 1A().23()%2x+1h(3K,10));l{3K:3K,3F:b.1f(h,"3F"),3y:b.1f(h,"3y"),4A:b.1f(h,"4A"),3e:b.1f(h,"3e")}},6D:k(h,1N,1K,1E){if(!1N){h.31=h.3t;h.3v=h.3d;h.3j=h.3p}c 1a=(1N?(2n 1N=="5j"?1N:1w 1A(1E,1K,1N)):1w 1A(h.3j,h.3v,h.31));l b.4R(b.1f(h,"6C"),1a,b.43(h))}});k 72(1d,7w){$.1Q(1d,7w);29(c 3b in 7w){if(7w[3b]==1e||7w[3b]==2w){1d[3b]=7w[3b]}}l 1d}k ed(a){l(a&&(($.2y.ee&&2n a=="5j"&&a.1C)||(a.4n&&a.4n.b0().2I(/\\9j\\(\\)/))))}$.fn.19=k(q){if(!$.19.b7){$(1n.2g).5e($.19.1X).9H($.19.eg);$.19.b7=1m}c b2=9j.5f.ef.24(1H,1);if(2n q=="4L"&&(q=="kK"||q=="2o")){l $.19["aY"+q+"8Q"].1G($.19,[b[0]].4u(b2))}l b.1R(k(){2n q=="4L"?$.19["aY"+q+"8Q"].1G($.19,[b].4u(b2)):$.19.es(b,q)})};$.19=1w 8Q();$.19.b7=1g;$.19.b6=1w 1A().4c()})(1u);(k(A){A.4b("p.3a",{6H:k(){b.eH=b.q.8I;c B=b,C=b.q,E=(1w 1A()).4c()+1i.kM(),D=C.4T||"0%";b.18.1I("p-3a").v(C.v);A.1Q(b,{77:1g,74:0,7I:0,6T:E,49:A(\'<1p 22="p-3a-49 p-30"></1p>\').Z({v:"2m",2V:"30",2W:2x}),5L:A(\'<1p 22="p-3a-4T"></1p>\').1V(D).Z({v:"2m",2V:"30"}),aV:A(\'<1p 22="p-3a-4T p-3a-4T-kN"></1p>\').1V(D).Z({v:b.18.v()}),8G:A(\'<1p 22="p-3a-8L"></1p>\')});b.8G.5e(b.49.5e(b.5L.1I(C.ew)),b.aV).3T(b.18)},5q:{},p:k(B){l{1F:b,6T:b.6T,q:b.q,18:b.49,5L:b.5L,74:b.74,7I:b.7I}},2e:k(C,B){A.p.2u.24(b,C,[B,b.p()]);b.18.3O(C=="3a"?C:["3a",C].8e(""),[B,b.p()],b.q[C])},6o:k(){b.2M();b.18.2k("p-3a p-3a-1Y").5I("3a").3M(".3a").6W(".p-3a-8L").26();eI 1u.2t[b.6T]},et:k(){b.18.2k("p-3a-1Y");b.1Y=1g},eE:k(){b.18.1I("p-3a-1Y");b.1Y=1m},2p:k(){c B=b,C=b.q;if(b.1Y){l}1u.2t[b.6T]=k(K,L,J,I,H){c G=C.eB,E=C.v,F=((G>E?E:G)/E),D=1i.3f(K/F)*F;l D>1?1:D};B.77=1m;eD(k(){B.77=1g},C.1S);b.eF();b.2e("2p",b.p());l 1g},eF:k(){c C=b,D=b.q,B=D.8I;b.49.2a({v:D.v},{1S:B,2t:b.6T,bY:k(G,E){C.b8((G/D.v)*2x);c H=1w 1A().4c(),F=(H-E.kO);D.8I=B-F},aG:k(){eI 1u.2t[C.6T];C.aR();if(C.77){}}})},aR:k(){if(b.1Y){l}b.49.2M();b.2e("aR",b.p())},2M:k(){b.49.2M();b.49.v(0);b.5L.v(0);b.49.1I("p-30");b.q.8I=b.eH;b.2e("2M",b.p())},4T:k(B){b.5L.1V(B);b.aV.1V(B)},b8:k(B){if(b.49.is(".p-30")){b.49.2k("p-30")}b.7I=B>2x?2x:B;b.74=(b.7I/2x)*b.q.v;b.49.v(b.74);b.5L.v(b.74);if(b.q.7B&&!b.q.4T){b.5L.1V(1i.3f(b.7I)+"%")}b.2e("b8",b.p())}});A.p.3a.5v={v:ky,1S:kn,8I:k1,eB:1,7B:1m,4T:"",1I:"",ew:""}})(1u);(k(C){C.1v=C.1v||{};C.1Q(C.1v,{7N:k(F,G){29(c E=0;E<G.1C;E++){if(G[E]!==1e){C.1t(F[0],"ec.ey."+G[E],F[0].2v[G[E]])}}},6j:k(F,G){29(c E=0;E<G.1C;E++){if(G[E]!==1e){F.Z(G[E],C.1t(F[0],"ec.ey."+G[E]))}}},6E:k(E,F){if(F=="5t"){F=E.is(":30")?"2R":"2s"}l F},fa:k(G,F){c H,E;63(G[0]){1s"u":H=0;1z;1s"e0":H=0.5;1z;1s"4q":H=1;1z;4s:H=G[0]/F.15}63(G[1]){1s"t":E=0;1z;1s"dT":E=0.5;1z;1s"4g":E=1;1z;4s:E=G[1]/F.v}l{x:E,y:H}},aC:k(F){if(F.1J().3r("id")=="bv"){l F}c E={v:F.3l({6b:1m}),15:F.3n({6b:1m}),"dK":F.Z("dK")};F.8L(\'<1p id="bv" 2v="jZ-1r:2x%;8O:5w;br:4i;6b:0;dP:0"></1p>\');c I=F.1J();if(F.Z("1c")=="66"){I.Z({1c:"1O"});F.Z({1c:"1O"})}1o{c H=F.Z("u");if(4K(1h(H))){H="3q"}c G=F.Z("t");if(4K(1h(G))){G="3q"}I.Z({1c:F.Z("1c"),u:H,t:G,2W:F.Z("z-dH")}).2R();F.Z({1c:"1O",u:0,t:0})}I.Z(E);l I},a3:k(E){if(E.1J().3r("id")=="bv"){l E.1J().jT(E)}l E},4t:k(F,G,E,H){H=H||{};C.1R(G,k(J,I){9L=F.eP(I);if(9L[0]>0){H[I]=9L[0]*E+9L[1]}});l H},8v:k(G,J,I,H){c E=(2n I=="k"?I:(H?H:1e));c F=(2n I=="5j"?I:1e);l b.1R(k(){c O={};c M=C(b);c N=M.3r("2v")||"";if(2n N=="5j"){N=N.bd}if(G.5t){M.5F(G.5t)?G.26=G.5t:G.2d=G.5t}c K=C.1Q({},(1n.9R?1n.9R.dE(b,1e):b.dG));if(G.2d){M.1I(G.2d)}if(G.26){M.2k(G.26)}c L=C.1Q({},(1n.9R?1n.9R.dE(b,1e):b.dG));if(G.2d){M.2k(G.2d)}if(G.26){M.1I(G.26)}29(c P in L){if(2n L[P]!="k"&&L[P]&&P.8a("ko")==-1&&P.8a("1C")==-1&&L[P]!=K[P]&&(P.2I(/8o/i)||(!P.2I(/8o/i)&&!4K(1h(L[P],10))))&&(K.1c!="66"||(K.1c=="66"&&!P.2I(/t|u|4q|4g/)))){O[P]=L[P]}}M.2a(O,J,F,k(){if(2n C(b).3r("2v")=="5j"){C(b).3r("2v")["bd"]="";C(b).3r("2v")["bd"]=N}1o{C(b).3r("2v",N)}if(G.2d){C(b).1I(G.2d)}if(G.26){C(b).2k(G.26)}if(E){E.1G(b,1H)}})})}});C.fn.1Q({f5:C.fn.2R,ff:C.fn.2s,f8:C.fn.5t,fe:C.fn.1I,f3:C.fn.2k,eR:C.fn.eQ,4B:k(E,H,F,G){l C.1v[E]?C.1v[E].24(b,{k7:E,q:H||{},1S:F,3o:G}):1e},2R:k(){if(!1H[0]||(1H[0].4n==8p||/(98|94|bb)/.1q(1H[0]))){l b.f5.1G(b,1H)}1o{c E=1H[1]||{};E.4C="2R";l b.4B.1G(b,[1H[0],E,1H[2]||E.1S,1H[3]||E.3o])}},2s:k(){if(!1H[0]||(1H[0].4n==8p||/(98|94|bb)/.1q(1H[0]))){l b.ff.1G(b,1H)}1o{c E=1H[1]||{};E.4C="2s";l b.4B.1G(b,[1H[0],E,1H[2]||E.1S,1H[3]||E.3o])}},5t:k(){if(!1H[0]||(1H[0].4n==8p||/(98|94|bb)/.1q(1H[0]))||(1H[0].4n==ki)){l b.f8.1G(b,1H)}1o{c E=1H[1]||{};E.4C="5t";l b.4B.1G(b,[1H[0],E,1H[2]||E.1S,1H[3]||E.3o])}},1I:k(H,E,G,F){l E?C.1v.8v.1G(b,[{2d:H},E,G,F]):b.fe(H)},2k:k(H,E,G,F){l E?C.1v.8v.1G(b,[{26:H},E,G,F]):b.f3(H)},eQ:k(H,E,G,F){l E?C.1v.8v.1G(b,[{5t:H},E,G,F]):b.eR(H)},eS:k(F,I,E,H,G){l C.1v.8v.1G(b,[{2d:I,26:F},E,H,G])},kh:k(){l b.eS.1G(b,1H)},eP:k(E){c F=b.Z(E),G=[];C.1R(["em","2J","%","kl"],k(H,I){if(F.8a(I)>0){G=[9v(F),I]}});l G}});1u.1R(["6I","kg","kf","ka","k9","8o","k8"],k(F,E){1u.fx.bY[E]=k(G){if(G.kd==0){G.2p=D(G.f0,E);G.4m=A(G.4m)}G.f0.2v[E]="bi("+[1i.2c(1i.1W(1h((G.2P*(G.4m[0]-G.2p[0]))+G.2p[0]),21),0),1i.2c(1i.1W(1h((G.2P*(G.4m[1]-G.2p[1]))+G.2p[1]),21),0),1i.2c(1i.1W(1h((G.2P*(G.4m[2]-G.2p[2]))+G.2p[2]),21),0)].8e(",")+")"}});k A(E){c F;if(E&&E.4n==9j&&E.1C==3){l E}if(F=/bi\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.6P(E)){l[1h(F[1]),1h(F[2]),1h(F[3])]}if(F=/bi\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.6P(E)){l[9v(F[1])*2.55,9v(F[2])*2.55,9v(F[3])*2.55]}if(F=/#([a-fA-7A-9]{2})([a-fA-7A-9]{2})([a-fA-7A-9]{2})/.6P(E)){l[1h(F[1],16),1h(F[2],16),1h(F[3],16)]}if(F=/#([a-fA-7A-9])([a-fA-7A-9])([a-fA-7A-9])/.6P(E)){l[1h(F[1]+F[1],16),1h(F[2]+F[2],16),1h(F[3]+F[3],16)]}if(F=/eY\\(0, 0, 0, 0\\)/.6P(E)){l B.5w}l B[1u.eV(E).6Q()]}k D(G,E){c F;do{F=1u.km(G,E);if(F!=""&&F!="5w"||1u.2q(G,"2g")){1z}E="6I"}4j(G=G.4e);l A(F)}c B={ii:[0,21,21],kk:[eU,21,21],kj:[eZ,eZ,k6],jX:[0,0,0],jV:[0,0,21],jU:[eG,42,42],jY:[0,21,21],k4:[0,0,7E],k5:[0,7E,7E],k3:[bt,bt,bt],kQ:[0,2x,0],kz:[io,hw,bn],fO:[7E,0,7E],fK:[85,bn,47],fN:[21,eT,0],fJ:[fI,50,fP],fQ:[7E,0,0],fm:[fo,bC,fp],fl:[fj,0,8U],fq:[21,0,21],fr:[21,gp,0],gb:[0,5H,0],gc:[75,0,gj],gk:[eU,f6,eT],g9:[fY,fU,f6],g2:[e8,21,21],g3:[dR,g1,dR],g5:[8U,8U,8U],g7:[21,g6,fV],fX:[21,21,e8],gm:[0,21,0],go:[21,0,21],gn:[5H,0,0],ga:[0,0,5H],gd:[5H,5H,0],gg:[21,eG,0],fs:[21,9P,fu],fy:[5H,0,5H],fz:[5H,0,5H],fM:[21,0,0],fD:[9P,9P,9P],fC:[21,21,21],fB:[21,21,0],5w:[21,21,21]};1u.2t.fE=1u.2t.b1;1u.1Q(1u.2t,{eo:"ej",b1:k(F,G,E,I,H){l 1u.2t[1u.2t.eo](F,G,E,I,H)},fF:k(F,G,E,I,H){l I*(G/=H)*G+E},ej:k(F,G,E,I,H){l-I*(G/=H)*(G-2)+E},ft:k(F,G,E,I,H){if((G/=H/2)<1){l I/2*G*G+E}l-I/2*((--G)*(G-2)-1)+E},fv:k(F,G,E,I,H){l I*(G/=H)*G*G+E},fG:k(F,G,E,I,H){l I*((G=G/H-1)*G*G+1)+E},fH:k(F,G,E,I,H){if((G/=H/2)<1){l I/2*G*G*G+E}l I/2*((G-=2)*G*G+2)+E},g4:k(F,G,E,I,H){l I*(G/=H)*G*G*G+E},ih:k(F,G,E,I,H){l-I*((G=G/H-1)*G*G*G-1)+E},hF:k(F,G,E,I,H){if((G/=H/2)<1){l I/2*G*G*G*G+E}l-I/2*((G-=2)*G*G*G-2)+E},hD:k(F,G,E,I,H){l I*(G/=H)*G*G*G*G+E},hC:k(F,G,E,I,H){l I*((G=G/H-1)*G*G*G*G+1)+E},hH:k(F,G,E,I,H){if((G/=H/2)<1){l I/2*G*G*G*G*G+E}l I/2*((G-=2)*G*G*G*G+2)+E},hK:k(F,G,E,I,H){l-I*1i.er(G/H*(1i.5c/2))+I+E},hq:k(F,G,E,I,H){l I*1i.7Y(G/H*(1i.5c/2))+E},hr:k(F,G,E,I,H){l-I/2*(1i.er(1i.5c*G/H)-1)+E},hs:k(F,G,E,I,H){l(G==0)?E:I*1i.6c(2,10*(G/H-1))+E},ht:k(F,G,E,I,H){l(G==H)?E+I:I*(-1i.6c(2,-10*G/H)+1)+E},hy:k(F,G,E,I,H){if(G==0){l E}if(G==H){l E+I}if((G/=H/2)<1){l I/2*1i.6c(2,10*(G-1))+E}l I/2*(-1i.6c(2,-10*--G)+2)+E},hx:k(F,G,E,I,H){l-I*(1i.a5(1-(G/=H)*G)-1)+E},gq:k(F,G,E,I,H){l I*1i.a5(1-(G=G/H-1)*G)+E},hv:k(F,G,E,I,H){if((G/=H/2)<1){l-I/2*(1i.a5(1-G*G)-1)+E}l I/2*(1i.a5(1-(G-=2)*G)+1)+E},hN:k(F,H,E,L,K){c I=1.7s;c J=0;c G=L;if(H==0){l E}if((H/=K)==1){l E+L}if(!J){J=K*0.3}if(G<1i.3A(L)){G=L;c I=J/4}1o{c I=J/(2*1i.5c)*1i.c4(L/G)}l-(G*1i.6c(2,10*(H-=1))*1i.7Y((H*K-I)*(2*1i.5c)/J))+E},i7:k(F,H,E,L,K){c I=1.7s;c J=0;c G=L;if(H==0){l E}if((H/=K)==1){l E+L}if(!J){J=K*0.3}if(G<1i.3A(L)){G=L;c I=J/4}1o{c I=J/(2*1i.5c)*1i.c4(L/G)}l G*1i.6c(2,-10*H)*1i.7Y((H*K-I)*(2*1i.5c)/J)+L+E},i4:k(F,H,E,L,K){c I=1.7s;c J=0;c G=L;if(H==0){l E}if((H/=K/2)==2){l E+L}if(!J){J=K*(0.3*1.5)}if(G<1i.3A(L)){G=L;c I=J/4}1o{c I=J/(2*1i.5c)*1i.c4(L/G)}if(H<1){l-0.5*(G*1i.6c(2,10*(H-=1))*1i.7Y((H*K-I)*(2*1i.5c)/J))+E}l G*1i.6c(2,-10*(H-=1))*1i.7Y((H*K-I)*(2*1i.5c)/J)*0.5+L+E},i9:k(F,G,E,J,I,H){if(H==2w){H=1.7s}l J*(G/=I)*G*((H+1)*G-H)+E},ig:k(F,G,E,J,I,H){if(H==2w){H=1.7s}l J*((G=G/I-1)*G*((H+1)*G+H)+1)+E},ie:k(F,G,E,J,I,H){if(H==2w){H=1.7s}if((G/=I/2)<1){l J/2*(G*G*(((H*=(1.eC))+1)*G-H))+E}l J/2*((G-=2)*G*(((H*=(1.eC))+1)*G+H)+2)+E},eA:k(F,G,E,I,H){l I-1u.2t.c0(F,H-G,0,I,H)+E},c0:k(F,G,E,I,H){if((G/=H)<(1/2.75)){l I*(7.9C*G*G)+E}1o{if(G<(2/2.75)){l I*(7.9C*(G-=(1.5/2.75))*G+0.75)+E}1o{if(G<(2.5/2.75)){l I*(7.9C*(G-=(2.25/2.75))*G+0.ia)+E}1o{l I*(7.9C*(G-=(2.hT/2.75))*G+0.hS)+E}}}},hR:k(F,G,E,I,H){if(G<H/2){l 1u.2t.eA(F,G*2,0,I,H)*0.5+E}l 1u.2t.c0(F,G*2-H,0,I,H)*0.5+I*0.5+E}})})(1u);(k(A){A.1v.hP=k(B){l b.5h(k(){c E=A(b),K=["1c","u","t"];c J=A.1v.6E(E,B.q.4C||"4B");c O=B.q.e3||"cg";c D=B.q.6a||20;c C=B.q.hQ||5;c G=B.1S||hU;if(/2R|2s/.1q(J)){K.7K("2E")}A.1v.7N(E,K);E.2R();A.1v.aC(E);c F=(O=="cg"||O=="hZ")?"u":"t";c M=(O=="cg"||O=="t")?"2P":"hY";c D=B.q.6a||(F=="u"?E.3n({6b:1m})/3:E.3l({6b:1m})/3);if(J=="2R"){E.Z("2E",0).Z(F,M=="2P"?-D:D)}if(J=="2s"){D=D/(C*2)}if(J!="2s"){C--}if(J=="2R"){c H={2E:1};H[F]=(M=="2P"?"+=":"-=")+D;E.2a(H,G/2,B.q.2t);D=D/2;C--}29(c I=0;I<C;I++){c N={},L={};N[F]=(M=="2P"?"-=":"+=")+D;L[F]=(M=="2P"?"+=":"-=")+D;E.2a(N,G/2,B.q.2t).2a(L,G/2,B.q.2t);D=(J=="2s")?D*2:D/2}if(J=="2s"){c H={2E:0};H[F]=(M=="2P"?"-=":"+=")+D;E.2a(H,G/2,B.q.2t,k(){E.2s();A.1v.6j(E,K);A.1v.a3(E);if(B.3o){B.3o.1G(b,1H)}})}1o{c N={},L={};N[F]=(M=="2P"?"-=":"+=")+D;L[F]=(M=="2P"?"+=":"-=")+D;E.2a(N,G/2,B.q.2t).2a(L,G/2,B.q.2t,k(){A.1v.6j(E,K);A.1v.a3(E);if(B.3o){B.3o.1G(b,1H)}})}E.5h("fx",k(){E.70()});E.70()})}})(1u);(k(A){A.1v.gK=k(B){l b.5h(k(){c E=A(b),D=["bz","6I","2E"];c H=A.1v.6E(E,B.q.4C||"2R");c C=B.q.8o||"#gJ";c G=E.Z("6I");A.1v.7N(E,D);E.2R();E.Z({bz:"4i",6I:C});c F={6I:G};if(H=="2s"){F.2E=0}E.2a(F,{5h:1g,1S:B.1S,2t:B.q.2t,aG:k(){if(H=="2s"){E.2s()}A.1v.6j(E,D);if(H=="2R"&&1u.2y.4d){b.2v.gI("e1")}if(B.3o){B.3o.1G(b,1H)}E.70()}})})}})(1u);(k(A){A.1v.gG=k(B){l b.5h(k(){c G=A(b);c F=A.1Q(1m,{},B.q);c H=A.1v.6E(G,B.q.4C||"2s");c C=1h(B.q.9n)||bC;F.dS=1m;c E={15:G.15(),v:G.v()};c D=C/2x;G.1D=(H=="2s")?E:{15:E.15*D,v:E.v*D};F.1D=G.1D;F.9n=(H=="2s")?C:2x;F.4C=H;G.4B("bL",F,B.1S,B.3o);G.70()})};A.1v.bL=k(B){l b.5h(k(){c H=A(b);c F=A.1Q(1m,{},B.q);c I=A.1v.6E(H,B.q.4C||"4B");c C=1h(B.q.9n)||(1h(B.q.9n)==0?0:(I=="2s"?0:2x));c J=B.q.e3||"5a";c G=B.q.ab;if(I!="4B"){F.ab=G||["e0","dT"];F.6j=1m}c E={15:H.15(),v:H.v()};H.1D=B.q.1D||(I=="2R"?{15:0,v:0}:E);c D={y:J!="9w"?(C/2x):1,x:J!="4N"?(C/2x):1};H.1L={15:E.15*D.y,v:E.v*D.x};if(B.q.dS){if(I=="2R"){H.1D.2E=0;H.1L.2E=1}if(I=="2s"){H.1D.2E=1;H.1L.2E=0}}F.1D=H.1D;F.1L=H.1L;F.4C=I;H.4B("1r",F,B.1S,B.3o);H.70()})};A.1v.1r=k(B){l b.5h(k(){c H=A(b),N=["1c","u","t","v","15","2V","2E"];c D=["1c","u","t","2V","2E"];c F=["v","15","2V"];c O=["dV"];c E=["6Y","93","eJ","f2"];c K=["6F","9A","fb","fc"];c L=A.1v.6E(H,B.q.4C||"4B");c M=B.q.6j||1g;c J=B.q.bL||"5a";c P=B.q.ab;c I={15:H.15(),v:H.v()};H.1D=B.q.1D||I;H.1L=B.q.1L||I;if(P){c G=A.1v.fa(P,I);H.1D.u=(I.15-H.1D.15)*G.y;H.1D.t=(I.v-H.1D.v)*G.x;H.1L.u=(I.15-H.1L.15)*G.y;H.1L.t=(I.v-H.1L.v)*G.x}c C={1D:{y:H.1D.15/I.15,x:H.1D.v/I.v},1L:{y:H.1L.15/I.15,x:H.1L.v/I.v}};if(J=="gL"||J=="5a"){if(C.1D.y!=C.1L.y){N=N.4u(E);H.1D=A.1v.4t(H,E,C.1D.y,H.1D);H.1L=A.1v.4t(H,E,C.1L.y,H.1L)}if(C.1D.x!=C.1L.x){N=N.4u(K);H.1D=A.1v.4t(H,K,C.1D.x,H.1D);H.1L=A.1v.4t(H,K,C.1L.x,H.1L)}}if(J=="f9"||J=="5a"){if(C.1D.y!=C.1L.y){N=N.4u(O);H.1D=A.1v.4t(H,O,C.1D.y,H.1D);H.1L=A.1v.4t(H,O,C.1L.y,H.1L)}}A.1v.7N(H,M?N:D);H.2R();A.1v.aC(H);H.Z("2V","30").Z(H.1D);if(J=="f9"||J=="5a"){E=E.4u(["8r","7i"]).4u(O);K=K.4u(["7Z","7b"]);F=N.4u(E).4u(K);H.6W("*[v]").1R(k(){2G=A(b);if(M){A.1v.7N(2G,F)}c Q={15:2G.15(),v:2G.v()};2G.1D={15:Q.15*C.1D.y,v:Q.v*C.1D.x};2G.1L={15:Q.15*C.1L.y,v:Q.v*C.1L.x};if(C.1D.y!=C.1L.y){2G.1D=A.1v.4t(2G,E,C.1D.y,2G.1D);2G.1L=A.1v.4t(2G,E,C.1L.y,2G.1L)}if(C.1D.x!=C.1L.x){2G.1D=A.1v.4t(2G,K,C.1D.x,2G.1D);2G.1L=A.1v.4t(2G,K,C.1L.x,2G.1L)}2G.Z(2G.1D);2G.2a(2G.1L,B.1S,B.q.2t,k(){if(M){A.1v.6j(2G,F)}})})}H.2a(H.1L,{5h:1g,1S:B.1S,2t:B.q.2t,aG:k(){if(L=="2s"){H.2s()}A.1v.6j(H,M?N:D);A.1v.a3(H);if(B.3o){B.3o.1G(b,1H)}H.70()}})})}})(1u);(k(A){A.1v.f7=k(B){l b.5h(k(){c E=A(b);c F=A.1v.6E(E,B.q.4C||"4B");c G=A(B.q.1L);c C=E.1b();c D=A(\'<1p 22="p-1v-f7"></1p>\').3T(1n.2g);if(B.q.8E){D.1I(B.q.8E)}D.1I(B.q.8E);D.Z({u:C.u,t:C.t,15:E.3n()-1h(D.Z("6Y"))-1h(D.Z("93")),v:E.3l()-1h(D.Z("6F"))-1h(D.Z("9A")),1c:"2i"});C=G.1b();fh={u:C.u,t:C.t,15:G.3n()-1h(D.Z("6Y"))-1h(D.Z("93")),v:G.3l()-1h(D.Z("6F"))-1h(D.Z("9A"))};D.2a(fh,B.1S,B.q.2t,k(){D.26();if(B.3o){B.3o.1G(E[0],1H)}E.70()})})}})(1u);',62,1295,'|||||||||||this|var|||||inst|||function|return||||ui|options|||left|top|width||||||||||||||||||||||||||||||css||||||height|||element|datepicker|date|offset|position|target|null|_get|false|parseInt|Math|helper|input|resizable|true|document|else|div|test|size|case|data|jQuery|effects|new|handle|value|break|Date|settings|length|from|year|instance|apply|arguments|addClass|parent|month|to|drawMonth|day|relative|currentHandle|extend|each|duration|drawYear|containment|html|min|dpDiv|disabled|draggable||255|class|getFullYear|call||remove|||for|animate|minDate|max|add|_propagate|axis|body|resize|absolute|cursor|removeClass|maxDate|0px|typeof|getDate|start|nodeName|iFormat|hide|easing|plugin|style|undefined|100|browser|scrollLeft|scrollTop|getMonth|initStatus|showStatus|opacity|ddmanager|child|format|match|px|handles|endYear|stop|click|charAt|pos|stepping|show|inline|helperProportions|originalPosition|overflow|zIndex|grid|rangeStart|numMonths|hidden|currentDay|||||||||progressbar|name|bind|selectedMonth|monthNames|round|se|sw|_getInst|currentYear|nw|outerWidth|ctrlKey|outerHeight|callback|selectedYear|auto|attr|printDate|selectedDay|pageY|currentMonth|isFixed|ne|dayNames|pageX|abs|matches|_defaults|td|slider|dayNamesShort|currentItem|firstDay|positionAbs|accept|shortYearCutoff|droppable|unbind|_adjustDate|triggerHandler|isRTL|get|literal|ghost|appendTo|rangeSelect|snapElements|_pos|margins|_translateValue|_addStatus||lookAhead||_getFormatConfig|documentElement||||dateStr|bar|4px|widget|getTime|msie|parentNode|showAnim|right|cssPosition|none|while|endDay|output|end|constructor|originalSize|iValue|bottom|mouse|default|setTransition|concat|endMonth|alsoResize|current|_updateDatepicker|checkDate|monthNamesShort|effect|mode|markerClassName|onclick|_convertPositionTo|overflowY|period|fixed|rangeElement|isNaN|string|isover|vertical|endDate|over|aspectRatio|formatDate|overflowX|text|_dialogInput|_change|window|tagName|status|scrollSensitivity||scrollSpeed|_convertValue|snap|select||display|defaultDate|handled|button|both|offsetParent|PI|unselectable|append|prototype|focus|queue|_mouseStarted|object|_disabledInputs|_triggerClass|num|dow|stepBigMonths|stepMonths|plugins|_setData|_hideDatepicker|toggle|chars|defaults|transparent|drag|proportionallyResize|_getMinMaxDate|stayOpen|scroll|scope|knobHandles|offsetHeight|hasClass|offsetWidth|128|removeData|dates|previousHandle|textElement|prevBigText|prevText|span|actualSize|showOtherMonths|otherMonth|buttonText|clear|realMax|years|week|today|label|nextBigText||navigationAsDateFormat|_mouseDrag|switch|key|nextText|static|_inDialog|onSelect|widgetName|distance|margin|pow|revert|0pt|type|isout|droppables|scrollLeftParent|restore|PROP_NAME|scrollTopParent|sizeDiff|steps|destroy|val|drop|cell|parents|doy|Show|row|_datepickerShowing|trigger|_getDaysInMonth|dateStatus|obj|yy|dateFormat|_formatDate|setMode|borderLeftWidth|_handleSize|_init|backgroundColor|showBigPrevNext|event|currentText|scrollY|showOn|_mouseStop|exec|toLowerCase|_mouseStart|the|identifier|clickOffset|monthHtml|find|_focus|borderTopWidth|postProcess|dequeue|scrollX|extendRemove|intersect|pixelState||col|active|firstMon|_getNumberOfMonths|prompt|marginRight|option|highlightWeek|split|inlineSettings|buttonImage|next|marginBottom|selectedDate|_handles|siblings|isOver|stack|cssNamespace|_lastInput|days|newMinDate|70158|getDay|utcDate|altFormat|props|borderDif|throw|disableSelection|F0|range|_curInst|_showDatepicker|139|parentData|_mouseCapture|getNumber|percentState|iframeFix|push|hideIfNoPrevNext|containerOffset|save|showMonthAfterYear|selected|number|_mouseUp|minWidth|cancelHelperRemoval|delay|isFunction|cancel|minHeight|sin|marginLeft|_notifyChange|_determineDate|maxDraw|uiHash|names||appendText|daySettings|title|clone|indexOf|beforeShow|replace|blockUI|join|changeFirstDay|showWeeks|weekStatus|beforeShowDay|DD|block|iframe|version|proportions|color|Number|textarea|marginTop|onClose|hasScroll|tzDate|animateClass|closeAtTop|_aspectRatio|img|knob|cssCache|opera|rangeSeparator|_translateRange|className|keyCode|wrapper|moveTo|interval|visible|_translateLimits|wrap|_proportionallyResize|altField|background|continue|Datepicker|keydown|prev|iso8601Week|211|_mouseDestroy|_oneStep|hoverClass|_mouseInit|deactivate|_selectDate|attrValue|activeClass|borderBottomWidth|normal|attrName|maxHeight|shiftKey|slow|mouseDelayMet|dayStatus|dayNamesMin|mm|String|currentDate|preventDefault|calculateWeek|leadDays|formatNumber|Array|firstValue|resizing|_currentClass|percent|_doKeyDown|maxWidth|tr|activate|shortNames|_selectingMonthYear|innerHeight|parseFloat|horizontal|_mouseDownEvent|startDate|innerWidth|borderRightWidth|browserWidth|5625|relOffset|change|sortables|HTML|mousedown|snapping|showCurrentAtPos|_updateRange|unit|sliderValue|setDate|try|192|slide|defaultView|browserHeight|tolerance|catch|map|prepareOffsets|longNames|checkLiteral|containerPosition|absolutePosition|item|scrollHeight|removeWrapper|dragging|sqrt|containerSize|_adjustInstDate|pattern|_doKeyPress|getData|origin|children|parseDate|_disableClass|formatName|Invalid|log|_inlineClass|_setDateFromField|_mouseDistanceMet|gotoDate|_gotoToday|_appendClass|_clearDate|mandatory|widgetEventPrefix|gotoCurrent|||_dialogClass|_promptClass|chr|_mouseUpDelegate|_mainDivId|_getData|_mouseDelayMet|_setDate|createWrapper|getDaysInMonth|_getDate|_tidyDialog|complete|_mouseMoveDelegate|_getDefaultDate|_newInst|x3e|knobTheme|_drag|_findPos|1px|borderTop|_nodeName|pause|documentScroll|originalElement|autohide|textBg|borderLeft|borderRight|_|_out|toString|swing|otherArgs|_over|borderBottom|out|uuid|initialized|progress|handleOffset|_mouseDown|fast|containerElement|cssText|preserveCursor|generated|unwrap|removeChild|rgb|_updateCache|alsoresize|firstChild|_initBoundaries|107|elementOffset|dim|origSize|border|_createRange|169|clientHeight|fxWrapper|getName|_updateAlternate|_helper|backgroundImage|controls|OFFSET_PARENT_NOT_SCROLL_PARENT_X|150|src|_generatePosition|regional|secondary|xa0|cover|after|PAGEX_INCLUDES_SCROLL|scale|dRow|divSpan|daysInMonth|showOptions|_unselectableClass|OFFSET_PARENT_NOT_SCROLL_PARENT_Y|_selectDay|PAGEY_INCLUDES_SCROLL|cacheHelperProportions|dims|_clear|x3c|step|onChange|easeOutBounce|clientWidth|overflowXOffset|sortable|asin|_isInRange|_canAdjustMonth|overflowYOffset|_opacity|_cursor|_clickMonthYear|original|_selectMonthYear|setData|_zIndex|onmouseout|up|onmouseover|Class|_checkOffset|empty|_start|placeholder|andSelf|droppablesLoop|shouldRevert|connectToSortable|release|snapMode|snapItem|_activate|_drop|solid|8px|1000|F2F2F2|greedyChild|_deactivate|greedy|dropBehaviour|setContainment|MozUserSelect|selectstart|on|5000px|widgetBaseClass|metadata|getterSetter|_mouseUnselectable|_mouseMove|cursorAt|cacheScrollParents|adjustOffsetFromHelper|createHelper|getHandle|mousemove|mouseup|defaultTheme|_renderAxis|Select|debug|_connectDatepicker|different|May|Close|previous|buttonImageOnly|alt|keypress|err|charCode|dateText|_dialogInst|before|_inlineDatepicker||getter|_stop|autoHide|scrollWidth|href|_renderProxy|_respectSize|originalMousePosition|_updateRatio|blur|||startValue|_getRange|_handleIndex|_pageStep|_removeRange|_click|_keydown|_blur|_isDisabledDatepicker|origYear|thead|isMultiMonth|numRows|_changeFirstDay|getComputedStyle|weekHeader|currentStyle|index|setUTCDate|_generateMonthYearHeader|float|changeMonth|table|tbody|getUTCDate|padding|statusForDate|144|fade|center|closeStatus|fontSize|clearText|_generateHTML|clearStatus|closeText|middle|filter|currentStatus|direction|nextStatus|prevBigStatus|prevStatus|monthStatus|224|curMonth|curYear|_getFirstDayOfMonth||isArray|safari|slice|_checkExternalClick|onchange|checkRange|easeOutQuad|minMax|numberOfMonths||onChangeMonthYear|def|yearStatus||cos|_attachDatepicker|enable|changeYear|yearRange|textClass|inMaxYear|storage|inMinYear|easeInBounce|increment|525|setTimeout|disable|_animate|165|_interval|delete|paddingTop|nextBigStatus|_possibleChars|getYear|len|100px|cssUnit|toggleClass|_toggleClass|morph|140|240|trim|iInit|Missing|rgba|245|elem|Year|paddingBottom|_removeClass|Month|_show|230|transfer|__toggle|content|getBaseline|paddingLeft|paddingRight|origMonth|_addClass|_hide|offsetNumeric|animation|offsetString|148|dragstart|darkviolet|darksalmon||233|122|fuchsia|gold|pink|easeInOutQuad|203|easeInCubic|sortactivate||purple|violet||yellow|white|silver|jswing|easeInQuad|easeOutCubic|easeInOutCubic|153|darkorchid|darkolivegreen|refreshPositions|red|darkorange|darkmagenta|204|darkred|Bottom|canvas|proxy|216|193|zoom|lightyellow|173|808080|DEDEDE|238|lightcyan|lightgreen|easeInQuart|lightgrey|182|lightpink|all|lightblue|navy|green|indigo|olive|mouseover|hover|orange|Left|Right|130|khaki|Top|lime|maroon|magenta|215|easeOutCirc|TAB|SPACE|UP|inArray|eventPrefix|substring|SHIFT|RIGHT|PAGE_DOWN|109|PAGE_UP|PERIOD|190|_trigger|fix|puff|mozilla|removeAttribute|ffff99|highlight|box|_mouseDelayTimer|enableSelection|gen|off|started|which|NUMPAD_SUBTRACT|106|188|COMMA|CONTROL|DELETE|DOWN|CAPS_LOCK|BACKSPACE|dir|visibility|expr|tabbable|tabIndex|END|ENTER|111|NUMPAD_DIVIDE|NUMPAD_ENTER|108|NUMPAD_MULTIPLY|110|NUMPAD_DECIMAL|HOME|ESCAPE|INSERT|LEFT|NUMPAD_ADD|invalid|valid|makeArray|fromSortable|group|sort|easeOutSine|easeInOutSine|easeInExpo|easeOutExpo|toSortable|easeInOutCirc|183|easeInCirc|easeInOutExpo|splice|dropover|pointer|easeOutQuint|easeInQuint|touch|easeInOutQuart|fit|easeInOutQuint|not|dropout|easeInSine|dropactivate|dropdeactivate|easeInElastic|containerCache|bounce|times|easeInOutBounce|984375|625|250|001|500|revertDuration|neg|down|fff|items|snapTolerance|sortreceive|easeInOutElastic|sender|receive|easeOutElastic|_refreshItems|easeInBack|9375|inner|outer||easeInOutBack||easeOutBack|easeOutQuart|aqua|Th|Fr|Sa|Set||189|Tu|Fri|Sat||Su|Mo|first|hasDatepicker|other|ceil|_inlineShow|_dialogDatepicker|javascript|header|console|setDefaults|getAttribute|eval|Thu|Wed|Nov|Dec|Wk|Week|Oct|Sep|Apr|Jun|Jul|Aug|of|Sunday|Saturday|Sun|Mon|Tue|Friday|Thursday|Monday|Tuesday|Wednesday|cellspacing|cellpadding|ATOM|Unexpected|Unknown|86400000|COOKIE|ISO_8601|RFC_1036|rtl|RFC_850|RFC_822|floor|getTimezoneOffset|fadeIn|fadeOut|draw|unblockUI|slideUp|slideDown|nodeType|nextSibling|noWeekends|selectedIndex|multi|RFC_1123|prepend|close|control|_changeDatepicker|9999|_disableDatepicker|one|_destroyDatepicker|links|_enableDatepicker|_refreshDatepicker|_setDateDatepicker|W3C|TIMESTAMP|RSS|RFC_2822|1000px|0123456789|_getDateDatepicker|stopPropagation|fromCharCode|Mar|We|noKeyboard|instanceof|replaceWith|brown|blue|outline|black|cyan|font|Height|200|Width|darkgrey|darkblue|darkcyan|220|method|outlineColor|borderTopColor|borderRightColor|Feb|animateDuration|state|animateEasing|borderLeftColor|borderBottomColor|switchClass|Function|beige|azure|pt|curCSS|3000|Moz|Today|January|February|March|Next|setHours|setMinutes|without|Prev|300|darkkhaki|November|December|Jan|October|September|June|July|August|Erase|April|isDisabled|setMilliseconds|random|back|startTime|setSeconds|darkgreen|Clear|dialog'.split('|'),0,{}))
// 
/*  */

// Main library file 
// Contains all functions used by two or more widgets,
// Contains the main initialization and widget management code

/*  */

//
// START Global Initialization code
//

window.widget_manager = null;
$(document).ready(
	function ()
	{
		window.widget_manager = new WidgetManager( window.widget_names );
		if ( window.widget_roots && window.widget_roots.length > 0 )
		{
			for ( var i in window.widget_roots )
			{
				// Initialize widgets at one or more specific root points
				// This option is here for perfomance reasons: it can make
				// a huge difference on a big page with few localized widgets,
				// e.g. admin interface
				init_widgets( window.widget_roots[i] );
			}
		}
		else
		{
			// Initialize the widgets starting from the root
			init_widgets( document.body );
		}
		$( window ).unload( 
			function ()
			{
				// There might be things to save at 
				// the moment a user clicks a link
				window.widget_manager.stopAll();
			}
		);		

		// check if modifier keys influence a link
		modifier_keys();

		// #4825: ready function for edit_required_fields template
		if ( window.required_fields )
		{
			validate_update();
		}
	}
);

// check if modifier keys influence a link
function modifier_keys( url )
{
	if ($('#editpage'))
	{
		// check if editpage button is clicked
		// if shift key is clicked, use the admin page in new window
		$('#editpage').click(
			function(e)
			{
				if (e.shiftKey && $('#editpage').attr('rel')) 
				{
					uri = $('#editpage').attr('rel');
					win = window.open('','_blank');
					win.location.href = uri;
					return false;
				}
			}
		); 
	}
}

// External callback for the widget 
function widget_save( submit_form )
{
	var n = window.widget_manager.stopAll();
	var t = n > 0 ? 2000 : 1; 
	setTimeout( 
		function ()
		{
			submit_form.submit();
		},
		t
	);
	return false;
}

// Start widgets inside a given element/css selector
function init_widgets( context )
{                    
	var x = $( context ).get(0);
	x && window.widget_manager.startWidgets( x );
}

// CLASS WidgetManager
// Handles the inter-widget communication
function WidgetManager( widget_names )
{
	this.widgetNames 	= widget_names;
	this.currentWidgets = {};
	this.allWidgets 	= {};
}

// Return all widgets of a given type
WidgetManager.prototype.widgets = function ( name )
{
	return this.allWidgets[name];
};

// Make the Widget Manager aware of a new widget instance
WidgetManager.prototype.add = function ( name, w )
{
	this.allWidgets[name] = this.allWidgets[name] || [];
	this.allWidgets[name].push( w );
};

// Select all the widget instances of types defined in ws
// that match predicate function f
WidgetManager.prototype.find_all = function ( f, ws )
{
	ws = ws || ['editinplace','editatonce'];
	var rt = [];
	for ( var i in ws )
	{
		var a = this.allWidgets[ws[i]] || [];
		
		for ( var j in a )
		{
			if ( f( a[j] ) )
			{
				rt.push( a[j] );
			}
		}
	}
	return rt;
};

// Finds the first element belonging to one of the types 
// defined in ws that matches predicate function f
WidgetManager.prototype.find = function ( f, ws )
{
	ws = ws || ['editinplace','editatonce'];
	for ( var i in ws )
	{
		var a = this.allWidgets[ws[i]] || [];
		
		for ( var j in a )
		{
			if ( f( a[j] ) )
			{
				return a[j];
			}
		}
	}
	return null;
};

// Returns the current/active widget of type name
WidgetManager.prototype.current = function ( name )
{
	return this.currentWidgets[name];
};

// Stop (blur) all widgets. Used for e.g when the page is unloading
WidgetManager.prototype.stopAll = function ()
{
	var count = 0;
	for ( var name in this.currentWidgets )
	{
		var w = this.currentWidgets[name];
		if ( w )
		{
			if ( w.widgetBlur( name, null ) )
			{
				count += 1;
			}
		}
	}
	return count;
};

// Stop the current/active widget instance of type name
WidgetManager.prototype.stop = function ( name )
{
	var w = this.currentWidgets[name];
	w && w.widgetBlur( name, null );
};

// Defined a widget instance as the new current/active element
// fot the widget type name
WidgetManager.prototype.widgetFocus = function ( name, obj )
{
	for ( i in this.currentWidgets )
	{
		var w = this.currentWidgets[i];
		w.widgetBlur && w.widgetBlur( name, obj );
	}
	
	this.currentWidgets[name] = obj;
};

// Main widget initialization function
// Does a traversal of the tree that starts at root, checking
// the css classes of all elements for the do_<widgetname> pattern
// that matches one of the allowed types defined in window.widgetNames
WidgetManager.prototype.startWidgets = function ( root )
{
	var stack = [root];
	var names = this.widgetNames;
	var names_do = {};
	for ( var i in names )
	{
		names_do['do_' + names[i]] = names[i];
	}
	
	while ( stack.length > 0 )
	{
		var e = stack.pop();
		if ( e.className && e.className.match( /do_[a-z_]+/ ) )
		{
			// Note: IE6 does not recognize the \b escape char 
			// (whitespace in js regexps)
			var clsss = e.className.match( /do_[a-z_]+/g );
			for ( var i = 0; i < clsss.length; i++ )
			{
				var w = names_do[clsss[i]];
				if ( w )
				{
					eval("init_" + w + "( e )");
				}
			}
		}
		
		if ( e.childNodes ) 
		{
			for ( var i = 0 ; i < e.childNodes.length ; i++ )
			{
				if ( e.childNodes[i].nodeType != 3 )
				{
					// Only process if not a text node
					stack.unshift( e.childNodes[i] );
				}
			}
		}
	}
	
	var ends = ['editinplace','editatonce'];
	for ( var i in ends )
	{
		if ( jQuery.inArray( ends[i], names ) > -1)
		{
			eval( 'end_' + ends[i] + '()' );
		}
	}
};

// Convert the name of a validated field into a 
// string usable as a dom id attribute
function validate_field2id ( name )
{
	name = name.replace( /\./g, "_" );
	return 'required_fields_li_' + name;
}

function validate_cmpfield ( l )
{
	return function ( x ) 
	{
		return jQuery.inArray( x.options.ajax.field, l ) > -1; 
	}
}

// Scroll down/up the window to make visible the edit place of 
// a given validate field that was incorrect or missing
function validate_goto ( i )
{
	var e = window.widget_manager.find( validate_cmpfield( [i] ) );
	if ( e )
	{
		var p = jQuery.getPosition( e.container );
		scroll( 0, p.y - 100 );
	}
}

// Update the validate fields error information
function validate_update ()
{
	if ( jQuery.isEmptyObject( window.required_fields ) )
	{
		$( "#required_fields_main"  ).hide();
		$( "#required_fields_other" ).show();
		return;
	}
	
	$( "#required_fields_main" ).show();
	$( "#required_fields_other" ).hide();
	
	var fs = window.required_fields;
	var ul = $( "#required_fields_list" ).get( 0 );
	ul.innerHTML = '';
	var bind_click = function ( li, i )
	{
		var fu = function ( x ) 
		{ 
			return x.options.ajax.field == i; 
		};

		var e = window.widget_manager.find( fu );

		if ( e && e.options )
		{
			var c = e.options.callback;
			c = c || function () {};

			var fc = function ( d )
			{
				delete( window.required_fields[i] );
				validate_update();
				c && c( d );
			}

			e.options.callback = fc;
			
			$( li ).bind( "click",
				function () 
				{
					validate_goto( i );
					return false;
				}
			);
		}
	};
	
	var gs = jQuery.objKeys( fs );
	var fu = validate_cmpfield( gs );
	var ws = window.widget_manager.find_all( fu );
	for ( var i in ws )
	{
		ws[i].addRequiredClass();
	}
	
	for ( var i in fs )
	{
		var li = document.createElement( "li" );
		var an = document.createElement( "a" );
		li.id = validate_field2id( i );
		li.className = "required_field_title";
		an.href='#';
		$( an  ).html( fs[i] );
		$( li ).append( an );
		$( ul ).append( li );
		bind_click( an, i );
	}
}

// Used by all widgets. Override the default widget 'docs' 
// options with those 'o' specific for this instance
function apply_options( docs, o )
{
	for ( var i in docs )
	{
		var d	= docs[i];
		var ds	= d[0].split('.');
		if ( ds.length > 1 )
		{
			o[ds[0]][ds[1]]	= (typeof o[ds[0]][ds[1]] != 'undefined') ? o[ds[0]][ds[1]]	: d[1];
		}
		else
		{
			o[d[0]]			= (typeof o[d[0]] != 'undefined') 		  ? o[d[0]] 		: d[1];
		}
	}
	return o;
}


//
// END Global Initialization code
//

// Identity function
function identity ( x )
{
	return x;
}

jQuery.fn.opacity = function ( v )
{
	this.css('opacity', v );
	if ( jQuery.browser.msie ) 
	{
		this.css('filter', 'alpha(opacity=' + v * 100 + ')');
	}
}

jQuery.extend( {
	
	objKeys: function ( obj )
	{
		var ret = [];
		for ( var i in obj )
		{
			ret.push( i );
		}
		return ret;
	},
	
	label: function ( path, def )
	{
		var names 	= path.split('.');
		var tmp 	= window.labels;

		while ( names.length > 0 && tmp )
		{
			tmp = tmp[names.shift()];
		}

		return tmp || def;
	},
	
	// Create a new cookie
	// @param	name	string		name of the cookie
	// @param	value	string		value to be stored
	// @param	days	int			expiry time in days
	createCookie: function ( name, value, days )
	{
		if ( days ) 
		{
			var date = new Date();
			date.setTime( date.getTime() + ( days * 24 * 60 * 60 * 1000 ) );
			var expires = "; expires=" + date.toGMTString();
		}
		else
		{
			var expires = "";
		}
		document.cookie = name + "=" + value+expires + "; path=/";
	},

	// Read the value of a cookie
	readCookie: function ( name )
	{
		var nameEQ = name + "=";
		var ca = document.cookie.split( ';' );
		for ( var i = 0 ; i < ca.length ; i++ )
		{
			var c = ca[i];
			while ( c.charAt(0) == ' ' )
			{
				c = c.substring( 1, c.length );
			}
			
			if ( c.indexOf( nameEQ ) == 0 ) 
			{
				return c.substring( nameEQ.length, c.length );
			}
		}
		return null;
	},

	// Delete a cookie
	eraseCookie: function( name )
	{
		jQuery.createCookie( name, "", -1 );
	},
	
	// Use the log function of firebug without messing with other browsers 
	log: function () 
	{
		if ( window.console && window.console.log && window.console.assert )
		{
			window.console.log( arguments );
		}
	},
	
	warn: function(where, what)
	{
		if(!what)
		{
			what = "You cannot edit this now.";
		}
		
		anyRest.notifications.add(where+': '+what, 'notice');
	},
	
	error: function ( msg , url , line ) 
	{
		alert( msg + " @ " + url + " @ " + line );
		return false;
	},
	
	// Encode object for get/post request: works with arbitrarily-leveled-nested 
	// arrays and objects. Adapted from PHP (any_functions' http_build_query)
	//
	xparam: function (params)
	{
		var encoder_f = function (f, name, value, sep, uri)
		{
			if (value.constructor == Array)
			{
				for ( var i = 0 ; i < value.length ; i++ )
				{
					f(f, name + '[' + i + ']', value[i], sep, uri);
				}
			}
			else if ( value.constructor == Object )
			{
				for ( var i in value )
				{
					f(f, name + '[' + i + ']', value[i], sep, uri);
				}
			}
			else
			{
				uri.uri += sep.sep + name + '=' + encodeURIComponent(value);
				sep.sep = '&';
			}
		};

		// Hack for simulating call-by-reference in JavaScript
		var sep = {sep:''};
		var uri = {uri:''};

		for ( var i in params )
		{
			encoder_f(encoder_f, i, params[i], sep, uri);
		}

		return uri.uri;
	},
	
	// Get the window size
	windowSize: function ()
	{
		var p = { w: 0, h: 0 };
        var e = document.documentElement;
        var b = document.body;

		if ( typeof( window.innerWidth ) == 'number' )
		{
		  //Non-IE
		  p.w = window.innerWidth;
		  p.h = window.innerHeight;
		}
		else if( e && ( e.clientWidth || e.clientHeight ) )
		{
		  //IE 6+ in 'standards compliant mode'
		  p.w = e.clientWidth;
		  p.h = e.clientHeight;
		}
		else if( b && ( b.clientWidth || b.clientHeight ) )
		{
		  //IE 4 compatible
		  p.w = b.clientWidth;
		  p.h = b.clientHeight;
		}	
		
		return p;
	},
	
	mousePosition: function ( ev )
	{
		ev = ev || window.event;

		var x = 0, y = 0;

		if ( ev.pageX || ev.pageY )
		{
			x = ev.pageX;
			y = ev.pageY;
		}
		else if ( ev.clientX || ev.clientY )
		{
			x = ev.clientX + document.body.scrollLeft;
			y = ev.clientY + jQuery.pageScrollTop(); //document.body.scrollTop;
		}

		return { "x": x, "y": y };
	},
	
	// Coordinates of mouse in relation to the window 
	mouseInWindow: function ( e )
	{
		var ret = {};
		if ( !e )
		{
			var e = window.event;
		}
		
		if ( e.clientX || e.clientY )
		{
			ret.x = e.clientX - Math.max( 0 , document.body.scrollLeft );
			ret.y = e.clientY - Math.max( 0 , document.body.scrollTop ); // document.body.scrollTop*/  + document.documentElement.scrollTop;
		}
		return ret;
	},
	
	// Override r with properties from object a
	assocMergeInto: function ( r , a ) 
	{
		if ( a )
		{
			for( var i in a )
			{
				r[i] = a[i];
			}
		}
		return r;
	},
	
	// Merge two objects (properties of the second 
	// argument override those of the first), result is a new 
	// object in memory
	assocMerge: function ( a , b ) 
	{
	 	return jQuery.assocMergeInto( jQuery.assocMergeInto( {}, a ),  b );
	},
	
	// Output a datetime 
	dateFormat: function ( format , date )
	{
		format = format.replace( /\%Y/ , date.getFullYear() );
		format = format.replace( /\%m/ , date.getMonth() + 1 );
		format = format.replace( /\%d/ , date.getDate() );
		format = format.replace( /\%H/ , date.getHours() );
		format = format.replace( /\%M/ , date.getMinutes() );
		return format;
	},

	// Remove a parameter from the url
	remFromQuery: function ( url , name ) 
	{
		var reg = new RegExp( '&?' + name + '=[^&]*' );
		url = url.replace( reg, '' );
		return url;
	},
	
		
	// Add some query data to a url
	addToQuery: function ( url , data ) 
	{
		return url + ( url.match( /\?/ ) ? '&' : '?' ) + data;
	},
	
	// Parse options given inside the attribute of an element
	attrOptions: function ( e , name )
	{
		var a = e.getAttribute( name ) || '';
		a = a.replace( /,\s*$/ , '' );
		eval( "var tmp = {" + a + "}" );
		return tmp;
	},

	// DEPRECATED: Vertical scroll offset in pixels 
	pageScrollTop: function ()
	{
        var pos = jQuery.getScroll();
        return pos.y;
	},
    
    getScroll: function ()
    {
        var p = {x: 0, y: 0};
        var e = document.documentElement;
        var b = document.body;

        if ( e && ( e.scrollLeft || e.scrollTop ) ) 
        {
            p.x = e.scrollLeft;
            p.y = e.scrollTop;
        
        }
        else if ( b && ( b.scrollLeft || b.scrollTop ) ) 
        {
            p.x = b.scrollLeft;
            p.y = b.scrollTop;
        }
        else if ( window.pageXOffset || window.pageYOffset )
        {
            p.x = window.pageXOffset;
            p.y = window.pageYOffset;
        }
        else if( window.scrollX || window.scrollY ) 
        {
            p.x = window.scrollX;
            p.y = window.scrollY;
        }
        return p;
    },


	// Calculate x,y position of a given dom element
	getPosition: function ( obj, ignoreRelative )
	{
        ignoreRelative = ignoreRelative || false;

		var curleft = curtop = 0;

		// Hack for IE not needed ?
		// Not sure but this check for IE gave problems in the end
		// Keep the if in until we're sure that it is not needed
		if ( false && jQuery.browser.msie )
		{
			// Hack for IE, naturally
			var childImg = false;
			for ( var i in obj.childNodes )
			{
				childImg = childImg || obj.childNodes[i].tagName == 'IMG';
			}

			if ( childImg )
			{
				curleft -= obj.offsetLeft;
			}
		}

		while ( obj )
		{                                        
			if ( !ignoreRelative || jQuery( obj ).css('position') != "relative" )
			{
				curleft += obj.offsetLeft;
				curtop  += obj.offsetTop;
			}
			obj = obj.offsetParent;
		}
		return { x: curleft, y: curtop };
	},
	
	// Calculate dimensions of a dom element
	getSize : function(e)
	{
		var w = jQuery.css(e,'width');
		var h = jQuery.css(e,'height');
		var wb = 0;
		var hb = 0;
		es = e.style;
		
		if ( jQuery(e).css('display') != 'none' ) 
		{
			wb = e.offsetWidth;
			hb = e.offsetHeight;
		}
		else
		{
			oldVisibility = es.visibility;
			oldPosition = es.position;
			es.visibility = 'hidden';
			es.display = 'block';
			es.position = 'absolute';
			wb = e.offsetWidth;
			hb = e.offsetHeight;
			es.display = 'none';
			es.position = oldPosition;
			es.visibility = oldVisibility;
		}
		return { w:w, h:h, wb:wb, hb:hb };
	},
	
	// Get an object position from the upper left viewport corner
	elemInWindow: function ( o )
	{
		// Get the positions from the parent object
		var oLeft = o.offsetLeft;            
		var oTop  = o.offsetTop;            

		// Parse the parent hierarchy up to the document element
		while( o.offsetParent != null )
		{   
			oParent	 = 	o.offsetParent;		// Get parent object reference
			oLeft	+=	oParent.offsetLeft;	// Add parent left position
			oTop	+=	oParent.offsetTop;	// Add parent top position
			o = oParent;
		}
		
		return { l: oLeft , t: oTop };
	},

	validateForm: function ( frm , alrt )
	{
		if ( document.getElementById( frm ) )
		{
			var f = document.getElementById( frm );
		}
		else if ( document.forms[ frm ] )
		{
			var f = document.forms[ frm ];
		}
		else
		{
			f = frm;
		}

		if ( alrt == 'null' )
		{
			alrt = 'All fields are required';
		}

		var isValid		= true;
		var	vFormElems	= new Array();

		for ( i = 0 ; i < f.elements.length ; i++ ) 
		{
			elem  = f.elements[i]; 


			vCode = ( elem['alt'] ) ? elem['alt'] : elem.getAttribute('alt');

			if ( !( typeof vCode == 'undefined' || vCode == null || vCode == "" ) )	
			{
				if ( jQuery.inArray( elem.name, vFormElems ) == -1)
				{
					v = jQuery.getValue( f.elements[elem.name] );

					if ( vCode == 'required' && v.length < 1 ) 
					{
						isValid = false;
					}
					vFormElems[i] = elem.name;
				}
			}
		}
		if (!isValid) 
		{
			alert( alrt );
		}
		return isValid
	},

	// Returns value of a formfield
	getValue: function ( ffield , def )
	{
		v = '';
		t = ffield.type;
		
		if( !t ) 
		{
			t = ffield[0].type;
		}

		if( t == 'checkbox' )
		{
			if( ffield.length )
			{
				for( gv_i=0 ; gv_i < ffield.length ; gv_i++ )
				{
					if ( ffield[gv_i].checked ) 
					{
						v = ffield[gv_i].value;
					}
				}
			}
			else
			{
				if ( ffield.checked ) 
				{
					v = ffield.value;
				}
			}	
		} 
		else if ( t == 'file' )		v = ffield.value;
		else if ( t == 'hidden' )	v = ffield.value;
		else if ( t == 'password' ) v = ffield.value;
		else if ( t == 'radio' ) 
		{
			if ( ffield.length ) 
			{
				for ( gv_i=0 ; gv_i < ffield.length ; gv_i++) 
				{
					if ( ffield[gv_i].checked ) v = ffield[gv_i].value;
				}
			}
			else
			{
				if ( ffield.checked ) v = ffield.value;
			}	
		} 
		else if (t == 'select-multiple' ) v = ffield.options[ffield.selectedIndex].value;
		else if (t == 'select-one' )	  v = ffield.options[ffield.selectedIndex].value;
		else if (t == 'text' )			  v = ffield.value;
		else if (t == 'textarea' )		  v = ffield.value;
		
		if (def != null && v == '')
		{
			return def;
		}
		return v;
	},
	
	byId: function ( id , doc ) 
	{
		if ( typeof id == "string" || id instanceof String ) 
		{
			if ( !doc )
			{
				doc = document;
			}
			return doc.getElementById ( id );
		}
		// assume it's a node
		return id; 
	},

	textContent: function ( node ) 
	{
		var _result = "";
		if (node == null)
		{ 
			return _result;
		}
		
		for (var i = 0; i < node.childNodes.length; i++) 
		{
			switch (node.childNodes[i].nodeType) 
			{
				case 1: // ELEMENT_NODE
				case 5: // ENTITY_REFERENCE_NODE
					_result += jQuery.textContent(node.childNodes[i]);
					break;
				case 3: // TEXT_NODE
				case 2: // ATTRIBUTE_NODE
				case 4: // CDATA_SECTION_NODE
					_result += node.childNodes[i].nodeValue;
					break;
				default:
					break;
			}
		}
		return _result;
	},

	// used in form validator
	// maybe change in the future
	isEmailAddress: function ( v ) 
	{
		mailvalid = true;
		if ( v.indexOf ( '@' ) < 1 )
		{
			mailvalid = false;
		}
		else if ( v.lastIndexOf ( '.' ) < v.indexOf ( '@' ) ) 
		{
			isvalid = false;
		}
		aapje  = v.indexOf( '@' ); 
		puntje = v.indexOf( '.' );  
		if ( puntje - aapje == 1 ) 
		{
			mailvalid = false;
		}
		return mailvalid;
	},

	// used in form validator
	// maybe change in the future
	isSizeSmaller: function ( v , size ) 
	{
		if ( v.length < size )
		{
			return true;
		}
		else
		{
			return false;
		}
	},

	// used in form validator
	// maybe change in the future
	isSizeGreater: function ( v , size ) 
	{
		if ( v.length > size )
		{
			return true;
		}
		else
		{
			return false;
		}
	},

	// showhide functions
	// used while rest call state is failed/ok/wait
	showHide: function (str)
	{
		a = str.split(',');
		for ( var i = 0 ; i < a.length ; i++ ) 
		{
			s = a[i];
			c = s.charAt(0);
			v = 'block';
			
			if (c == '-') 
			{
				v = 'none';
				s = s.substr( 1 , s.length-1);
			}
			else if ( c == '+') 
			{
				s = s.substr( 1 , s.length - 1 );
			}
			
			if ( $( "#" + s ) ) 
			{
				$("#" + s).css( 'display', v );	
			}
		}
	},

	// Hide all obj in an array or string and optionally show obj b (can be an array)
	// Parameters:	a	which obj to hide (can be an array) 				
	//				b	which obj should openend afterwards (hide all but ...)(can be an array)
	//				s	if s = true search for objects starting with the string 'a'
	hideAllBut: function ( a, b ) 
	{
		if ( jQuery.isObject( a ) )
		{
			for ( var p in a ) 
			{
				$( "#" + a[p] ).hide(); 
			}
		}
		else if ( jQuery.isArray(a) )
		{
			for ( i = 0 ; i < a.length ; i++ )
			{
				$( "#" + a[i] ).hide(); 
			}
		}
		else if ( jQuery.isString( a ) )
		{
			var d = document.getElementsByTagName( 'div' );
			for( i = 0 ; i < d.length ; i++ )
			{
				var l = a.length;
				var id = d[i].id;
				if ( id.substring( 0 , l ) == a )
				{
					$( "#" + d[i].id ).hide(); 
				}
			}
		}
		
		if ( jQuery.isArray( b ) )
		{
			for ( i = 0 ; i < a.length ; i++) 
			{
				$( "#" + b[i] ).show();
			}
		}
		else if ( jQuery.isString( b ) ) 
		{
			$( "#" + b ).show();
		}
	},
		
	
	popup: function ( thg_id, o, l, t, w, h ) 
	{ 
		if ( l == null ) l = 100;
		if ( t == null ) t = 100;
		if ( w == null ) w = 400;
		if ( h == null ) h = 400;

		var aPopupWin = window.open( '', 'PopupWin', 'scrollbars=yes,menubar=no,location=no,directories=no,statusbar=no,toolbar=no,resizable=yes,width=' + w + ',height=' + h + ',top=' + t + ',left=' + l );
		aPopupWin.document.open(); 
		aPopupWin.document.close();
		order = '';
		if ( o != null ) order = '&order='+o;
		var p = 'popup.php?id=' + thg_id + order;

		aPopupWin.document.location.href = p;
		if( aPopupWin && !aPopupWin.closed )
		{
			aPopupWin.focus();
		}	
	},

	resizePopup: function()
	{
		var mw = 400;

		if ( parseInt( navigator.appVersion.charAt( 0 ) ) >= 4 )
		{
			NN = ( navigator.appName=="Netscape" ) ? 1 : 0;
		}

		if ( document.images[0] )
		{
			ww = ( screen.width  );
			wh = ( screen.height );

			if (NN)
			{
				rw = document.images[0].width + 80;
				rh = document.images[0].height;
				if ( ww < rw ) rw = ww;
				if ( rw < mw ) rw = mw;
				if ( wh < rh ) rh = wh;
				if ( rh < wh - 140 ) rh = rh + 160;
				window.top.innerWidth  = rw;
				window.top.innerHeight = rh;
			}
			else
			{
				rw = document.images[0].width + 80;
				rh = document.images[0].height;
				if ( ww < rw ) rw = ww;
				if ( rw < mw ) rw = mw;
				if ( wh < rh ) rh = wh;
				if ( rh < wh - 140 ) rh = rh + 160;
				window.top.resizeTo( rw, rh );
			}
			parent.window.moveTo( ( screen.width - rw ) / 2, ( screen.height - rh ) / 2 );
		}
	},

	// helper function
	isAlien: function ( a ) 
	{
		return jQuery.isObject(a) && typeof a.constructor != 'function';
	},

	isArray: function ( a ) 
	{
		return jQuery.isObject(a) && a.constructor == Array;
	},

	isBoolean: function ( a ) 
	{
		return typeof a == 'boolean';
	},
	
	isEmptyObject: function ( o )
	{
		for ( var i in o )
		{
			return false;
		}
		return true;
	},

	isEmpty: function(o) 
	{
		var i, v;
		if (jQuery.isObject(o)) 
		{
			for (i in o) 
			{
				v = o[i];
				if (jQuery.isUndefined(v) && jQuery.isFunction(v)) 
				{
					return false;
				}
			}
		}
		return true;
	},

	isFunction: function ( a ) 
	{
		return typeof a == 'function';
	},

	isNull: function ( a ) 
	{
		return typeof a == 'object' && !a;
	},

	isNumber: function ( a ) 
	{
		return typeof a == 'number' && isFinite(a);
	},

	isObject: function ( a ) 
	{
		return (a && typeof a == 'object') || jQuery.isFunction(a);
	},

	isString: function ( a ) 
	{
		return typeof a == 'string';
	},

	isUndefined: function ( a ) 
	{
		return typeof a == 'undefined';
	},

	isDomElement: function ( a ) 
	{
		return a && typeof a == 'object' && !jQuery.isUndefined(a.childNodes);
	},
	
	truncate: function(string, chars, after)
	{
		if (string.length <= chars)
		{
			return string;
		}
		
		if (typeof after == 'undefined')
		{
			after = '&hellip;';
		}
		
		string = string.substring(0, chars);
		string = string.replace(/\w+$/, '');
		 
		var re  = new RegExp('[ 	\.\,\:\;\!\?]+$', 'g');
		string  = string.replace(re, '');
		string += ' ' + after;
		
		return string;
	}
});

// CLASS AjaxNotice
function AjaxNotice( sel )
{
	this.sel = sel;
}

// Start the notice
AjaxNotice.prototype.start = function ( text )
{
	if ( text == '...' )
	{
		text = '<img src="http://fast2.mediamatic.nl/f/rgxv/image/throbberdots.gif" />';
	}
	
	text && notice_corner_show( text );
	$( this.sel ).addClass( 'ajax_notice' );	
}

// Stop the notice
AjaxNotice.prototype.stop = function ()
{
	notice_corner_hide();
	$( this.sel ).removeClass( 'ajax_notice' );
}

// Make corner notices have unique ids so that timeout events
// only act if the instance that triggered them is still active
window.notice_corner_count = 0;

// Show the notice in the corner of window
function notice_corner_show ( text )
{
	window.notice_corner_count += 1;
	var x = document.getElementById( 'corner_notice' );
	if ( !x )
	{
		x = document.createElement( 'div' );
		x.id = 'corner_notice';
		$( document.body ).append( x );
	}
	$( x ).html( text );
	$( x ).fadeIn(400);
	
	window.notice_corner_time = (new Date()).getTime();
}

// Hide the notice in the corner of window
function notice_corner_hide ()
{
	window.notice_corner_count -= 1
	if ( window.notice_corner_count > 0 )
	{
		return;
	}
	else
	{
		window.notice_corner_count = 0;
	}
	var now = (new Date()).getTime();
	var dif = now - window.notice_corner_time;
	if ( dif > 1000 )
	{
		$( '#corner_notice' ).fadeOut(400);
	}
	else
	{
		setTimeout(
			function () 
			{
				notice_corner_hide();
			},
			dif
		);
	}
}


// External callback for the documentation functions
function docs_validate()
{
	var lm = jQuery.label( 'editinplace.validate.msg'	, 'Please input a valid value' );
	var lo = jQuery.label( 'editinplace.validate.out'	, 'Value out of range'  );
	
	return { opts:	
		[[ "validate",			{},			"Input format validation" ]
		,[ "validate.regexp",	null,		"Regular expression to validate format" ]
		,[ "validate.name",		null,		"Name of predefined regular expression [integer|float]" ]
		,[ "validate.msg",		lm,			"Alert message to be displayed in case of wrong format" ]
		,[ "validate.min",		null,		"Minimum allowed value" ]
		,[ "validate.max",		null,		"Maximum allowed value" ]
		,[ "validate.empty",	false,		"Input value is allowed to be empty" ]
		,[ "validate.blank",	false,		"Input value is allowed to be empty/whitespace" ]
		,[ "validate.out",		lo,			"Alert message to be displayed in case of out of range number" ]
		]
	};
}

// CLASS Validate
// Used by EditAtOnce and EditInPlace to validate 
// the presence or format of some fields
function Validate( opts )
{
	this.opts = opts;
	if ( "integer" == this.opts.name )
	{
		this.opts.msg		= jQuery.label( 'editinplace.validate.integer'	, 'Please input an integer number' );
		this.opts.regexp	= /^\s*[-+]?\d+\s*$/;
	} 
	else if ( "float" == this.opts.name )
	{
		this.opts.msg		= jQuery.label( 'editinplace.validate.float'	, 'Please input a number' );
		this.opts.regexp	= /^\s*[-+]?\d+(\.\d+)?\s*$/;
	}
}

// Is the value inside this range?
Validate.prototype.range = function ( value )
{
	var fs 	= {'integer': parseInt, 'float': parseFloat};
	var f 	= fs[this.opts.name] || identity;
	value = f( value );
	
	return 	!(	this.opts.min && this.opts.min > value  
			||	this.opts.max && this.opts.max < value );
}

// Is the value not empty?
Validate.prototype.value = function ( value )
{	
	return ( this.opts.blank && value.match( /^\s*$/ ) )
		|| ( this.opts.empty && value == '' )
		|| ( this.opts.regexp && this.opts.regexp.exec( value ) )
		|| ( !this.opts.regexp );
}


// Comment this line to stop server-side reporting of javascript errors
//window.onerror = anyOnError;

window.handlingOnError = false;
window.handledErrors   = [];

// Function used for server-side reporting of javascript errors 
function anyOnError( msg , url , line )
{
	var exclude = [ "uncaught exception: Permission denied to get property HTMLInputElement.parentNode"
				  , "uncaught exception: Permission denied to get property HTMLDivElement.parentNode" ];

	// Don't report errors in black list
	for ( var i in exclude )
	{
		if ( exclude[i] == msg )
		{
			jQuery.log( "Error belongs to blacklist, won't report it." );

			// Stop browser from declaring this error
			return true;
		}
	}

	// Don't report same error twice
	for ( var i in window.handledErrors )
	{
		if ( window.handledErrors[i] == msg )
		{
			jQuery.log( "Error already reported once on this session" );
			
			// Stop browser from declaring same error twice
			return true;
		}
	}
	
	// Don't report errors that may have happened 
	// during the error-processing phase 
	// (danger of infinite recursivity)
	if ( window.handlingOnError )
	{
		jQuery.log( "Trying to report an error while already busy reporting another one" );
		
		// Pass error onto browser
		return false;
	}
	
	// Lock (informal mutex)
	window.handlingOnError = true;

	jQuery.log( "Reporting error: " + msg ); 
	
	// Remember this error
	window.handledErrors.push( msg ); 

	// Values to send to the server
	var params = {};
	params.msg			= msg;
	params.pageurl		= location.href;
	params.scripturl	= url;
	params.linenumber	= line;
	params.referrer		= document.referrer;
	
	// Send error report o server
	anyRest.error.log( params , 
		function ( xml ) 
		{ 
			jQuery.log( 'Error was reported!' ); 
			// Unlock (informal mutex)
			window.handlingOnError = false;
		}
	);
	
	// Pass error onto browser
	return false;
}

// rebuild a scomp ( file ) with a specific dom_id
function rebuild_scp ( ops, xml )
{
	var dom_id	= ops.dom_id;
	var file	= ops.file;
	var thg_id 	= ops.rebuild_scp_thg_id || self.options.id; 

	if ( dom_id == null || file == null || thg_id == null )
	{
		jQuery.log('rebuild_scp - please use all parameters: dom_id, file, thg_id');
	}
	else
	{
		var scomp_options = jQuery.assocMerge( 
			ops.extra,
			{ 	'name': 		file, 
				'thg_id':		thg_id
			}
		);
	
		anyRest.html.scomp ( scomp_options , 
			function ( xml ) 
			{
				if (anyRest.aux.error(xml)) 
				{
					jQuery.log(anyRest.aux.errorMsg(xml));
				}
				else
				{
					var ts = xml.getElementsByTagName( 'html' )[0];
					x = document.getElementById( dom_id );
				
					if ( ts && x )
					{
						var v = anyRest.aux.concatChildNodes( ts );
	
						$( x ).after ( v ).remove();
	
						y = document.getElementById( dom_id );

						init_widgets( y );
					}
					else
					{
						jQuery.log('Internal error: did not get a template from the server or no dom id. Sorry...');
					}
				}
			}
		);
	}
}

// Get a css style attribute for a html node
function anyGetComputedStyle( node , cssSelector , inValue ) 
{
	var cssSelector = toSelectorCase( cssSelector );
	var property = toCamelCase( cssSelector );
	if( !node || !node.style ) 
	{
		return inValue;
	} 
	
	else if ( document.defaultView &&
			// mozilla segfaults when margin-* and node is removed from doc
			// FIXME: need to figure out a if there is quicker workaround
			isDescendantOf( node, node.ownerDocument ) ) 
	{ // W3, gecko, KHTML
		try 
		{
			var cs = document.defaultView.getComputedStyle( node , "" );
			if ( cs ) 
			{
				return cs.getPropertyValue( cssSelector );
			}
		} 
		catch( e )
		{ // reports are that Safari can throw an exception above
			if ( node.style.getPropertyValue ) 
			{ // W3
				return node.style.getPropertyValue( cssSelector );
			} 
			else 
			{
				return inValue;
			}
		}
	} 
	else if ( node.currentStyle ) 
	{ // IE
		return node.currentStyle[property];
	} 
	if ( node.style.getPropertyValue ) 
	{ // W3
		return node.style.getPropertyValue( cssSelector );
	}
	else
	{
		return inValue;
	}
}



// Change from fontSize to font-size
function toSelectorCase( selector )
{
	return selector.replace(/([A-Z])/g, "-$1" ).toLowerCase();
}


// Change from font-size to fontSize
function toCamelCase ( selector ) {
	var arr = selector.split('-'), cc = arr[0];
	for ( var i = 1 ; i < arr.length ; i++ )
	{
		cc += arr[i].charAt( 0 ).toUpperCase() + arr[i].substring( 1 );
	}
	return cc;
}


// Test if node is descendant of a given ancestor
function isDescendantOf( node, ancestor, guaranteeDescendant )
{
	// guaranteeDescendant allows us to be a "true" isDescendantOf function
	if( guaranteeDescendant && node ) 
	{
		node = node.parentNode; 
	}
	
	while( node ) 
	{
		if ( node == ancestor ) 
		{	
			return true;
		}
		node = node.parentNode;
	}
	return false;
}

// Convert these strings '#abc', '#aabbcc', 'abc', etc
// into this string 'aabbcc'
// TODO: Find better name
function validate_hex( s )
{
	s = s.replace( /#/, '' );
	var h3 = s.match(/^[a-fA-F0-9]{3}$/);
	if ( h3 )
	{
		var a = "";
		for ( var i = 0; i < 3; i++ )
		{
			var c = s.slice(i,i+1);
			a += c + c;
		}
		s = a;
	}
	return s;
}

// Get the background color of a dom node and convert it 
// into an array of decimal numbers [255,255,255]
// TODO: Find better name
function parse_dec_a( elem, stl )
{
	var stl = stl || 'background-color';
	var color = anyGetComputedStyle( elem, stl );
	
	if ( color == 'transparent' )
	{
		color = '';	
	}
	else
	{
		var ff_fr = ffrgb_s2dec_a( color );
	
		if ( ff_fr || ff_fr == 'transparent' )
		{
			color = ff_fr;
		}
		else
		{
			color = validate_hex( color );
			color = hex_s2dec_a( color );
		}
	}
	return color;
}

// Convert from firefox-returned color format 'rgb(12,34,12)'
// into an array of decimal numbers [12,34,12]
// TODO: Find better name
function ffrgb_s2dec_a( x )
{
	var a = null;
	var m = x.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);
	
	if ( m )
	{
		a = [];
		for ( var i = 1; i < 4 ; i++ )
		{
			a.push( parseInt( m[i] ) );
		}
	}
	return a;
}

// Make the node in the first argument throb its background color 
// using the bkg color of the second argument as the intermediate
function throb( selector, color_example )
{
	var elem = $( selector      ).get( 0 );
	var exmp = $( color_example ).get( 0 );

	if ( !elem || !exmp )
	{
		jQuery.log( 'throb: did not receive the correct arguments' );
		return;
	}

	// Get the base color
	var frcolor = parse_dec_a( elem );
	var tocolor = parse_dec_a( exmp );
	
	if ( !frcolor || !tocolor )
	{
		jQuery.log( 'throb: color values not parseable' );
		return;
	}
	
	
	// Get the start time for animation
	var start = (new Date()).getTime();
	
	// Total duration of animation
	var total = 5000;
	
	var anim = function () 
	{
		var diff = (new Date()).getTime() - start;
		if ( diff > total )
		{
			elem.style.backgroundColor = '#' + dec_a2hex_s( frcolor );
		}
		else
		{
			var x = [];
			var f = diff / total;
			var g = ( Math.cos(6 * Math.PI * f + Math.PI) + 1 ) / 2;
			for ( var i = 0; i < 3; i++ )
			{
				x[i] = Math.floor( g * tocolor[i] + (1 - g) * frcolor[i] )
			}
			elem.style.backgroundColor = '#' + dec_a2hex_s( x );
		}
	};
	setInterval( anim, 20 );
}



// Parse a mysql datetime field
// @param	String		datetime	The string containing the datetime value "YYYY-MM-DD HH-MM-SS"
// @return	Date					The parsed value
function mysqlDatetimeToDate ( datetime )
{
   var regex = /^([0-9]{2,4})-([0-1][0-9])-([0-3][0-9]) (?:([0-2][0-9]):([0-5][0-9]):([0-5][0-9]))?$/;
   var parts = datetime.replace( regex, "$1 $2 $3 $4 $5 $6" ).split( ' ' );
   return new Date( parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5] );
}



// Show a date relative to a given moment
// @param	Date		date		The date to represent
// @param	Date		now			Optional, used as reference, default new Date()
// @return	String					The formatted string
function showDateRelative( date, now )
{
	now = now || new Date();
	var prefix = '';
	if ( date.getFullYear() != now.getFullYear() || date.getMonth() != now.getMonth() || date.getDay() != now.getDay() )
	{
		prefix = '' + date.getFullYear() + '/' + ( date.getMonth() + 1 ) + '/' + date.getDate() + ' ';
	}
	return prefix + lpad( date.getHours(), 2, '0' ) + ':' + lpad( date.getMinutes(), 2, '0' );
}



// Left-pad a string to a desired length
// @param	String		s		The string to pad
// @param	Number		n		Final length of resulting string
// @param	String		c 		The character to repeat
// @return	String				The padded string
function lpad( s, n, c )
{
	// Make sure it is a string
	s = '' + s; 
	
	while ( s.length < n )
	{
		s = c + s;
	}
	return s
}

// Convert [255,255,255] into 'ffffff'
// TODO: Find better name
function dec_a2hex_s( a )
{
	var x = '';
	for ( var i in a )
	{
		x += lpad( dec2hex( a[i] ), 2, '0' );
	}
	return x;
}

// Convert 'ffffff' into [255,255,255]
// TODO: Find better name
function hex_s2dec_a( s )
{
	var r = [];	
	for ( var i = 0; i <= 4; i += 2 )
	{
		r.push( hex2dec( s.slice( i, i + 2 ) ) );
	}
	return r;
}

// Convert a decimal number/string into a hex string
function dec2hex( x )
{
	x = parseInt( x );
	var m = 16;
	var s = '';
	while ( x > 0 )
	{
		r = x % m;
		r = r > 9 ? "abcdef".slice( r-10, r-9 ) : '' + r;
		s = r + s;
		x = Math.floor( x / m );
	}
	return s;
}

// Convert a hex string into a decimal number
function hex2dec( x )
{
	x = '' + x;
	x = x.toLowerCase();
	s = "0123456789abcdef";
	n = 0;
	for ( var i = 0; i < x.length; i++ )
	{
		n = n * 16 + s.indexOf( x.slice(i,i+1) );
	}
	return n;
}

// Convert an array to string using a separator in between
function implode( arr, sep )
{
    var ret = ''
    for ( var i = 0; i < arr.length; i++ )
    {
        ret += ( i > 0 ? sep : '' ) + arr[i];
    }
    return ret;
}

function strip( str )
{
	str = str || '';
	str = str.replace( /^\s+/g, "" );
	str = str.replace( /\s+$/g, "" );
	return str;
}

jQuery.fn.extend({
	everyTime: function(interval, label, fn, times, belay) {
		return this.each(function() {
			jQuery.timer.add(this, interval, label, fn, times, belay);
		});
	},
	oneTime: function(interval, label, fn) {
		return this.each(function() {
			jQuery.timer.add(this, interval, label, fn, 1);
		});
	},
	stopTime: function(label, fn) {
		return this.each(function() {
			jQuery.timer.remove(this, label, fn);
		});
	}
});

jQuery.extend({
	timer: {
		guid: 1,
		global: {},
		regex: /^([0-9]+)\s*(.*s)?$/,
		powers: {
			// Yeah this is major overkill...
			'ms': 1,
			'cs': 10,
			'ds': 100,
			's': 1000,
			'das': 10000,
			'hs': 100000,
			'ks': 1000000
		},
		timeParse: function(value) {
			if (value == undefined || value == null)
				return null;
			var result = this.regex.exec(jQuery.trim(value.toString()));
			if (result && result[2]) {
				var num = parseInt(result[1], 10);
				var mult = this.powers[result[2]] || 1;
				return num * mult;
			} else {
				return value;
			}
		},
		add: function(element, interval, label, fn, times, belay) {
			var counter = 0;
			
			if (jQuery.isFunction(label)) {
				if (!times) 
					times = fn;
				fn = label;
				label = interval;
			}
			
			interval = jQuery.timer.timeParse(interval);

			if (typeof interval != 'number' || isNaN(interval) || interval <= 0)
				return;

			if (times && times.constructor != Number) {
				belay = !!times;
				times = 0;
			}
			
			times = times || 0;
			belay = belay || false;
			
			if (!element.$timers) 
				element.$timers = {};
			
			if (!element.$timers[label])
				element.$timers[label] = {};
			
			fn.$timerID = fn.$timerID || this.guid++;
			
			var handler = function() {
				if (belay && this.inProgress) 
					return;
				this.inProgress = true;
				if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
					jQuery.timer.remove(element, label, fn);
				this.inProgress = false;
			};
			
			handler.$timerID = fn.$timerID;
			
			if (!element.$timers[label][fn.$timerID]) 
				element.$timers[label][fn.$timerID] = window.setInterval(handler,interval);
			
			if ( !this.global[label] )
				this.global[label] = [];
			this.global[label].push( element );
			
		},
		remove: function(element, label, fn) {
			var timers = element.$timers, ret;
			
			if ( timers ) {
				
				if (!label) {
					for ( label in timers )
						this.remove(element, label, fn);
				} else if ( timers[label] ) {
					if ( fn ) {
						if ( fn.$timerID ) {
							window.clearInterval(timers[label][fn.$timerID]);
							delete timers[label][fn.$timerID];
						}
					} else {
						for ( var fn in timers[label] ) {
							window.clearInterval(timers[label][fn]);
							delete timers[label][fn];
						}
					}
					
					for ( ret in timers[label] ) break;
					if ( !ret ) {
						ret = null;
						delete timers[label];
					}
				}
				
				for ( ret in timers ) break;
				if ( !ret ) 
					element.$timers = null;
			}
		}
	}
});

if (jQuery.browser.msie)
	jQuery(window).one("unload", function() {
		var global = jQuery.timer.global;
		for ( var label in global ) {
			var els = global[label], i = els.length;
			while ( --i )
				jQuery.timer.remove(els[i], label);
		}
	});


// rounded corners
	
	// adds 4 spans to element, positions using css in utils.css
	/*  EXAMPLE 
	
	if( $.browser.msie){	
		// add rounded corners to these elements for IE
		$('.list-context li').rounded_corners();
	};
	// add rounded corners to these elements for all browsers
	$('.fig li').rounded_corners();
	
	*/
	
	$.fn.rounded_corners = function(){
		if (!$(this).length)
		return false;
		
		$(this)
			.css({position: 'relative'})
			.hover(function(){
				$(this).addClass('cnrs-hovered');
			},function(){
				$(this).removeClass('cnrs-hovered');
			});
			
		$('<span class="cnrs cnr_nw"></span><span class="cnrs cnr_ne"></span><span class="cnrs cnr_sw"></span><span class="cnrs cnr_se"></span>')
		.css({ // will only accept numeric border widths
	 		marginTop: 		'-'+(parseInt($(this).css('border-top-width'))||0),
	 		marginRight: 	'-'+(parseInt($(this).css('border-right-width'))||0),
	 		marginBottom: 	'-'+(parseInt($(this).css('border-bottom-width'))||0),
	 		marginLeft: 	'-'+(parseInt($(this).css('border-left-width'))||0)
	 	})
		.appendTo(this);
		// ie odd values bug fix
		if( $.browser.msie && $.browser.version < 7){
			$(this).each(function(){	
				var h = $(this).height();
				if (h%2){ $('.cnr_sw',this).css({bottom: '-1px'});$('.cnr_se',this).css({bottom: '-1px'}); };
				var w = $(this).width();
				if (w%2){ $('.cnr_ne',this).css({right: '-1px'});$('.cnr_se',this).css({right: '-1px'}); };
			});
		};
	};	
	


/*  */
/*  */
/*  */

// Methods that do not fall inside the standard anyrest call style
var anyRest = {
	'aux':
	{
		'items': function ( xml )
		{
			var rsp = xml.getElementsByTagName( 'rsp' )[0];
			var rst = [];
			for ( var i = 0 ; i < rsp.childNodes.length ; i++ )
			{
				if ( rsp.childNodes[i].tagName == 'item' )
				{
					rst.push( rsp.childNodes[i] );
				}
			}
			return rst;
		},
		
		'status': function ( xml )
		{
			var rsp = xml.getElementsByTagName( 'rsp' );
			return rsp[0].getAttribute( 'stat' );
		},
		
		'error': function ( xml )
		{
			return ( anyRest.aux.status( xml ) != 'ok' );
		},

		'errorMsg': function ( xml )
		{
			var es = xml.getElementsByTagName( 'err' );
			return es[0] ? es[0].getAttribute( 'msg' ) : '';
		},
		
		'skeleton': function ( type , params , callback )
		{
			params.format = params.format || "xml";
			callback = callback || function ( _ ) {};

			var no_notification_check = false;
			if (params.no_notification_check)
			{
				var no_notification_check = true;
				delete params.no_notification_check;
			}

			var opts = {
				"type": type,
				"url": 	"http://www.bidnetwork.org/services/rest/"
			};
			
			if ( type == 'GET' ) 
			{
				opts.url += '?' + jQuery.xparam( params );
			}

			if ( type == 'POST' )
			{
				opts.data = jQuery.xparam( params );
			}

			opts.success = function restSuccess ( data )
			{
			    if (type == 'POST' && !no_notification_check) 
			    {
				anyRest.notifications.check();
			    }
			    
			    callback( data );
			}
			opts.error = function restError ( request, text, errorThrown )
			{
				if (request.status == 401)
				{
					var loc = request.getResponseHeader('X-Authorize-Location');
					if (!loc)
					{
						return false;
					}

					$( "#throbberwait" ).remove();

					var target = document;
					if (LightboxHelper.isLightbox())
					{
						target = window.parent.document;
					}

					// Append return_to to callback URI
					if (loc.match(/\?/))
					{
						loc = loc + '&';
					}
					else
					{
						loc = loc + '?';
					}
					loc = loc + 'return_to=' + target.location.href;
					target.location = loc;

				}
			}

			jQuery.ajax( opts );
		}
	}
};

anyRest.aux.concatChildNodes = function ( xmldom )
{
	var str = '';
	for ( var i = 0; i < xmldom.childNodes.length ; i++ )
	{
		str += xmldom.childNodes[i].nodeValue;
	}
	return str;
};

anyRest.aux.checkNotifications = function ( xml, target )
{
	if (!target && LightboxHelper.isLightbox())
	{
		target = window.parent.document;
	}
	else if (!target)
	{
		target = document;
	}

	$(xml).find('item').each( function() {
		var msg = $(this).find('message').text();
		var cls = $(this).find('class').text();
		var el = $('<div></div>', target).html(msg).addClass(cls).hide();
		$('.notification', target).append(el);
		el.slideDown('fast');
	});
	
};

anyRest.notifications = 
{
	check: function ()
	{
		if(LightboxHelper.isLightbox())
		{
			return window.parent.anyRest.notifications.check();
		}
		
		anyRest.get( 'anymeta.notifications.get', [], anyRest.notifications.checkCallback );
	},

	checkCallback: function (xml)
	{

		$(xml).find('item').each( function() {
			var msg = $(this).find('message').text();
			var cls = $(this).find('class').text();
			anyRest.notifications.add(msg, cls);
		});
	},

	add: function (message, cls)
	{
		if(LightboxHelper.isLightbox())
		{
			return window.parent.anyRest.notifications.add(message, cls);
		}
		
		var notification = $('.notification');
		
		$('<div></div>')
			.html(message)
			.addClass(cls)
			.appendTo(notification)
			.parent()
				.hide()
				.animate({height: 'show', opacity: 'show'}, 600, function() 
				{
					message = message.split(' ');
					var notification_time = ((message.length * .9) + 1) * 1000;
					
					$(this).oneTime(notification_time, function() 
					{ 
						notification.animate({height: 'hide', opacity: 'hide'}, 600, function()
						{
							$(this).empty();					
						});
					});
				});
	}
};

// POST
// List of anymeta REST methods, indexed by their name prefix and http verbs
var batch = [
	['anymeta.','POST',
		['edge.attribute.get'
		,'edge.attribute.set'
		,'edge.add'
		,'edge.remove'
		,'edge.order'
		,'edge.addList'
		,'error.log'
		,'tags.add'
		,'predicates.get'
		,'predicates.set'
		,'messages.send'
		,'user.check'
		,'thing.insert'
		]],
	['','POST',
		['contact.add'
		,'contact.change'
		,'contact.remove'
		]],
	['','POST',
		['jury.accuse'
		]],
	['anymeta.','GET',
		['html.template'
		,'html.scomp'
		,'search.live'
		]]]

for ( var i in batch )
{
	// For each of the REST methods, generate a javascript method with the same name. 
	// Mostly here for backwards compatibility, this additional style freedom is not
	// particularly welcome
	var prefix = batch[i][0];
	var http_method = batch[i][1];
	var lis = batch[i][2];

	for ( var j in lis )
	{
		var words = lis[j].split('.');
		var tmp = anyRest;
		for ( var k = 0; k < words.length - 1; k++ )
		{
			if ( !tmp[words[k]] )
			{
				tmp[words[k]] = {};
			}
			tmp = tmp[words[k]];
		}
		
		tmp[words[words.length-1]] = makeRestMethod( http_method, prefix + lis[j] );
		
	}
}

// Produces a ajax method to communicate with anymeta REST services
function makeRestMethod( http_method, rest_method )
{
	return function ( params, callback )
	{
		params.method = rest_method;
		anyRest.aux.skeleton( http_method, params, callback );
	}
}

anyRest.service = function ( name, opts, callback )
{
	opts.method = name;
	anyRest.aux.skeleton( 'POST' , opts , callback );
};

anyRest.call = function ( opts, callback )
{
	anyRest.aux.skeleton( 'POST' , opts , callback );
};

anyRest.post = function ( name, opts, callback )
{
	opts.method = name;
	anyRest.aux.skeleton( 'POST' , opts , callback );
};

anyRest.get = function ( name, opts, callback )
{
	opts.method = name;
	anyRest.aux.skeleton( 'GET' , opts , callback );
};

/**/
/* $Id: link.js 40440 2009-01-27 12:01:33Z bas $ */
/*  */



// External callback to initialize the widget
// @param   mixed   container   jQuery selector for the object to be used
// @param   dom     context     DOM object used as jQuery context. Defaults to document.body
// @return  undefined
function init_link( container, context )
{
	context = context || document;
	
	$( container, context ).each(
		function () 
		{
			var options		= jQuery.attrOptions( this , 'link' );
			options.ajax	= jQuery.attrOptions( this , 'link_ajax' );
			options.extra	= jQuery.attrOptions( this , 'link_extra' );
			new Link( this, options );
		}
	);
}



// External callback for the documentation functions
// @return  object      Structure containing 'examples' of usage, 'about' message, default 'opts', and 'classes' (never used...)
function docs_link()
{
	var a = 'Link things';
	var e = [];
	var c = [];
	var o = 
	[[ "id", 			null,				"Id of the element to hide/show during linking - defaults to id of container extracted from the element" ]
	,[ "url",			null,				"Used for connection via url (eg. module)" ]
	,[ "silent",		false,				"Don't jQuery.log on ajax error" ]
	,[ "service",		"anymeta.edge.add",	"Name of REST service" ]
	,[ "dropDown",		null,				"jQuery selector of autocomplete dom element -- used with the imputless dropdow menu" ]
	,[ "showonload",	false,				"Start widget immediatly as page loads" ]
	,[ "toggle",		false,				"Link element switches between two views"]
	,[ "toggle_hide",	null, 				"DOM id of object to hide on link_show"]
	,[ "toggle_show",	null, 				"DOM id of object to show on link_show"]
	,[ "ajax",			{},					"Extra ajax parameters" ]
	,[ "extra",			{},					"Parameters passed to the scomp when creating an instance of the newly-linked element" ]
	,[ "notification",	'',					"The notification the system should give after succes of the ajax call" ]
	];
	
	return { 'examples': e, 'about': a, 'opts': o, 'classes': c };
}



// Process the options for this widget (cached)
// @param   object  o   Widget options extracted from the html
// @return  object      Default options overriden by html options
function opts_link( o )
{
	window.link_opts = window.link_opts || docs_link().opts;
	return apply_options( window.link_opts, o );
}



function Link( container, options )
{
	options			= opts_link( options, container );
	options.id		= options.id 	|| container.id 	|| null;
	options.url		= options.url	|| container.href	|| null;
	this.options	= options;
	this.container	= container;
	var self = this;
	$( container ).click( 
		function (event) 
		{
			window.lastEvent = event;
			self.show();
			return false;
		}
	);

	this.options.showonload && this.show();
}



// Hide the widget
// @return undefined
Link.prototype.hide = function ()
{
	if ( this.options.ajax.link_autocomplete )
	{
		$( "#link_overlay" ).remove();
		this.showObjects();
	}
	$( "#link_" + this.options.id ).remove();
	$( "#" + this.options.id ).show();		


	// could be an automplete box
	$( "#autocomplete_" + this.options.id ).remove();
};


// Static hook to hide the current widget
// @return undefined
function link_hide()
{
	window.widget_manager && window.widget_manager.stop( 'link' );
}



// Callback for when the widget gets out of focus
// @param   string  name    The name of the widget type
// @param   object  obj     The object replacing this one in the widget focus
// @return  bool            True if ajax request made, false otherwise
Link.prototype.widgetBlur = function ( name, obj )
{
	if ( obj != this )
	{
		this.hide();
	}
	return false;
};



// Show the widget
// @return undefined
Link.prototype.show = function ()
{
	window.widget_manager && window.widget_manager.widgetFocus( 'link', this );

	if ( this.options.id && document.getElementById( 'link_' + this.options.id ) )
	{
		return false;
	}

	if ( this.options.url != null )
	{
		this.linkByURL();
	} 
	else if ( this.options.dropDown )
	{
		var auto = $( this.options.dropDown ).get( 0 ).obj_autocomplete;
		auto.show();
	} 
	else 
	{
		this.linkDirectly();
	}
};



// Connect by loading a given scomp first
// @return undefined
Link.prototype.linkByURL = function ()
{
	// connection via url (eg. module)
	var arrowOffset	= this.container.offsetWidth;
	var pos 		= jQuery.elemInWindow( this.container );

	if ( this.options.ajax.link_autocomplete )
	{
		// create overlay link holder 9 i this case for the autocomplete 
		$( "#link_overlay" ).get( 0 ) || this.domCreate( );
		this.overlaySize();

		var ac 		 = document.createElement( 'div' );
		ac.id 		 = 'autocomplete_' + this.options.id;
		ac.className = 'autocomplete-holder';
		$( document.body ).append( ac );

		$( ac )
			.css( { position: "absolute", "z-index": 102, left: 0, top: pos.t + 30 + "px" } )
			.load( jQuery.addToQuery( this.options.url , jQuery.param( this.options.ajax ) ) );
		
		var self 	= this;
		setTimeout(
			function ()
			{
				self.hideObjects();
			},
			20
		);
	}
	else
	{
		var link = document.createElement( 'div' );
		link.id = 'link_' + this.options.id;
		link.className = 'link-holder';
		$( document.body ).append( link );

		$( link )
			.css( { position: "absolute", left: pos.l + "px", top: pos.t + "px" } )
			.load( jQuery.addToQuery( this.options.url , jQuery.param( this.options.ajax ) ) );
	}
};

// Create the dom structure necessary to display lightbox
// @param container optional container where to create the lightbox
// @return  undefined
Link.prototype.domCreate = function ( container )
{
	var lo	= document.createElement( "div" );
	
	lo.id	= "link_overlay";

	if (container)
	{
		$( container ).append( lo );
	}
	else
	{
		$( "body" ).append( lo );
	}
	
};

// Determine size of dark mask 
// @return  undefined
Link.prototype.overlaySize = function ()
{
	if ( window.innerHeight && window.scrollMaxY )
	{	
		yScroll = window.innerHeight + window.scrollMaxY;
	}
	else if ( document.body.scrollHeight > document.body.offsetHeight )
	{
		 // all but Explorer Mac
		yScroll = document.body.scrollHeight;
	}
	else
	{ 
		// Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		yScroll = document.body.offsetHeight;
  	}

	$( "#link_overlay" ).css( "height" , yScroll + "px" );
};


// Connect directly
// @return undefined
Link.prototype.linkDirectly = function ()
{
	// direct connection
	$( this.container ).append(
		'<span id="throbberwait"><img src="http://fast2.mediamatic.nl/f/rgxv/image/throbberwait.gif" alt="" /></span>'
	);
	
	var self 	= this;
	anyRest.service( this.options.service, this.options.ajax, 
		function ( xml ) 
		{
			if ( anyRest.aux.error( xml ) )
			{
				// on error
				var errorMsg = anyRest.aux.errorMsg( xml ) || 'Something went wrong, try again later.';
				$( "#throbberwait" ).remove();
				jQuery.warn( "Link" , null , errorMsg );
			}
			else
			{
				self.options.callback && self.options.callback( xml );
				// on ok
				if ( self.options.writetxt != null ) 
				{
					$( self.container ).remove();
					$( "#throbberwait" ).empty();
					$( "#throbberwait" ).prepend( self.options.writetxt );
				} 
				else if ( self.options.rebuild_scp ) 
				{
					$( "#throbberwait" ).remove();

					rebuild_scp( self.options );
				}
				else if ( self.options.toggle && self.options.toggle_hide != null && self.options.toggle_show != null) 
				{
					$( "#throbberwait" ).remove();
					$( "#" + self.options.toggle_show ).show();
					$( "#" + self.options.toggle_hide ).hide();
				}
				else
				{
					$( "#throbberwait" ).remove();
				}
				
				//if(self.options.notification)
				//{
				//	anyRest.notifications.add(self.options.notification,'success');	
				//}
			}
		}
	);
};

Link.prototype.hideObjects = function ()
{
	$( 'embed,select' ).each(
		function ()
		{
			this.preLinkVisibility = $( this ).css( 'visibility' );
			this.style.visibility = 'hidden';
		}
	);
};

Link.prototype.showObjects = function ()
{
	$( 'embed,select' ).each(
		function ()
		{
			this.style.visibility = this.preLinkVisibility;
		}
	);
};


// STATIC FUNCTIONS


// Static callback for injecting the link results on the page
// Removed from template file because of scoping problems
function edge_clone( oldid , xmlsubs , xml )
{
	var o = document.getElementById( oldid );
	var x = o.cloneNode(true);
	var newid = x.getAttribute( 'newid' );
	
	$( x )
		.attr( 'id', newid )
		.addClass( 'sortable-item' )
		.removeClass( 'link_new' );
	$( o ).before( x );

	for ( var i = 0 ; i < xmlsubs.length ; i++ )
	{
		var r = new RegExp( '\\$' + xmlsubs[i] , 'g' );
		x.innerHTML = x.innerHTML.replace( r , $( xmlsubs[i] , xml ).text() );
		x.id 		= x.id.replace( r , $( xmlsubs[i] , xml ).text() );
	}

	$( x ).show();
	init_unlink( x );
	$( x ).SortableAdd();
}



// Static callback for injecting the link results on the page
function edge_inject( ops, xml )
{
	var dom_id		 = ops.dom_id;
	var file		 = ops.file;
	var manipulation = ops.manipulation || '';
	var new_base	 = ops.new_base 	|| 'list_item';

	if ( jQuery.isObject( dom_id ) )
	{
		for ( var i = 0 ; i < dom_id.length ; i++ )
		{
			fl = jQuery.isObject( file ) 		 ? file[i] 		   : file;
			nb = jQuery.isObject( new_base ) 	 ? new_base[i] 	   : new_base;
			mp = jQuery.isObject( manipulation ) ? manipulation[i] : manipulation;

			_edge_inject( ops, xml, dom_id[i], fl, nb, mp );
		}	
	}
	else
	{
		_edge_inject( ops, xml, dom_id, file, new_base, manipulation );
	}
}

function _edge_inject ( ops, xml, dom_id, file, new_base, manipulation )
{
	var rsp			 = xml.getElementsByTagName( 'rsp' 			)[0];
	var edg_id		 = rsp.getElementsByTagName( 'edg_id' 		)[0].firstChild.nodeValue;
	var predicate_id = rsp.getElementsByTagName( 'predicate_id' )[0].firstChild.nodeValue;
	var thg_id		 = rsp.getElementsByTagName( 'subject' 		)[0].firstChild.nodeValue;
	var list_id		 = rsp.getElementsByTagName( 'object' 		)[0].firstChild.nodeValue;

	// Renamed the thg_id paramater to subject_id
	// thg_id is stronger then list_id in template fetching
	// so the subject list item tempalte is used
	// When a person is added to an article the article list item is fetched
	// TODO: lets see if this works out

	var scomp_options = jQuery.assocMerge( 
		ops.extra,
		{ 	'name': 		file, 
			'edg_id':		edg_id,
			'predicate_id':	predicate_id,
			'list_id':		list_id,
			'new_base':		new_base,
			'subject_id':	thg_id,
			'thg_id':		thg_id
		}
	);

	anyRest.html.scomp ( scomp_options , 
		function ( xml ) 
		{
			if (anyRest.aux.error(xml)) 
			{
				jQuery.log(anyRest.aux.errorMsg(xml));
			}
			else
			{
				var ts = xml.getElementsByTagName( 'html' )[0];
				x = document.getElementById( dom_id );
			
				if ( ts && x )
				{
					var v = anyRest.aux.concatChildNodes( ts );
					//var v = ts.firstChild.nodeValue;
					if ( manipulation == 'replace' )
					{
						$( x ).after ( v ).remove();
					}
					else if ( manipulation == 'inner' )
					{
						$( x ).innerHTML( v );
					}
					else if ( manipulation == 'before' )
					{
						$( x ).before( v );
					}
					else if ( manipulation == 'after' )
					{
						$( x ).after( v );
					}
					else if ( manipulation == 'prepend' )
					{
						$( x ).prepend( v );
					}
					else if ( manipulation == 'append' )
					{
						$( x ).append( v );
					}
					else
					{
						$( x ).before( v );
					}
			
					y = document.getElementById( new_base + '' + edg_id );
			
					init_widgets( y );
					//init_unlink( '.do_unlink' , y );
					//init_lightbox( '.do_lightbox' , y );
					//$( y ).SortableAdd();
			
				}
				else
				{
					jQuery.log('Internal error: did not get a template from the server or no dom id. Sorry...');
				}
			}
		}
	);
}


// Static callback for injecting the link results on the page
// Give access rights to a user
function auth_add( usr_id )
{
	var current = window.widget_manager && window.widget_manager.current( 'link' );
	opts = {};
	opts['usr_id']		= usr_id;
	opts['aco_section']	= current.options.ajax.aco_section;
	opts['aco_value']	= current.options.ajax.aco_value;
	opts['id']			= current.options.ajax.id;

	anyRest.service( 'accesscontrol.user.thing.add', opts,
		function ( xml ) 
		{
			if ( anyRest.aux.error( xml ) )
			{
				jQuery.warn( "Link", null, anyRest.aux.errorMsg( xml ) );
			}
			else
			{
				auth_inject( xml );	
			}
		}
	);
	link_hide();
}



// Inject a scomp for a user that as access rights 
// Static callback for injecting the link results on the page
function auth_inject( xml )
{
	var current		 = window.widget_manager && window.widget_manager.current( 'link' );
	var dom_id		 = current.options.dom_id;
	var manipulation = current.options.manipulation;
	var new_base	 = current.options.new_base 	|| 'list_item';

	var rsp		= xml.getElementsByTagName( 'rsp' 	 )[0];
	var usr_id	= rsp.getElementsByTagName( 'usr_id' )[0].firstChild.nodeValue;
	var gut_id 	= rsp.getElementsByTagName( 'gut_id' )[0].firstChild.nodeValue;

	var scomp_options = jQuery.assocMerge(
		current.options.extra,
		{ 'gut_id': gut_id,
		  'usr_id': usr_id
		}
	);	

	anyRest.service( 'anymeta.html.scomp', scomp_options, 
		function ( xml ) 
		{
			if ( anyRest.aux.error( xml ) )
			{
				jQuery.warn( "Link", null, anyRest.aux.errorMsg( xml ) );
			}
			else 
			{
				//var html = xml.getElementsByTagName( 'html' )[0];
				//$( '#' + dom_id ).append( html.firstChild.nodeValue );
				//init_unlink( '.do_unlink' );

				var ts = xml.getElementsByTagName( 'html' )[0];
				x = document.getElementById( dom_id );
			
				if ( ts && x )
				{
					var v = anyRest.aux.concatChildNodes( ts );
					//var v = ts.firstChild.nodeValue;
					if ( manipulation == 'replace' )
					{
						$( x ).after ( v ).remove();
					}
					else if ( manipulation == 'inner' )
					{
						$( x ).innerHTML( v );
					}
					else if ( manipulation == 'before' )
					{
						$( x ).before( v );
					}
					else if ( manipulation == 'after' )
					{
						$( x ).after( v );
					}
					else if ( manipulation == 'prepend' )
					{
						$( x ).prepend( v );
					}
					else if ( manipulation == 'append' )
					{
						$( x ).append( v );
					}
					else
					{
						$( x ).before( v );
					}
			
					y = document.getElementById( new_base + '' + gut_id );
			
					init_widgets( y );
				}
				else
				{
					jQuery.log('Internal error: did not get a template from the server or no dom id. Sorry...');
				}
			}
		}
	);
}



// Static callback for injecting the link results on the page
function edge_add( ajax )
{
	var current = window.widget_manager && window.widget_manager.current( 'link' );
	extra = current.options;
	ajax['id']		  = extra.ajax.id;
	ajax['predicate'] = extra.ajax.predicate;
	ajaxNotice = new AjaxNotice();

	ajaxNotice.start( '...' );
	anyRest.edge.add( ajax , 
		function ( xml ) 
		{
			ajaxNotice.stop();

			if ( anyRest.aux.error( xml ) ) 
			{
				jQuery.warn( "Link" , null , anyRest.aux.errorMsg( xml ) );
			}
			else
			{
				edge_inject( extra , xml  );
	 		}

		}
	);

	link_hide();
}

function edge_add_lb ( ajax )
{
	var current = window.widget_manager && window.widget_manager.current( 'link' );
	var extra   = current.options;

	var id	  = extra.ajax.id;
	var pred  = extra.ajax.predicate;
	var title = ajax.object_title;

	//var kind  = ajax.object_kind;
	//var type  = ajax.object_type;

	url = '/add/object/ID/PRED';
	
	url = url.replace(/ID/,   escape(id));
	url = url.replace(/PRED/, escape(pred));
	
	b = document.createElement( 'button' );
	b.style.display = 'none';
	
	jQuery( document.body ).append( b );
	
	var l_opt 	 = {};
	l_opt.freeze = true;
	l_opt.width  = '60%';
	l_opt.height = '80%';
	l_opt.url	 = url;
	
	if (title)
	{
		l_opt.url += '?title='+escape(title);
	}

/*	
	if (kind)
	{
		l_opt.url += '&amp;kind=' + escape(kind);
	}
	if (type)
	{
		l_opt.url += '&amp;type=' + escape(type);
	}
*/

	l = new Lightbox( b , l_opt );
	l.show();
}

// Static callback for injecting the link results on the page
function add_tag ( opts , addexisting )
{
	var rest = addexisting ? anyRest.edge.add : anyRest.tags.add;

	var current = window.widget_manager && window.widget_manager.current( 'link' );
	opts['id']  = current.options.ajax.id;

	rest( opts , 
		function ( xml ) 
		{
			if ( anyRest.aux.error( xml ) ) 
			{
				jQuery.warn( "Add tag" , null , anyRest.aux.errorMsg( xml ) );
			}
			else
			{
				edge_inject_tag();
			}
		}
	);

	link_hide();
}



// Static callback for injecting the link results on the page
function edge_inject_tag ()
{
	var current = window.widget_manager && window.widget_manager.current( 'link' );
	var id		= current.options.ajax.id;
	var file	= current.options.file;
	var dom_id	= current.options.dom_id;

	anyRest.html.scomp ( 
		{ 'name': file, 'thg_id': id } , function (xml) { edge_inject_aux ( xml , dom_id ) }
	);
}



// Static callback for injecting the link results on the page
function edge_inject_aux ( xml , dom_id ) 
{
	if (anyRest.aux.error(xml)) 
	{
		jQuery.log(anyRest.aux.errorMsg(xml));
	}
	else
	{
		var ts = xml.getElementsByTagName( 'html' )[0];

		x = document.getElementById( dom_id );
		if ( ts && x )
		{
			$( x ).after( ts.firstChild.nodeValue ).remove();
			
			y = document.getElementById( dom_id );
			init_widgets( y );
			//init_link( '.do_link' , y );
			//init_unlink( '.do_unlink' , y );
			//init_lightbox( '.do_lightbox' , y );
		}
		else
		{
			jQuery.log('Internal error: did not get a template from the server or no dom id. Sorry...');
		}
	}
} 


// Static callback for injecting the link results on the page
function edit_trust ( id, dom_id, file, lang, rem_id, val, field )
{
	fld = field || 'trust.view';
	var options = {
		'id':	 id, 
		'field': fld,
		'value': val,
		'lang':	 lang
	};

	anyRest.predicates.set( 
		options , 
		function ( xml ) 
		{
			if ( anyRest.aux.error( xml ) )
			{
				// on error
				jQuery.log(anyRest.aux.errorMsg(xml));
			}
			else
			{
				// create new scomp with the date
				var scomp_options = {
					'name':	  file, 
					'thg_id': id,
					'list_id': id,
					'dom_id': dom_id,
					'trust': val,
					'field': fld
				};
			
				anyRest.html.scomp ( scomp_options , 
					function ( xml ) 
					{
						if (anyRest.aux.error(xml)) 
						{
							jQuery.showHide(onfail);
							jQuery.log(anyRest.aux.errorMsg(xml));
						}
						else
						{
							var ts = xml.getElementsByTagName( 'html' )[0];

							x = document.getElementById( dom_id );
							if ( ts && x )
							{
								$( x ).after( ts.firstChild.nodeValue ).remove();
								
								y = document.getElementById( dom_id );
								$( "#" + rem_id ).remove();
								init_widgets( y );
							}
							else
							{
								jQuery.log('Internal error: did not get a template from the server or no dom id. Sorry...');
							}
						}
					}
				);
			}
		}
	);

}

/*  */
/*  */
/*  */



// External callback to initialize the widget
// @param   mixed   container   jQuery selector for the object to be used
// @param   dom     context     DOM object used as jQuery context. Defaults to document.body
// @return  undefined
function init_unlink( container , context )
{
	context = context || document;
	
	$( container, context ).each(
		function () 
		{
			var options		= jQuery.attrOptions( this , 'unlink' );
			options.ajax	= jQuery.attrOptions( this , 'unlink_ajax' );

			new Unlink( this, options );
		}
	);
}



// External callback for the documentation functions
// @return  object      Structure containing 'examples' of usage, 'about' message, default 'opts', and 'classes' (never used...)
function docs_unlink()
{
	var a = 'Unlink things';
	var e = [];
	var c = [];
	var o = 
	[[ "unlink", 	jQuery.label( 'unlink.title'	, 'Unlink this item'),	"Label - html 'title' attribute of [x]" ]
	,[ "confirm",	jQuery.label( 'unlink.confirm'	, 'Remove'			),	"Label - confirmation text" ]
	,[ "yes",		jQuery.label( 'unlink.yes'		, 'Yes'				),	"Label - confirmation button" ]
	,[ "cancel",	jQuery.label( 'unlink.cancel'	, 'Cancel'			),	"Label - cancelation button" ]
	,[ "service",	"anymeta.edge.remove",	"Name of REST service" ]
	,[ "use_cross",	true,						"use a cross?" ]
	,[ "ajax",		{},						"Extra ajax parameters" ]
	];
	
	return { 'examples': e, 'about': a, 'opts': o, 'classes': c };
}



// Process the options for this widget (cached)
// @param   object  o   Widget options extracted from the html
// @return  object      Default options overriden by html options
function opts_unlink( o )
{
	window.unlink_opts = window.unlink_opts || docs_unlink().opts;
	return apply_options( window.unlink_opts, o );
}



function Unlink( container, options )
{
	options			= opts_unlink( options );
	this.options	= options;
	this.container	= container;

    this.show();
}



// Callback for when the widget gets out of focus
// @param   string  name    The name of the widget type
// @param   object  obj     The object replacing this one in the widget focus
// @return  bool            True if ajax request made, false otherwise
Unlink.prototype.widgetBlur = function ( name, obj )
{
	if ( obj != this )
	{
		this.selector_dont();
	}
	return false;
};



// Callback for when the [x] is clicked
// @param   event   ev      Click event
// @return  boolean         (Always) false to stop the event propagation
Unlink.prototype.x_fun = function ( ev, obj )
{
	window.widget_manager.widgetFocus( 'unlink', this );
	
    // this.marker.style.display 	= "none";
	// this.selector.style.display = "block";
	
	$(this.selector).fadeIn(300);
	
	var pos = jQuery.elemInWindow( obj );

	$(this.container).addClass('unlinking');

	$( this.selector ).css({
		position: 	"absolute",
		left: 		pos.l,
		top: 		pos.t
	});

	return false;
};



// Make the yes / no confirmation dialog
// @param   string      id      The suffix used in the dom ids of the different elements
// @return  undefined
Unlink.prototype.mk_selector = function ( id )
{
	var div = document.createElement( 'div' );
		div.id = 'unlink_confirm_' + id;
		div.className = 'unlink-confirm';
		div.innerHTML = '<span class="unlink-confirm-text">' + this.options.confirm + '</span>';
		div.style.display = 'none';
		div.style.zIndex = 200;
		$( document.body ).append( div );

	var buty = document.createElement( 'button' );
		buty.className = 'unlink-confirm-yes cancel';
		buty.innerHTML = this.options.yes;
		$( div ).append( buty );

	var butn = document.createElement( 'button' );
		butn.id = 'unlink-confirm-cancel' + id;
		butn.className = 'cancel';
		butn.innerHTML = this.options.cancel;
		$( div ).append( butn );
		
	this.selector = div;
	this.selector_y = buty;
	this.selector_n = butn;
};



// Make the [x] marker
// @param   string      id      The suffix used in the dom ids of the different elements
// @return  undefined
Unlink.prototype.mk_marker = function ( id )
{
	var del = document.createElement( 'span' );
		del.id = 'unlink_' + id;
		del.className = "unlink-marker";

	var axx = document.createElement( 'a' );
		axx.title 			= this.options.unlink;
		axx.href  			= 'javascript:void(0);';
		
		if(this.options.use_cross)
		{
			$(axx).html('<img src="http://fast2.mediamatic.nl/f/rgxv/image/cross.gif" alt="" />');
		}
		
		$(axx).css({cursor: 'pointer'});
		$(axx).addClass('do_tooltip');
		$(axx).attr('tooltip', 'width: \'auto\'');

    $( del ).append( axx );
    $( this.container ).append( del );
    this.marker     = del;
    this.marker_x   = axx;
};

// Show the [x] symbol and initialize other structures
// @return  undefined
Unlink.prototype.show = function ()
{
	$( this.container ).addClass('unlink-hover');

	// the object which should be removed could be anither one of the 
	this.id = this.options.id || this.container.id;
	
	this.marker || this.mk_marker( this.id );
	// this.marker.style.display = 'block';
		
	this.selector || this.mk_selector( this.id );

	if ( this.container.tagName.toLowerCase() == 'button' ) 
	{
		var mdown = this.container;
	}
	else
	{
		var mdown = this.marker_x;
	}
	
	var self = this;
	
	var fdown = function ( ev )
	{ 
		ev.preventDefault();
		// $( mdown ).unbind( 'mousedown' , fdown );
		self.x_fun( ev, this );
		return false;
	} 
	
	$( mdown ).bind( 'mousedown' , fdown );
	
	$( this.selector_y ).click( 
		function ( ev )
		{ 
			self.selector_do();
			ev.preventDefault();
			return false;
		}
	);

	$( this.selector_n ).click( 
		function ( ev )
		{ 
			self.selector_dont();
			ev.preventDefault();
			return false;
		}
	);	
};



// Callback for when 'yes' is press on the confirmation dialog
// @return  undefined
Unlink.prototype.selector_do = function ()
{
	if ( this.is_unlinked && !this.options.toggle)
	{
		return;
	}

	this.is_unlinked = true;

	this.selector && $( this.selector ).remove();
	this.selector = null;

	var self = this;
	anyRest.service( this.options.service, this.options.ajax , 
		function ( xml ) 
		{
			self.options.callback && self.options.callback( xml );

			if ( self.options.rebuild_scp ) 
			{
				rebuild_scp( self.options );
			}
			else if ( self.options.toggle && self.options.toggle_hide != null && self.options.toggle_show != null )
			{
				$( ".unlink-confirm" , self.container ).remove();

				$( "#" + self.options.toggle_show ).show();
				$( "#" + self.options.toggle_hide ).hide();
			} 
			else 
			{
				$( "#" + self.id ).fadeOut('slow');
			}
		}
	);
};



// Callback for when 'no' is pressed in the confirmation dialog
// @return  undefined
Unlink.prototype.selector_dont = function ()
{
    if ( this.selector )
    {
        $(this.selector).slideUp(100);
        // this.selector.style.display = 'none';
    }
	$( this.container ).removeClass('unlink-hover').removeClass('unlinking');
};


/*  */
/*  */

/*  */

// Notes
// ULs and LIs margin values are set to 0
// LIs get display: block
// Style the menu and get it working first with CSS, then add this JS to make it nicer

// External callback to initialize the widget
// @param	mixed	container	jQuery selector for the object to be used
// @param	dom		context		DOM object used as jQuery context. Defaults to document.body
function init_menu( container, context )
{
	context = context || document.body;
	
	$( container, context ).each( 
		function () 
		{
			var opts = "";
			opts = jQuery.attrOptions( this , "menu" );
			new Menu( this, opts );
		}
	);
}

// External callback for the documentation functions
// @return  object Structure containing 'examples' of usage, 'about' message, default 'opts', and 'classes' (never used...)
function docs_menu()
{
	var a = "Dynamic cascading menu item. Notes: Get it working with CSS only first, then use this file to make it nice.";
	var e = [
		['<ul class="do_menu" menu="animationOver: {ldelim}height:\'show\',opacity: .9{rdelim}, speedOver: 400, dropShadows: true">\n<li>A.root\n\t<ul>\n\t<li>A.1</li>\n\t<li>A.2</li>\n\t</ul>\n</li>\n<li>B.root\n\t<ul>\n\t<li>B.1</li>\n\t</ul>\n</li>\n</ul>',
		"Superfish menu"]
	];
	var c = [];
	
	var o = 
	[[ "hoverClass", 	'sfHover', 		 				"the class applied to hovered list items" ]
	,[ "pathClass", 	'overideThisToUse',				"the class you have applied to list items that lead to the current page" ]
	,[ "pathLevels", 	1,								"the number of levels of submenus that remain open or are restored using pathClass" ]
	,[ "delay",  		400,							"the delay in milliseconds that the mouse can remain outside a submenu without it closing" ]
	,[ 'animationOver',	{height:'show'},				"exmp: {opacity:.85}, {height:'show'}, Animation on mouse over. See jQueryÍs .animate() method" ]
	,[ "speedOver",		300, 			 				"speed of the mouse over animation (in milliseconds). Equivalent to second parameter of jQueryÍs .animate() method" ]
	,[ 'animationOut',	{opacity:'hide',height:'hide'},	"{opacity:'hide'}, {height:'hide'}, Animation on mouse out" ]
	,[ "speedOut", 		200, 			 				"speed of the mouse out animation (in milliseconds). Equivalent to second parameter of jQueryÍs .animate() method" ]
	,[ "autoArrows",	false, 			 				"if true, arrow mark-up generated automatically. Will add .sf-with-ul to anchor of parent. " ]
	,[ "dropShadows",	false, 			 				"completely disable drop shadows by setting this to false" ]
	];
	
	return { 'examples': e, 'about': a, 'opts': o, 'classes': c };
}


// Process the options for this widget (cached)
// @param   object  o   Widget options extracted from the html
// @return  object      Default options overriden by html options
function opts_menu( o )
{
	return apply_options( docs_menu().opts, o );
}



function Menu( container, opts )
{
	opts			= opts_menu( opts );
	this.container	= container;
	this.opts		= opts;
	
	
	$(container).superfish(
	{
		hoverClass: 	this.opts.hoverClass,
		pathClass: 		this.opts.pathClass,
		pathLevels: 	this.opts.pathLevels,
		delay: 			this.opts.delay,
		animationOver:	this.opts.animationOver,
		speedOver:		this.opts.speedOver,
		animationOut:	this.opts.animationOut,
		speedOut:		this.opts.speedOut,
		autoArrows: 	this.opts.autoArrows,
		dropShadows:	this.opts.dropShadows
	}	
	);	
	
}

;(function($){
	$.fn.superfish = function(op){

		var sf = $.fn.superfish,
			c = sf.c,
			$arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
			over = function(){
				var $$ = $(this), menu = getMenu($$);
				clearTimeout(menu.sfTimer);
				$$.showSuperfishUl().siblings().hideSuperfishUl();
			},
			out = function(){
				var $$ = $(this), menu = getMenu($$), o = sf.op;
				clearTimeout(menu.sfTimer);
				menu.sfTimer=setTimeout(function(){
					o.retainPath=($.inArray($$[0],o.$path)>-1);
					$$.hideSuperfishUl();
					if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
				},o.delay);	
			},
			getMenu = function($menu){
				var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
				sf.op = sf.o[menu.serial];
				return menu;
			},
			addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
			
		return this.each(function() {
			var s = this.serial = sf.o.length;
			var o = $.extend({},sf.defaults,op);
			o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
				$(this).addClass([o.hoverClass,c.bcClass].join(' '))
					.filter('li:has(ul)').removeClass(o.pathClass);
			});
			sf.o[s] = sf.op = o;
			
			$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
				if (o.autoArrows) addArrow( $('>a:first-child',this) );
			})
			.not('.'+c.bcClass)
				.hideSuperfishUl();
			
			var $a = $('a',this);
			$a.each(function(i){
				var $li = $a.eq(i).parents('li');
				$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
			});
			o.onInit.call(this);
			
		}).each(function() {
			menuClasses = [c.menuClass];
			if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
			$(this).addClass(menuClasses.join(' '));
		});
	};

	var sf = $.fn.superfish;
	sf.o = [];
	sf.op = {};
	sf.IE7fixAdd = function(){
		var o = sf.op;
		if ($.browser.msie && $.browser.version > 6 && o.dropShadows )
			this.addClass(sf.c.shadowClass+'-off');
		};
	sf.IE7fixRemove = function(){
		var o = sf.op;
		if ($.browser.msie && $.browser.version > 6 && o.dropShadows )
			this.removeClass(sf.c.shadowClass+'-off');
		};
	sf.c = {
		bcClass     : 'sf-breadcrumb',
		menuClass   : 'sf-js-enabled',
		anchorClass : 'sf-with-ul',
		arrowClass  : 'sf-sub-indicator',
		shadowClass : 'sf-shadow'
	};
	sf.defaults = {
		disableHI	: true,		// true disables hoverIntent detection
		onInit		: function(){}, // callback functions
		onBeforeShow: function(){},
		onShow		: function(){},
		onHide		: function(){}
	};
	$.fn.extend({
		hideSuperfishUl : function(){
			var o = sf.op,
			not = (o.retainPath===true) ? o.$path : '';
			o.retainPath = false;
			
			var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).find('>ul:visible')
			sf.IE7fixAdd.call($ul);		
			
			// important fix for ff2 opacity issues on a mac
			if (navigator.appVersion.indexOf("Mac")!=-1 && ($.browser.mozilla && $.browser.version.substr(0,3) == 1.8)) o.animationOut.opacity = 1;
			
			$ul.animate(o.animationOut,o.speedOut,function(){$(this).parent().removeClass(o.hoverClass); sf.IE7fixRemove.call($ul);});
			
			o.onHide.call($ul);
			return this;
		},
		showSuperfishUl : function(){
			var o = sf.op,
				sh = sf.c.shadowClass+'-off',
				$ul = this.addClass(o.hoverClass)
					.find('>ul:hidden').css('visibility','visible');
					
			sf.IE7fixAdd.call($ul);
			o.onBeforeShow.call($ul);
			
			// important fix for ff2 opacity issues on a mac
			if (navigator.appVersion.indexOf("Mac")!=-1 && ($.browser.mozilla && $.browser.version.substr(0,3) == 1.8)) o.animationOut.opacity = 1;
						
			$ul.animate(o.animationOver,o.speedOver,function(){ sf.IE7fixRemove.call($ul); o.onShow.call($ul); });
			return this;
		}
	});

})(jQuery);

/*  */
//
// External callback to initialize the widget
// @param	mixed	container	jQuery selector for the object to be used
// @param	dom		context		DOM object used as jQuery context. Defaults to document.body
function init_tooltip ( container, context )
{
	context = context || document.body;
	
	$(container, context).each(function()
	{
		var opts = jQuery.attrOptions( this , 'tooltip' );
		new Tooltip( this, opts );
	});
}

// External callback for the documentation functions
// @return  object      Structure containing 'examples' of usage, 'about' message, default 'opts', and 'classes' (never used...)
function docs_tooltip()
{
	var a = 'Mouse-pivoted tooltip that behaves intelligently against screen limits';
	var e = 
	[
		[ '<a class="do_tooltip" title="my tooltip text"', "simple popup using a custom div id" ],
	];
	
	var c = [];
	
	var o = 
	[ 
	 	[ 'timeover'			,50,				  					'Number of milliseconds before tooltip appears' ],
		[ 'effectover'			,{opacity: "show"}, 				 	'Action when hovering over. {opacity: \'toggle\', height: \'toggle\'}' ],
	 	[ 'effectover_duration'	,150,	  								'Duration of out effect' ],
	 	[ 'effectout' 			,{opacity: "hide"},  				  	'Action when hovering out. Other examples can be hide(), fadeOut(\'slow\')' ],
	 	[ 'effectout_duration'	,100,	  								'Duration of hover effect' ],
	 	[ 'offy'				,0, 				  					'Vertical distance from the mouse pointer' ],
	 	[ 'offx'				,5, 				  					'Horizontal distance from the mouse pointer' ],
	 	[ 'follow'				,true,	  								'Follow the mouse cursor' ],
		[ 'extra_image'			,'',									'Add an extra image to the ' ],
	 	[ 'inevent'				,'mouseover', 	  	  					'Bind this action when hovering over, choose mousemove when tooltip should move with mouse' ],
	 	[ 'outevent' 			,'mouseout', 		  					'Bind this action when hovering out' ],
	 	[ 'width'				,'auto', 			  					'Width of the tooltip' ],
	 	[ 'selectable'			,1, 	  	  	  					    'Set to true when it should be possible to select the text in the tooltip' ],
	 	[ 'cursor'				,'', 	  	  	  					    'tooltip parent cursor' ],
	 	[ 'maxwidth'			,'300px',								'the maximum width of the tooltip' ],
	 	[ 'type'				,'',									'is the type an input?' ],
	 	[ 'html'				,'',									'The html to be injected into the tooltip div' ],
	 	[ 'dom_id'				,'',									'what dom id to use for filling the tooltip' ]
	];
	
	return { 'examples': e, 'about': a, 'opts': o, 'classes': c };
}

// Process the options for this widget
// @param   object  o   Widget options extracted from the html
// @return  object      Default options overriden by html options
function opts_tooltip( o )
{
	return apply_options( docs_tooltip().opts, o );
}

function Tooltip( container, options )
{
	options			= opts_tooltip( options );
	this.options	= options;
    this.container  = container;
        
	$(container).tooltip(
    {
    	timein: 			options.timeover,
    	ineffect: 			options.effectover,
    	ineffectduratrion: 	options.effectover_duration, 
    	outeffect: 			options.effectout,
    	outeffectduratrion: options.effectout_duration, 
    	offsetY:			options.offy,
    	offsetX: 			options.offx,
    	follow: 			options.follow,
    	extra_image: 		options.extra_image,
	   	inevent: 			options.inevent,
    	outevent: 			options.outevent,
    	width: 				options.width,
    	cursor:				options.cursor,
    	maxwidth:			options.maxwidth,
    	type:				options.type,
    	html:				options.html,
    	dom_id:				options.dom_id
    });
}

(function(jQuery) 
{
	jQuery.fn.tooltip = function(options)
	{
		var defaults = {
			timein: 			300, 
			ineffect: 			{opacity: 'show'},
			ineffectduration: 	200, 
			outeffect: 			{opacity: 'hide'},
			outeffectduration: 	300, 
			offsetY: 			-15,
			offsetX: 			15,
			follow: 			true,
			extra_image: 		'<span class="tooltip-arrow"></span>',
			inevent: 			'mouseover',
			outevent: 			'mouseout',
			width: 				'auto',
			cursor: 			'',
			maxwidth: 			'330px',
			type: 				'',
			html: 				'',
			dom_id:				''
  		};
  		
  		var options = jQuery.extend(defaults, options);
  			
  		return this.each(function() 
		{
			obj = jQuery(this);
		
			obj.css({cursor: options.cursor});			
			
			if(this.title == '' && !options.dom_id && !options.html)
			{
				obj.unbind(options.inevent, options.outevent);
				return false;
			}

			obj.bind(options.inevent, function(e) 
			{
				this.tip = this.title;
				
				if(options.html)
				{
					var tip_content = options.html;
				}
				else if(options.dom_id)
				{
					var tip_content = $('#' + options.dom_id).html();
				}
				else
				{
					var tip_content = this.tip;
				}
				
				this.title = "";
				
				tip = jQuery('<div></div>')
						.addClass('tooltip')
						.html(options.extra_image + tip_content)
						.css({top: e.pageY + options.offsetY, left: e.pageX + options.offsetX, width: options.width, maxWidth: options.maxwidth });
				
				jQuery(document.body).append(tip);
								
				if(options.follow)
				{
					jQuery(document).bind('mousemove', function(e)
					{ 
						tip.css({top: e.pageY + options.offsetY});
						
						if(e.pageX + tip.width() > jQuery.windowSize().w)
						{
							tip.css({left: e.pageX - options.offsetX - tip.width() - 30});
						}
						else if(e.pageX + tip.width() < jQuery.windowSize().w)
						{
							tip.css({left: e.pageX + options.offsetX });
						}
						else
						{
							tip.css({left: e.pageX + options.offsetX });
						}
					});
				}
				else
				{
					var left = jQuery.getPosition(this).x;
					var top  = jQuery.getPosition(this).y;
					
					tip.css({top: top - tip.height() - 10});
					
					if(left + tip.width() > jQuery.windowSize().w)
					{
						tip.css({left: left - (obj.width() / 2) - (tip.width() / 2 )});
					}
					else
					{
						tip.css({left: left + (obj.width() / 2) - (tip.width() / 2 )});
					}
									
					if(options.type == 'input')
					{
						tip.css({ left: left + obj.width() + 15, top: top});
					}
				}
								
				tip.oneTime(options.timein, function()
				{
					jQuery(this).stop().animate(options.ineffect, options.ineffectduration);
				});
			});
			
			obj.bind(options.outevent, function(e) 
			{
				tip.stop().animate(options.outeffect, options.outeffectduration, function()
				{
					jQuery(this).remove();
				});
				
				jQuery.fn.tooltip.destroy();
				this.title = this.tip;
			});
			
			jQuery.fn.tooltip.destroy = function()
			{
				obj.unbind(options.inevent, options.outevent);
				jQuery(document).unbind('mousemove');
			}
		});			
	}
})(jQuery);
//
// image zoomer
//	

$.fn.img_zoomer = function() 
{
return this.each(function() {
		
	// set object
	var origImg = $(this);	
	
	var imgWidth = origImg.width();
	var imgHeight = origImg.height();

						
	// find the <map> that belongs to this image
	var img_id = origImg.attr('usemap').replace('#','');
	var usemap = $('map[name='+ img_id +']');

	
	var imgVars 		= usemap.attr('title').split(",");
	var originalWidth 	= parseInt(imgVars[0]);
	var originalHeight 	= parseInt(imgVars[1]);
	imgSrc 				= imgVars[2];
	
	var perc = 1;
	
	
	if(imgWidth != originalWidth)
	{ 
		perc = (imgWidth / originalWidth) 
	};
		

	// if image does not need zoomer, finish here, and skip to the next iteration
	if (!perc || perc > .85 || imgWidth < 220)
	{
		return true;
	};
		
	var a = false;
	
	// create wrapper div if it not in the template
	if (!origImg.parents('.img-wrapper').length) 
	{
		// wrap the image in a div for annotation positioning		
		wrapper = $('<div class="img-wrapper"></div>')
						.attr({rel: img_id})
						.css({width: imgWidth,height: imgHeight});
						
		if (origImg.parents('a').length)
		{
			var a = origImg.parents('a');
			origImg.parents('a').wrap(wrapper);
		}
		else
		{
			origImg.wrap(wrapper);
		};
	}
	else
	{
 		if (origImg.parents('a').length)
		{
			var a = origImg.parents('a');
		};
	};
	
	var wrapper = origImg.parents('.img-wrapper');

	
	if($('.img-toolbar',wrapper).length)
	{
		var toolbar = $('.img-toolbar',wrapper);
	}
	else
	{
		// find toolbar div, add it to the wrapper
		var toolbar = wrapper.siblings('.img-toolbar')
					.prependTo(wrapper);
					
	}
	
	
	// bind hovers
	wrapper
		.mouseover(function(){
			
			// load hi res image if present
			if(!$('.img-zoomer-hi-res',this).attr('src') && perc < .85)
			{
				$('.img-zoomer-hi-res',this).load_hi_res_image();
			}
						
			//toolbar = $('.img-toolbar',this);
			
			$(this).addClass('img_hovered');			
			
			if ($.browser.msie) 
			{
				toolbar.show();
				return false;
			}
			
			if (toolbar.length && toolbar.html() != '') 
			{
				toolbar.slideDown(200);
				if (toolbar.css('display') == 'none') 
				{
					toolbar.show();
				}
			}	
						
		})
		.mouseout(function(){	
			//toolbar = $('.img-toolbar',this);
			
			$(this).removeClass('img_hovered');
			
			if ($.browser.msie) 
			{
				toolbar.animate({opacity: 1},800,function(){
					if ( toolbar.length && !objParent.hasClass('img_hovered') )
					{
						toolbar.slideUp(200);
					};
				});
				return false;
			}
			
			$(this).animate({opacity: 1},800,function(){
				toolbar = $('.img-toolbar',this);
				if (!$(this).hasClass('img_hovered')) 
				{
					if (toolbar.length)
					{
						toolbar.slideUp(200);
					};
				}
			});
		});


	
	toolbar
		.prependTo(wrapper)
		.mouseover(function(){
			wrapper.addClass('img_hovered zooming-img');
		})
		.mouseout(function(){
			if( $('.ui-slider',this).slider('value') <= 1)
			{
				wrapper.removeClass('zooming-img');
			};
		});
		
	toolbar = $(toolbar,wrapper);
	
	// add tags button, set binds and title	
	tag_img_btn_title = $('.edit-img-tags',toolbar).text().split(',')
	$('.edit-img-tags',toolbar).text(tag_img_btn_title[0])
	
	var img = $('<img />').addClass('img-zoomer-hi-res').css({position: 'absolute'}).hide().insertAfter(origImg);	
	loader = $('<span></span>', origImg).addClass('loading-toolbar').hide().prependTo(toolbar);
		
	if(!speed)
	{
		var speed = 400;
	};
	
	// if zooming tools don't exist, add them to the toolbar
	if( !$('.img-zoomer-tools',toolbar).length )
	{
		var zoomer = $('<div></div>').addClass('img-zoomer-tools').hide().prependTo(toolbar);
	}
	else 
	{
		var zoomer = $('.img-zoomer-tools',toolbar);
	}
	
	// build zoom slider and add to zoomer
	$('<div></div>').slider(
	{
		max: (perc * 100)+100,
		start: function()
		{
			origImg.hide();
			img.show();
						
			if ( !wrapper.hasClass('zooming-img') )
			{
				wrapper.addClass('zooming-img');
			};
		},
		slide: function()
		{	
			if($('.ui-slider',toolbar).slider('value') > 1)
			{
				$('.img-zoomer-tool-reset',toolbar).animate({opacity: 1},200);
				$('.annotation',wrapper).hide();
			}
			
			var val 		= $(this).slider('value');
			var newPerc 	= ( val / 100 ) + 1 ;			
			var percWidth 	= ( imgWidth * newPerc );
			var percHeight 	= ( imgHeight * newPerc );
			var left 		= ( imgWidth - percWidth ) / 2;
			var top 		= ( imgHeight - percHeight ) / 2;
			
			img.css({width: percWidth,height: percHeight,top: top,left: left});			
		},
		stop: function()
		{					
							
			if (a)
			{
				a.click(function(){ return false });
			};
			
			if($(this).slider('value') < 1)
			{
			 	reset_image($(this))
			};
		}		
	})
	.appendTo(zoomer);
		
	$('<span>+</span>')
		.addClass('img-zoomer-tool-add')
		.mousedown(function(){
			$(this).siblings('.ui-slider').slider("moveTo", "+=15");
		})
		.appendTo(zoomer);
	$('<span>-</span>')
		.addClass('img-zoomer-tool-less')
		.mousedown(function(){
			if($(this).siblings('.ui-slider').slider('value') < 1)
			{
			 	reset_image($(this).siblings('.ui-slider'))
			} 
			else 
			{
				$(this).siblings('.ui-slider').slider("moveTo", "-=15");
			}	
		})
		.prependTo(zoomer);	
	$('<span>r</span>')
		.addClass('img-zoomer-tool-reset')
		.mouseup(function(){
			reset_image($(this).siblings('.ui-slider'));
		})
		.css({opacity: .4})
		.prependTo(zoomer);
		
	$('<span></span>')
		.addClass('img-zoomer-tool-fullscreen')
		.mousedown(function(){
			img_go_fullsize();
		})
		.prependTo(zoomer);
		
	
	$.fn.load_hi_res_image = function(){

		img = this;
		var wrapper = img.parents('div');
		var toolbar = $('.img-toolbar',wrapper);
		var zoomer = $('.img-zoomer-tools',wrapper);
		zoomer.hide();
		
		loader = $('.loading-toolbar',wrapper);
		loader.show();
		
		var imgVars	= $('map[name='+ wrapper.attr('rel') +']').attr('title').split(",");
		var imgSrc 	= imgVars[2];
		
		// load hi-res image	
		img.attr({src: imgSrc})
			.load(function(){
				loader.hide();
				zoomer.fadeIn(300);
				$(this)
					.attr({rel: $(this).width()+','+$(this).height()})
					.css({width: wrapper.width(),height: wrapper.height()})
					.unbind('load');
			})
			.draggable({
				start: function(e,ui){
					uiWidth = - (ui.helper.width() - wrapper.width());
					uiHeight = - (ui.helper.height() - wrapper.height());
				},
				drag: function(e,ui){
									
					if (ui.position.left >= 0)
					{
						ui.position.left = 1
					}
					if (ui.position.top >= 0)
					{		
						ui.position.top = 1
					}
					if (ui.position.left <= uiWidth)
					{		
						ui.position.left = (uiWidth + 1)
					}	
					if (ui.position.top <= uiHeight)
					{		
						ui.position.top = (uiHeight + 1)
					}	
				}
			});
	}
		
	function reset_image(slider){
		if (slider.slider('value') > 1 )
		{
			slider.slider("moveTo", "1");
		};
		img.hide()
	 	origImg.show()
	 	$('.img_zoomer_tool_reset',toolbar).css({opacity: .4});
		$('.annotation',wrapper).show().animate({opacity: 1},300,function(){
			wrapper.removeClass('zooming-img');
		});
		
		if (a)
		a.unbind('click');
	};
	
	function img_go_fullsize(){		
		
		var zoomDimen = img.attr('rel').split(',');
		
		var zoomImgWidth 	= zoomDimen[0];
		var zoomImgHeight 	= zoomDimen[1];
		var fullWidth 		= zoomImgWidth;
		var fullHeight 		= zoomImgHeight;

		// never wider than window
		if (zoomImgWidth > $(window).width())
		{
			fullWidth = $(window).width() - 40;
			fullHeight = zoomImgHeight * (fullWidth / zoomImgWidth);	
		};		
		
		// re-position when window resizes
		$(window).resize(function(){
		
			if( $(window).width() < zoomImgWidth )
			{
				$('.full-screen-img').animate({ 
					width: ($(window).width() - 40),
					height: zoomImgHeight * (($(window).width() - 40) / zoomImgWidth),
					left: ($(window).width() / 2) - (($(window).width() - 40) / 2)
				},200)
			} 
			else
			{
				$('.full-screen-img').animate({ 
					width: zoomImgWidth,
					height: zoomImgHeight,
					left: ($(window).width() / 2) - (zoomImgWidth / 2)
				},200)
			}			
		});
 		
		leftPos = ($(window).width() / 2) - (fullWidth / 2);
		topPos = $(window).scrollTop() + 10;
				
		// overlay
		$('<span class="popup-overlay"></span>')
			.css({opacity: .5,height: $(document).height(),backgroundColor: '#000000'})
			.click(function()
			{
				close_fullscreen_img()	
			})
			.appendTo('body');
			
		// clone the large image, and animate to full screen
		img.clone()
		.show()
		.addClass('full-screen-img')
		.css({left: wrapper.offset().left,top: wrapper.offset().top})
		.appendTo('body')
		.animate({width: fullWidth,height: fullHeight, left: leftPos, top: topPos},300,'easeOutCirc')
		.click(function(){
			close_fullscreen_img()
		});
	};
	
	function close_fullscreen_img(){
		$('.popup-overlay').fadeOut(300,function(){ $(this).remove() })
		$('.full-screen-img').animate({width: origImg.width(),height: origImg.height(), left: wrapper.offset().left,top: wrapper.offset().top},200,function(){ 
			$(this).remove(); 
			toolbar.show();
		})		
	};
	
});
	
};

//	
//	

$.fn.img_annotations = function() 
{
return this.each(function() {
	
	var obj = 		$(this);
	objParent = obj.parent();
		
	// create label for future use
	if ( !$('.annotation-label').length )
	{
		$('<span class="annotation-label"></span>')
			.css({opacity: .9})
			.appendTo('body');
	}
	// ## Set up the image for annotations	##	
	var imgId = $(this).attr('usemap');//+id;
	imgId = imgId.replace("#","");
	// remove usemap
	
	
	var imgWidth = $(this).width();
	var imgHeight = $(this).height();
						
	// find the <map> that belongs to this image
	var usemap = $('map[name='+imgId+']');	
	
	var imgVars 		= usemap.attr('title').split(",");
	var originalWidth 	= parseInt(imgVars[0]);
	var originalHeight 	= parseInt(imgVars[1]);
	
	var percWidth = 1;
	var percHeight = 1;
	
	if(imgWidth != originalWidth){ percWidth = (imgWidth / originalWidth) }
	if(imgHeight != originalHeight){ percHeight = (imgHeight / originalHeight) }
	
	// remove <a> from around image if in edit mode
	if (obj.parents('a:first').length) 
	{
		attachmentLink = obj.parents('a:first').clone();
		obj.parents('a:first').replaceWith(obj);
	}
	
	// create wrapper div if it not in the template
	if (!obj.parents('.img-wrapper').length) 
	{
		// wrap the image in a div for annotation positioning		
		img_wrapper = $('<div class="img-wrapper '+imgId+'_wrap"></div>')
						.addClass('img-with-annotations')
						.attr({rel: imgId})
						.css({width: imgWidth,height: imgHeight});
		
		if (obj.parents('a:first').length)
		{
			obj.parents('a:first').wrap(img_wrapper);
		}
		else
		{
			obj.wrap(img_wrapper);
		};
		
	}
	else 
	{
		img_wrapper = obj.parents('.img-wrapper')
						.addClass('img-with-annotations '+imgId+'_wrap')
						.attr({rel: imgId})
	};		
	
	objParent = obj.parents('.img-wrapper');
	
	
	// find and add toolbar
	if($('.img-toolbar',objParent).length)
	{
		toolbar = $('.img-toolbar',objParent);
	}
	else
	{
		// find toolbar div, add it to the wrapper
		toolbar = objParent.siblings('.img-toolbar:first')
					.prependTo(objParent);
	}
	
	
	// Set up image 
	objParent.siblings('.help-text:first').slideUp();
	objParent.siblings('.temp-actor-list').remove()
	
	objParent.removeClass('in_edit');
	
	actorList = $('.list-actor ul');

	
	
	// highlight annotation when actor li is hovered
	function highlight_annotation_from_li()
	{
		$('li',actorList).unbind('mouseover','mouseout');
		
		$('li',actorList).hover(function(){
			if( !$(".annotation",objParent).length )
			return false;
			
			$('a',this).removeAttr('title');
			
			var li_text = $('span',this).text().replace('\n',' ').split(' ');
			if (li_text.length <= 1)
			{
				var search_text = li_text[0]
			}
			else
			{
				var search_text = li_text[0]+" "+li_text[1]
			}
			
			$(".annotation:contains("+search_text+")",objParent).addClass('hovered');
			objParent.trigger('mouseover');
			
			toolbar.css({top: -9999});	
				
		}, function(){
			if( !$(".annotation",objParent).length )
			return false;
			
			$(".annotation",objParent).removeClass('hovered');
			objParent.trigger('mouseout');
			
			toolbar.hide().css({top: 0});
		});
	};
	
	highlight_annotation_from_li()
	
	
	// ## Create annotations from <map><area>'s ##
	if (obj.siblings('.annotation').length < 1)
	{
		$("area",usemap).each(function(i)
		{	
			// post ids = thing_id , edge_id, actor id
			var postIds = $(this).attr('rel').split(",");
			var thing_id = postIds[0];
			var actor_id = postIds[1];
			var edge_id = postIds[2];
						
			var coords = $(this).attr('coords').split(",");			
			// find the saved dimensions for the annotation
			var width = (coords[2] - coords[0]) * percWidth;
			var height = (coords[3] - coords[1]) * percHeight;
			var left = parseInt(coords[0]) * percHeight;
			var top = parseInt(coords[1]) * percHeight;
			
			
			var full_title = $(this).attr("title").split(",");
	
			// create annotation
			annotation = $('<a id="annot'+actor_id+'" rel="'+postIds+'" href="'+$(this).attr("href")+'"><span class="drag">'+full_title+'</span></a>');

			
			$('span.drag',annotation).css(
			{
				width: width,
				height: height,
				zIndex: ( 9998 - ( width + height ) )
			});
			
			// IE fix
			if ($.browser.msie) 
			{
				$('span.drag',annotation).css({backgroundColor: '#ccc',opacity: 0});
				$('body').addClass('isIE');
			}
			
			// make outer wrapper wider for border
			width = (width + 2);
					
			$(annotation)
			.addClass('annotation')
			.css(
			{
				width: width,
				top: top,
				left: left,
				zIndex: ( 9998 - ( width + height ) ) 
			})
			.prependTo('.'+imgId+'_wrap');
												
		});
	};

	
	// Bind image and annotation hover states
	
	annotations = $('.annotation',objParent);
	annotations.css({opacity: 1})
		// pause before fading
		.animate({opacity: 1},1500,function(){
			// fade annotations out
			$(this).animate({opacity: 0},500,function(){
				// if image has gone into edit, and show annotations
				if ( img_wrapper.hasClass('in_edit') )
				{
					$(this).css({opacity: 1});
				};
			});
		})
		.each(function(){
			// show label on hover
			$(this).hover(function()
			{
				annotations.css({opacity: 1});
							
				if (!labelText) 
				{
					var labelText = $(this).text();
					$('span.annotation-label').text(labelText);
				}
				$(this).mousemove(function(e){
					$('span.annotation-label').css({ left: e.pageX, top: e.pageY, zIndex: 9999999 });
				});
				
				// underline li in actor list that matches annotation title
				var text = $('span:first',this).text().split(',');
				$('li:contains('+text[0]+') a',actorList).css({textDecoration: 'underline'});		
			},function()
			{
				hide_label();
				$('li a',actorList).css({textDecoration: 'none'});
			})
		});
	
	obj.removeAttr('alt');
	
	objParent
		.mouseover(function(){
			annotations = $('.annotation',this);
			toolbar = $('.img-toolbar',this);
			
			$(this).addClass('img_hovered');
			
			if (!objParent.hasClass('zooming-img'))
			{
				annotations.css({opacity: 1});
			}
			
			// load hi res image if present and has not been loaded yet
			if($('.img-zoomer-hi-res',this).length && !$('.img-zoomer-hi-res',this).attr('src'))
			{
				$('.img-zoomer-hi-res',this).load_hi_res_image();
			}
			
			
			if ($.browser.msie && !objParent.hasClass('zooming-img')) 
			{
				annotations.show();
				toolbar.show();
				return false;
			}
			
			if (toolbar.length && toolbar.html() != '') 
			{
				toolbar.slideDown(200);
				if (annotations.css('opacity') < 1 && toolbar.css('display') == 'none') 
				{
					toolbar.show();
				}
			}
			
						
		})
		.mouseout(function(){	
			annotations = $('.annotation',this);
			toolbar = $('.img-toolbar',this);
			
			$(this).removeClass('img_hovered');
			
			if ($.browser.msie) 
			{
				annotations.hide();
				toolbar.animate({opacity: 1},800,function(){
					if ( toolbar.length && !objParent.hasClass('img_hovered') )
					{
						toolbar.slideUp(200);
					};
				});
				return false;
			}
			
			$(this).animate({opacity: 1},800,function(){
				annotations = $('.annotation',this);
				toolbar = $('.img-toolbar',this);
				if (!$(this).hasClass('img_hovered')) 
				{
					annotations.animate({opacity: 0},200);	
					if (toolbar.length)
					{
						toolbar.slideUp(200);
					};
				}
			});
		});
			
			
	// remove areas for edit mode - needed for IE
	$("area",usemap).remove();
	
	function hide_label()
	{
		$('span.annotation-label').css({top: -99999});
	}	

});
	
};
	
//
/*  $Id: lightbox.js 40995 2009-03-11 17:12:05Z bas $ */


// STATIC 

window.lightbox_pointer = null;


// Static hook to kill the currently active lightbox
// @return  undefined
function lightbox_remove()
{
	window.widget_manager.stop( 'lightbox' );
}


// Static hook to add an item to the top bar of the currently active lightbox
// @return  undefined
function lightbox_bar_add( x )
{
	$( "#lightbox-wrap-buttons" ).append( x );
}

// Static hook to add an button to the top bar of the currently active lightbox
// @return  undefined
function lightbox_bar_add_button( value, functionName )
{
	var str =  "<button onclick='lightbox_pointer." + functionName + "();'>" + value + "</button>";
	lightbox_bar_add( str );
}

// External callback to initialize the widget
// @param   mixed   container   jQuery selector for the object to be used
// @param   dom     context     DOM object used as jQuery context. Defaults to document.body
// @return  undefined
function init_lightbox( container, context )
{
	context = context || document;

	$( container, context ).each(
		function ()
		{
			var opts	= jQuery.attrOptions( this , 'lightbox' );
			var ajax	= jQuery.attrOptions( this , 'lightbox_ajax' );
			
			opts.ajax = ajax;
			
			new Lightbox( this, opts );
		}
	);
}


// External callback for the documentation functions
// @return  object      Structure containing 'examples' of usage, 'about' message, default 'opts', and 'classes' (never used...)
function docs_lightbox()
{
	var a = "A slightly too versatile lightbox implementation...";
	var e = [];
	var c = [];
	var s = jQuery.label( 'lightbox.cancel', 'Cancel' );
	var o = 
	[[ 'url', 			null, 	"Url to be loaded. Defaults to the href attribute in the element, and then to null" ]
	,[ 'lbl_cancel',	s, 		"Cancel button name" ]
	,[ 'width',			"60%", 	"Css width of the lightbox" ]
	,[ 'height',		"60%", 	"Css height of the lightbox" ]
	,[ 'freeze',		false, 	"Whether the lightbox size should be fixed instead of adapting to content"]
	,[ 'ajax',			{}, 	"Parameters to be added to lightbox url" ]
	,[ 'className',		"", 	"Class that will be added to the lightbox frame" ]
	];
	
	return { 'examples': e, 'about': a, 'opts': o, 'classes': c };
}


// Process the options for this widget (cached)
// // @param   object  o   Widget options extracted from the html
// // @return  object      Default options overriden by html options
function opts_lightbox( o )
{
	return apply_options( docs_lightbox().opts, o );	
}


function Lightbox( container, options )
{
	options			= opts_lightbox( options, container );
	options.url		= options.url || container.href || null;
	options.width	= ( "" + options.width  ).replace( 'px' , '' );
	options.height	= ( "" + options.height ).replace( 'px' , '' );

	this.options	= options;
	
	container = $( container ).get(0);
	container.obj_lightbox = this;

	var self = this;
	$( container ).click( 
		function (event)
		{
			window.lastEvent = event;
			self.show();
			return false;
		}
	);

	if ( options.showonload )
	{
		// bug#1732
		//
		// http://support.microsoft.com/default.aspx/kb/927917
		// http://clientside.cnet.com/code-snippets/manipulating-the-dom/ie-and-operation-aborted/
		//
		// The "operation is aborted" when we generate DOM content in the parent of a container of a script.
		// It is also aborted when we try to add DOM content to a container that is not yet ready.
		// We fix this IE problem by generating the lightbox inside the container that has the showonload parameter.
		//
		if ($.browser.msie)
		{
			this.show(container);
		}
		else
		{
			this.show();
		}
		container.blur();	
	}
}


// Callback for when the widget gets out of focus
// // @param   string  name    The name of the widget type
// // @param   object  obj     The object replacing this one in the widget focus
// // @return  bool            True if ajax request made, false otherwise
Lightbox.prototype.widgetBlur = function ( name, obj )
{
	if ( obj == null )
	{
		this.remove();
	}
	return false;
};



// Create the dom structure necessary to display lightbox
// @param container optional container where to create the lightbox
// @return  undefined
Lightbox.prototype.domCreate = function ( container )
{
	var self = this;
	
	var lo	= document.createElement( "div" );
	var lf	= document.createElement( "div" );
	var lw	= document.createElement( "div" );
	var lc	= document.createElement( "div" );
	var wb	= document.createElement( "div" );
	
	var cb	= $('<div></div>')
					.attr({id: 'lightbox-cancel', title: this.options.lbl_cancel})
					.click(function() 
					{ 
						self.remove();
					});
	
	lo.id	= "lightbox-overlay";
	lf.id	= "lightbox-frame";
	lw.id	= "lightbox-window";
	lc.id	= "lightbox-bar";
	wb.id	= "lightbox-wrap-buttons";
	
	lf.className = this.options.className;
	
	lf.style.position	= "absolute";
	lw.style.width		= "100%";
	lw.style.height		= "100%";
	
	if (container)
	{
		$( container ).append( lo );
		$( container ).append( lf );
	}
	else
	{
		$( "body" ).append( lo );
		$( "body" ).append( lf );
	}
		
	$( lf ).append( lc );
	$( lf ).append( lw );
	$( wb ).append( cb );
	$( lc ).append( wb );
	$( lc ).addClass('clearfix');
	
};


// Clear the timer used to resize the lightbox
// @return  undefined
Lightbox.prototype.clearResizeInterval = function()
{
	if ( window.lightbox_pointer && window.lightbox_pointer.interval )
	{
		clearInterval( window.lightbox_pointer.interval );
		window.lightbox_pointer.interval = null;
	}
};


// Remove this lightbox
// @return  undefined
Lightbox.prototype.remove = function ()
{
	this.clearResizeInterval();
	
	// $( document ).unkeyup();

	// Timeout is needed when this function is called from within the lightbox itself
	var self = this;
	setTimeout(
		function () 
		{
			$('#lightbox-window,#lightbox-frame,#lightbox-overlay').remove();
			self.showObjects();
		},
		500
	);
};


// Get the height of the page inside the lightbox 
// @return  undefined
Lightbox.prototype.size_of_content = function ()
{
	var fr = document.getElementById("lightbox-iframeContent").contentWindow;
	var h1 = 0;
	var h2 = 0;
	
	if ( fr && fr.document )
	{
		if ( fr.document.documentElement && fr.document.documentElement.scrollHeight )
		{
			h1 = fr.document.documentElement.scrollHeight;
		}

		if ( fr.document.body && fr.document.body.scrollHeight )
		{
			h2 = fr.document.body.scrollHeight;
		}
	}

	var h = Math.max( h1, h2 );
	var s = jQuery.getSize( document.getElementById( 'lightbox-frame'  ) );

	h = s.h < h ? h + 60 : 0;
	
	return h;
};


// Resize the lightbox in accordance to its contents
Lightbox.prototype.size = function ()
{
	if ( document.getElementById( "lightbox-iframeContent" ) )
	{
		var h = this.size_of_content();
		h > 0 && $( "#lightbox-frame" ).css( 'height', h + 'px' );
	}
};


// Convert a size in "%" into a value in "px"
// @param   string      x   Percentage value
// @param   integer     y   Absolute value
// @return  integer         Resulting pixel value
Lightbox.prototype.pixelizeSize = function ( x, y )
{
	x = parseInt( x.match( /\d+/ ) );
	x = Math.max( x , 0 );
	x = Math.min( x , 100 );
	x = Math.round( y * x / 100 );
	return x;
};


// Determine the width (horizontal position)
// @return  undefined
Lightbox.prototype.h_position = function ()
{
	var l = 0;
	var w = this.options.width;
	var d = jQuery.windowSize();

	if ( w.match( /\%/ ) )
	{
		w = this.pixelizeSize( w, d.w );
	}

	l = ( d.w - w ) / 2;

	$( "#lightbox-frame"  ).css( 'left',  l + 'px' );	
	$( "#lightbox-bar" ).css( 'width', w  - 2 + 'px' );
	$( "#lightbox-window" ).css( 'width', w + 'px' );
	
	this.overlaySize();	
};


// Determine the position  (vertical position)
// @return  undefined
Lightbox.prototype.v_position = function ()
{
	var pagesize   = jQuery.windowSize();	
	var pageScroll = jQuery.pageScrollTop();
	
	var t = 0;
	var h = this.options.height;
	var d = jQuery.windowSize();

	if ( h.match( /\%/ ) )
	{
		h = this.pixelizeSize( h, d.h );
	}

	t = ( d.h - h ) / 2;
	
	t = jQuery.pageScrollTop() + t;

	$( "#lightbox-frame" ).css({
		top:    t + 'px',
		height: h + 'px'
	});
};


// Determine size of dark mask 
// @return  undefined
Lightbox.prototype.overlaySize = function ()
{
	if ( window.innerHeight && window.scrollMaxY )
	{	
		yScroll = window.innerHeight + window.scrollMaxY;
	}
	else if ( document.body.scrollHeight > document.body.offsetHeight )
	{
		 // all but Explorer Mac
		yScroll = document.body.scrollHeight;
	}
	else
	{ 
		// Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		yScroll = document.body.offsetHeight;
  	}

	$( "#lightbox-overlay" ).css( {height: yScroll + "px", cursor: 'pointer' })
							.bind('click', function()
							{
								Lightbox.prototype.remove();
							});
};


// Update de size of the lightbox at a regular time interval
// @return  undefined
Lightbox.prototype.setRegularUpdate = function ()
{
	var self 	= this;
	var fr 		= document.getElementById("lightbox-iframeContent");
	fr.interval = setInterval( 
		function () 
		{ 
			self.size() 
		}, 
		800 
	);
};

Lightbox.prototype.hideObjects = function ()
{
	var self = this;
	$( 'embed,select' ).each(
		function ()
		{
			this.preLightboxVisibility = $( this ).css( 'visibility' );
			this.style.visibility = 'hidden';
		}
	);
};

Lightbox.prototype.showObjects = function ()
{
	var self = this;
	$( 'embed,select' ).each(
		function ()
		{
			this.style.visibility = this.preLightboxVisibility;
		}
	);
};


// Show the lightbox
// @param container, optional container where to generate the lightbox
// @return  undefined
Lightbox.prototype.show = function ( container )
{
	try 
	{
		window.widget_manager.widgetFocus( 'lightbox', this );
		
		$( "#lightbox-overlay" ).get( 0 ) || this.domCreate(container);
		
		var scroll = jQuery.pageScrollTop();

/*		window.scrollTo( 0, scroll );*/

		this.overlaySize();

		this.options.before_ajax && this.options.before_ajax( this.options );
		
		// Let the request know it is inside a lightbox
		this.options.ajax.in_lightbox = '1';
		
		var url		= jQuery.addToQuery( this.options.url , jQuery.param( this.options.ajax ) );
		var rand	= Math.floor( Math.random() * 100000 );
		
		if ( document.getElementById( "lightbox-iframeContent" ) == null )
		{
			$("#lightbox-window").append(
				"<iframe src='" + url + "' name='frame" + rand + "' id='lightbox-iframeContent' frameborder='0' border='0' style='width: 100%; height: 100%;'></iframe>" );
		}
		else
		{
			$( "#lightbox-iframeContent").get(0).src = url;
		}
		
		this.v_position();
		this.h_position();
		
 		$( "#lightbox-window,#lightbox-frame" ).css( 'display' , 'block' );

		this.options.freeze || this.setRegularUpdate();
		
		window.lightbox_pointer = window.frames['frame'+rand];
		
		var self = this;
		$( window ).resize(function () 
		{
			self.h_position();
			self.v_position();
		});	
		
		setTimeout(
			function ()
			{
				self.hideObjects();
			},
			20
		)
	}
	catch( e ) 
	{
		jQuery.warn( "Lightbox" , "An error occurred when opening the lightbox." , e );
	}
};

var LightboxHelper = 
{
	isLightbox: function(uri) 
	{
		if (!window.parent || window.parent.document.location.href == document.location.href)
		{
			return false;
		}
		if (!uri) uri = document.location.href;
		if (uri.match(/\bin_lightbox=1\b/))
		{
			return true;
		}
		
		return false;
	},

	openLightbox: function(url, container, options)
	{
		options['url'] = url;
		var lb = new Lightbox (container, options);
		lb.show();
	}
};

/**/
//
// External callback to initialize the widget
// @param	mixed	container	jQuery selector for the object to be used
// @param	dom		context		DOM object used as jQuery context. Defaults to document.body
function init_dialog ( container, context )
{
	context = context || document.body;
	
	$(container, context).each(function()
	{
		var opts = jQuery.attrOptions( this , 'dialog' );
		new Dialog( this, opts );
	});
}

// External callback for the documentation functions
// @return  object      Structure containing 'examples' of usage, 'about' message, default 'opts', and 'classes' (never used...)
function docs_dialog()
{
	var a = 'dialog is a lightweight version of lightbox';
	var e = 
	[
		[ '<a class="do_dialog" dialog="url: ..."', "simple popup using a custom div id" ],
	];
	
	var c = [];
	
	var o = 
	[ 
	 	[ 'width'			,'500px',  							'The width of the dialog' ],
		[ 'height'			,'auto',				 			'The height of the dialog' ],
	 	[ 'url'				,'',	  							'Url to load' ],
	 	[ 'ineffect' 		,{opacity: 'show', height: 'show'}, 'Action when clicked on the launch button. {opacity: \'show\', height: \'show\'}' ],
	 	[ 'ineffectTime'	,250,	  							'Duration of the startup effect' ],
	 	[ 'outeffect'		,{opacity: 'hide'}, 'Action when clicked on the close button. {opacity: \'hide\', height: \'hide\'}' ],
	 	[ 'outeffectTime'	,100, 				  				'Duration of the close effect' ],
	 	[ 'dialog'			,true,	  							'Is this box a dialog? It will become draggable and you get an overlay div, like a real lightbox.' ],
	 	[ 'direct'			,false,	  							'Fire the dialog without a click event'],
	 	[ 'title'			,'',	  							'The title of the dialog if there is no object specified'],
	 	[ 'callback'		,'',	  							'Function that gets called after the dialog is destroyed' ]
	];
	
	return { 'examples': e, 'about': a, 'opts': o, 'classes': c };
}

// Process the options for this widget
// @param   object  o   Widget options extracted from the html
// @return  object      Default options overriden by html options
function opts_dialog( o )
{
	return apply_options( docs_dialog().opts, o );
}

function Dialog( container, options )
{
	options			= opts_dialog( options );
	this.options	= options;
    this.container  = container;
        
	jQuery(container).dialog(
    {
    	width: 			options.width,
		height: 		options.height,
		url:			options.url,
		ineffect:		options.ineffect,
		ineffectTime:	options.ineffectTime,
		outeffect:		options.outEffect,
		outeffectTime:	options.outEffectTime,
		dialog:			options.dialog,
		direct:			options.direct,
		title:			options.title,
		callback:		options.callback
    });
}

;(function(jQuery)
{
	jQuery.fn.dialog = function(options)
	{
  		var options = jQuery.extend({}, jQuery.fn.dialog.defaults, options);

		return this.each(function() 
		{			
			if(options.direct)
			{
				jQuery.addDialog(options, jQuery(this));
			}
			else
			{
				jQuery(this).click(function()
				{
					jQuery.addDialog(options, jQuery(this))
				});
			}
		});
	}
	
	jQuery.extend(
	{                 
    	addDialog: function(options, obj)
		{
			var theBox, closeButton, templateWrapper, dialogContent, overlayDiv, clickedText, dragHandle, dialogTop, dialogLeft, boxHeight, buttonText, obj = obj || '';
			
			opts = options;
			
			if(!jQuery('.dialog').length)
			{
				clickedText		= jQuery('<div></div>').addClass('dialog-loader-text loading');
				closeButton		= jQuery('<span></span>').addClass('dialog-close').html('x');
				templateWrapper	= jQuery('<div></div>').addClass('dialog-template-wrapper');
				overlayDiv		= jQuery('<div></div>').addClass('dialog-overlay').css({zIndex: 100, opacity: .75, height: $(document).height() });
			
				if(typeof opts.height == 'string')
				{
					boxHeight = 'auto';
				}
				else
				{
					boxHeight = opts.height.replace('px', '') - 52;
				}
			
				if(obj != '')
				{
					buttonText	= obj.html();
				}
				else
				{
					buttonText	= opts.title;
				}

				dialogTop	= jQuery(window).scrollTop() + Math.floor(jQuery(window).height() / 5);
				dialogLeft	= (jQuery(window).width() / 2) - (parseInt(opts.width) / 2);				

				theBox 			= jQuery('<div></div>')
									.addClass('dialog')
									.css({position: "absolute", top: dialogTop, left: dialogLeft, width: opts.width, height: opts.height});
				
				dialogContent 	= jQuery('<div></div>')
									.addClass('dialog-content')
									.css({height: boxHeight})
									.append(clickedText)
									.appendTo(theBox);
				
				document.onkeypress = function(e)
				{
					if($.browser.msie) 
					{
						var key = e.which
					}
					else 
					{
						key = e.keyCode
					} 
					
					if(key == 27)
					{
						jQuery.fn.dialog.destroy(theBox);
					}
				}
				
				//clickedText.css({height: dialogContent.css('height') || 16});
													
				if(opts.dialog)
				{
					dragHandle	= jQuery('<div></div>')
									.addClass('dialog-drag-handle')
									.html('<span class="dialog-drag-handle-text">'+buttonText+'</span>')
									.mousedown(function()
									{
										$(this).addClass('pressed');
									})
									.mouseup(function()
									{
										$(this).removeClass('pressed');
									});
				
					theBox
						.draggable({
							handle: dragHandle
						})
						.prepend(dragHandle);
					
					jQuery(document.body).append(overlayDiv);
				}
				
				if(jQuery.browser.msie) 
				{
					theBox.css({background: 'none', padding: 0});
					
					if(jQuery.browser.version < 7)
					{
						jQuery('select').each(function()
						{
							jQuery(this).css({visibility: 'hidden'});
						});
					}
				}
				
				jQuery(document.body).append(theBox);
				
				theBox.animate(opts.ineffect, opts.ineffectTime, function()
				{
					if(opts.url)
					{
						jQuery.ajax({
							type: 'GET',
							url: opts.url,
							success: function(html)
							{
								dialogContent.append(templateWrapper);										
								
								clickedText.animate({opacity: 'hide'}, opts.outeffectTime, function()
								{
									templateWrapper
										.html(html)
										.animate(opts.ineffect, opts.ineffectTime, function()
										{
											var left = jQuery(theBox).position().left;
											var top  = jQuery(theBox).position().top;
											
											if(top + jQuery(this).height() > jQuery(window).height() && top > (jQuery(window).height() / 2))
											{
												var bodyTop = jQuery(document.body).scrollTop() + Math.floor(jQuery(window).height() / 5);
												theBox.animate({top: bodyTop}, 300);
												$('html, body').animate({scrollTop: bodyTop}, 300);											}
											
											if(left + jQuery(this).width() > jQuery(window).width())
											{
												theBox.animate({left: left - (jQuery(this).width() / 2) - 20}, 150);
											}
										});
										
									jQuery('.dialog-template-wrapper p:last', theBox).css({margin: 0});
									jQuery('.dialog-template-wrapper input:first', theBox).focus();
										
									if(opts.dialog)
									{
										dragHandle.append(closeButton);
									}
									else
									{
										templateWrapper.prepend(closeButton);
									}
								});
							}
						});
					}
					else
					{
						dialogContent.append(templateWrapper);
								
						clickedText.animate(opts.outeffect, opts.outeffectTime, function()
						{
							templateWrapper
								.html('<p>No template to load.</p>')
								.animate(opts.ineffect, opts.ineffectTime);							
						});
					}
				});
				
				closeButton.click(function()
				{
					jQuery.fn.dialog.destroy(theBox);	
				});
			}
		}
	});
	
	jQuery.fn.dialog.destroy = function(theBox)
	{
		var closeButton 	= jQuery('.dialog-close', theBox);
		var templateWrapper = jQuery('.dialog-template-wrapper', theBox);
		var overlayDiv		= jQuery('.dialog-overlay');
		
		templateWrapper.animate(opts.outeffect, opts.outeffectTime, function()
		{
			theBox.animate(opts.outeffect, opts.outeffectTime, function()
			{
				theBox.remove();
				overlayDiv.fadeOut(300, function()
				{
					overlayDiv.remove();
				});
				
				if(jQuery.browser.msie && jQuery.browser.version < 7) 
				{
					jQuery('select').each(function()
					{
						jQuery(this).css({visibility: 'visible'});
					})
				}
					
				if(opts.callback)
				{
					opts.callback();
				}
			});
		});
	}
	
	jQuery.fn.dialog.defaults = {
		width: 			'500px',
		height: 		'auto',
		url:			'',
		ineffect:		{opacity: 'show', height: 'show'},
		ineffectTime:	100,
		outeffect:		{opacity: 'hide'},
		outeffectTime:	100,
		dialog:			false,
		direct:			false,
		title:			'',
		callback:		''
	}

})(jQuery);
//