
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(J(){7(1e.3N)L w=1e.3N;L E=1e.3N=J(a,b){K 1B E.2l.4T(a,b)};7(1e.$)L D=1e.$;1e.$=E;L u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;L G=/^.[^:#\\[\\.]*$/;E.1n=E.2l={4T:J(d,b){d=d||T;7(d.15){6[0]=d;6.M=1;K 6}N 7(1o d=="25"){L c=u.2O(d);7(c&&(c[1]||!b)){7(c[1])d=E.4a([c[1]],b);N{L a=T.5J(c[3]);7(a)7(a.2w!=c[3])K E().2s(d);N{6[0]=a;6.M=1;K 6}N d=[]}}N K 1B E(b).2s(d)}N 7(E.1q(d))K 1B E(T)[E.1n.21?"21":"3U"](d);K 6.6E(d.1k==1M&&d||(d.5h||d.M&&d!=1e&&!d.15&&d[0]!=10&&d[0].15)&&E.2I(d)||[d])},5h:"1.2.3",87:J(){K 6.M},M:0,22:J(a){K a==10?E.2I(6):6[a]},2F:J(b){L a=E(b);a.54=6;K a},6E:J(a){6.M=0;1M.2l.1g.1i(6,a);K 6},R:J(a,b){K E.R(6,a,b)},4X:J(b){L a=-1;6.R(J(i){7(6==b)a=i});K a},1J:J(c,a,b){L d=c;7(c.1k==4e)7(a==10)K 6.M&&E[b||"1J"](6[0],c)||10;N{d={};d[c]=a}K 6.R(J(i){Q(c 1p d)E.1J(b?6.W:6,c,E.1l(6,d[c],b,i,c))})},1j:J(b,a){7((b==\'27\'||b==\'1R\')&&2M(a)<0)a=10;K 6.1J(b,a,"2o")},1u:J(b){7(1o b!="3V"&&b!=V)K 6.4x().3t((6[0]&&6[0].2i||T).5r(b));L a="";E.R(b||6,J(){E.R(6.3p,J(){7(6.15!=8)a+=6.15!=1?6.6K:E.1n.1u([6])})});K a},5m:J(b){7(6[0])E(b,6[0].2i).5k().3o(6[0]).2c(J(){L a=6;2b(a.1C)a=a.1C;K a}).3t(6);K 6},8w:J(a){K 6.R(J(){E(6).6z().5m(a)})},8p:J(a){K 6.R(J(){E(6).5m(a)})},3t:J(){K 6.3O(18,P,S,J(a){7(6.15==1)6.38(a)})},6q:J(){K 6.3O(18,P,P,J(a){7(6.15==1)6.3o(a,6.1C)})},6o:J(){K 6.3O(18,S,S,J(a){6.1a.3o(a,6)})},5a:J(){K 6.3O(18,S,P,J(a){6.1a.3o(a,6.2B)})},3h:J(){K 6.54||E([])},2s:J(b){L c=E.2c(6,J(a){K E.2s(b,a)});K 6.2F(/[^+>] [^+>]/.17(b)||b.1f("..")>-1?E.57(c):c)},5k:J(e){L f=6.2c(J(){7(E.14.1d&&!E.3E(6)){L a=6.69(P),4Y=T.3s("1x");4Y.38(a);K E.4a([4Y.3d])[0]}N K 6.69(P)});L d=f.2s("*").4R().R(J(){7(6[F]!=10)6[F]=V});7(e===P)6.2s("*").4R().R(J(i){7(6.15==3)K;L c=E.O(6,"2R");Q(L a 1p c)Q(L b 1p c[a])E.16.1b(d[i],a,c[a][b],c[a][b].O)});K f},1E:J(b){K 6.2F(E.1q(b)&&E.3y(6,J(a,i){K b.1P(a,i)})||E.3e(b,6))},56:J(b){7(b.1k==4e)7(G.17(b))K 6.2F(E.3e(b,6,P));N b=E.3e(b,6);L a=b.M&&b[b.M-1]!==10&&!b.15;K 6.1E(J(){K a?E.33(6,b)<0:6!=b})},1b:J(a){K!a?6:6.2F(E.37(6.22(),a.1k==4e?E(a).22():a.M!=10&&(!a.12||E.12(a,"3u"))?a:[a]))},3H:J(a){K a?E.3e(a,6).M>0:S},7j:J(a){K 6.3H("."+a)},5O:J(b){7(b==10){7(6.M){L c=6[0];7(E.12(c,"2k")){L e=c.3T,5I=[],11=c.11,2X=c.U=="2k-2X";7(e<0)K V;Q(L i=2X?e:0,2f=2X?e+1:11.M;i<2f;i++){L d=11[i];7(d.2p){b=E.14.1d&&!d.9J.1A.9y?d.1u:d.1A;7(2X)K b;5I.1g(b)}}K 5I}N K(6[0].1A||"").1r(/\\r/g,"")}K 10}K 6.R(J(){7(6.15!=1)K;7(b.1k==1M&&/5u|5t/.17(6.U))6.3k=(E.33(6.1A,b)>=0||E.33(6.31,b)>=0);N 7(E.12(6,"2k")){L a=b.1k==1M?b:[b];E("98",6).R(J(){6.2p=(E.33(6.1A,a)>=0||E.33(6.1u,a)>=0)});7(!a.M)6.3T=-1}N 6.1A=b})},3q:J(a){K a==10?(6.M?6[0].3d:V):6.4x().3t(a)},6S:J(a){K 6.5a(a).1V()},6Z:J(i){K 6.2K(i,i+1)},2K:J(){K 6.2F(1M.2l.2K.1i(6,18))},2c:J(b){K 6.2F(E.2c(6,J(a,i){K b.1P(a,i,a)}))},4R:J(){K 6.1b(6.54)},O:J(d,b){L a=d.23(".");a[1]=a[1]?"."+a[1]:"";7(b==V){L c=6.5n("8P"+a[1]+"!",[a[0]]);7(c==10&&6.M)c=E.O(6[0],d);K c==V&&a[1]?6.O(a[0]):c}N K 6.1N("8K"+a[1]+"!",[a[0],b]).R(J(){E.O(6,d,b)})},35:J(a){K 6.R(J(){E.35(6,a)})},3O:J(g,f,h,d){L e=6.M>1,3n;K 6.R(J(){7(!3n){3n=E.4a(g,6.2i);7(h)3n.8D()}L b=6;7(f&&E.12(6,"1O")&&E.12(3n[0],"4v"))b=6.3S("1U")[0]||6.38(6.2i.3s("1U"));L c=E([]);E.R(3n,J(){L a=e?E(6).5k(P)[0]:6;7(E.12(a,"1m")){c=c.1b(a)}N{7(a.15==1)c=c.1b(E("1m",a).1V());d.1P(b,a)}});c.R(6A)})}};E.2l.4T.2l=E.2l;J 6A(i,a){7(a.3Q)E.3P({1c:a.3Q,3l:S,1H:"1m"});N E.5g(a.1u||a.6x||a.3d||"");7(a.1a)a.1a.34(a)}E.1s=E.1n.1s=J(){L b=18[0]||{},i=1,M=18.M,5c=S,11;7(b.1k==8d){5c=b;b=18[1]||{};i=2}7(1o b!="3V"&&1o b!="J")b={};7(M==1){b=6;i=0}Q(;i<M;i++)7((11=18[i])!=V)Q(L a 1p 11){7(b===11[a])6w;7(5c&&11[a]&&1o 11[a]=="3V"&&b[a]&&!11[a].15)b[a]=E.1s(b[a],11[a]);N 7(11[a]!=10)b[a]=11[a]}K b};L F="3N"+(1B 3v()).3L(),6t=0,5b={};L H=/z-?4X|86-?84|1w|6k|7Z-?1R/i;E.1s({7Y:J(a){1e.$=D;7(a)1e.3N=w;K E},1q:J(a){K!!a&&1o a!="25"&&!a.12&&a.1k!=1M&&/J/i.17(a+"")},3E:J(a){K a.1F&&!a.1h||a.28&&a.2i&&!a.2i.1h},5g:J(a){a=E.3g(a);7(a){L b=T.3S("6f")[0]||T.1F,1m=T.3s("1m");1m.U="1u/4m";7(E.14.1d)1m.1u=a;N 1m.38(T.5r(a));b.38(1m);b.34(1m)}},12:J(b,a){K b.12&&b.12.2E()==a.2E()},1T:{},O:J(c,d,b){c=c==1e?5b:c;L a=c[F];7(!a)a=c[F]=++6t;7(d&&!E.1T[a])E.1T[a]={};7(b!=10)E.1T[a][d]=b;K d?E.1T[a][d]:a},35:J(c,b){c=c==1e?5b:c;L a=c[F];7(b){7(E.1T[a]){2V E.1T[a][b];b="";Q(b 1p E.1T[a])1Q;7(!b)E.35(c)}}N{1S{2V c[F]}1X(e){7(c.52)c.52(F)}2V E.1T[a]}},R:J(c,a,b){7(b){7(c.M==10){Q(L d 1p c)7(a.1i(c[d],b)===S)1Q}N Q(L i=0,M=c.M;i<M;i++)7(a.1i(c[i],b)===S)1Q}N{7(c.M==10){Q(L d 1p c)7(a.1P(c[d],d,c[d])===S)1Q}N Q(L i=0,M=c.M,1A=c[0];i<M&&a.1P(1A,i,1A)!==S;1A=c[++i]){}}K c},1l:J(b,a,c,i,d){7(E.1q(a))a=a.1P(b,i);K a&&a.1k==51&&c=="2o"&&!H.17(d)?a+"2S":a},1t:{1b:J(c,b){E.R((b||"").23(/\\s+/),J(i,a){7(c.15==1&&!E.1t.3Y(c.1t,a))c.1t+=(c.1t?" ":"")+a})},1V:J(c,b){7(c.15==1)c.1t=b!=10?E.3y(c.1t.23(/\\s+/),J(a){K!E.1t.3Y(b,a)}).6a(" "):""},3Y:J(b,a){K E.33(a,(b.1t||b).3X().23(/\\s+/))>-1}},68:J(b,c,a){L e={};Q(L d 1p c){e[d]=b.W[d];b.W[d]=c[d]}a.1P(b);Q(L d 1p c)b.W[d]=e[d]},1j:J(d,e,c){7(e=="27"||e=="1R"){L b,46={43:"4W",4U:"1Z",19:"3D"},3c=e=="27"?["7O","7M"]:["7J","7I"];J 5E(){b=e=="27"?d.7H:d.7F;L a=0,2N=0;E.R(3c,J(){a+=2M(E.2o(d,"7E"+6,P))||0;2N+=2M(E.2o(d,"2N"+6+"5X",P))||0});b-=24.7C(a+2N)}7(E(d).3H(":4d"))5E();N E.68(d,46,5E);K 24.2f(0,b)}K E.2o(d,e,c)},2o:J(e,k,j){L d;J 3x(b){7(!E.14.2d)K S;L a=T.4c.4K(b,V);K!a||a.4M("3x")==""}7(k=="1w"&&E.14.1d){d=E.1J(e.W,"1w");K d==""?"1":d}7(E.14.2z&&k=="19"){L c=e.W.50;e.W.50="0 7r 7o";e.W.50=c}7(k.1D(/4g/i))k=y;7(!j&&e.W&&e.W[k])d=e.W[k];N 7(T.4c&&T.4c.4K){7(k.1D(/4g/i))k="4g";k=k.1r(/([A-Z])/g,"-$1").2h();L h=T.4c.4K(e,V);7(h&&!3x(e))d=h.4M(k);N{L f=[],2C=[];Q(L a=e;a&&3x(a);a=a.1a)2C.4J(a);Q(L i=0;i<2C.M;i++)7(3x(2C[i])){f[i]=2C[i].W.19;2C[i].W.19="3D"}d=k=="19"&&f[2C.M-1]!=V?"2H":(h&&h.4M(k))||"";Q(L i=0;i<f.M;i++)7(f[i]!=V)2C[i].W.19=f[i]}7(k=="1w"&&d=="")d="1"}N 7(e.4n){L g=k.1r(/\\-(\\w)/g,J(a,b){K b.2E()});d=e.4n[k]||e.4n[g];7(!/^\\d+(2S)?$/i.17(d)&&/^\\d/.17(d)){L l=e.W.26,3K=e.3K.26;e.3K.26=e.4n.26;e.W.26=d||0;d=e.W.7f+"2S";e.W.26=l;e.3K.26=3K}}K d},4a:J(l,h){L k=[];h=h||T;7(1o h.3s==\'10\')h=h.2i||h[0]&&h[0].2i||T;E.R(l,J(i,d){7(!d)K;7(d.1k==51)d=d.3X();7(1o d=="25"){d=d.1r(/(<(\\w+)[^>]*?)\\/>/g,J(b,a,c){K c.1D(/^(aa|a6|7e|a5|4D|7a|a0|3m|9W|9U|9S)$/i)?b:a+"></"+c+">"});L f=E.3g(d).2h(),1x=h.3s("1x");L e=!f.1f("<9P")&&[1,"<2k 74=\'74\'>","</2k>"]||!f.1f("<9M")&&[1,"<73>","</73>"]||f.1D(/^<(9G|1U|9E|9B|9x)/)&&[1,"<1O>","</1O>"]||!f.1f("<4v")&&[2,"<1O><1U>","</1U></1O>"]||(!f.1f("<9w")||!f.1f("<9v"))&&[3,"<1O><1U><4v>","</4v></1U></1O>"]||!f.1f("<7e")&&[2,"<1O><1U></1U><6V>","</6V></1O>"]||E.14.1d&&[1,"1x<1x>","</1x>"]||[0,"",""];1x.3d=e[1]+d+e[2];2b(e[0]--)1x=1x.5o;7(E.14.1d){L g=!f.1f("<1O")&&f.1f("<1U")<0?1x.1C&&1x.1C.3p:e[1]=="<1O>"&&f.1f("<1U")<0?1x.3p:[];Q(L j=g.M-1;j>=0;--j)7(E.12(g[j],"1U")&&!g[j].3p.M)g[j].1a.34(g[j]);7(/^\\s/.17(d))1x.3o(h.5r(d.1D(/^\\s*/)[0]),1x.1C)}d=E.2I(1x.3p)}7(d.M===0&&(!E.12(d,"3u")&&!E.12(d,"2k")))K;7(d[0]==10||E.12(d,"3u")||d.11)k.1g(d);N k=E.37(k,d)});K k},1J:J(d,e,c){7(!d||d.15==3||d.15==8)K 10;L f=E.3E(d)?{}:E.46;7(e=="2p"&&E.14.2d)d.1a.3T;7(f[e]){7(c!=10)d[f[e]]=c;K d[f[e]]}N 7(E.14.1d&&e=="W")K E.1J(d.W,"9u",c);N 7(c==10&&E.14.1d&&E.12(d,"3u")&&(e=="9r"||e=="9o"))K d.9m(e).6K;N 7(d.28){7(c!=10){7(e=="U"&&E.12(d,"4D")&&d.1a)6Q"U 9i 9h\'t 9g 9e";d.9b(e,""+c)}7(E.14.1d&&/6O|3Q/.17(e)&&!E.3E(d))K d.4z(e,2);K d.4z(e)}N{7(e=="1w"&&E.14.1d){7(c!=10){d.6k=1;d.1E=(d.1E||"").1r(/6M\\([^)]*\\)/,"")+(2M(c).3X()=="96"?"":"6M(1w="+c*6L+")")}K d.1E&&d.1E.1f("1w=")>=0?(2M(d.1E.1D(/1w=([^)]*)/)[1])/6L).3X():""}e=e.1r(/-([a-z])/95,J(a,b){K b.2E()});7(c!=10)d[e]=c;K d[e]}},3g:J(a){K(a||"").1r(/^\\s+|\\s+$/g,"")},2I:J(b){L a=[];7(1o b!="93")Q(L i=0,M=b.M;i<M;i++)a.1g(b[i]);N a=b.2K(0);K a},33:J(b,a){Q(L i=0,M=a.M;i<M;i++)7(a[i]==b)K i;K-1},37:J(a,b){7(E.14.1d){Q(L i=0;b[i];i++)7(b[i].15!=8)a.1g(b[i])}N Q(L i=0;b[i];i++)a.1g(b[i]);K a},57:J(a){L c=[],2r={};1S{Q(L i=0,M=a.M;i<M;i++){L b=E.O(a[i]);7(!2r[b]){2r[b]=P;c.1g(a[i])}}}1X(e){c=a}K c},3y:J(c,a,d){L b=[];Q(L i=0,M=c.M;i<M;i++)7(!d&&a(c[i],i)||d&&!a(c[i],i))b.1g(c[i]);K b},2c:J(d,a){L c=[];Q(L i=0,M=d.M;i<M;i++){L b=a(d[i],i);7(b!==V&&b!=10){7(b.1k!=1M)b=[b];c=c.71(b)}}K c}});L v=8Y.8W.2h();E.14={5K:(v.1D(/.+(?:8T|8S|8R|8O)[\\/: ]([\\d.]+)/)||[])[1],2d:/77/.17(v),2z:/2z/.17(v),1d:/1d/.17(v)&&!/2z/.17(v),48:/48/.17(v)&&!/(8L|77)/.17(v)};L y=E.14.1d?"6H":"75";E.1s({8I:!E.14.1d||T.6F=="79",46:{"Q":"8F","8E":"1t","4g":y,75:y,6H:y,3d:"3d",1t:"1t",1A:"1A",2Y:"2Y",3k:"3k",8C:"8B",2p:"2p",8A:"8z",3T:"3T",6C:"6C",28:"28",12:"12"}});E.R({6B:J(a){K a.1a},8y:J(a){K E.4u(a,"1a")},8x:J(a){K E.2Z(a,2,"2B")},8v:J(a){K E.2Z(a,2,"4t")},8u:J(a){K E.4u(a,"2B")},8t:J(a){K E.4u(a,"4t")},8s:J(a){K E.5i(a.1a.1C,a)},8r:J(a){K E.5i(a.1C)},6z:J(a){K E.12(a,"8q")?a.8o||a.8n.T:E.2I(a.3p)}},J(c,d){E.1n[c]=J(b){L a=E.2c(6,d);7(b&&1o b=="25")a=E.3e(b,a);K 6.2F(E.57(a))}});E.R({6y:"3t",8m:"6q",3o:"6o",8l:"5a",8k:"6S"},J(c,b){E.1n[c]=J(){L a=18;K 6.R(J(){Q(L i=0,M=a.M;i<M;i++)E(a[i])[b](6)})}});E.R({8j:J(a){E.1J(6,a,"");7(6.15==1)6.52(a)},8i:J(a){E.1t.1b(6,a)},8h:J(a){E.1t.1V(6,a)},8g:J(a){E.1t[E.1t.3Y(6,a)?"1V":"1b"](6,a)},1V:J(a){7(!a||E.1E(a,[6]).r.M){E("*",6).1b(6).R(J(){E.16.1V(6);E.35(6)});7(6.1a)6.1a.34(6)}},4x:J(){E(">*",6).1V();2b(6.1C)6.34(6.1C)}},J(a,b){E.1n[a]=J(){K 6.R(b,18)}});E.R(["8f","5X"],J(i,c){L b=c.2h();E.1n[b]=J(a){K 6[0]==1e?E.14.2z&&T.1h["5e"+c]||E.14.2d&&1e["8e"+c]||T.6F=="79"&&T.1F["5e"+c]||T.1h["5e"+c]:6[0]==T?24.2f(24.2f(T.1h["5d"+c],T.1F["5d"+c]),24.2f(T.1h["5L"+c],T.1F["5L"+c])):a==10?(6.M?E.1j(6[0],b):V):6.1j(b,a.1k==4e?a:a+"2S")}});L C=E.14.2d&&4s(E.14.5K)<8c?"(?:[\\\\w*4r-]|\\\\\\\\.)":"(?:[\\\\w\\8b-\\8a*4r-]|\\\\\\\\.)",6v=1B 4q("^>\\\\s*("+C+"+)"),6u=1B 4q("^("+C+"+)(#)("+C+"+)"),6s=1B 4q("^([#.]?)("+C+"*)");E.1s({6r:{"":J(a,i,m){K m[2]=="*"||E.12(a,m[2])},"#":J(a,i,m){K a.4z("2w")==m[2]},":":{89:J(a,i,m){K i<m[3]-0},88:J(a,i,m){K i>m[3]-0},2Z:J(a,i,m){K m[3]-0==i},6Z:J(a,i,m){K m[3]-0==i},3j:J(a,i){K i==0},3J:J(a,i,m,r){K i==r.M-1},6n:J(a,i){K i%2==0},6l:J(a,i){K i%2},"3j-4p":J(a){K a.1a.3S("*")[0]==a},"3J-4p":J(a){K E.2Z(a.1a.5o,1,"4t")==a},"83-4p":J(a){K!E.2Z(a.1a.5o,2,"4t")},6B:J(a){K a.1C},4x:J(a){K!a.1C},82:J(a,i,m){K(a.6x||a.81||E(a).1u()||"").1f(m[3])>=0},4d:J(a){K"1Z"!=a.U&&E.1j(a,"19")!="2H"&&E.1j(a,"4U")!="1Z"},1Z:J(a){K"1Z"==a.U||E.1j(a,"19")=="2H"||E.1j(a,"4U")=="1Z"},80:J(a){K!a.2Y},2Y:J(a){K a.2Y},3k:J(a){K a.3k},2p:J(a){K a.2p||E.1J(a,"2p")},1u:J(a){K"1u"==a.U},5u:J(a){K"5u"==a.U},5t:J(a){K"5t"==a.U},59:J(a){K"59"==a.U},3I:J(a){K"3I"==a.U},58:J(a){K"58"==a.U},6j:J(a){K"6j"==a.U},6i:J(a){K"6i"==a.U},2G:J(a){K"2G"==a.U||E.12(a,"2G")},4D:J(a){K/4D|2k|6h|2G/i.17(a.12)},3Y:J(a,i,m){K E.2s(m[3],a).M},7X:J(a){K/h\\d/i.17(a.12)},7W:J(a){K E.3y(E.3G,J(b){K a==b.Y}).M}}},6g:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1B 4q("^([:.#]*)("+C+"+)")],3e:J(a,c,b){L d,2m=[];2b(a&&a!=d){d=a;L f=E.1E(a,c,b);a=f.t.1r(/^\\s*,\\s*/,"");2m=b?c=f.r:E.37(2m,f.r)}K 2m},2s:J(t,p){7(1o t!="25")K[t];7(p&&p.15!=1&&p.15!=9)K[];p=p||T;L d=[p],2r=[],3J,12;2b(t&&3J!=t){L r=[];3J=t;t=E.3g(t);L o=S;L g=6v;L m=g.2O(t);7(m){12=m[1].2E();Q(L i=0;d[i];i++)Q(L c=d[i].1C;c;c=c.2B)7(c.15==1&&(12=="*"||c.12.2E()==12))r.1g(c);d=r;t=t.1r(g,"");7(t.1f(" ")==0)6w;o=P}N{g=/^([>+~])\\s*(\\w*)/i;7((m=g.2O(t))!=V){r=[];L l={};12=m[2].2E();m=m[1];Q(L j=0,3f=d.M;j<3f;j++){L n=m=="~"||m=="+"?d[j].2B:d[j].1C;Q(;n;n=n.2B)7(n.15==1){L h=E.O(n);7(m=="~"&&l[h])1Q;7(!12||n.12.2E()==12){7(m=="~")l[h]=P;r.1g(n)}7(m=="+")1Q}}d=r;t=E.3g(t.1r(g,""));o=P}}7(t&&!o){7(!t.1f(",")){7(p==d[0])d.4l();2r=E.37(2r,d);r=d=[p];t=" "+t.6e(1,t.M)}N{L k=6u;L m=k.2O(t);7(m){m=[0,m[2],m[3],m[1]]}N{k=6s;m=k.2O(t)}m[2]=m[2].1r(/\\\\/g,"");L f=d[d.M-1];7(m[1]=="#"&&f&&f.5J&&!E.3E(f)){L q=f.5J(m[2]);7((E.14.1d||E.14.2z)&&q&&1o q.2w=="25"&&q.2w!=m[2])q=E(\'[@2w="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.12(q,m[3]))?[q]:[]}N{Q(L i=0;d[i];i++){L a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];7(a=="*"&&d[i].12.2h()=="3V")a="3m";r=E.37(r,d[i].3S(a))}7(m[1]==".")r=E.55(r,m[2]);7(m[1]=="#"){L e=[];Q(L i=0;r[i];i++)7(r[i].4z("2w")==m[2]){e=[r[i]];1Q}r=e}d=r}t=t.1r(k,"")}}7(t){L b=E.1E(t,r);d=r=b.r;t=E.3g(b.t)}}7(t)d=[];7(d&&p==d[0])d.4l();2r=E.37(2r,d);K 2r},55:J(r,m,a){m=" "+m+" ";L c=[];Q(L i=0;r[i];i++){L b=(" "+r[i].1t+" ").1f(m)>=0;7(!a&&b||a&&!b)c.1g(r[i])}K c},1E:J(t,r,h){L d;2b(t&&t!=d){d=t;L p=E.6g,m;Q(L i=0;p[i];i++){m=p[i].2O(t);7(m){t=t.7V(m[0].M);m[2]=m[2].1r(/\\\\/g,"");1Q}}7(!m)1Q;7(m[1]==":"&&m[2]=="56")r=G.17(m[3])?E.1E(m[3],r,P).r:E(r).56(m[3]);N 7(m[1]==".")r=E.55(r,m[2],h);N 7(m[1]=="["){L g=[],U=m[3];Q(L i=0,3f=r.M;i<3f;i++){L a=r[i],z=a[E.46[m[2]]||m[2]];7(z==V||/6O|3Q|2p/.17(m[2]))z=E.1J(a,m[2])||\'\';7((U==""&&!!z||U=="="&&z==m[5]||U=="!="&&z!=m[5]||U=="^="&&z&&!z.1f(m[5])||U=="$="&&z.6e(z.M-m[5].M)==m[5]||(U=="*="||U=="~=")&&z.1f(m[5])>=0)^h)g.1g(a)}r=g}N 7(m[1]==":"&&m[2]=="2Z-4p"){L e={},g=[],17=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2O(m[3]=="6n"&&"2n"||m[3]=="6l"&&"2n+1"||!/\\D/.17(m[3])&&"7U+"+m[3]||m[3]),3j=(17[1]+(17[2]||1))-0,d=17[3]-0;Q(L i=0,3f=r.M;i<3f;i++){L j=r[i],1a=j.1a,2w=E.O(1a);7(!e[2w]){L c=1;Q(L n=1a.1C;n;n=n.2B)7(n.15==1)n.4k=c++;e[2w]=P}L b=S;7(3j==0){7(j.4k==d)b=P}N 7((j.4k-d)%3j==0&&(j.4k-d)/3j>=0)b=P;7(b^h)g.1g(j)}r=g}N{L f=E.6r[m[1]];7(1o f=="3V")f=f[m[2]];7(1o f=="25")f=6c("S||J(a,i){K "+f+";}");r=E.3y(r,J(a,i){K f(a,i,m,r)},h)}}K{r:r,t:t}},4u:J(b,c){L d=[];L a=b[c];2b(a&&a!=T){7(a.15==1)d.1g(a);a=a[c]}K d},2Z:J(a,e,c,b){e=e||1;L d=0;Q(;a;a=a[c])7(a.15==1&&++d==e)1Q;K a},5i:J(n,a){L r=[];Q(;n;n=n.2B){7(n.15==1&&(!a||n!=a))r.1g(n)}K r}});E.16={1b:J(f,i,g,e){7(f.15==3||f.15==8)K;7(E.14.1d&&f.53!=10)f=1e;7(!g.2D)g.2D=6.2D++;7(e!=10){L h=g;g=J(){K h.1i(6,18)};g.O=e;g.2D=h.2D}L j=E.O(f,"2R")||E.O(f,"2R",{}),1v=E.O(f,"1v")||E.O(f,"1v",J(){L a;7(1o E=="10"||E.16.5f)K a;a=E.16.1v.1i(18.3R.Y,18);K a});1v.Y=f;E.R(i.23(/\\s+/),J(c,b){L a=b.23(".");b=a[0];g.U=a[1];L d=j[b];7(!d){d=j[b]={};7(!E.16.2y[b]||E.16.2y[b].4j.1P(f)===S){7(f.3F)f.3F(b,1v,S);N 7(f.6b)f.6b("4i"+b,1v)}}d[g.2D]=g;E.16.2a[b]=P});f=V},2D:1,2a:{},1V:J(e,h,f){7(e.15==3||e.15==8)K;L i=E.O(e,"2R"),29,4X;7(i){7(h==10||(1o h=="25"&&h.7T(0)=="."))Q(L g 1p i)6.1V(e,g+(h||""));N{7(h.U){f=h.2q;h=h.U}E.R(h.23(/\\s+/),J(b,a){L c=a.23(".");a=c[0];7(i[a]){7(f)2V i[a][f.2D];N Q(f 1p i[a])7(!c[1]||i[a][f].U==c[1])2V i[a][f];Q(29 1p i[a])1Q;7(!29){7(!E.16.2y[a]||E.16.2y[a].4h.1P(e)===S){7(e.67)e.67(a,E.O(e,"1v"),S);N 7(e.66)e.66("4i"+a,E.O(e,"1v"))}29=V;2V i[a]}}})}Q(29 1p i)1Q;7(!29){L d=E.O(e,"1v");7(d)d.Y=V;E.35(e,"2R");E.35(e,"1v")}}},1N:J(g,c,d,f,h){c=E.2I(c||[]);7(g.1f("!")>=0){g=g.2K(0,-1);L a=P}7(!d){7(6.2a[g])E("*").1b([1e,T]).1N(g,c)}N{7(d.15==3||d.15==8)K 10;L b,29,1n=E.1q(d[g]||V),16=!c[0]||!c[0].36;7(16)c.4J(6.4Z({U:g,2L:d}));c[0].U=g;7(a)c[0].65=P;7(E.1q(E.O(d,"1v")))b=E.O(d,"1v").1i(d,c);7(!1n&&d["4i"+g]&&d["4i"+g].1i(d,c)===S)b=S;7(16)c.4l();7(h&&E.1q(h)){29=h.1i(d,b==V?c:c.71(b));7(29!==10)b=29}7(1n&&f!==S&&b!==S&&!(E.12(d,\'a\')&&g=="4V")){6.5f=P;1S{d[g]()}1X(e){}}6.5f=S}K b},1v:J(c){L a;c=E.16.4Z(c||1e.16||{});L b=c.U.23(".");c.U=b[0];L f=E.O(6,"2R")&&E.O(6,"2R")[c.U],42=1M.2l.2K.1P(18,1);42.4J(c);Q(L j 1p f){L d=f[j];42[0].2q=d;42[0].O=d.O;7(!b[1]&&!c.65||d.U==b[1]){L e=d.1i(6,42);7(a!==S)a=e;7(e===S){c.36();c.44()}}}7(E.14.1d)c.2L=c.36=c.44=c.2q=c.O=V;K a},4Z:J(c){L a=c;c=E.1s({},a);c.36=J(){7(a.36)a.36();a.7S=S};c.44=J(){7(a.44)a.44();a.7R=P};7(!c.2L)c.2L=c.7Q||T;7(c.2L.15==3)c.2L=a.2L.1a;7(!c.4S&&c.5w)c.4S=c.5w==c.2L?c.7P:c.5w;7(c.64==V&&c.63!=V){L b=T.1F,1h=T.1h;c.64=c.63+(b&&b.2v||1h&&1h.2v||0)-(b.62||0);c.7N=c.7L+(b&&b.2x||1h&&1h.2x||0)-(b.60||0)}7(!c.3c&&((c.4f||c.4f===0)?c.4f:c.5Z))c.3c=c.4f||c.5Z;7(!c.7b&&c.5Y)c.7b=c.5Y;7(!c.3c&&c.2G)c.3c=(c.2G&1?1:(c.2G&2?3:(c.2G&4?2:0)));K c},2y:{21:{4j:J(){5M();K},4h:J(){K}},3C:{4j:J(){7(E.14.1d)K S;E(6).2j("4P",E.16.2y.3C.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4P",E.16.2y.3C.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3C";K E.16.1v.1i(6,18)}},3B:{4j:J(){7(E.14.1d)K S;E(6).2j("4O",E.16.2y.3B.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4O",E.16.2y.3B.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3B";K E.16.1v.1i(6,18)}}}};E.1n.1s({2j:J(c,a,b){K c=="4H"?6.2X(c,a,b):6.R(J(){E.16.1b(6,c,b||a,b&&a)})},2X:J(d,b,c){K 6.R(J(){E.16.1b(6,d,J(a){E(6).3w(a);K(c||b).1i(6,18)},c&&b)})},3w:J(a,b){K 6.R(J(){E.16.1V(6,a,b)})},1N:J(c,a,b){K 6.R(J(){E.16.1N(c,a,6,P,b)})},5n:J(c,a,b){7(6[0])K E.16.1N(c,a,6[0],S,b);K 10},2g:J(){L b=18;K 6.4V(J(a){6.4N=0==6.4N?1:0;a.36();K b[6.4N].1i(6,18)||S})},7D:J(a,b){K 6.2j(\'3C\',a).2j(\'3B\',b)},21:J(a){5M();7(E.2Q)a.1P(T,E);N E.3A.1g(J(){K a.1P(6,E)});K 6}});E.1s({2Q:S,3A:[],21:J(){7(!E.2Q){E.2Q=P;7(E.3A){E.R(E.3A,J(){6.1i(T)});E.3A=V}E(T).5n("21")}}});L x=S;J 5M(){7(x)K;x=P;7(T.3F&&!E.14.2z)T.3F("5W",E.21,S);7(E.14.1d&&1e==3b)(J(){7(E.2Q)K;1S{T.1F.7B("26")}1X(3a){3z(18.3R,0);K}E.21()})();7(E.14.2z)T.3F("5W",J(){7(E.2Q)K;Q(L i=0;i<T.4L.M;i++)7(T.4L[i].2Y){3z(18.3R,0);K}E.21()},S);7(E.14.2d){L a;(J(){7(E.2Q)K;7(T.39!="5V"&&T.39!="1y"){3z(18.3R,0);K}7(a===10)a=E("W, 7a[7A=7z]").M;7(T.4L.M!=a){3z(18.3R,0);K}E.21()})()}E.16.1b(1e,"3U",E.21)}E.R(("7y,7x,3U,7w,5d,4H,4V,7v,"+"7G,7u,7t,4P,4O,7s,2k,"+"58,7K,7q,7p,3a").23(","),J(i,b){E.1n[b]=J(a){K a?6.2j(b,a):6.1N(b)}});L I=J(a,c){L b=a.4S;2b(b&&b!=c)1S{b=b.1a}1X(3a){b=c}K b==c};E(1e).2j("4H",J(){E("*").1b(T).3w()});E.1n.1s({3U:J(g,d,c){7(E.1q(g))K 6.2j("3U",g);L e=g.1f(" ");7(e>=0){L i=g.2K(e,g.M);g=g.2K(0,e)}c=c||J(){};L f="4Q";7(d)7(E.1q(d)){c=d;d=V}N{d=E.3m(d);f="61"}L h=6;E.3P({1c:g,U:f,1H:"3q",O:d,1y:J(a,b){7(b=="1W"||b=="5U")h.3q(i?E("<1x/>").3t(a.4b.1r(/<1m(.|\\s)*?\\/1m>/g,"")).2s(i):a.4b);h.R(c,[a.4b,b,a])}});K 6},7n:J(){K E.3m(6.5T())},5T:J(){K 6.2c(J(){K E.12(6,"3u")?E.2I(6.7m):6}).1E(J(){K 6.31&&!6.2Y&&(6.3k||/2k|6h/i.17(6.12)||/1u|1Z|3I/i.17(6.U))}).2c(J(i,c){L b=E(6).5O();K b==V?V:b.1k==1M?E.2c(b,J(a,i){K{31:c.31,1A:a}}):{31:c.31,1A:b}}).22()}});E.R("5S,6d,5R,6D,5Q,6m".23(","),J(i,o){E.1n[o]=J(f){K 6.2j(o,f)}});L B=(1B 3v).3L();E.1s({22:J(d,b,a,c){7(E.1q(b)){a=b;b=V}K E.3P({U:"4Q",1c:d,O:b,1W:a,1H:c})},7l:J(b,a){K E.22(b,V,a,"1m")},7k:J(c,b,a){K E.22(c,b,a,"3i")},7i:J(d,b,a,c){7(E.1q(b)){a=b;b={}}K E.3P({U:"61",1c:d,O:b,1W:a,1H:c})},85:J(a){E.1s(E.4I,a)},4I:{2a:P,U:"4Q",2U:0,5P:"4o/x-7h-3u-7g",5N:P,3l:P,O:V,6p:V,3I:V,49:{3M:"4o/3M, 1u/3M",3q:"1u/3q",1m:"1u/4m, 4o/4m",3i:"4o/3i, 1u/4m",1u:"1u/a7",4G:"*/*"}},4F:{},3P:J(s){L f,2W=/=\\?(&|$)/g,1z,O;s=E.1s(P,s,E.1s(P,{},E.4I,s));7(s.O&&s.5N&&1o s.O!="25")s.O=E.3m(s.O);7(s.1H=="4E"){7(s.U.2h()=="22"){7(!s.1c.1D(2W))s.1c+=(s.1c.1D(/\\?/)?"&":"?")+(s.4E||"7d")+"=?"}N 7(!s.O||!s.O.1D(2W))s.O=(s.O?s.O+"&":"")+(s.4E||"7d")+"=?";s.1H="3i"}7(s.1H=="3i"&&(s.O&&s.O.1D(2W)||s.1c.1D(2W))){f="4E"+B++;7(s.O)s.O=(s.O+"").1r(2W,"="+f+"$1");s.1c=s.1c.1r(2W,"="+f+"$1");s.1H="1m";1e[f]=J(a){O=a;1W();1y();1e[f]=10;1S{2V 1e[f]}1X(e){}7(h)h.34(g)}}7(s.1H=="1m"&&s.1T==V)s.1T=S;7(s.1T===S&&s.U.2h()=="22"){L i=(1B 3v()).3L();L j=s.1c.1r(/(\\?|&)4r=.*?(&|$)/,"$a4="+i+"$2");s.1c=j+((j==s.1c)?(s.1c.1D(/\\?/)?"&":"?")+"4r="+i:"")}7(s.O&&s.U.2h()=="22"){s.1c+=(s.1c.1D(/\\?/)?"&":"?")+s.O;s.O=V}7(s.2a&&!E.5H++)E.16.1N("5S");7((!s.1c.1f("a3")||!s.1c.1f("//"))&&s.1H=="1m"&&s.U.2h()=="22"){L h=T.3S("6f")[0];L g=T.3s("1m");g.3Q=s.1c;7(s.7c)g.a2=s.7c;7(!f){L l=S;g.9Z=g.9Y=J(){7(!l&&(!6.39||6.39=="5V"||6.39=="1y")){l=P;1W();1y();h.34(g)}}}h.38(g);K 10}L m=S;L k=1e.78?1B 78("9X.9V"):1B 76();k.9T(s.U,s.1c,s.3l,s.6p,s.3I);1S{7(s.O)k.4C("9R-9Q",s.5P);7(s.5C)k.4C("9O-5A-9N",E.4F[s.1c]||"9L, 9K 9I 9H 5z:5z:5z 9F");k.4C("X-9C-9A","76");k.4C("9z",s.1H&&s.49[s.1H]?s.49[s.1H]+", */*":s.49.4G)}1X(e){}7(s.6Y)s.6Y(k);7(s.2a)E.16.1N("6m",[k,s]);L c=J(a){7(!m&&k&&(k.39==4||a=="2U")){m=P;7(d){6I(d);d=V}1z=a=="2U"&&"2U"||!E.6X(k)&&"3a"||s.5C&&E.6J(k,s.1c)&&"5U"||"1W";7(1z=="1W"){1S{O=E.6W(k,s.1H)}1X(e){1z="5x"}}7(1z=="1W"){L b;1S{b=k.5q("6U-5A")}1X(e){}7(s.5C&&b)E.4F[s.1c]=b;7(!f)1W()}N E.5v(s,k,1z);1y();7(s.3l)k=V}};7(s.3l){L d=53(c,13);7(s.2U>0)3z(J(){7(k){k.9t();7(!m)c("2U")}},s.2U)}1S{k.9s(s.O)}1X(e){E.5v(s,k,V,e)}7(!s.3l)c();J 1W(){7(s.1W)s.1W(O,1z);7(s.2a)E.16.1N("5Q",[k,s])}J 1y(){7(s.1y)s.1y(k,1z);7(s.2a)E.16.1N("5R",[k,s]);7(s.2a&&!--E.5H)E.16.1N("6d")}K k},5v:J(s,a,b,e){7(s.3a)s.3a(a,b,e);7(s.2a)E.16.1N("6D",[a,s,e])},5H:0,6X:J(r){1S{K!r.1z&&9q.9p=="59:"||(r.1z>=6T&&r.1z<9n)||r.1z==6R||r.1z==9l||E.14.2d&&r.1z==10}1X(e){}K S},6J:J(a,c){1S{L b=a.5q("6U-5A");K a.1z==6R||b==E.4F[c]||E.14.2d&&a.1z==10}1X(e){}K S},6W:J(r,b){L c=r.5q("9k-U");L d=b=="3M"||!b&&c&&c.1f("3M")>=0;L a=d?r.9j:r.4b;7(d&&a.1F.28=="5x")6Q"5x";7(b=="1m")E.5g(a);7(b=="3i")a=6c("("+a+")");K a},3m:J(a){L s=[];7(a.1k==1M||a.5h)E.R(a,J(){s.1g(3r(6.31)+"="+3r(6.1A))});N Q(L j 1p a)7(a[j]&&a[j].1k==1M)E.R(a[j],J(){s.1g(3r(j)+"="+3r(6))});N s.1g(3r(j)+"="+3r(a[j]));K s.6a("&").1r(/%20/g,"+")}});E.1n.1s({1G:J(c,b){K c?6.2e({1R:"1G",27:"1G",1w:"1G"},c,b):6.1E(":1Z").R(J(){6.W.19=6.5s||"";7(E.1j(6,"19")=="2H"){L a=E("<"+6.28+" />").6y("1h");6.W.19=a.1j("19");7(6.W.19=="2H")6.W.19="3D";a.1V()}}).3h()},1I:J(b,a){K b?6.2e({1R:"1I",27:"1I",1w:"1I"},b,a):6.1E(":4d").R(J(){6.5s=6.5s||E.1j(6,"19");6.W.19="2H"}).3h()},6N:E.1n.2g,2g:J(a,b){K E.1q(a)&&E.1q(b)?6.6N(a,b):a?6.2e({1R:"2g",27:"2g",1w:"2g"},a,b):6.R(J(){E(6)[E(6).3H(":1Z")?"1G":"1I"]()})},9f:J(b,a){K 6.2e({1R:"1G"},b,a)},9d:J(b,a){K 6.2e({1R:"1I"},b,a)},9c:J(b,a){K 6.2e({1R:"2g"},b,a)},9a:J(b,a){K 6.2e({1w:"1G"},b,a)},99:J(b,a){K 6.2e({1w:"1I"},b,a)},97:J(c,a,b){K 6.2e({1w:a},c,b)},2e:J(l,k,j,h){L i=E.6P(k,j,h);K 6[i.2P===S?"R":"2P"](J(){7(6.15!=1)K S;L g=E.1s({},i);L f=E(6).3H(":1Z"),4A=6;Q(L p 1p l){7(l[p]=="1I"&&f||l[p]=="1G"&&!f)K E.1q(g.1y)&&g.1y.1i(6);7(p=="1R"||p=="27"){g.19=E.1j(6,"19");g.32=6.W.32}}7(g.32!=V)6.W.32="1Z";g.40=E.1s({},l);E.R(l,J(c,a){L e=1B E.2t(4A,g,c);7(/2g|1G|1I/.17(a))e[a=="2g"?f?"1G":"1I":a](l);N{L b=a.3X().1D(/^([+-]=)?([\\d+-.]+)(.*)$/),1Y=e.2m(P)||0;7(b){L d=2M(b[2]),2A=b[3]||"2S";7(2A!="2S"){4A.W[c]=(d||1)+2A;1Y=((d||1)/e.2m(P))*1Y;4A.W[c]=1Y+2A}7(b[1])d=((b[1]=="-="?-1:1)*d)+1Y;e.45(1Y,d,2A)}N e.45(1Y,a,"")}});K P})},2P:J(a,b){7(E.1q(a)||(a&&a.1k==1M)){b=a;a="2t"}7(!a||(1o a=="25"&&!b))K A(6[0],a);K 6.R(J(){7(b.1k==1M)A(6,a,b);N{A(6,a).1g(b);7(A(6,a).M==1)b.1i(6)}})},94:J(b,c){L a=E.3G;7(b)6.2P([]);6.R(J(){Q(L i=a.M-1;i>=0;i--)7(a[i].Y==6){7(c)a[i](P);a.72(i,1)}});7(!c)6.5p();K 6}});L A=J(b,c,a){7(!b)K 10;c=c||"2t";L q=E.O(b,c+"2P");7(!q||a)q=E.O(b,c+"2P",a?E.2I(a):[]);K q};E.1n.5p=J(a){a=a||"2t";K 6.R(J(){L q=A(6,a);q.4l();7(q.M)q[0].1i(6)})};E.1s({6P:J(b,a,c){L d=b&&b.1k==92?b:{1y:c||!c&&a||E.1q(b)&&b,2u:b,3Z:c&&a||a&&a.1k!=91&&a};d.2u=(d.2u&&d.2u.1k==51?d.2u:{90:8Z,9D:6T}[d.2u])||8X;d.5y=d.1y;d.1y=J(){7(d.2P!==S)E(6).5p();7(E.1q(d.5y))d.5y.1i(6)};K d},3Z:{70:J(p,n,b,a){K b+a*p},5j:J(p,n,b,a){K((-24.8V(p*24.8U)/2)+0.5)*a+b}},3G:[],3W:V,2t:J(b,c,a){6.11=c;6.Y=b;6.1l=a;7(!c.47)c.47={}}});E.2t.2l={4y:J(){7(6.11.30)6.11.30.1i(6.Y,[6.2J,6]);(E.2t.30[6.1l]||E.2t.30.4G)(6);7(6.1l=="1R"||6.1l=="27")6.Y.W.19="3D"},2m:J(a){7(6.Y[6.1l]!=V&&6.Y.W[6.1l]==V)K 6.Y[6.1l];L r=2M(E.1j(6.Y,6.1l,a));K r&&r>-8Q?r:2M(E.2o(6.Y,6.1l))||0},45:J(c,b,d){6.5B=(1B 3v()).3L();6.1Y=c;6.3h=b;6.2A=d||6.2A||"2S";6.2J=6.1Y;6.4B=6.4w=0;6.4y();L e=6;J t(a){K e.30(a)}t.Y=6.Y;E.3G.1g(t);7(E.3W==V){E.3W=53(J(){L a=E.3G;Q(L i=0;i<a.M;i++)7(!a[i]())a.72(i--,1);7(!a.M){6I(E.3W);E.3W=V}},13)}},1G:J(){6.11.47[6.1l]=E.1J(6.Y.W,6.1l);6.11.1G=P;6.45(0,6.2m());7(6.1l=="27"||6.1l=="1R")6.Y.W[6.1l]="8N";E(6.Y).1G()},1I:J(){6.11.47[6.1l]=E.1J(6.Y.W,6.1l);6.11.1I=P;6.45(6.2m(),0)},30:J(a){L t=(1B 3v()).3L();7(a||t>6.11.2u+6.5B){6.2J=6.3h;6.4B=6.4w=1;6.4y();6.11.40[6.1l]=P;L b=P;Q(L i 1p 6.11.40)7(6.11.40[i]!==P)b=S;7(b){7(6.11.19!=V){6.Y.W.32=6.11.32;6.Y.W.19=6.11.19;7(E.1j(6.Y,"19")=="2H")6.Y.W.19="3D"}7(6.11.1I)6.Y.W.19="2H";7(6.11.1I||6.11.1G)Q(L p 1p 6.11.40)E.1J(6.Y.W,p,6.11.47[p])}7(b&&E.1q(6.11.1y))6.11.1y.1i(6.Y);K S}N{L n=t-6.5B;6.4w=n/6.11.2u;6.4B=E.3Z[6.11.3Z||(E.3Z.5j?"5j":"70")](6.4w,n,0,1,6.11.2u);6.2J=6.1Y+((6.3h-6.1Y)*6.4B);6.4y()}K P}};E.2t.30={2v:J(a){a.Y.2v=a.2J},2x:J(a){a.Y.2x=a.2J},1w:J(a){E.1J(a.Y.W,"1w",a.2J)},4G:J(a){a.Y.W[a.1l]=a.2J+a.2A}};E.1n.5L=J(){L b=0,3b=0,Y=6[0],5l;7(Y)8M(E.14){L d=Y.1a,41=Y,1K=Y.1K,1L=Y.2i,5D=2d&&4s(5K)<8J&&!/a1/i.17(v),2T=E.1j(Y,"43")=="2T";7(Y.6G){L c=Y.6G();1b(c.26+24.2f(1L.1F.2v,1L.1h.2v),c.3b+24.2f(1L.1F.2x,1L.1h.2x));1b(-1L.1F.62,-1L.1F.60)}N{1b(Y.5G,Y.5F);2b(1K){1b(1K.5G,1K.5F);7(48&&!/^t(8H|d|h)$/i.17(1K.28)||2d&&!5D)2N(1K);7(!2T&&E.1j(1K,"43")=="2T")2T=P;41=/^1h$/i.17(1K.28)?41:1K;1K=1K.1K}2b(d&&d.28&&!/^1h|3q$/i.17(d.28)){7(!/^8G|1O.*$/i.17(E.1j(d,"19")))1b(-d.2v,-d.2x);7(48&&E.1j(d,"32")!="4d")2N(d);d=d.1a}7((5D&&(2T||E.1j(41,"43")=="4W"))||(48&&E.1j(41,"43")!="4W"))1b(-1L.1h.5G,-1L.1h.5F);7(2T)1b(24.2f(1L.1F.2v,1L.1h.2v),24.2f(1L.1F.2x,1L.1h.2x))}5l={3b:3b,26:b}}J 2N(a){1b(E.2o(a,"a8",P),E.2o(a,"a9",P))}J 1b(l,t){b+=4s(l)||0;3b+=4s(t)||0}K 5l}})();',62,631,'||||||this|if||||||||||||||||||||||||||||||||||||||function|return|var|length|else|data|true|for|each|false|document|type|null|style||elem||undefined|options|nodeName||browser|nodeType|event|test|arguments|display|parentNode|add|url|msie|window|indexOf|push|body|apply|css|constructor|prop|script|fn|typeof|in|isFunction|replace|extend|className|text|handle|opacity|div|complete|status|value|new|firstChild|match|filter|documentElement|show|dataType|hide|attr|offsetParent|doc|Array|trigger|table|call|break|height|try|cache|tbody|remove|success|catch|start|hidden||ready|get|split|Math|string|left|width|tagName|ret|global|while|map|safari|animate|max|toggle|toLowerCase|ownerDocument|bind|select|prototype|cur||curCSS|selected|handler|done|find|fx|duration|scrollLeft|id|scrollTop|special|opera|unit|nextSibling|stack|guid|toUpperCase|pushStack|button|none|makeArray|now|slice|target|parseFloat|border|exec|queue|isReady|events|px|fixed|timeout|delete|jsre|one|disabled|nth|step|name|overflow|inArray|removeChild|removeData|preventDefault|merge|appendChild|readyState|error|top|which|innerHTML|multiFilter|rl|trim|end|json|first|checked|async|param|elems|insertBefore|childNodes|html|encodeURIComponent|createElement|append|form|Date|unbind|color|grep|setTimeout|readyList|mouseleave|mouseenter|block|isXMLDoc|addEventListener|timers|is|password|last|runtimeStyle|getTime|xml|jQuery|domManip|ajax|src|callee|getElementsByTagName|selectedIndex|load|object|timerId|toString|has|easing|curAnim|offsetChild|args|position|stopPropagation|custom|props|orig|mozilla|accepts|clean|responseText|defaultView|visible|String|charCode|float|teardown|on|setup|nodeIndex|shift|javascript|currentStyle|application|child|RegExp|_|parseInt|previousSibling|dir|tr|state|empty|update|getAttribute|self|pos|setRequestHeader|input|jsonp|lastModified|_default|unload|ajaxSettings|unshift|getComputedStyle|styleSheets|getPropertyValue|lastToggle|mouseout|mouseover|GET|andSelf|relatedTarget|init|visibility|click|absolute|index|container|fix|outline|Number|removeAttribute|setInterval|prevObject|classFilter|not|unique|submit|file|after|windowData|deep|scroll|client|triggered|globalEval|jquery|sibling|swing|clone|results|wrapAll|triggerHandler|lastChild|dequeue|getResponseHeader|createTextNode|oldblock|checkbox|radio|handleError|fromElement|parsererror|old|00|Modified|startTime|ifModified|safari2|getWH|offsetTop|offsetLeft|active|values|getElementById|version|offset|bindReady|processData|val|contentType|ajaxSuccess|ajaxComplete|ajaxStart|serializeArray|notmodified|loaded|DOMContentLoaded|Width|ctrlKey|keyCode|clientTop|POST|clientLeft|clientX|pageX|exclusive|detachEvent|removeEventListener|swap|cloneNode|join|attachEvent|eval|ajaxStop|substr|head|parse|textarea|reset|image|zoom|odd|ajaxSend|even|before|username|prepend|expr|quickClass|uuid|quickID|quickChild|continue|textContent|appendTo|contents|evalScript|parent|defaultValue|ajaxError|setArray|compatMode|getBoundingClientRect|styleFloat|clearInterval|httpNotModified|nodeValue|100|alpha|_toggle|href|speed|throw|304|replaceWith|200|Last|colgroup|httpData|httpSuccess|beforeSend|eq|linear|concat|splice|fieldset|multiple|cssFloat|XMLHttpRequest|webkit|ActiveXObject|CSS1Compat|link|metaKey|scriptCharset|callback|col|pixelLeft|urlencoded|www|post|hasClass|getJSON|getScript|elements|serialize|black|keyup|keypress|solid|change|mousemove|mouseup|dblclick|resize|focus|blur|stylesheet|rel|doScroll|round|hover|padding|offsetHeight|mousedown|offsetWidth|Bottom|Top|keydown|clientY|Right|pageY|Left|toElement|srcElement|cancelBubble|returnValue|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|ajaxSetup|font|size|gt|lt|uFFFF|u0128|417|Boolean|inner|Height|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|contentWindow|contentDocument|wrap|iframe|children|siblings|prevAll|nextAll|prev|wrapInner|next|parents|maxLength|maxlength|readOnly|readonly|reverse|class|htmlFor|inline|able|boxModel|522|setData|compatible|with|1px|ie|getData|10000|ra|it|rv|PI|cos|userAgent|400|navigator|600|slow|Function|Object|array|stop|ig|NaN|fadeTo|option|fadeOut|fadeIn|setAttribute|slideToggle|slideUp|changed|slideDown|be|can|property|responseXML|content|1223|getAttributeNode|300|method|protocol|location|action|send|abort|cssText|th|td|cap|specified|Accept|With|colg|Requested|fast|tfoot|GMT|thead|1970|Jan|attributes|01|Thu|leg|Since|If|opt|Type|Content|embed|open|area|XMLHTTP|hr|Microsoft|onreadystatechange|onload|meta|adobeair|charset|http|1_|img|br|plain|borderLeftWidth|borderTopWidth|abbr'.split('|'),0,{}));
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(4($){$.R($.7,{3:4(c,b,d){9 e=2,q;5($.O(c))d=b,b=c,c=z;$.h($.3.j,4(i,a){5(e.8==a.8&&e.g==a.g&&c==a.m&&(!b||b.$6==a.7.$6)&&(!d||d.$6==a.o.$6))l(q=a)&&v});q=q||Y $.3(2.8,2.g,c,b,d);q.u=v;$.3.s(q.F);l 2},T:4(c,b,d){9 e=2;5($.O(c))d=b,b=c,c=z;$.h($.3.j,4(i,a){5(e.8==a.8&&e.g==a.g&&(!c||c==a.m)&&(!b||b.$6==a.7.$6)&&(!d||d.$6==a.o.$6)&&!2.u)$.3.y(a.F)});l 2}});$.3=4(e,c,a,b,d){2.8=e;2.g=c||S;2.m=a;2.7=b;2.o=d;2.t=[];2.u=v;2.F=$.3.j.K(2)-1;b.$6=b.$6||$.3.I++;5(d)d.$6=d.$6||$.3.I++;l 2};$.3.p={y:4(){9 b=2;5(2.m)2.t.16(2.m,2.7);E 5(2.o)2.t.h(4(i,a){b.o.x(a)});2.t=[];2.u=Q},s:4(){5(2.u)l;9 b=2;9 c=2.t,w=$(2.8,2.g),H=w.11(c);2.t=w;5(2.m){H.10(2.m,2.7);5(c.C>0)$.h(c,4(i,a){5($.B(a,w)<0)$.Z.P(a,b.m,b.7)})}E{H.h(4(){b.7.x(2)});5(2.o&&c.C>0)$.h(c,4(i,a){5($.B(a,w)<0)b.o.x(a)})}}};$.R($.3,{I:0,j:[],k:[],A:v,D:X,N:4(){5($.3.A&&$.3.k.C){9 a=$.3.k.C;W(a--)$.3.j[$.3.k.V()].s()}},U:4(){$.3.A=v},M:4(){$.3.A=Q;$.3.s()},L:4(){$.h(G,4(i,n){5(!$.7[n])l;9 a=$.7[n];$.7[n]=4(){9 r=a.x(2,G);$.3.s();l r}})},s:4(b){5(b!=z){5($.B(b,$.3.k)<0)$.3.k.K(b)}E $.h($.3.j,4(a){5($.B(a,$.3.k)<0)$.3.k.K(a)});5($.3.D)1j($.3.D);$.3.D=1i($.3.N,1h)},y:4(b){5(b!=z)$.3.j[b].y();E $.h($.3.j,4(a){$.3.j[a].y()})}});$.3.L(\'1g\',\'1f\',\'1e\',\'1b\',\'1a\',\'19\',\'18\',\'17\',\'1c\',\'15\',\'1d\',\'P\');$(4(){$.3.M()});9 f=$.p.J;$.p.J=4(a,c){9 r=f.x(2,G);5(a&&a.8)r.g=a.g,r.8=a.8;5(14 a==\'13\')r.g=c||S,r.8=a;l r};$.p.J.p=$.p})(12);',62,82,'||this|livequery|function|if|lqguid|fn|selector|var|||||||context|each||queries|queue|return|type||fn2|prototype|||run|elements|stopped|false|els|apply|stop|undefined|running|inArray|length|timeout|else|id|arguments|nEls|guid|init|push|registerPlugin|play|checkQueue|isFunction|remove|true|extend|document|expire|pause|shift|while|null|new|event|bind|not|jQuery|string|typeof|toggleClass|unbind|addClass|removeAttr|attr|wrap|before|removeClass|empty|after|prepend|append|20|setTimeout|clearTimeout'.split('|'),0,{}));
(function($) {
$.fn.window= function(event, callback ,settings){
settings = jQuery.extend({
width: 500,
height: 500,
prefix: 'frame',
beforeShow: function(){return true},
beforeClose: function(){}
},settings);
function _init()
{
if (settings.beforeShow())
{
$(document.body).append('<div id="'+settings.prefix+'_window" style="width: 100%; height: 100%; position: fixed; top: 0px;"></div><div style="width: '+settings.width+'px; height: '+settings.height+'px;" id="'+settings.prefix+'_content" class="jquery-window"><div class="bar"><div class="close"></div></div><div id="'+settings.prefix+'_result" style="width: '+settings.width+'px; height: '+settings.height+'px; padding:10px;"><div class="loader-window"></div></div></div>');
var real_width= settings.width-parseInt($('#'+settings.prefix+'_result').css('paddingRight'))-parseInt($('#'+settings.prefix+'_result').css('paddingLeft'))-parseInt($('#'+settings.prefix+'_result').css('borderRightWidth'))-parseInt($('#'+settings.prefix+'_result').css('borderLeftWidth'));
$('#'+settings.prefix+'_result').width(real_width);
$('#'+settings.prefix+'_content').center();
$('#'+settings.prefix+'_window').click(function(){
$(this).remove();
$('#'+settings.prefix+'_content').remove();
settings.beforeClose();
});
$(document).keypress(function(e){
if(e.keyCode==27)
$('#'+settings.prefix+'_window').trigger('click');
});
$('#'+settings.prefix+'_content .bar').click(function(){
$('#'+settings.prefix+'_window').trigger('click');
});
if (!callback($('#'+settings.prefix+'_result'), this))
return false;
}
}
eval('this.unbind(event).'+event+'(_init);');
};
})(jQuery);
jQuery.fn.center = function() {
return this.each(function() {
var t = jQuery(this);
t.css({position: 'fixed'});
try
{
var w = t.width(), 
h = t.height(), 
lrPadding = parseInt(t.css('paddingLeft'), 10) + parseInt(t.css('paddingRight'), 10), 
lrBorder = parseInt(t.css('borderLeftWidth'), 10) + parseInt(t.css('borderRightWidth'), 10), 
tbPadding = parseInt(t.css('paddingTop'), 10) + parseInt(t.css('paddingBottom'), 10), 
tbBorder = parseInt(t.css('borderTopWidth'), 10) + parseInt(t.css('borderBottomWidth'), 10);
if (!lrBorder) lrBorder=0;
if (!tbBorder) tbBorder=0;
var leftMargin = (w + lrPadding + lrBorder) / 2;
var topMargin = (h + tbPadding + tbBorder) / 2;
t.css({
position: 'fixed', 
left: '50%', 
top: '50%', 
marginLeft: '-' +leftMargin +'px', 
marginTop: '-' +topMargin +'px', 
zIndex: '99'
});
}
catch(e){}
 
});
};
if(!jQuery.fn.outerWidth) {
jQuery.fn.outerWidth = function() {
var t = jQuery(this[0]), 
w = t.width(), 
lrPadding = parseInt(t.css('paddingLeft'), 10) + parseInt(t.css('paddingRight'), 10), 
lrBorder = parseInt(t.css('borderLeftWidth'), 10) + parseInt(t.css('borderRightWidth'), 10);
return w + lrPadding + lrBorder;
};
}
if(!jQuery.fn.outerHeight) {
jQuery.fn.outerHeight = function() {
return this.each(function() {
var t = jQuery(this)[0], 
h = t.height(), 
tbPadding = parseInt(t.css('paddingTop'), 10) + parseInt(t.css('paddingBottom'), 10), 
tbBorder = parseInt(t.css('borderTopWidth'), 10) + parseInt(t.css('borderBottomWidth'), 10);
return h + tbPadding + tbBorder;
});
};
}
;
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(8($){j e={},9,m,B,A=$.2u.2g&&/29\\s(5\\.5|6\\.)/.1M(1H.2t),M=12;$.k={w:12,1h:{Z:25,r:12,1d:19,X:"",G:15,E:15,16:"k"},2s:8(){$.k.w=!$.k.w}};$.N.1v({k:8(a){a=$.1v({},$.k.1h,a);1q(a);g 2.F(8(){$.1j(2,"k",a);2.11=e.3.n("1g");2.13=2.m;$(2).24("m");2.22=""}).21(1e).1U(q).1S(q)},H:A?8(){g 2.F(8(){j b=$(2).n(\'Y\');4(b.1J(/^o\\(["\']?(.*\\.1I)["\']?\\)$/i)){b=1F.$1;$(2).n({\'Y\':\'1D\',\'1B\':"2r:2q.2m.2l(2j=19, 2i=2h, 1p=\'"+b+"\')"}).F(8(){j a=$(2).n(\'1o\');4(a!=\'2f\'&&a!=\'1u\')$(2).n(\'1o\',\'1u\')})}})}:8(){g 2},1l:A?8(){g 2.F(8(){$(2).n({\'1B\':\'\',Y:\'\'})})}:8(){g 2},1x:8(){g 2.F(8(){$(2)[$(2).D()?"l":"q"]()})},o:8(){g 2.1k(\'28\')||2.1k(\'1p\')}});8 1q(a){4(e.3)g;e.3=$(\'<t 16="\'+a.16+\'"><10></10><t 1i="f"></t><t 1i="o"></t></t>\').27(K.f).q();4($.N.L)e.3.L();e.m=$(\'10\',e.3);e.f=$(\'t.f\',e.3);e.o=$(\'t.o\',e.3)}8 7(a){g $.1j(a,"k")}8 1f(a){4(7(2).Z)B=26(l,7(2).Z);p l();M=!!7(2).M;$(K.f).23(\'W\',u);u(a)}8 1e(){4($.k.w||2==9||(!2.13&&!7(2).U))g;9=2;m=2.13;4(7(2).U){e.m.q();j a=7(2).U.1Z(2);4(a.1Y||a.1V){e.f.1c().T(a)}p{e.f.D(a)}e.f.l()}p 4(7(2).18){j b=m.1T(7(2).18);e.m.D(b.1R()).l();e.f.1c();1Q(j i=0,R;(R=b[i]);i++){4(i>0)e.f.T("<1P/>");e.f.T(R)}e.f.1x()}p{e.m.D(m).l();e.f.q()}4(7(2).1d&&$(2).o())e.o.D($(2).o().1O(\'1N://\',\'\')).l();p e.o.q();e.3.P(7(2).X);4(7(2).H)e.3.H();1f.1L(2,1K)}8 l(){B=S;4((!A||!$.N.L)&&7(9).r){4(e.3.I(":17"))e.3.Q().l().O(7(9).r,9.11);p e.3.I(\':1a\')?e.3.O(7(9).r,9.11):e.3.1G(7(9).r)}p{e.3.l()}u()}8 u(c){4($.k.w)g;4(c&&c.1W.1X=="1E"){g}4(!M&&e.3.I(":1a")){$(K.f).1b(\'W\',u)}4(9==S){$(K.f).1b(\'W\',u);g}e.3.V("z-14").V("z-1A");j b=e.3[0].1z;j a=e.3[0].1y;4(c){b=c.2o+7(9).E;a=c.2n+7(9).G;j d=\'1w\';4(7(9).2k){d=$(C).1r()-b;b=\'1w\'}e.3.n({E:b,14:d,G:a})}j v=z(),h=e.3[0];4(v.x+v.1s<h.1z+h.1n){b-=h.1n+20+7(9).E;e.3.n({E:b+\'1C\'}).P("z-14")}4(v.y+v.1t<h.1y+h.1m){a-=h.1m+20+7(9).G;e.3.n({G:a+\'1C\'}).P("z-1A")}}8 z(){g{x:$(C).2e(),y:$(C).2d(),1s:$(C).1r(),1t:$(C).2p()}}8 q(a){4($.k.w)g;4(B)2c(B);9=S;j b=7(2);8 J(){e.3.V(b.X).q().n("1g","")}4((!A||!$.N.L)&&b.r){4(e.3.I(\':17\'))e.3.Q().O(b.r,0,J);p e.3.Q().2b(b.r,J)}p J();4(7(2).H)e.3.1l()}})(2a);',62,155,'||this|parent|if|||settings|function|current||||||body|return|||var|tooltip|show|title|css|url|else|hide|fade||div|update||blocked|||viewport|IE|tID|window|html|left|each|top|fixPNG|is|complete|document|bgiframe|track|fn|fadeTo|addClass|stop|part|null|append|bodyHandler|removeClass|mousemove|extraClass|backgroundImage|delay|h3|tOpacity|false|tooltipText|right||id|animated|showBody|true|visible|unbind|empty|showURL|save|handle|opacity|defaults|class|data|attr|unfixPNG|offsetHeight|offsetWidth|position|src|createHelper|width|cx|cy|relative|extend|auto|hideWhenEmpty|offsetTop|offsetLeft|bottom|filter|px|none|OPTION|RegExp|fadeIn|navigator|png|match|arguments|apply|test|http|replace|br|for|shift|click|split|mouseout|jquery|target|tagName|nodeType|call||mouseover|alt|bind|removeAttr|200|setTimeout|appendTo|href|MSIE|jQuery|fadeOut|clearTimeout|scrollTop|scrollLeft|absolute|msie|crop|sizingMethod|enabled|positionLeft|AlphaImageLoader|Microsoft|pageY|pageX|height|DXImageTransform|progid|block|userAgent|browser'.split('|'),0,{}));
(function($) {
$.fn.lightBox = function(settings) {
settings = jQuery.extend({
overlayBgColor: '#000',
overlayOpacity:0.8,
fixedNavigation:false,
imageLoading:'/layouts/img/lightbox-ico-loading.gif',
imageBtnPrev:'/layouts/img/lightbox-btn-prev.gif',
imageBtnNext:'/layouts/img/lightbox-btn-next.gif',
imageBtnClose:'/layouts/img/lightbox-btn-close.gif',
imageBlank:'/layouts/img/lightbox-blank.gif',
containerBorderSize:10,
containerResizeSpeed:400,
txtImage:'Image',
txtOf:'of',
keyToClose:'c',
keyToPrev:'p',
keyToNext:'n',
imageArray:[],
activeImage:0
},settings);
var jQueryMatchedObj = this;
function _initialize() {
_start(this,jQueryMatchedObj); 
return false; 
}
function _start(objClicked,jQueryMatchedObj) {
$('embed, object, select').css({ 'visibility' : 'hidden' });
_set_interface();
settings.imageArray.length = 0;
settings.activeImage = 0;
if ( jQueryMatchedObj.length == 1 ) {
settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title'),jQueryMatchedObj[0].getAttribute('rel')));
} else {
for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {
settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title'),jQueryMatchedObj[i].getAttribute('rel')));
}
}
while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) {
settings.activeImage++;
}
_set_image_to_view();
}
function _set_interface() 
{
$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div><div style="clear:both"></div></div></div></div>');
var arrPageSizes = ___getPageSize();
$('#jquery-overlay').css({
backgroundColor:settings.overlayBgColor,
opacity:settings.overlayOpacity,
width:arrPageSizes[0],
height:arrPageSizes[1]
}).fadeIn();
var arrPageScroll = ___getPageScroll();
$('#jquery-lightbox').css({
top:arrPageScroll[1] + (arrPageSizes[3] / 10),
left:arrPageScroll[0]
}).show();
$('#jquery-overlay,#jquery-lightbox').click(function() {
_finish();
});
$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {
_finish();
return false;
});
$(window).resize(function() {
var arrPageSizes = ___getPageSize();
$('#jquery-overlay').css({
width:arrPageSizes[0],
height:arrPageSizes[1]
});
var arrPageScroll = ___getPageScroll();
$('#jquery-lightbox').css({
top:arrPageScroll[1] + (arrPageSizes[3] / 10),
left:arrPageScroll[0]
});
});
}
function _set_image_to_view() {
$('#lightbox-loading').show();
if ( settings.fixedNavigation ) {
$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
} else {
$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
}
var objImagePreloader = new Image();
objImagePreloader.onload = function() {
$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);
_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);
objImagePreloader.onload=function(){};
};
objImagePreloader.src = settings.imageArray[settings.activeImage][0];
};
function _resize_container_image_box(intImageWidth,intImageHeight) {
var intCurrentWidth = $('#lightbox-container-image-box').width();
var intCurrentHeight = $('#lightbox-container-image-box').height();
var intWidth = (intImageWidth + (settings.containerBorderSize * 2));
var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); 
var intDiffW = intCurrentWidth - intWidth;
var intDiffH = intCurrentHeight - intHeight;
$('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); });
if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) {
if ( $.browser.msie ) {
___pause(250);
} else {
___pause(100);
}
} 
$('#lightbox-container-image-data-box').css({ width: intImageWidth });
$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) });
};
function _show_image() {
$('#lightbox-loading').hide();
$('#lightbox-image').fadeIn(function() {
_show_image_data();
_set_navigation();
});
_preload_neighbor_images();
};
function _show_image_data() {
$('#lightbox-container-image-data-box').slideDown('fast');
$('#lightbox-image-details-caption').hide();
if ( settings.imageArray[settings.activeImage][1] ) 
{
$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();
}
if ( settings.imageArray.length > 1 ) {
$('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();
}
}
function _set_navigation() {
$('#lightbox-nav').show();
$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
if ( settings.activeImage != 0 ) {
if ( settings.fixedNavigation ) {
$('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' })
.unbind()
.bind('click',function() {
settings.activeImage = settings.activeImage - 1;
_set_image_to_view();
return false;
});
} else {
$('#lightbox-nav-btnPrev').unbind().hover(function() {
$(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' });
},function() {
$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
}).show().bind('click',function() {
settings.activeImage = settings.activeImage - 1;
_set_image_to_view();
return false;
});
}
}
if ( settings.activeImage != ( settings.imageArray.length -1 ) ) {
if ( settings.fixedNavigation ) {
$('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' })
.unbind()
.bind('click',function() {
settings.activeImage = settings.activeImage + 1;
_set_image_to_view();
return false;
});
} else {
$('#lightbox-nav-btnNext').unbind().hover(function() {
$(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' });
},function() {
$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
}).show().bind('click',function() {
settings.activeImage = settings.activeImage + 1;
_set_image_to_view();
return false;
});
}
}
_enable_keyboard_navigation();
}
function _enable_keyboard_navigation() {
$(document).keydown(function(objEvent) {
_keyboard_action(objEvent);
});
}
function _disable_keyboard_navigation() {
$(document).unbind();
}
function _keyboard_action(objEvent) {
if ( objEvent == null ) {
keycode = event.keyCode;
escapeKey = 27;
} else {
keycode = objEvent.keyCode;
escapeKey = objEvent.DOM_VK_ESCAPE;
}
key = String.fromCharCode(keycode).toLowerCase();
if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) {
_finish();
}
if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) {
if ( settings.activeImage != 0 ) {
settings.activeImage = settings.activeImage - 1;
_set_image_to_view();
_disable_keyboard_navigation();
}
}
if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) {
if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) {
settings.activeImage = settings.activeImage + 1;
_set_image_to_view();
_disable_keyboard_navigation();
}
}
}
function _preload_neighbor_images() {
if ( (settings.imageArray.length -1) > settings.activeImage ) {
objNext = new Image();
objNext.src = settings.imageArray[settings.activeImage + 1][0];
}
if ( settings.activeImage > 0 ) {
objPrev = new Image();
objPrev.src = settings.imageArray[settings.activeImage -1][0];
}
}
function _finish() {
$('#jquery-lightbox').remove();
$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });
$('embed, object, select').css({ 'visibility' : 'visible' });
}
function ___getPageSize() {
var xScroll, yScroll;
if (window.innerHeight && window.scrollMaxY) {
xScroll = window.innerWidth + window.scrollMaxX;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){ 
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else { 
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}
var windowWidth, windowHeight;
if (self.innerHeight) {
if(document.documentElement.clientWidth){
windowWidth = document.documentElement.clientWidth; 
} else {
windowWidth = self.innerWidth;
}
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) {
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) { 
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
}
if(yScroll < windowHeight){
pageHeight = windowHeight;
} else { 
pageHeight = yScroll;
}
if(xScroll < windowWidth){
pageWidth = xScroll;
} else {
pageWidth = windowWidth;
}
arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
return arrayPageSize;
};
function ___getPageScroll() {
var xScroll, yScroll;
if (self.pageYOffset) {
yScroll = self.pageYOffset;
xScroll = self.pageXOffset;
} else if (document.documentElement && document.documentElement.scrollTop) {
yScroll = document.documentElement.scrollTop;
xScroll = document.documentElement.scrollLeft;
} else if (document.body) {
yScroll = document.body.scrollTop;
xScroll = document.body.scrollLeft;
}
arrayPageScroll = new Array(xScroll,yScroll);
return arrayPageScroll;
};
 function ___pause(ms) {
var date = new Date(); 
curDate = null;
do { var curDate = new Date(); }
while ( curDate - date < ms);
 };
return this.unbind('click').click(_initialize);
};
})(jQuery); 
;
$(document).ready(function(){
try {
$('a[@rel=lightbox,advertisment]').lightBox();
}
catch(e){}
try {
$('a[@rel=lightbox,]').lightBox();
}
catch(e){}
});
;

var isIE= (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function ControlVersion()
{
var version;
var axo;
var e;
try {
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
version = axo.GetVariable("$version");
} catch (e) {
}
if (!version)
{
try {
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
version = "WIN 6,0,21,0";
axo.AllowScriptAccess = "always";
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = "WIN 3,0,18,0";
} catch (e) {
}
}
if (!version)
{
try {
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
version = "WIN 2,0,0,11";
} catch (e) {
version = -1;
}
}
return version;
}
function GetSwfVer(){
var flashVer = -1;
if (navigator.plugins != null && navigator.plugins.length > 0) {
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
var descArray = flashDescription.split(" ");
var tempArrayMajor = descArray[2].split(".");
var versionMajor = tempArrayMajor[0];
var versionMinor = tempArrayMajor[1];
var versionRevision = descArray[3];
if (versionRevision == "") {
versionRevision = descArray[4];
}
if (versionRevision[0] == "d") {
versionRevision = versionRevision.substring(1);
} else if (versionRevision[0] == "r") {
versionRevision = versionRevision.substring(1);
if (versionRevision.indexOf("d") > 0) {
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
}
}
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
}
}
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
else if ( isIE && isWin && !isOpera ) {
flashVer = ControlVersion();
}
return flashVer;
}
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
versionStr = GetSwfVer();
if (versionStr == -1 ) {
return false;
} else if (versionStr != 0) {
if(isIE && isWin && !isOpera) {
tempArray = versionStr.split(" "); 
tempString= tempArray[1];
versionArray= tempString.split(",");
} else {
versionArray= versionStr.split(".");
}
var versionMajor= versionArray[0];
var versionMinor= versionArray[1];
var versionRevision = versionArray[2];
if (versionMajor > parseFloat(reqMajorVer)) {
return true;
} else if (versionMajor == parseFloat(reqMajorVer)) {
if (versionMinor > parseFloat(reqMinorVer))
return true;
else if (versionMinor == parseFloat(reqMinorVer)) {
if (versionRevision >= parseFloat(reqRevision))
return true;
}
}
return false;
}
}
function AC_AddExtension(src, ext)
{
if (src.indexOf('?') != -1)
return src.replace(/\?/, ext+'?'); 
else
return src + ext;
}
function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
var str = '';
if (isIE && isWin && !isOpera)
{
str += '<object ';
for (var i in objAttrs)
{
str += i + '="' + objAttrs[i] + '" ';
}
str += '>';
for (var i in params)
{
str += '<param name="' + i + '" value="' + params[i] + '" /> ';
}
str += '</object>';
}
else
{
str += '<embed ';
for (var i in embedAttrs)
{
str += i + '="' + embedAttrs[i] + '" ';
}
str += '> </embed>';
}
document.write(str);
}
function AC_FL_RunContent(){
var ret = 
AC_GetArgs
(arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
 , "application/x-shockwave-flash"
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_SW_RunContent(){
var ret = 
AC_GetArgs
(arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
 , null
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
var ret = new Object();
ret.embedAttrs = new Object();
ret.params = new Object();
ret.objAttrs = new Object();
for (var i=0; i < args.length; i=i+2){
var currArg = args[i].toLowerCase();
switch (currArg){
case "classid":
break;
case "pluginspage":
ret.embedAttrs[args[i]] = args[i+1];
break;
case "src":
case "movie":
args[i+1] = AC_AddExtension(args[i+1], ext);
ret.embedAttrs["src"] = args[i+1];
ret.params[srcParamName] = args[i+1];
break;
case "onafterupdate":
case "onbeforeupdate":
case "onblur":
case "oncellchange":
case "onclick":
case "ondblClick":
case "ondrag":
case "ondragend":
case "ondragenter":
case "ondragleave":
case "ondragover":
case "ondrop":
case "onfinish":
case "onfocus":
case "onhelp":
case "onmousedown":
case "onmouseup":
case "onmouseover":
case "onmousemove":
case "onmouseout":
case "onkeypress":
case "onkeydown":
case "onkeyup":
case "onload":
case "onlosecapture":
case "onpropertychange":
case "onreadystatechange":
case "onrowsdelete":
case "onrowenter":
case "onrowexit":
case "onrowsinserted":
case "onstart":
case "onscroll":
case "onbeforeeditfocus":
case "onactivate":
case "onbeforedeactivate":
case "ondeactivate":
case "type":
case "codebase":
case "id":
ret.objAttrs[args[i]] = args[i+1];
break;
case "width":
case "height":
case "align":
case "vspace": 
case "hspace":
case "class":
case "title":
case "accesskey":
case "name":
case "tabindex":
ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
break;
default:
ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
}
}
ret.objAttrs["classid"] = classid;
if (mimeType) ret.embedAttrs["type"] = mimeType;
return ret;
}
;
 
(function($) {
function Datepicker() {
this.debug = false; 
this._nextId = 0;
this._inst = []; 
this._curInst = null; 
this._disabledInputs = []; 
this._datepickerShowing = false; 
this._inDialog = false; 
this.regional = []; 
this.regional[''] = { 
clearText: 'Clear', 
clearStatus: 'Erase the current date', 
closeText: 'Close', 
closeStatus: 'Close without change', 
prevText: '&#x3c;Prev', 
prevStatus: 'Show the previous month', 
nextText: 'Next&#x3e;', 
nextStatus: 'Show the next month', 
currentText: 'Today', 
currentStatus: 'Show the current month', 
monthNames: ['January','February','March','April','May','June',
'July','August','September','October','November','December'], 
monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 
monthStatus: 'Show a different month', 
yearStatus: 'Show a different year', 
weekHeader: 'Wk', 
weekStatus: 'Week of the year', 
dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], 
dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 
dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], 
dayStatus: 'Set DD as first week day', 
dateStatus: 'Select DD, M d', 
dateFormat: 'mm/dd/yy', 
firstDay: 0, 
initStatus: 'Select a date', 
isRTL: false 
};
this._defaults = { 
showOn: 'focus', 
showAnim: 'show', 
defaultDate: null, 
appendText: '', 
buttonText: '...', 
buttonImage: '', 
buttonImageOnly: false, 
closeAtTop: true, 
mandatory: false, 
hideIfNoPrevNext: false, 
changeMonth: true, 
changeYear: true, 
yearRange: '-10:+10', 
changeFirstDay: true, 
showOtherMonths: false, 
showWeeks: false, 
calculateWeek: this.iso8601Week, 
shortYearCutoff: '+10', 
showStatus: false, 
statusForDate: this.dateStatus, 
minDate: null, 
maxDate: null, 
speed: 'normal', 
beforeShowDay: null, 
beforeShow: null, 
onSelect: null, 
onClose: null, 
numberOfMonths: 1, 
stepMonths: 1, 
rangeSelect: false, 
rangeSeparator: ' - ' 
};
$.extend(this._defaults, this.regional['']);
this._datepickerDiv = $('<div id="datepicker_div"></div>');
}
$.extend(Datepicker.prototype, {
markerClassName: 'hasDatepicker',
log: function () {
if (this.debug) {
console.log.apply('', arguments);
}
},
_register: function(inst) {
var id = this._nextId++;
this._inst[id] = inst;
return id;
},
_getInst: function(id) {
return this._inst[id] || id;
},
setDefaults: function(settings) {
extendRemove(this._defaults, settings || {});
return this;
},
_attachDatepicker: function(target, settings) {
var inlineSettings = null;
for (attrName in this._defaults) {
var attrValue = target.getAttribute('date:' + attrName);
if (attrValue) {
inlineSettings = inlineSettings || {};
try {
inlineSettings[attrName] = eval(attrValue);
}
catch (err) {
inlineSettings[attrName] = attrValue;
}
}
}
var nodeName = target.nodeName.toLowerCase();
if (nodeName == 'input') {
var instSettings = (inlineSettings ? $.extend($.extend({}, settings || {}),
inlineSettings || {}) : settings); 
var inst = (inst && !inlineSettings ? inst :
new DatepickerInstance(instSettings, false));
this._connectDatepicker(target, inst);
} 
else if (nodeName == 'div' || nodeName == 'span') {
var instSettings = $.extend($.extend({}, settings || {}),
inlineSettings || {}); 
var inst = new DatepickerInstance(instSettings, true);
this._inlineDatepicker(target, inst);
}
},
_destroyDatepicker: function(target) {
var $target = $(target);
var nodeName = target.nodeName.toLowerCase();
var calId = target._calId;
target._calId = null;
if (nodeName == 'input') {
$target.siblings('.datepicker_append').replaceWith('');
$target.siblings('.datepicker_trigger').replaceWith('');
$target.removeClass(this.markerClassName).
unbind('focus', this._showDatepicker).
unbind('keydown', this._doKeyDown).
unbind('keypress', this._doKeyPress);
var wrapper = $target.parents('.datepicker_wrap');
if (wrapper) {
wrapper.replaceWith(wrapper.html());
}
} 
else if (nodeName == 'div' || nodeName == 'span') {
$target.removeClass(this.markerClassName).empty();
}
if ($('input[_calId=' + calId + ']').length == 0) {
this._inst[calId] = null;
}
},
_enableDatepicker: function(target) {
target.disabled = false;
$(target).siblings('button.datepicker_trigger').each(function() { this.disabled = false; });
$(target).siblings('img.datepicker_trigger').css({opacity: '1.0', cursor: ''});
var $target = target;
this._disabledInputs = $.map(this._disabledInputs,
function(value) { return (value == $target ? null : value); }); 
},
_disableDatepicker: function(target) {
target.disabled = true;
$(target).siblings('button.datepicker_trigger').each(function() { this.disabled = true; });
$(target).siblings('img.datepicker_trigger').css({opacity: '0.5', cursor: 'default'});
var $target = target;
this._disabledInputs = $.map($.datepicker._disabledInputs,
function(value) { return (value == $target ? null : value); }); 
this._disabledInputs[$.datepicker._disabledInputs.length] = target;
},
_isDisabledDatepicker: function(target) {
if (!target) {
return false;
}
for (var i = 0; i < this._disabledInputs.length; i++) {
if (this._disabledInputs[i] == target) {
return true;
}
}
return false;
},
_changeDatepicker: function(target, name, value) {
var settings = name || {};
if (typeof name == 'string') {
settings = {};
settings[name] = value;
}
var inst = this._getInst(target._calId);
if (inst) {
extendRemove(inst._settings, settings);
this._updateDatepicker(inst);
}
},
_setDateDatepicker: function(target, date, endDate) {
var inst = this._getInst(target._calId);
if (inst) {
inst._setDate(date, endDate);
this._updateDatepicker(inst);
}
},
_getDateDatepicker: function(target) {
var inst = this._getInst(target._calId);
return (inst ? inst._getDate() : null);
},
_doKeyDown: function(e) {
var inst = $.datepicker._getInst(this._calId);
if ($.datepicker._datepickerShowing) {
switch (e.keyCode) {
case 9:$.datepicker.hideDatepicker('');
break; 
case 13: $.datepicker._selectDay(inst, inst._selectedMonth, inst._selectedYear,
$('td.datepicker_daysCellOver', inst._datepickerDiv)[0]);
return false; 
break; 
case 27: $.datepicker.hideDatepicker(inst._get('speed'));
break; 
case 33: $.datepicker._adjustDate(inst,
(e.ctrlKey ? -1 : -inst._get('stepMonths')), (e.ctrlKey ? 'Y' : 'M'));
break; 
case 34: $.datepicker._adjustDate(inst,
(e.ctrlKey ? +1 : +inst._get('stepMonths')), (e.ctrlKey ? 'Y' : 'M'));
break; 
case 35: if (e.ctrlKey) $.datepicker._clearDate(inst);
break; 
case 36: if (e.ctrlKey) $.datepicker._gotoToday(inst);
break; 
case 37: if (e.ctrlKey) $.datepicker._adjustDate(inst, -1, 'D');
break; 
case 38: if (e.ctrlKey) $.datepicker._adjustDate(inst, -7, 'D');
break; 
case 39: if (e.ctrlKey) $.datepicker._adjustDate(inst, +1, 'D');
break; 
case 40: if (e.ctrlKey) $.datepicker._adjustDate(inst, +7, 'D');
break; 
}
}
else if (e.keyCode == 36 && e.ctrlKey) { 
$.datepicker._showDatepicker(this);
}
},
_doKeyPress: function(e) {
var inst = $.datepicker._getInst(this._calId);
var chars = $.datepicker._possibleChars(inst._get('dateFormat'));
var chr = String.fromCharCode(e.charCode == undefined ? e.keyCode : e.charCode);
return e.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1);
},
_connectDatepicker: function(target, inst) {
var input = $(target);
if (input.is('.' + this.markerClassName)) {
return;
}
var appendText = inst._get('appendText');
var isRTL = inst._get('isRTL');
if (appendText) {
if (isRTL) {
input.before('<span class="datepicker_append">' + appendText + '</span>');
}
else {
input.after('<span class="datepicker_append">' + appendText + '</span>');
}
}
var showOn = inst._get('showOn');
if (showOn == 'focus' || showOn == 'both') { 
input.focus(this._showDatepicker);
}
if (showOn == 'button' || showOn == 'both') { 
var buttonText = inst._get('buttonText');
var buttonImage = inst._get('buttonImage');
var trigger = $(inst._get('buttonImageOnly') ? '<img class="datepicker_trigger" src="' +
buttonImage + '" alt="' + buttonText + '" title="' + buttonText + '"/>' :
'<button type="button" class="datepicker_trigger">' + (buttonImage != '' ?
'<img src="' + buttonImage + '" alt="' + buttonText + '" title="' + buttonText + '"/>' :
buttonText) + '</button>');
input.wrap('<span class="datepicker_wrap"></span>');
if (isRTL) {
input.before(trigger);
}
else {
input.after(trigger);
}
trigger.click(function() {
if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target) {
$.datepicker.hideDatepicker();
} else {
$.datepicker._showDatepicker(target);
}
});
}
input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress);
input.bind("setData.datepicker", function(event, key, value) {
inst._settings[key] = value;
}).bind("getData.datepicker", function(event, key) {
return inst._get(key);
});
input[0]._calId = inst._id;
},
_inlineDatepicker: function(target, inst) {
var input = $(target);
if (input.is('.' + this.markerClassName)) {
return;
}
input.addClass(this.markerClassName).append(inst._datepickerDiv);
input.bind("setData.datepicker", function(event, key, value){
inst._settings[key] = value;
}).bind("getData.datepicker", function(event, key){
return inst._get(key);
});
input[0]._calId = inst._id;
this._updateDatepicker(inst);
},
_inlineShow: function(inst) {
var numMonths = inst._getNumberOfMonths(); 
inst._datepickerDiv.width(numMonths[1] * $('.datepicker', inst._datepickerDiv[0]).width());
}, 
dialogDatepicker: function(dateText, onSelect, settings, pos) {
var inst = this._dialogInst; 
if (!inst) {
inst = this._dialogInst = new DatepickerInstance({}, false);
this._dialogInput = $('<input type="text" size="1" style="position: absolute; top: -100px;"/>');
this._dialogInput.keydown(this._doKeyDown);
$('body').append(this._dialogInput);
this._dialogInput[0]._calId = inst._id;
}
extendRemove(inst._settings, settings || {});
this._dialogInput.val(dateText);
this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
if (!this._pos) {
var browserWidth = window.innerWidth || document.documentElement.clientWidth ||
document.body.clientWidth;
var browserHeight = window.innerHeight || document.documentElement.clientHeight ||
document.body.clientHeight;
var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
this._pos = 
[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
}
this._dialogInput.css('left', this._pos[0] + 'px').css('top', this._pos[1] + 'px');
inst._settings.onSelect = onSelect;
this._inDialog = true;
this._datepickerDiv.addClass('datepicker_dialog');
this._showDatepicker(this._dialogInput[0]);
if ($.blockUI) {
$.blockUI(this._datepickerDiv);
}
return this;
},
_showDatepicker: function(input) {
input = input.target || input;
if (input.nodeName.toLowerCase() != 'input') { 
input = $('input', input.parentNode)[0];
}
if ($.datepicker._lastInput == input) { 
return;
}
if ($.datepicker._isDisabledDatepicker(input)) {
return;
}
var inst = $.datepicker._getInst(input._calId);
var beforeShow = inst._get('beforeShow');
extendRemove(inst._settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {}));
$.datepicker.hideDatepicker('');
$.datepicker._lastInput = input;
inst._setDateFromField(input);
if ($.datepicker._inDialog) { 
input.value = '';
}
if (!$.datepicker._pos) { 
$.datepicker._pos = $.datepicker._findPos(input);
$.datepicker._pos[1] += input.offsetHeight; 
}
var isFixed = false;
$(input).parents().each(function() {
isFixed |= $(this).css('position') == 'fixed';
});
if (isFixed && $.browser.opera) { 
$.datepicker._pos[0] -= document.documentElement.scrollLeft;
$.datepicker._pos[1] -= document.documentElement.scrollTop;
}
inst._datepickerDiv.css('position', ($.datepicker._inDialog && $.blockUI ?
'static' : (isFixed ? 'fixed' : 'absolute'))).
css('left', $.datepicker._pos[0] + 'px').css('top', $.datepicker._pos[1] + 'px');
$.datepicker._pos = null;
inst._rangeStart = null;
$.datepicker._updateDatepicker(inst);
if (!inst._inline) {
var speed = inst._get('speed');
var postProcess = function() {
$.datepicker._datepickerShowing = true;
$.datepicker._afterShow(inst);
};
var showAnim = inst._get('showAnim') || 'show';
inst._datepickerDiv[showAnim](speed, postProcess);
if (speed == '') {
postProcess();
}
if (inst._input[0].type != 'hidden') {
inst._input[0].focus();
}
$.datepicker._curInst = inst;
}
},
_updateDatepicker: function(inst) {
inst._datepickerDiv.empty().append(inst._generateDatepicker());
var numMonths = inst._getNumberOfMonths();
if (numMonths[0] != 1 || numMonths[1] != 1) {
inst._datepickerDiv.addClass('datepicker_multi');
} 
else {
inst._datepickerDiv.removeClass('datepicker_multi');
}
if (inst._get('isRTL')) {
inst._datepickerDiv.addClass('datepicker_rtl');
}
else {
inst._datepickerDiv.removeClass('datepicker_rtl');
}
if (inst._input && inst._input[0].type != 'hidden') {
inst._input[0].focus();
}
},
_afterShow: function(inst) {
var numMonths = inst._getNumberOfMonths(); 
inst._datepickerDiv.width(numMonths[1] * $('.datepicker', inst._datepickerDiv[0])[0].offsetWidth);
if ($.browser.msie && parseInt($.browser.version) < 7) { 
$('#datepicker_cover').css({width: inst._datepickerDiv.width() + 4,
height: inst._datepickerDiv.height() + 4});
}
var isFixed = inst._datepickerDiv.css('position') == 'fixed';
var pos = inst._input ? $.datepicker._findPos(inst._input[0]) : null;
var browserWidth = window.innerWidth || document.documentElement.clientWidth ||
document.body.clientWidth;
var browserHeight = window.innerHeight || document.documentElement.clientHeight ||
document.body.clientHeight;
var scrollX = (isFixed ? 0 : document.documentElement.scrollLeft || document.body.scrollLeft);
var scrollY = (isFixed ? 0 : document.documentElement.scrollTop || document.body.scrollTop);
if ((inst._datepickerDiv.offset().left + inst._datepickerDiv.width() -
(isFixed && $.browser.msie ? document.documentElement.scrollLeft : 0)) >
(browserWidth + scrollX)) {
inst._datepickerDiv.css('left', Math.max(scrollX,
pos[0] + (inst._input ? $(inst._input[0]).width() : null) - inst._datepickerDiv.width() -
(isFixed && $.browser.opera ? document.documentElement.scrollLeft : 0)) + 'px');
}
if ((inst._datepickerDiv.offset().top + inst._datepickerDiv.height() -
(isFixed && $.browser.msie ? document.documentElement.scrollTop : 0)) >
(browserHeight + scrollY) ) {
inst._datepickerDiv.css('top', Math.max(scrollY,
pos[1] - (this._inDialog ? 0 : inst._datepickerDiv.height()) -
(isFixed && $.browser.opera ? document.documentElement.scrollTop : 0)) + 'px');
}
},
_findPos: function(obj) {
while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) {
obj = obj.nextSibling;
}
var curleft = curtop = 0;
if (obj.offsetParent) {
do {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
}
return [curleft,curtop];
},
hideDatepicker: function(speed) {
var inst = this._curInst;
if (!inst) {
return;
}
var rangeSelect = inst._get('rangeSelect');
if (rangeSelect && this._stayOpen) {
this._selectDate(inst, inst._formatDate(
inst._currentDay, inst._currentMonth, inst._currentYear));
}
this._stayOpen = false;
if (this._datepickerShowing) {
speed = (speed != null ? speed : inst._get('speed'));
var showAnim = inst._get('showAnim');
inst._datepickerDiv[(showAnim == 'slideDown' ? 'slideUp' :
(showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))](speed, function() {
$.datepicker._tidyDialog(inst);
});
if (speed == '') {
this._tidyDialog(inst);
}
var onClose = inst._get('onClose');
if (onClose) {
onClose.apply((inst._input ? inst._input[0] : null),
[inst._getDate(), inst]);
}
this._datepickerShowing = false;
this._lastInput = null;
inst._settings.prompt = null;
if (this._inDialog) {
this._dialogInput.css('position', 'absolute').
css('left', '0px').css('top', '-100px');
if ($.blockUI) {
$.unblockUI();
$('body').append(this._datepickerDiv);
}
}
this._inDialog = false;
}
this._curInst = null;
},
_tidyDialog: function(inst) {
inst._datepickerDiv.removeClass('datepicker_dialog').
unbind('.datepicker');
$('.datepicker_prompt', inst._datepickerDiv).remove();
},
_checkExternalClick: function(event) {
if (!$.datepicker._curInst) {
return;
}
var target = $(event.target);
if ((target.parents("#datepicker_div").length == 0) &&
(target.attr('class') != 'datepicker_trigger') &&
$.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI)) {
$.datepicker.hideDatepicker('');
}
},
_adjustDate: function(id, offset, period) {
var inst = this._getInst(id);
inst._adjustDate(offset, period);
this._updateDatepicker(inst);
},
_gotoToday: function(id) {
var date = new Date();
var inst = this._getInst(id);
inst._selectedDay = date.getDate();
inst._drawMonth = inst._selectedMonth = date.getMonth();
inst._drawYear = inst._selectedYear = date.getFullYear();
this._adjustDate(inst);
},
_selectMonthYear: function(id, select, period) {
var inst = this._getInst(id);
inst._selectingMonthYear = false;
inst[period == 'M' ? '_drawMonth' : '_drawYear'] =
select.options[select.selectedIndex].value - 0;
this._adjustDate(inst);
},
_clickMonthYear: function(id) {
var inst = this._getInst(id);
if (inst._input && inst._selectingMonthYear && !$.browser.msie) {
inst._input[0].focus();
}
inst._selectingMonthYear = !inst._selectingMonthYear;
},
_changeFirstDay: function(id, day) {
var inst = this._getInst(id);
inst._settings.firstDay = day;
this._updateDatepicker(inst);
},
_selectDay: function(id, month, year, td) {
if ($(td).is('.datepicker_unselectable')) {
return;
}
var inst = this._getInst(id);
var rangeSelect = inst._get('rangeSelect');
if (rangeSelect) {
if (!this._stayOpen) {
$('.datepicker td').removeClass('datepicker_currentDay');
$(td).addClass('datepicker_currentDay');
} 
this._stayOpen = !this._stayOpen;
}
inst._selectedDay = inst._currentDay = $('a', td).html();
inst._selectedMonth = inst._currentMonth = month;
inst._selectedYear = inst._currentYear = year;
this._selectDate(id, inst._formatDate(
inst._currentDay, inst._currentMonth, inst._currentYear));
if (this._stayOpen) {
inst._endDay = inst._endMonth = inst._endYear = null;
inst._rangeStart = new Date(inst._currentYear, inst._currentMonth, inst._currentDay);
this._updateDatepicker(inst);
}
else if (rangeSelect) {
inst._endDay = inst._currentDay;
inst._endMonth = inst._currentMonth;
inst._endYear = inst._currentYear;
inst._selectedDay = inst._currentDay = inst._rangeStart.getDate();
inst._selectedMonth = inst._currentMonth = inst._rangeStart.getMonth();
inst._selectedYear = inst._currentYear = inst._rangeStart.getFullYear();
inst._rangeStart = null;
if (inst._inline) {
this._updateDatepicker(inst);
}
}
},
_clearDate: function(id) {
var inst = this._getInst(id);
this._stayOpen = false;
inst._endDay = inst._endMonth = inst._endYear = inst._rangeStart = null;
this._selectDate(inst, '');
},
_selectDate: function(id, dateStr) {
var inst = this._getInst(id);
dateStr = (dateStr != null ? dateStr : inst._formatDate());
if (inst._rangeStart) {
dateStr = inst._formatDate(inst._rangeStart) + inst._get('rangeSeparator') + dateStr;
}
if (inst._input) {
inst._input.val(dateStr);
}
var onSelect = inst._get('onSelect');
if (onSelect) {
onSelect.apply((inst._input ? inst._input[0] : null), [dateStr, inst]);
}
else {
if (inst._input) {
inst._input.trigger('change'); 
}
}
if (inst._inline) {
this._updateDatepicker(inst);
}
else {
if (!this._stayOpen) {
this.hideDatepicker(inst._get('speed'));
this._lastInput = inst._input[0];
if (typeof(inst._input[0]) != 'object') {
inst._input[0].focus(); 
}
this._lastInput = null;
}
}
},
noWeekends: function(date) {
var day = date.getDay();
return [(day > 0 && day < 6), ''];
},
iso8601Week: function(date) {
var checkDate = new Date(date.getFullYear(), date.getMonth(), date.getDate());
var firstMon = new Date(checkDate.getFullYear(), 1 - 1, 4); 
var firstDay = firstMon.getDay() || 7; 
firstMon.setDate(firstMon.getDate() + 1 - firstDay); 
if (firstDay < 4 && checkDate < firstMon) { 
checkDate.setDate(checkDate.getDate() - 3); 
return $.datepicker.iso8601Week(checkDate);
}
else if (checkDate > new Date(checkDate.getFullYear(), 12 - 1, 28)) { 
firstDay = new Date(checkDate.getFullYear() + 1, 1 - 1, 4).getDay() || 7;
if (firstDay > 4 && (checkDate.getDay() || 7) < firstDay - 3) { 
checkDate.setDate(checkDate.getDate() + 3); 
return $.datepicker.iso8601Week(checkDate);
}
}
return Math.floor(((checkDate - firstMon) / 86400000) / 7) + 1; 
},
dateStatus: function(date, inst) {
return $.datepicker.formatDate(inst._get('dateStatus'), date, inst._getFormatConfig());
},
parseDate: function (format, value, settings) {
if (format == null || value == null) {
throw 'Invalid arguments';
}
value = (typeof value == 'object' ? value.toString() : value + '');
if (value == '') {
return null;
}
var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff;
var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
var year = -1;
var month = -1;
var day = -1;
var literal = false;
var lookAhead = function(match) {
var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
if (matches) {
iFormat++;
}
return matches;
};
var getNumber = function(match) {
lookAhead(match);
var size = (match == 'y' ? 4 : 2);
var num = 0;
while (size > 0 && iValue < value.length &&
value.charAt(iValue) >= '0' && value.charAt(iValue) <= '9') {
num = num * 10 + (value.charAt(iValue++) - 0);
size--;
}
if (size == (match == 'y' ? 4 : 2)) {
throw 'Missing number at position ' + iValue;
}
return num;
};
var getName = function(match, shortNames, longNames) {
var names = (lookAhead(match) ? longNames : shortNames);
var size = 0;
for (var j = 0; j < names.length; j++) {
size = Math.max(size, names[j].length);
}
var name = '';
var iInit = iValue;
while (size > 0 && iValue < value.length) {
name += value.charAt(iValue++);
for (var i = 0; i < names.length; i++) {
if (name == names[i]) {
return i + 1;
}
}
size--;
}
throw 'Unknown name at position ' + iInit;
};
var checkLiteral = function() {
if (value.charAt(iValue) != format.charAt(iFormat)) {
throw 'Unexpected literal at position ' + iValue;
}
iValue++;
};
var iValue = 0;
for (var iFormat = 0; iFormat < format.length; iFormat++) {
if (literal) {
if (format.charAt(iFormat) == '\'' && !lookAhead('\'')) {
literal = false;
}
else {
checkLiteral();
}
}
else {
switch (format.charAt(iFormat)) {
case 'd':
day = getNumber('d');
break;
case 'D': 
getName('D', dayNamesShort, dayNames);
break;
case 'm': 
month = getNumber('m');
break;
case 'M':
month = getName('M', monthNamesShort, monthNames); 
break;
case 'y':
year = getNumber('y');
break;
case '\'':
if (lookAhead('\'')) {
checkLiteral();
}
else {
literal = true;
}
break;
default:
checkLiteral();
}
}
}
if (year < 100) {
year += new Date().getFullYear() - new Date().getFullYear() % 100 +
(year <= shortYearCutoff ? 0 : -100);
}
var date = new Date(year, month - 1, day);
if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) {
throw 'Invalid date';
}
return date;
},
formatDate: function (format, date, settings) {
if (!date) {
return '';
}
var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
var lookAhead = function(match) {
var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
if (matches) {
iFormat++;
}
return matches;
};
var formatNumber = function(match, value) {
return (lookAhead(match) && value < 10 ? '0' : '') + value;
};
var formatName = function(match, value, shortNames, longNames) {
return (lookAhead(match) ? longNames[value] : shortNames[value]);
};
var output = '';
var literal = false;
if (date) {
for (var iFormat = 0; iFormat < format.length; iFormat++) {
if (literal) {
if (format.charAt(iFormat) == '\'' && !lookAhead('\'')) {
literal = false;
}
else {
output += format.charAt(iFormat);
}
}
else {
switch (format.charAt(iFormat)) {
case 'd':
output += formatNumber('d', date.getDate()); 
break;
case 'D': 
output += formatName('D', date.getDay(), dayNamesShort, dayNames);
break;
case 'm': 
output += formatNumber('m', date.getMonth() + 1); 
break;
case 'M':
output += formatName('M', date.getMonth(), monthNamesShort, monthNames); 
break;
case 'y':
output += (lookAhead('y') ? date.getFullYear() : 
(date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100);
break;
case '\'':
if (lookAhead('\'')) {
output += '\'';
}
else {
literal = true;
}
break;
default:
output += format.charAt(iFormat);
}
}
}
}
return output;
},
_possibleChars: function (format) {
var chars = '';
var literal = false;
for (var iFormat = 0; iFormat < format.length; iFormat++) {
if (literal) {
if (format.charAt(iFormat) == '\'' && !lookAhead('\'')) {
literal = false;
}
else {
chars += format.charAt(iFormat);
}
}
else {
switch (format.charAt(iFormat)) {
case 'd':
case 'm': 
case 'y':
chars += '0123456789'; 
break;
case 'D': 
case 'M':
return null; 
case '\'':
if (lookAhead('\'')) {
chars += '\'';
}
else {
literal = true;
}
break;
default:
chars += format.charAt(iFormat);
}
}
}
return chars;
}
});
function DatepickerInstance(settings, inline) {
this._id = $.datepicker._register(this);
this._selectedDay = 0; 
this._selectedMonth = 0; 
this._selectedYear = 0; 
this._drawMonth = 0; 
this._drawYear = 0;
this._input = null; 
this._inline = inline; 
this._datepickerDiv = (!inline ? $.datepicker._datepickerDiv :
$('<div id="datepicker_div_' + this._id + '" class="datepicker_inline"></div>'));
this._settings = extendRemove({}, settings || {}); 
if (inline) {
this._setDate(this._getDefaultDate());
}
}
$.extend(DatepickerInstance.prototype, {
_get: function(name) {
return (this._settings[name] != null ? this._settings[name] : $.datepicker._defaults[name]);
},
_setDateFromField: function(input) {
this._input = $(input);
var dateFormat = this._get('dateFormat');
var dates = this._input ? this._input.val().split(this._get('rangeSeparator')) : null; 
this._endDay = this._endMonth = this._endYear = null;
var date = defaultDate = this._getDefaultDate();
if (dates.length > 0) {
var settings = this._getFormatConfig();
if (dates.length > 1) {
date = $.datepicker.parseDate(dateFormat, dates[1], settings) || defaultDate;
this._endDay = date.getDate();
this._endMonth = date.getMonth();
this._endYear = date.getFullYear();
}
try {
date = $.datepicker.parseDate(dateFormat, dates[0], settings) || defaultDate;
}
catch (e) {
$.datepicker.log(e);
date = defaultDate;
}
}
this._selectedDay = date.getDate();
this._drawMonth = this._selectedMonth = date.getMonth();
this._drawYear = this._selectedYear = date.getFullYear();
this._currentDay = (dates[0] ? date.getDate() : 0);
this._currentMonth = (dates[0] ? date.getMonth() : 0);
this._currentYear = (dates[0] ? date.getFullYear() : 0);
this._adjustDate();
},
_getDefaultDate: function() {
var date = this._determineDate('defaultDate', new Date());
var minDate = this._getMinMaxDate('min', true);
var maxDate = this._getMinMaxDate('max');
date = (minDate && date < minDate ? minDate : date);
date = (maxDate && date > maxDate ? maxDate : date);
return date;
},
_determineDate: function(name, defaultDate) {
var offsetNumeric = function(offset) {
var date = new Date();
date.setDate(date.getDate() + offset);
return date;
};
var offsetString = function(offset, getDaysInMonth) {
var date = new Date();
var matches = /^([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?$/.exec(offset);
if (matches) {
var year = date.getFullYear();
var month = date.getMonth();
var day = date.getDate();
switch (matches[2] || 'd') {
case 'd' : case 'D' :
day += (matches[1] - 0); break;
case 'w' : case 'W' :
day += (matches[1] * 7); break;
case 'm' : case 'M' :
month += (matches[1] - 0); 
day = Math.min(day, getDaysInMonth(year, month));
break;
case 'y': case 'Y' :
year += (matches[1] - 0);
day = Math.min(day, getDaysInMonth(year, month));
break;
}
date = new Date(year, month, day);
}
return date;
};
var date = this._get(name);
return (date == null ? defaultDate :
(typeof date == 'string' ? offsetString(date, this._getDaysInMonth) :
(typeof date == 'number' ? offsetNumeric(date) : date)));
},
_setDate: function(date, endDate) {
this._selectedDay = this._currentDay = date.getDate();
this._drawMonth = this._selectedMonth = this._currentMonth = date.getMonth();
this._drawYear = this._selectedYear = this._currentYear = date.getFullYear();
if (this._get('rangeSelect')) {
if (endDate) {
this._endDay = endDate.getDate();
this._endMonth = endDate.getMonth();
this._endYear = endDate.getFullYear();
}
else {
this._endDay = this._currentDay;
this._endMonth = this._currentMonth;
this._endYear = this._currentYear;
}
}
this._adjustDate();
},
_getDate: function() {
var startDate = (!this._currentYear || (this._input && this._input.val() == '') ? null :
new Date(this._currentYear, this._currentMonth, this._currentDay));
if (this._get('rangeSelect')) {
return [startDate, (!this._endYear ? null :
new Date(this._endYear, this._endMonth, this._endDay))];
}
else {
return startDate;
}
},
_generateDatepicker: function() {
var today = new Date();
today = new Date(today.getFullYear(), today.getMonth(), today.getDate()); 
var showStatus = this._get('showStatus');
var isRTL = this._get('isRTL');
var clear = (this._get('mandatory') ? '' :
'<div class="datepicker_clear"><a onclick="jQuery.datepicker._clearDate(' + this._id + ');"' + 
(showStatus ? this._addStatus(this._get('clearStatus') || '&#xa0;') : '') + '>' +
this._get('clearText') + '</a></div>');
var controls = '<div class="datepicker_control">' + (isRTL ? '' : clear) +
'<div class="datepicker_close"><a onclick="jQuery.datepicker.hideDatepicker();"' +
(showStatus ? this._addStatus(this._get('closeStatus') || '&#xa0;') : '') + '>' +
this._get('closeText') + '</a></div>' + (isRTL ? clear : '')+ '</div>';
var prompt = this._get('prompt');
var closeAtTop = this._get('closeAtTop');
var hideIfNoPrevNext = this._get('hideIfNoPrevNext');
var numMonths = this._getNumberOfMonths();
var stepMonths = this._get('stepMonths');
var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);
var minDate = this._getMinMaxDate('min', true);
var maxDate = this._getMinMaxDate('max');
var drawMonth = this._drawMonth;
var drawYear = this._drawYear;
if (maxDate) {
var maxDraw = new Date(maxDate.getFullYear(),
maxDate.getMonth() - numMonths[1] + 1, maxDate.getDate());
maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
while (new Date(drawYear, drawMonth, 1) > maxDraw) {
drawMonth--;
if (drawMonth < 0) {
drawMonth = 11;
drawYear--;
}
}
}
var prev = '<div class="datepicker_prev">' + (this._canAdjustMonth(-1, drawYear, drawMonth) ? 
'<a onclick="jQuery.datepicker._adjustDate(' + this._id + ', -' + stepMonths + ', \'M\');"' +
(showStatus ? this._addStatus(this._get('prevStatus') || '&#xa0;') : '') + '>' +
this._get('prevText') + '</a>' :
(hideIfNoPrevNext ? '' : '<label>' + this._get('prevText') + '</label>')) + '</div>';
var next = '<div class="datepicker_next">' + (this._canAdjustMonth(+1, drawYear, drawMonth) ?
'<a onclick="jQuery.datepicker._adjustDate(' + this._id + ', +' + stepMonths + ', \'M\');"' +
(showStatus ? this._addStatus(this._get('nextStatus') || '&#xa0;') : '') + '>' +
this._get('nextText') + '</a>' :
(hideIfNoPrevNext ? '>' : '<label>' + this._get('nextText') + '</label>')) + '</div>';
var html = (prompt ? '<div class="datepicker_prompt">' + prompt + '</div>' : '') +
(closeAtTop && !this._inline ? controls : '') +
'<div class="datepicker_links">' + (isRTL ? next : prev) +
(this._isInRange(today) ? '<div class="datepicker_current">' +
'<a onclick="jQuery.datepicker._gotoToday(' + this._id + ');"' +
(showStatus ? this._addStatus(this._get('currentStatus') || '&#xa0;') : '') + '>' +
this._get('currentText') + '</a></div>' : '') + (isRTL ? prev : next) + '</div>';
var showWeeks = this._get('showWeeks');
for (var row = 0; row < numMonths[0]; row++) {
for (var col = 0; col < numMonths[1]; col++) {
var selectedDate = new Date(drawYear, drawMonth, this._selectedDay);
html += '<div class="datepicker_oneMonth' + (col == 0 ? ' datepicker_newRow' : '') + '">' +
this._generateMonthYearHeader(drawMonth, drawYear, minDate, maxDate,
selectedDate, row > 0 || col > 0) + 
'<table class="datepicker" cellpadding="0" cellspacing="0"><thead>' + 
'<tr class="datepicker_titleRow">' +
(showWeeks ? '<td>' + this._get('weekHeader') + '</td>' : '');
var firstDay = this._get('firstDay');
var changeFirstDay = this._get('changeFirstDay');
var dayNames = this._get('dayNames');
var dayNamesShort = this._get('dayNamesShort');
var dayNamesMin = this._get('dayNamesMin');
for (var dow = 0; dow < 7; dow++) { 
var day = (dow + firstDay) % 7;
var status = this._get('dayStatus') || '&#xa0;';
status = (status.indexOf('DD') > -1 ? status.replace(/DD/, dayNames[day]) :
status.replace(/D/, dayNamesShort[day]));
html += '<td' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="datepicker_weekEndCell"' : '') + '>' +
(!changeFirstDay ? '<span' :
'<a onclick="jQuery.datepicker._changeFirstDay(' + this._id + ', ' + day + ');"') + 
(showStatus ? this._addStatus(status) : '') + ' title="' + dayNames[day] + '">' +
dayNamesMin[day] + (changeFirstDay ? '</a>' : '</span>') + '</td>';
}
html += '</tr></thead><tbody>';
var daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
if (drawYear == this._selectedYear && drawMonth == this._selectedMonth) {
this._selectedDay = Math.min(this._selectedDay, daysInMonth);
}
var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
var currentDate = (!this._currentDay ? new Date(9999, 9, 9) :
new Date(this._currentYear, this._currentMonth, this._currentDay));
var endDate = this._endDay ? new Date(this._endYear, this._endMonth, this._endDay) : currentDate;
var printDate = new Date(drawYear, drawMonth, 1 - leadDays);
var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); 
var beforeShowDay = this._get('beforeShowDay');
var showOtherMonths = this._get('showOtherMonths');
var calculateWeek = this._get('calculateWeek') || $.datepicker.iso8601Week;
var dateStatus = this._get('statusForDate') || $.datepicker.dateStatus;
for (var dRow = 0; dRow < numRows; dRow++) { 
html += '<tr class="datepicker_daysRow">' +
(showWeeks ? '<td class="datepicker_weekCol">' + calculateWeek(printDate) + '</td>' : '');
for (var dow = 0; dow < 7; dow++) { 
var daySettings = (beforeShowDay ?
beforeShowDay.apply((this._input ? this._input[0] : null), [printDate]) : [true, '']);
var otherMonth = (printDate.getMonth() != drawMonth);
var unselectable = otherMonth || !daySettings[0] ||
(minDate && printDate < minDate) || (maxDate && printDate > maxDate);
html += '<td class="datepicker_daysCell' +
((dow + firstDay + 6) % 7 >= 5 ? ' datepicker_weekEndCell' : '') + 
(otherMonth ? ' datepicker_otherMonth' : '') + 
(printDate.getTime() == selectedDate.getTime() && drawMonth == this._selectedMonth ?
' datepicker_daysCellOver' : '') + 
(unselectable ? ' datepicker_unselectable' : '') +
(otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + 
(printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ?
' datepicker_currentDay' : '') + 
(printDate.getTime() == today.getTime() ? ' datepicker_today' : '')) + '"' + 
(unselectable ? '' : ' onmouseover="jQuery(this).addClass(\'datepicker_daysCellOver\');' +
(!showStatus || (otherMonth && !showOtherMonths) ? '' : 'jQuery(\'#datepicker_status_' +
this._id + '\').html(\'' + (dateStatus.apply((this._input ? this._input[0] : null),
[printDate, this]) || '&#xa0;') +'\');') + '"' +
' onmouseout="jQuery(this).removeClass(\'datepicker_daysCellOver\');' +
(!showStatus || (otherMonth && !showOtherMonths) ? '' : 'jQuery(\'#datepicker_status_' +
this._id + '\').html(\'&#xa0;\');') + '" onclick="jQuery.datepicker._selectDay(' +
this._id + ',' + drawMonth + ',' + drawYear + ', this);"') + '>' + 
(otherMonth ? (showOtherMonths ? printDate.getDate() : '&#xa0;') : 
(unselectable ? printDate.getDate() : '<a>' + printDate.getDate() + '</a>')) + '</td>'; 
printDate.setDate(printDate.getDate() + 1);
}
html += '</tr>';
}
drawMonth++;
if (drawMonth > 11) {
drawMonth = 0;
drawYear++;
}
html += '</tbody></table></div>';
}
}
html += (showStatus ? '<div id="datepicker_status_' + this._id + 
'" class="datepicker_status">' + (this._get('initStatus') || '&#xa0;') + '</div>' : '') +
(!closeAtTop && !this._inline ? controls : '') +
'<div style="clear: both;"></div>' + 
($.browser.msie && parseInt($.browser.version) < 7 && !this._inline ? 
'<iframe src="javascript:false;" class="datepicker_cover"></iframe>' : '');
return html;
},
_generateMonthYearHeader: function(drawMonth, drawYear, minDate, maxDate, selectedDate, secondary) {
minDate = (this._rangeStart && minDate && selectedDate < minDate ? selectedDate : minDate);
var showStatus = this._get('showStatus');
var html = '<div class="datepicker_header">';
var monthNames = this._get('monthNames');
if (secondary || !this._get('changeMonth')) {
html += monthNames[drawMonth] + '&#xa0;';
}
else {
var inMinYear = (minDate && minDate.getFullYear() == drawYear);
var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
html += '<select class="datepicker_newMonth" ' +
'onchange="jQuery.datepicker._selectMonthYear(' + this._id + ', this, \'M\');" ' +
'onclick="jQuery.datepicker._clickMonthYear(' + this._id + ');"' +
(showStatus ? this._addStatus(this._get('monthStatus') || '&#xa0;') : '') + '>';
for (var month = 0; month < 12; month++) {
if ((!inMinYear || month >= minDate.getMonth()) &&
(!inMaxYear || month <= maxDate.getMonth())) {
html += '<option value="' + month + '"' +
(month == drawMonth ? ' selected="selected"' : '') +
'>' + monthNames[month] + '</option>';
}
}
html += '</select>';
}
if (secondary || !this._get('changeYear')) {
html += drawYear;
}
else {
var years = this._get('yearRange').split(':');
var year = 0;
var endYear = 0;
if (years.length != 2) {
year = drawYear - 10;
endYear = drawYear + 10;
}
else if (years[0].charAt(0) == '+' || years[0].charAt(0) == '-') {
year = drawYear + parseInt(years[0], 10);
endYear = drawYear + parseInt(years[1], 10);
}
else {
year = parseInt(years[0], 10);
endYear = parseInt(years[1], 10);
}
year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
html += '<select class="datepicker_newYear" ' +
'onchange="jQuery.datepicker._selectMonthYear(' + this._id + ', this, \'Y\');" ' +
'onclick="jQuery.datepicker._clickMonthYear(' + this._id + ');"' +
(showStatus ? this._addStatus(this._get('yearStatus') || '&#xa0;') : '') + '>';
for (; year <= endYear; year++) {
html += '<option value="' + year + '"' +
(year == drawYear ? ' selected="selected"' : '') +
'>' + year + '</option>';
}
html += '</select>';
}
html += '</div>'; 
return html;
},
_addStatus: function(text) {
return ' onmouseover="jQuery(\'#datepicker_status_' + this._id + '\').html(\'' + text + '\');" ' +
'onmouseout="jQuery(\'#datepicker_status_' + this._id + '\').html(\'&#xa0;\');"';
},
_adjustDate: function(offset, period) {
var year = this._drawYear + (period == 'Y' ? offset : 0);
var month = this._drawMonth + (period == 'M' ? offset : 0);
var day = Math.min(this._selectedDay, this._getDaysInMonth(year, month)) +
(period == 'D' ? offset : 0);
var date = new Date(year, month, day);
var minDate = this._getMinMaxDate('min', true);
var maxDate = this._getMinMaxDate('max');
date = (minDate && date < minDate ? minDate : date);
date = (maxDate && date > maxDate ? maxDate : date);
this._selectedDay = date.getDate();
this._drawMonth = this._selectedMonth = date.getMonth();
this._drawYear = this._selectedYear = date.getFullYear();
},
_getNumberOfMonths: function() {
var numMonths = this._get('numberOfMonths');
return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths));
},
_getMinMaxDate: function(minMax, checkRange) {
var date = this._determineDate(minMax + 'Date', null);
if (date) {
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
date.setMilliseconds(0);
}
return date || (checkRange ? this._rangeStart : null);
},
_getDaysInMonth: function(year, month) {
return 32 - new Date(year, month, 32).getDate();
},
_getFirstDayOfMonth: function(year, month) {
return new Date(year, month, 1).getDay();
},
_canAdjustMonth: function(offset, curYear, curMonth) {
var numMonths = this._getNumberOfMonths();
var date = new Date(curYear, curMonth + (offset < 0 ? offset : numMonths[1]), 1);
if (offset < 0) {
date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
}
return this._isInRange(date);
},
_isInRange: function(date) {
var newMinDate = (!this._rangeStart ? null :
new Date(this._selectedYear, this._selectedMonth, this._selectedDay));
newMinDate = (newMinDate && this._rangeStart < newMinDate ? this._rangeStart : newMinDate);
var minDate = newMinDate || this._getMinMaxDate('min');
var maxDate = this._getMinMaxDate('max');
return ((!minDate || date >= minDate) && (!maxDate || date <= maxDate));
},
_getFormatConfig: function() {
var shortYearCutoff = this._get('shortYearCutoff');
shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
return {shortYearCutoff: shortYearCutoff,
dayNamesShort: this._get('dayNamesShort'), dayNames: this._get('dayNames'),
monthNamesShort: this._get('monthNamesShort'), monthNames: this._get('monthNames')};
},
_formatDate: function(day, month, year) {
if (!day) {
this._currentDay = this._selectedDay;
this._currentMonth = this._selectedMonth;
this._currentYear = this._selectedYear;
}
var date = (day ? (typeof day == 'object' ? day : new Date(year, month, day)) :
new Date(this._currentYear, this._currentMonth, this._currentDay));
return $.datepicker.formatDate(this._get('dateFormat'), date, this._getFormatConfig());
}
});
function extendRemove(target, props) {
$.extend(target, props);
for (var name in props) {
if (props[name] == null) {
target[name] = null;
}
}
return target;
};
$.fn.datepicker = function(options){
var otherArgs = Array.prototype.slice.call(arguments, 1);
if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate')) {
return $.datepicker['_' + options + 'Datepicker'].apply($.datepicker, [this[0]].concat(otherArgs));
}
return this.each(function() {
typeof options == 'string' ?
$.datepicker['_' + options + 'Datepicker'].apply($.datepicker, [this].concat(otherArgs)) :
$.datepicker._attachDatepicker(this, options);
});
};
$(document).ready(function() {
$.datepicker = new Datepicker(); 
$(document.body).append($.datepicker._datepickerDiv).
mousedown($.datepicker._checkExternalClick);
});
})(jQuery);
;
jQuery(function($){
$.datepicker.regional['ru'] = {clearText: 'Удалить', clearStatus: 'Удалить дату',
closeText: 'Закрыть', closeStatus: 'Закрыть без записи',
prevText: '<img src="/layouts/img/calendar_left.png" />', prevStatus: 'Показать предыдущий месяц',
nextText: '<img src="/layouts/img/calendar_right.png" />', nextStatus: 'Показать следующий месяц',
currentText: 'Сегодня', currentStatus: 'Показать данный месяц',
monthNames: ['января','февраля','марта','апреля','мая','июня',
'июля','августа','сентября','октября','ноября','декабря'],
monthNamesShort: ['янв','февр','март','апр','май','июнь',
'июль','авг','сент','окт','нояб','дек'],
monthStatus: 'Показать другой месяц', yearStatus: 'Показать другой год',
weekHeader: 'Tydz', weekStatus: 'Tydzień roku',
dayNames: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'],
dayNamesShort: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
dayNamesMin: ['В','П','В','C','Ч','П','C'],
dayStatus: 'Установи дату DD первым днем недели', dateStatus: 'Неделя года D, M d',
dateFormat: 'yy-mm-dd', firstDay: 1, 
initStatus: 'Неделя года', isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['ru']);
});
;(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value;};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false;}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break;}}}if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value]);}$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback);});}).bind("flushCache",function(){cache.flush();}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data"in arguments[1])cache.populate();}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete");});function selectCurrent(){var selected=select.selected();if(!selected)return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){v=words.slice(0,words.length-1).join(options.multipleSeparator)+options.multipleSeparator+v;}v+=options.multipleSeparator;}$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}var currentValue=$input.val();if(!skipPrevCheck&&currentValue==previousValue)return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value){return[""];}var words=value.split(options.multipleSeparator);var result=[];$.each(words,function(i,value){if($.trim(value))result[i]=$.trim(value);});return result;}function lastWord(value){if(!options.multiple)return value;var words=trimWords(value);return words[words.length-1];}function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$.Autocompleter.Selection(input,previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}else
$input.val("");}});}if(wasVisible)$.Autocompleter.Selection(input,input.value.length,input.value.length);};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]};}}return parsed;};function stopLoading(){$input.removeClass(options.loadingClass);};};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0];},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}if(!data[q]){length++;}data[q]=value;}function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false)continue;var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar])stMatchSets[firstChar]=[];var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row);}};$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value);});}setTimeout(populate,25);function flush(){data={};length=0;}return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length)return null;if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}return csub;}else
if(data[q]){return data[q];}else
if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)return;element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options.width>0)element.css("width",options.width);needsInit=false;}function target(event){var element=event.target;while(element&&element.tagName!="LI")element=element.parentNode;if(!element)return[];return element;}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset<list.scrollTop()){list.scrollTop(offset);}}};function movePosition(step){active+=step;if(active<0){active=listItems.size()-1;}else if(active>=listItems.size()){active=0;}}function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available;}function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i])continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)continue;var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}if($.fn.bgiframe)list.bgiframe();}return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.Autocompleter.Selection=function(field,start,end){if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}else if(field.setSelectionRange){field.setSelectionRange(start,end);}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end;}}field.focus();};})(jQuery);
(function($){$.dimensions={version:'1.2'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr);};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase())+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0);};});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val;}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name];};});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return $(offsetParent);}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;};})(jQuery);
;(function($) {
$.ui = $.ui || {};
$.extend($.ui, {
plugin: {
add: function(module, option, set) {
var proto = $.ui[module].prototype;
for(var i in set) {
proto.plugins[i] = proto.plugins[i] || [];
proto.plugins[i].push([option, set[i]]);
}
},
call: function(instance, name, arguments) {
var set = instance.plugins[name]; if(!set) return;
for (var i = 0; i < set.length; i++) {
if (instance.options[set[i][0]]) set[i][1].apply(instance.element, arguments);
}
}
},
cssCache: {},
css: function(name) {
if ($.ui.cssCache[name]) return $.ui.cssCache[name];
var tmp = $('<div class="ui-resizable-gen">').addClass(name).css({position:'absolute', top:'-5000px', left:'-5000px', display:'block'}).appendTo('body');
$.ui.cssCache[name] = !!(
(!/auto|default/.test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) || 
!(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor')))
);
try { $('body').get(0).removeChild(tmp.get(0));} catch(e){}
return $.ui.cssCache[name];
},
disableSelection: function(e) {
e.unselectable = "on";
e.onselectstart = function() {return false; };
if (e.style) e.style.MozUserSelect = "none";
},
enableSelection: function(e) {
e.unselectable = "off";
e.onselectstart = function() { return true; };
if (e.style) e.style.MozUserSelect = "";
},
hasScroll: function(e, a) {
var scroll = /top/.test(a||"top") ? 'scrollTop' : 'scrollLeft', has = false;
if (e[scroll] > 0) return true; e[scroll] = 1;
has = e[scroll] > 0 ? true : false; e[scroll] = 0;
return has; 
}
});
$.each( ['Left', 'Top'], function(i, name) {
if(!$.fn['scroll'+name]) $.fn['scroll'+name] = function(v) {
return v != undefined ?
this.each(function() { this == window || this == document ? window.scrollTo(name == 'Left' ? v : $(window)['scrollLeft'](), name == 'Top'? v : $(window)['scrollTop']()) : this['scroll'+name] = v; }) :
this[0] == window || this[0] == document ? self[(name == 'Left' ? 'pageXOffset' : 'pageYOffset')] || $.boxModel && document.documentElement['scroll'+name] || document.body['scroll'+name] : this[0][ 'scroll' + name ];
};
});
var _remove = $.fn.remove;
$.fn.extend({
position: function() {
var offset = this.offset();
var offsetParent = this.offsetParent();
var parentOffset = offsetParent.offset();
return {
top:offset.top - num(this[0], 'marginTop')- parentOffset.top - num(offsetParent, 'borderTopWidth'),
left: offset.left - num(this[0], 'marginLeft')- parentOffset.left - num(offsetParent, 'borderLeftWidth')
};
},
offsetParent: function() {
var offsetParent = this[0].offsetParent;
while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && $.css(offsetParent, 'position') == 'static') )
offsetParent = offsetParent.offsetParent;
return $(offsetParent);
},
mouseInteraction: function(o) {
return this.each(function() {
new $.ui.mouseInteraction(this, o);
});
},
removeMouseInteraction: function(o) {
return this.each(function() {
if($.data(this, "ui-mouse"))
$.data(this, "ui-mouse").destroy();
});
},
remove: function() {
jQuery("*", this).add(this).trigger("remove");
return _remove.apply(this, arguments );
}
});
function num(el, prop) {
return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;
};

$.ui.mouseInteraction = function(element, options) {
var self = this;
this.element = element;
$.data(this.element, "ui-mouse", this);
this.options = $.extend({}, options);
$(element).bind('mousedown.draggable', function() { return self.click.apply(self, arguments); });
if($.browser.msie) $(element).attr('unselectable', 'on'); 
$(element).mouseup(function() {
if(self.timer) clearInterval(self.timer);
});
};
$.extend($.ui.mouseInteraction.prototype, {
destroy: function() { $(this.element).unbind('mousedown.draggable'); },
trigger: function() { return this.click.apply(this, arguments); },
click: function(e) {
if(
 e.which != 1 
|| $.inArray(e.target.nodeName.toLowerCase(), this.options.dragPrevention || []) != -1 
|| (this.options.condition && !this.options.condition.apply(this.options.executor || this, [e, this.element])) 
) return true;
var self = this;
var initialize = function() {
self._MP = { left: e.pageX, top: e.pageY }; 
$(document).bind('mouseup.draggable', function() { return self.stop.apply(self, arguments); });
$(document).bind('mousemove.draggable', function() { return self.drag.apply(self, arguments); });
if(!self.initalized && Math.abs(self._MP.left-e.pageX) >= self.options.distance || Math.abs(self._MP.top-e.pageY) >= self.options.distance) {
if(self.options.start) self.options.start.call(self.options.executor || self, e, self.element);
if(self.options.drag) self.options.drag.call(self.options.executor || self, e, this.element); 
self.initialized = true;
}
};
if(this.options.delay) {
if(this.timer) clearInterval(this.timer);
this.timer = setTimeout(initialize, this.options.delay);
} else {
initialize();
}
return false;
},
stop: function(e) {
var o = this.options;
if(!this.initialized) return $(document).unbind('mouseup.draggable').unbind('mousemove.draggable');
if(this.options.stop) this.options.stop.call(this.options.executor || this, e, this.element);
$(document).unbind('mouseup.draggable').unbind('mousemove.draggable');
this.initialized = false;
return false;
},
drag: function(e) {
var o = this.options;
if ($.browser.msie && !e.button) return this.stop.apply(this, [e]); 
if(!this.initialized && (Math.abs(this._MP.left-e.pageX) >= o.distance || Math.abs(this._MP.top-e.pageY) >= o.distance)) {
if(this.options.start) this.options.start.call(this.options.executor || this, e, this.element);
this.initialized = true;
} else {
if(!this.initialized) return false;
}
if(o.drag) o.drag.call(this.options.executor || this, e, this.element);
return false;
}
});
})(jQuery);
 ;
;(function($) {
$.fn.extend({
slider: function(options) {
var args = Array.prototype.slice.call(arguments, 1);
if ( options == "value" )
return $.data(this[0], "slider").value(arguments[1]);
return this.each(function() {
if (typeof options == "string") {
var slider = $.data(this, "slider");
if (slider) slider[options].apply(slider, args);
} else if(!$.data(this, "slider"))
new $.ui.slider(this, options);
});
}
});
$.ui.slider = function(element, options) {
var self = this;
this.element = $(element);
$.data(element, "slider", this);
this.element.addClass("ui-slider");
this.options = $.extend({},$.ui.slider.defaults, options);
var o = this.options;
$.extend(o, {
axis: o.axis || (element.offsetWidth < element.offsetHeight ? 'vertical' : 'horizontal'),
max: !isNaN(parseInt(o.max,10)) ? { x: parseInt(o.max, 10), y: parseInt(o.max, 10)} : ({ x: o.max && o.max.x || 100, y:o.max && o.max.y || 100 }),
min: !isNaN(parseInt(o.min,10)) ? { x: parseInt(o.min, 10), y: parseInt(o.min, 10)} : ({ x: o.min && o.min.x || 0, y:o.min && o.min.y || 0 })
});
o.realMax = {
x: o.max.x - o.min.x,
y: o.max.y - o.min.y
};
o.stepping = {
x: o.stepping && o.stepping.x || parseInt(o.stepping, 10) || (o.steps && o.steps.x ? o.realMax.x/o.steps.x : 0),
y: o.stepping && o.stepping.y || parseInt(o.stepping, 10) || (o.steps && o.steps.y ? o.realMax.y/o.steps.y : 0)
};
$(element).bind("setData.slider", function(event, key, value){
self.options[key] = value;
}).bind("getData.slider", function(event, key){
return self.options[key];
});
this.handle = $(o.handle, element);
if (!this.handle.length) {
self.handle = self.generated = $(o.handles || [0]).map(function() {
var handle = $("<div/>").addClass("ui-slider-handle").appendTo(element);
if (this.id)
handle.attr("id", this.id);
return handle[0];
});
}
$(this.handle)
.mouseInteraction({
executor: this,
delay: o.delay,
distance: o.distance != undefined ? o.distance : 1,
dragPrevention: o.prevention ? o.prevention.toLowerCase().split(',') : ['input','textarea','button','select','option'],
start: this.start,
stop: this.stop,
drag: this.drag,
condition: function(e, handle) {
if(!this.disabled) {
if(this.currentHandle) this.blur(this.currentHandle);
this.focus(handle,1);
return !this.disabled;
}
}
})
.wrap('<a href="javascript:void(0)" style="cursor:default;"></a>')
.parent()
.bind('focus', function(e) { self.focus(this.firstChild); })
.bind('blur', function(e) { self.blur(this.firstChild); })
.bind('keydown', function(e) {
if(/(37|38|39|40)/.test(e.keyCode)) {
self.moveTo({
x: /(37|39)/.test(e.keyCode) ? (e.keyCode == 37 ? '-' : '+') + '=' + self.oneStep(1) : null,
y: /(38|40)/.test(e.keyCode) ? (e.keyCode == 38 ? '-' : '+') + '=' + self.oneStep(2) : null
}, this.firstChild);
}
})
;
this.actualSize = { width: this.element.outerWidth() , height: this.element.outerHeight() };
this.element.bind('mousedown.slider', function(e) {
self.click.apply(self, [e]);
self.firstValue = self.firstValue + 1; 
});
$.each(o.handles || [], function(index, handle) {
self.moveTo(handle.start, index, true);
});
if (!isNaN(o.startValue))
this.moveTo(o.startValue, 0, true);
if(this.handle.length == 1) this.previousHandle = this.handle;
if(this.handle.length == 2 && o.range) this.createRange();
};
$.extend($.ui.slider.prototype, {
plugins: {},
createRange: function() {
this.rangeElement = $('<div></div>')
.addClass('ui-slider-range')
.css({ position: 'absolute' })
.appendTo(this.element);
this.updateRange();
},
updateRange: function() {
var prop = this.options.axis == "vertical" ? "top" : "left";
var size = this.options.axis == "vertical" ? "height" : "width";
this.rangeElement.css(prop, parseInt($(this.handle[0]).css(prop),10) + this.handleSize(0, this.options.axis == "vertical" ? 2 : 1)/2);
var range= (parseInt($(this.handle[1]).css(prop),10) - parseInt($(this.handle[0]).css(prop),10));
if (!range) range=0;
this.rangeElement.css(size, range);
},
getRange: function() {
return this.rangeElement ? this.convertValue(parseInt(this.rangeElement.css(this.options.axis == "vertical" ? "height" : "width"),10)) : null;
},
ui: function(e) {
return {
instance: this,
options: this.options,
handle: this.currentHandle,
value: this.options.axis != "both" || !this.options.axis ? Math.round(this.value(null,this.options.axis == "vertical" ? 2 : 1)) : {
x: Math.round(this.value(null,1)),
y: Math.round(this.value(null,2))
},
range: this.getRange()
};
},
propagate: function(n,e) {
$.ui.plugin.call(this, n, [e, this.ui()]);
this.element.triggerHandler(n == "slide" ? n : "slide"+n, [e, this.ui()], this.options[n]);
},
destroy: function() {
this.element
.removeClass("ui-slider ui-slider-disabled")
.removeData("slider")
.unbind(".slider");
this.handle.removeMouseInteraction();
this.generated && this.generated.remove();
},
enable: function() {
this.element.removeClass("ui-slider-disabled");
this.disabled = false;
},
disable: function() {
this.element.addClass("ui-slider-disabled");
this.disabled = true;
},
focus: function(handle,hard) {
this.currentHandle = $(handle).addClass('ui-slider-handle-active');
if(hard) this.currentHandle.parent()[0].focus();
},
blur: function(handle) {
$(handle).removeClass('ui-slider-handle-active');
if(this.currentHandle && this.currentHandle[0] == handle) { this.previousHandle = this.currentHandle; this.currentHandle = null; };
},
value: function(handle, axis) {
if(this.handle.length == 1) this.currentHandle = this.handle;
if(!axis) axis = this.options.axis == "vertical" ? 2 : 1;
var value = ((parseInt($(handle != undefined && handle !== null ? this.handle[handle] || handle : this.currentHandle).css(axis == 1 ? "left" : "top"),10) / (this.actualSize[axis == 1 ? "width" : "height"] - this.handleSize(null,axis))) * this.options.realMax[axis == 1 ? "x" : "y"]) + this.options.min[axis == 1 ? "x" : "y"];
var o = this.options;
if (o.stepping[axis == 1 ? "x" : "y"]) {
value = Math.round(value / o.stepping[axis == 1 ? "x" : "y"]) * o.stepping[axis == 1 ? "x" : "y"];
}
return value;
},
convertValue: function(value,axis) {
if(!axis) axis = this.options.axis == "vertical" ? 2 : 1;
return this.options.min[axis == 1 ? "x" : "y"] + (value / (this.actualSize[axis == 1 ? "width" : "height"] - this.handleSize(null,axis))) * this.options.realMax[axis == 1 ? "x" : "y"];
},
translateValue: function(value,axis) {
if(!axis) axis = this.options.axis == "vertical" ? 2 : 1;
return ((value - this.options.min[axis == 1 ? "x" : "y"]) / this.options.realMax[axis == 1 ? "x" : "y"]) * (this.actualSize[axis == 1 ? "width" : "height"] - this.handleSize(null,axis));
},
handleSize: function(handle,axis) {
if(!axis) axis = this.options.axis == "vertical" ? 2 : 1;
return $(handle != undefined && handle !== null ? this.handle[handle] : this.currentHandle)[axis == 1 ? "outerWidth" : "outerHeight"]();
},
click: function(e) {
},
start: function(e, handle) {
var o = this.options;
if(!this.currentHandle) this.focus(this.previousHandle, true); 
this.offset = this.element.offset();
this.handleOffset = this.currentHandle.offset();
this.clickOffset = { top: e.pageY - this.handleOffset.top, left: e.pageX - this.handleOffset.left };
this.firstValue = this.value();
this.propagate('start', e);
return false;
},
stop: function(e) {
this.propagate('stop', e);
if (this.firstValue != this.value())
this.propagate('change', e);
this.focus(this.currentHandle, true);
return false;
},
oneStep: function(axis) {
if(!axis) axis = this.options.axis == "vertical" ? 2 : 1;
return this.options.stepping[axis == 1 ? "x" : "y"] ? this.options.stepping[axis == 1 ? "x" : "y"] : (this.options.realMax[axis == 1 ? "x" : "y"] / this.actualSize[axis == 1 ? "width" : "height"]) * 5;
},
translateRange: function(value,axis) {
if (this.rangeElement) {
if (this.currentHandle[0] == this.handle[0] && value >= this.translateValue(this.value(1),axis))
value = this.translateValue(this.value(1,axis) - this.oneStep(axis), axis);
if (this.currentHandle[0] == this.handle[1] && value <= this.translateValue(this.value(0),axis))
value = this.translateValue(this.value(0,axis) + this.oneStep(axis));
}
if (this.options.handles) {
var handle = this.options.handles[this.handleIndex()];
if (value < this.translateValue(handle.min,axis)) {
value = this.translateValue(handle.min,axis);
} else if (value > this.translateValue(handle.max,axis)) {
value = this.translateValue(handle.max,axis);
}
}
return value;
},
handleIndex: function() {
return this.handle.index(this.currentHandle[0])
},
translateLimits: function(value,axis) {
if(!axis) axis = this.options.axis == "vertical" ? 2 : 1;
if (value >= this.actualSize[axis == 1 ? "width" : "height"] - this.handleSize(null,axis))
value = this.actualSize[axis == 1 ? "width" : "height"] - this.handleSize(null,axis);
if (value <= 0)
value = 0;
return value;
},
drag: function(e, handle) {
var o = this.options;
var position = { top: e.pageY - this.offset.top - this.clickOffset.top, left: e.pageX - this.offset.left - this.clickOffset.left};
if(!this.currentHandle) this.focus(this.previousHandle, true); 
position.left = this.translateLimits(position.left,1);
position.top = this.translateLimits(position.top,2);
if (o.stepping.x) {
var value = this.convertValue(position.left,1);
value = Math.round(value / o.stepping.x) * o.stepping.x;
position.left = this.translateValue(value, 1);
}
if (o.stepping.y) {
var value = this.convertValue(position.top,2);
value = Math.round(value / o.stepping.y) * o.stepping.y;
position.top = this.translateValue(value, 2);
}
position.left = this.translateRange(position.left, 1);
position.top = this.translateRange(position.top, 2);
if(o.axis != "vertical") this.currentHandle.css({ left: position.left });
if(o.axis != "horizontal") this.currentHandle.css({ top: position.top });
if (this.rangeElement)
this.updateRange();
this.propagate('slide', e);
return false;
},
moveTo: function(value, handle, noPropagation) {
var o = this.options;
if (handle == undefined && !this.currentHandle && this.handle.length != 1)
return false; 
if (handle == undefined && !this.currentHandle)
handle = 0;
if (handle != undefined)
this.currentHandle = this.previousHandle = $(this.handle[handle] || handle);
if(value.x !== undefined && value.y !== undefined) {
var x = value.x;
var y = value.y;
} else {
var x = value, y = value;
}
if(x && x.constructor != Number) {
var me = /^\-\=/.test(x), pe = /^\+\=/.test(x);
if (me) {
x = this.value(null,1) - parseInt(x.replace('-=', ''), 10);
} else if (pe) {
x = this.value(null,1) + parseInt(x.replace('+=', ''), 10);
}
}
if(y && y.constructor != Number) {
var me = /^\-\=/.test(y), pe = /^\+\=/.test(y);
if (me) {
y = this.value(null,2) - parseInt(y.replace('-=', ''), 10);
} else if (pe) {
y = this.value(null,2) + parseInt(y.replace('+=', ''), 10);
}
}
if(o.axis != "vertical" && x) {
if(o.stepping.x) x = Math.round(x / o.stepping.x) * o.stepping.x;
x = this.translateValue(x, 1);
x = this.translateLimits(x, 1);
x = this.translateRange(x, 1);
this.currentHandle.css({ left: x });
}
if(o.axis != "horizontal" && y) {
if(o.stepping.y) y = Math.round(y / o.stepping.y) * o.stepping.y;
y = this.translateValue(y, 2);
y = this.translateLimits(y, 2);
y = this.translateRange(y, 2);
this.currentHandle.css({ top: y });
}
if (this.rangeElement)
this.updateRange();
if (!noPropagation) {
this.propagate('start', null);
this.propagate('stop', null);
this.propagate('change', null);
this.propagate("slide", null);
}
}
});
$.ui.slider.defaults = {
handle: ".ui-slider-handle"
};
})(jQuery);
;
var $ = jQuery.noConflict();
var preloader_html='<center><img src="/layouts/accountancy/images/ajax-loader.gif"/></center>';
$(document).ready(function()
{
$(".invoice_stempel_option").livequery(function(e)
{
$(this).click(function()
{
var request=0;
if($(this).attr('checked')) request=1;
$.ajax({
url:$(this).attr('rel'),
data:'option='+request
});
});
});
function inputs(){
this.firm=$('#customer_firm_name');
this.nip=$('#customer_nip');
this.first_name=$('#customer_first_name');
this.sure_name=$('#customer_sure_name');
return true;
}

$('#booking_generate_blank').click(function()
{
window.open($(this).attr('href'), 'print', 'menubar=no,resizable=yes,location=no,toolbar=no,status=no,width=500,height=600,left=30,top=30,scrollbars=yes');
return false;
});
$('a.print').click(function()
{
window.open($(this).attr('href'), 'print', 'menubar=no,resizable=yes,location=no,toolbar=no,status=no,width=500,height=200,left=30,top=30,scrollbars=yes');
return false;
});
if ($("input[name='customer_send_to_the_same']:checked").val()==0) $('.turit_corresponding_data').hide();
$("input[name='customer_send_to_the_same'][value='1']").livequery(function(e)
{
$(this).bind("click", function(e)
{
$('.turit_corresponding_data').show();
$("#customer_send_to_country").attr('disabled','');
$(".turit_corresponding_data input").each(function(item,index)
{
$(this).attr('readonly','');
$("#customer_send_to_address").val("");
$("#customer_send_to_postal_code").val("");
$("#customer_send_to_city").val("");
});
});
});
$("input[name='customer_send_to_the_same'][value='0']").livequery(function(e)
{
$(this).bind("click", function(e)
{
$("#customer_send_to_first_name").val($('#customer_first_name').val());
$("#customer_send_to_sure_name").val($('#customer_sure_name').val());
$("#customer_send_to_address").val($('#customer_address').val());
$("#customer_send_to_postal_code").val($('#customer_postal_code').val());
$("#customer_send_to_city").val($('#customer_city').val());
$('.turit_corresponding_data').hide();
$("#customer_send_to_country").attr('disabled','true');
$(".turit_corresponding_data input").each(function(item,index)
{
$(this).attr('readonly','true');
});
});
});
$("#customer_send_to_country").livequery(function(e)
{
$(this).bind("change", function(e)
{
if(($(this).val()=='rest') || ($(this).val()=='ue'))
{
$("#turit_additional_send_to_country").show();
}else{
$("#turit_additional_send_to_country").val('');
$("#turit_additional_send_to_country").hide();
}
});
});
$("input[name='customer_is_firm'][value='1']").livequery(function(e)
{
$(this).bind("click", function(e)
{
$("#turit_customer_name").hide();
$("#turit_customer_firm").show();
$("#turit_customer_nip").show();
});
});
$("input[name='customer_is_firm'][value='0']").livequery(function(e)
{
$(this).bind("click", function(e)
{
$("#turit_customer_name").show();
$("#turit_customer_firm").hide();
$("#turit_customer_nip").hide();
$("#turit_customer_firm").val('');
$("#turit_customer_nip").val('');
});
});
$("#customer_country").livequery(function(e)
{
$(this).bind("change", function(e)
{
if(($(this).val()=='rest') || ($(this).val()=='ue'))
{
$("#turit_additional_country").show();
}else{
$("#turit_additional_country").hide();
}
});
});
$('.turit_sub_calendar thead a').livequery(function(e)
{
$(this).bind("click", function(e)
{
$.ajax({
url:$(this).attr('href'),
success: function(t)
{
$(".turit_sub_calendar").html(t);
}
});
return false;
});
});

$("#pf1000").livequery(function(e)
{
$(this).parent().remove();
});
$("#booking_customer_country").livequery(function(e)
{
var select=$("#payment_type").parent();
var diff=$("#booking_days_diff").val();
$(".p24_wfh940g").html('<div class="my_preloader" style="background-image:url(/layouts/img/ajax-loader.gif);background-repeat: no-repeat;background-position:center;height:26px;"></div>');
$.ajax({
type: 'post',
url:$("#booking_customer_country").attr('rel'),
data:"id="+$("#booking_customer_country").val()+'&diff='+diff,
success: function(t)
{
$(".p24_wfh940g").html(t);
}
});
var price=$("#booking_hidden_price").val();
var country=$("#booking_customer_country").val();
$.ajax({
type: 'post',
url:'/pl/pay/booking/currency',
data:"country="+country+'&price='+price,
success: function(t)
{
$("#booking_payment_price").val(t);
}
});
$.ajax({
type: 'post',
url:'/pl/pay/booking/currency',
data:"date=true",
success: function(t)
{
$(".booking_exchange_table").html(t);
}
});
return false;
});
$(".invoice_page").livequery(function(e)
{
$(this).bind("click", function(e)
{
$(".invoice_page").each(function(index,item)
{
$(this).css("color","black");
});
$(this).css("color","red");
$.ajax({
type: 'post',
url:$(this).attr("href"),
success: function(t)
{
$('.user_invoices').html(t);
}
});
return false;
});
});
$("#booking_currencies").livequery(function(e){
$(this).bind("change", function(e)
{
var obj=$(this).parent();
var price=$("#booking_hidden_price").val();
var currency=$(this).val();
var objCurrency=$("#booking_payment_price").val().split(" ");
var r=objCurrency[0]+" "+objCurrency[objCurrency.length-1]+" ->";
$(obj).append('<div class="my_preloader" style="background-image:url(/layouts/img/ajax-loader.gif);margin-right:60px;background-repeat: no-repeat;background-position:right;height:26px;"></div>');
$.ajax({
type: 'post',
url:$(this).attr('rel'),
data:"from="+objCurrency[objCurrency.length-1]+"&currency="+currency+'&price='+price,
success: function(t)
{
$(".booking_currency_output").html(r+t);
$('.my_preloader').remove();
}
});
return false;
});
});
$("#booking_customer_country").livequery(function(e){
$(this).bind("change", function(e)
{
var select=$("#payment_type").parent();
var diff=$("#booking_days_diff").val();
$('.p24_wfh940g').html('<div class="my_preloader" style="background-image:url(/layouts/img/ajax-loader.gif);background-repeat: no-repeat;background-position:center;height:26px;"></div>');
$.ajax({
type: 'post',
url:$(this).attr("rel"),
data:"id="+$(this).val()+'&diff='+diff,
success: function(t)
{
$('.p24_wfh940g').html(t);
}
});
var price=$("#booking_hidden_price").val();
var country=$("#booking_customer_country").val();
$.ajax({
type: 'post',
url:'/pl/pay/booking/currency',
data:"country="+country+'&price='+price,
success: function(t)
{
$("#booking_payment_price").val(t);
}
});
$.ajax({
type: 'post',
url:'/pl/pay/booking/currency',
data:"date=true",
success: function(t)
{
$(".booking_exchange_table").html(t);
}
});
return false;
});
});
if ($("#booking_confirmation .errors").tagName)
$("#booking_confirmation input").livequery(function(e){
$(this).bind("keydown", function(e)
{
return false;
});
});
var ci='';
$("#country_selector").livequery(function(e){
$(this).bind("change", function(e)
{
var country= $(this).val();
if(country==0 || country==1)
{ 
$('.dates_book').show();
$('.home_price').show();
}
else
{ 
$('.dates_book').hide();
$('.home_price').hide();
$('.dates_book input').val('');
}
var ci=$("#country_selector").val();
var url="/search/index/completer?ci="+ci+"&q="+$("#home_city").val();
$("#home_city").autocomplete(url,{cacheLength:2,delay:2,scroll:false});
return false;
});
});
var url="/search/index/completer";
$("#home_city").autocomplete(url,{cacheLength:2,delay:2,scroll:false});
$("#additional_home_city").autocomplete(url,{cacheLength:2,delay:2,scroll:false});
$("#additional_country_selector").livequery(function(e){
$(this).bind("change", function(e)
{
var helper=$("#additional_country_selector").val();
var url="/search/index/completer?ci="+helper+"&q="+$("#additional_home_city").val();
$("#additional_home_city").autocomplete(url,{cacheLength:2,delay:2,scroll:false});
return false;
});
});
$(".umowa").click(function()
{
window.open($(this).attr('href'), 'print', 'menubar=no,resizable=yes,location=no,toolbar=no,status=no,width=1000,height=700,left=30,top=30,scrollbars=yes');
return false;
});
$('#search_box_advanced').livequery(function()
{
$(this).click(function(e)
{
var src= $('#search_box_advanced img').attr('src');
$("#search_advanced").toggle();
if (src.indexOf('znajdz_zaaw1.png')<0)
$('#search_box_advanced img').attr('src', src.replace('zaawansowane.png', 'znajdz_zaaw1.png'));
else
$('#search_box_advanced img').attr('src', src.replace('znajdz_zaaw1.png', 'zaawansowane.png'));
return false;
})
});
$('#booking_send_to').livequery(function()
{
$(this).click(function(e)
{
if($(this).attr("checked"))
$('#customer_data_send_to').show();
else
$('#customer_data_send_to').hide();
});
});
$('#booking_customer_send_to_is_firm').livequery(function()
{
$(this).click(function(e)
{
if($(this).attr("checked"))
$('#booking_customer_send_to_firm_name').attr("disabled","");
else
$('#booking_customer_send_to_firm_name').attr("disabled","true");
});
});
$('#booking_customer_is_firm').livequery(function()
{
$(this).click(function(e)
{
if($(this).attr("checked"))
$('#booking_customer_firm_name').attr("disabled","");
else
$('#booking_customer_firm_name').attr("disabled","true");
});
});
$('#additional_country_selector').change(function(e)
{
$.ajax({
type: 'post',
url:$('#country_selector').attr('title'),
data: 'id='+$(this).val(),
success: function(t){ $('#additional_province_selector').html(t);}
});
});
$('#district_country').change(function(e)
{
if ($(this).val()!=1) 
$('#district_select').parent().hide();
else
$('#district_select').parent().show();
$.ajax({
type: 'post',
url:$('#country_selector').attr('title'),
data: 'id='+$(this).val(),
success: function(t){ 
$('#district_province').html(t);
$('#district_province').find('option:first').remove();
}
});
});
$('#district_province').change(function(e)
{
$.ajax({
type: 'post',
url:$('#district_province').attr('title'),
data: 'id='+$(this).val(),
success: function(t){ 
var choose= $('#district_select').find('option:first');
$('#district_select').html(t);
$('#district_select').prepend(choose);
}
});
});
$('#country_selector').change(function(e)
{
$.ajax({
type: 'post',
url: $(this).attr('title'),
data: 'id='+$(this).val(),
success: function(t){$('#province_selector').html(t);}
});
return false;
});
$('#search_region').submit(function(){
var province= $('#district_province').val();
if ($('#district_country').val()==1) 
var district= $('#district_select').val();
else
var district= '';
document.location.href= '/region-'+province+','+district+'-search,'+$(this).attr('title')+'.html';
return false;
});
$("#category_selector").livequery(function(e){
$(this).change(function(e)
{
var id=$(this).val();
$.ajax({
type: 'post',
url: '/pl/search/index/attribute',
data: 'id='+id,
dataType: 'html',
error: function(){},
success: function(t)
{
$(".pictograms").html(t);
}
});
return false;
})
});
var slider1Value= 1;
var slider1Stepping= 5;
var slider1Min= 0;
var slider1Max= 50;
$("#slider_distance").slider
({
'stepping': slider1Stepping,
'min': slider1Min,
'max': slider1Max,
'start': slider1Value,
'range':'min',
'slide': function(e, ui)
{
$("#distance").html(ui.value);
$("#search input[name='distance']").val(ui.value);
return false;
}
});
$("#additional_slider_distance").slider
({
'stepping': slider1Stepping,
'min': slider1Min,
'max': slider1Max,
'start': slider1Value,
'range':'min',
'slide': function(e, ui)
{
$("#additional_distance").html(ui.value);
$("#additional_search input[name='distance']").val(ui.value);
return false;
}
});
$("#slider_distance").slider('disable');
$("#additional_slider_distance").slider('disable');
$('#home_city').keyup(function(){
if ($(this).val())
{
$("#slider_distance").slider('enable');
}
});
$('#additional_home_city').keyup(function(){
if ($(this).val())
{
$("#additional_slider_distance").slider('enable');
}
});
$('#home_city').change(function(){
if ($(this).val())
{
$("#slider_distance").slider('enable');
}
});

$("#slider_price").slider({
'stepping': 25,
'min': 25,
'range': true,
'max': 525,
'start': 200, 
'slide': function(e, ui)
{
if($(ui.handle).attr("id")=="indicator_price_to")
{
$(".price_to").html(parseInt(ui.value));
$("#search input[name='price_to']").val(ui.value);
}
else
{
$(".price_from").html(parseInt(ui.value));
$("#search input[name='price_from']").val(ui.value);
}
if(parseInt(ui.value)>500)
{
$(".price_to").html('&#8734;');
$("#search input[name='price_to']").val('');
}
if(parseInt(ui.value)<=25)
{
$(".price_from").html('0');
$("#search input[name='price_from']").val(0);
}
return false;
}
});
$('#search_advanced').hide();
$(".event_gallery").livequery(function() {
$('.event_gallery a').lightBox();
});
$('li.turit_sub_calendar table.calendar tbody td.checked a').livequery(function(){
$(this).tooltip({
delay: 300,
showURL: false, 
bodyHandler: function(){
$.ajax({
url: $(this).attr('href'),
success: function(r)
{
$('#tooltip div').html(r);
}
});
return 'loading';
}
});
});
$(".event_on_map").livequery(function()
{
$('.event_on_map a.map').window('click', function(result, obj){
var latlng= $(obj).attr('title');
latlng= latlng.split(';');
var lat= latlng[0];
var lng= latlng[1];
$('#map_result div:first').livequery(function(){
if (parseInt(lat) && parseInt(lng))
{
map.clearOverlays();
map.addOverlay(new GMarker(new GLatLng(lat, lng), markers['advertisment']));
map.setCenter(new GLatLng(lat, lng), 11);
}
});
return false;
}, {width: 500, height: 400, prefix: 'map'});
});
$("#book_date_from").livequery(function(){
$(this).datepicker({dateFormat: "yy-mm-dd", beforeShow: bookRange, yearRange: '-0:+1'});
});
$("#book_date_to").livequery(function(){
$(this).datepicker({dateFormat: "yy-mm-dd", beforeShow: bookRange, yearRange: '-0:+1'});
});
});
function showRegion(code, index)
{
var map= new Array();
map['pl']= new Array('17--Zachodniopomorskie','12--Pomorskie','15--Warminsko-mazurskie','10--Podlaskie','3--Lubuskie','16--Wielkopolskie','2--Kujawsko--pomorskie','8--Mazowieckie','1--Dolnoslaskie','5--Lodzkie','4--Lubelskie','9--Opolskie','13--Slaskie','14--Swietokrzyskie','6--Malopolskie','11--Podkarpackie');
map['sk']= new Array('31--Bratislavsky-kraj','26--Trnavsky-kraj','27--Trenciansky-kraj','29--Nitriansky-kraj','25--Zilinsky-kraj','32--Banskobystricky-kraj','28--Presovsky-kraj','30--Kosicky-kraj');
map['cs']= new Array('22--Karlovarsky-kraj','23--Usetcky-kraj','21--Plzensky-kraj','24--Liberecky-kraj','19--Stredocesky-kraj','18--hlavni-mesto-Praha','20--Jihocesky-kraj','33--Kralovehradecky-kraj','34--Pardubicky-kraj','35--Vysocina','37--Olomoucky-kraj','36--Jihomorawsky-kraj','38--Moravskoslezsky-kraj','39--Zlinksy-kraj');
document.location.href= '/oferty-province-'+map[code][index]+','+$('#mapa').attr('title')+'.html';
}
function bookRange(input) 
{ 
var max_date= new Date();
max_date.setFullYear((max_date.getFullYear()+1));
var start_date= new Date();
start_date.setDate((start_date.getDate()+1));
return {minDate: (input.id == 'book_date_to' ? ($('#book_date_from').datepicker('getDate')?(new Date($('#book_date_from').datepicker('getDate').setDate($('#book_date_from').datepicker('getDate').getDate()+1))):start_date) : start_date), 
maxDate: (input.id == 'book_date_from' ? ($('#book_date_to').datepicker('getDate') ? $('#book_date_to').datepicker('getDate'):max_date) : max_date)};
};

