eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('k(1v 1t.6=="Q"){1t.Q=1t.Q;u 6=l(a,c){k(1t==7)q 1p 6(a,c);a=a||12;k(6.1k(a))q 1p 6(12)[6.C.28?"28":"2E"](a);k(1v a=="22"){u m=/^[^<]*(<(.|\\n)+>)[^>]*$/.2B(a);k(m)a=6.3W([m[1]]);H q 1p 6(c).2o(a)}q 7.4M(a.1g==2A&&a||(a.3e||a.G&&a!=1t&&!a.1V&&a[0]!=Q&&a[0].1V)&&6.3H(a)||[a])};k(1v $!="Q")6.2O$=$;u $=6;6.C=6.8o={3e:"1.1.1",8p:l(){q 7.G},G:0,2a:l(1R){q 1R==Q?6.3H(7):7[1R]},2q:l(a){u J=6(7);J.6j=7;q J.4M(a)},4M:l(a){7.G=0;[].1h.14(7,a);q 7},I:l(C,1y){q 6.I(7,C,1y)},2b:l(19){u 4I=-1;7.I(l(i){k(7==19)4I=i});q 4I},1E:l(20,N,v){u 19=20;k(20.1g==3p)k(N==Q)q 7.G&&6[v||"1E"](7[0],20)||Q;H{19={};19[20]=N}q 7.I(l(2b){O(u F 1B 19)6.1E(v?7.1q:7,F,6.F(7,19[F],v,2b,F))})},1f:l(20,N){q 7.1E(20,N,"2V")},2L:l(e){k(1v e=="22")q 7.3n().3t(12.8r(e));u t="";6.I(e||7,l(){6.I(7.38,l(){k(7.1V!=8)t+=7.1V!=1?7.60:6.C.2L([7])})});q t},2D:l(){u a=6.3W(1x);q 7.I(l(){u b=a[0].3V(T);7.V.2T(b,7);1Z(b.17)b=b.17;b.4i(7)})},3t:l(){q 7.35(1x,T,1,l(a){7.4i(a)})},5n:l(){q 7.35(1x,T,-1,l(a){7.2T(a,7.17)})},5h:l(){q 7.35(1x,Y,1,l(a){7.V.2T(a,7)})},5i:l(){q 7.35(1x,Y,-1,l(a){7.V.2T(a,7.2f)})},4E:l(){q 7.6j||6([])},2o:l(t){q 7.2q(6.2X(7,l(a){q 6.2o(t,a)}))},4w:l(4C){q 7.2q(6.2X(7,l(a){q a.3V(4C!=Q?4C:T)}))},1w:l(t){q 7.2q(6.1k(t)&&6.2k(7,l(2G,2b){q t.14(2G,[2b])})||6.3v(t,7))},2c:l(t){q 7.2q(t.1g==3p&&6.3v(t,7,T)||6.2k(7,l(a){k(t.1g==2A||t.3e)q 6.3g(t,a)<0;H q a!=t}))},1J:l(t){q 7.2q(6.2i(7.2a(),t.1g==3p?6(t).2a():t.G!=Q&&!t.1u?t:[t]))},46:l(1n){q 1n?6.1w(1n,7).r.G>0:Y},18:l(18){q 18==Q?(7.G?7[0].N:1c):7.1E("N",18)},4Q:l(18){q 18==Q?(7.G?7[0].2H:1c):7.3n().3t(18)},35:l(1y,1N,3F,C){u 4w=7.G>1;u a=6.3W(1y);k(3F<0)a.8s();q 7.I(l(){u 19=7;k(1N&&6.1u(7,"1N")&&6.1u(a[0],"3U"))19=7.5E("1T")[0]||7.4i(12.6e("1T"));6.I(a,l(){C.14(19,[4w?7.3V(T):7])})})}};6.1A=6.C.1A=l(){u 1P=1x[0],a=1;k(1x.G==1){1P=7;a=0}u F;1Z(F=1x[a++])O(u i 1B F)1P[i]=F[i];q 1P};6.1A({8v:l(){k(6.2O$)$=6.2O$;q 6},1k:l(C){q!!C&&1v C!="22"&&1v C[0]=="Q"&&/l/i.1s(C+"")},1u:l(B,W){q B.1u&&B.1u.3u()==W.3u()},I:l(19,C,1y){k(19.G==Q)O(u i 1B 19)C.14(19[i],1y||[i,19[i]]);H O(u i=0,6l=19.G;i<6l;i++)k(C.14(19[i],1y||[i,19[i]])===Y)4q;q 19},F:l(B,N,v,2b,F){k(6.1k(N))q N.3s(B,[2b]);u 6m=/z-?2b|7C-?7D|1b|64|8x-?26/i;k(N.1g==3N&&v=="2V"&&!6m.1s(F))q N+"49";q N},16:{1J:l(B,c){6.I(c.3o(/\\s+/),l(i,M){k(!6.16.2P(B.16,M))B.16+=(B.16?" ":"")+M})},2g:l(B,c){B.16=c?6.2k(B.16.3o(/\\s+/),l(M){q!6.16.2P(c,M)}).55(" "):""},2P:l(t,c){t=t.16||t;q t&&1p 4V("(^|\\\\s)"+c+"(\\\\s|$)").1s(t)}},44:l(e,o,f){O(u i 1B o){e.1q["1H"+i]=e.1q[i];e.1q[i]=o[i]}f.14(e,[]);O(u i 1B o)e.1q[i]=e.1q["1H"+i]},1f:l(e,p){k(p=="26"||p=="40"){u 1H={},41,3f,d=["7x","8z","8A","8B"];6.I(d,l(){1H["8C"+7]=0;1H["8E"+7+"8F"]=0});6.44(e,1H,l(){k(6.1f(e,"1e")!="1Y"){41=e.6E;3f=e.6v}H{e=6(e.3V(T)).2o(":4h").5j("2S").4E().1f({4g:"1C",3Z:"6q",1e:"2t",7v:"0",6r:"0"}).5f(e.V)[0];u 3c=6.1f(e.V,"3Z");k(3c==""||3c=="43")e.V.1q.3Z="6s";41=e.6t;3f=e.6u;k(3c==""||3c=="43")e.V.1q.3Z="43";e.V.39(e)}});q p=="26"?41:3f}q 6.2V(e,p)},2V:l(B,F,6k){u J;k(F=="1b"&&6.U.1m)q 6.1E(B.1q,"1b");k(F=="4L"||F=="2u")F=6.U.1m?"3l":"2u";k(!6k&&B.1q[F])J=B.1q[F];H k(12.3X&&12.3X.45){k(F=="2u"||F=="3l")F="4L";F=F.1U(/([A-Z])/g,"-$1").4P();u M=12.3X.45(B,1c);k(M)J=M.53(F);H k(F=="1e")J="1Y";H 6.44(B,{1e:"2t"},l(){u c=12.3X.45(7,"");J=c&&c.53(F)||""})}H k(B.4Z){u 54=F.1U(/\\-(\\w)/g,l(m,c){q c.3u()});J=B.4Z[F]||B.4Z[54]}q J},3W:l(a){u r=[];6.I(a,l(i,1L){k(!1L)q;k(1L.1g==3N)1L=1L.8m();k(1v 1L=="22"){u s=6.2Z(1L),1W=12.6e("1W"),2e=[];u 2D=!s.15("<1l")&&[1,"<3T>","</3T>"]||(!s.15("<6y")||!s.15("<1T")||!s.15("<6A"))&&[1,"<1N>","</1N>"]||!s.15("<3U")&&[2,"<1N><1T>","</1T></1N>"]||(!s.15("<6B")||!s.15("<6D"))&&[3,"<1N><1T><3U>","</3U></1T></1N>"]||[0,"",""];1W.2H=2D[1]+s+2D[2];1Z(2D[0]--)1W=1W.17;k(6.U.1m){k(!s.15("<1N")&&s.15("<1T")<0)2e=1W.17&&1W.17.38;H k(2D[1]=="<1N>"&&s.15("<1T")<0)2e=1W.38;O(u n=2e.G-1;n>=0;--n)k(6.1u(2e[n],"1T")&&!2e[n].38.G)2e[n].V.39(2e[n])}1L=1W.38}k(1L.G===0)q;k(1L[0]==Q)r.1h(1L);H r=6.2i(r,1L)});q r},1E:l(B,W,N){u 2m={"O":"6G","6H":"16","4L":6.U.1m?"3l":"2u",2u:6.U.1m?"3l":"2u",2H:"2H",16:"16",N:"N",2R:"2R",2S:"2S",6K:"6L",2Q:"2Q"};k(W=="1b"&&6.U.1m&&N!=Q){B.64=1;q B.1w=B.1w.1U(/4K\\([^\\)]*\\)/6M,"")+(N==1?"":"4K(1b="+N*57+")")}H k(W=="1b"&&6.U.1m)q B.1w?4f(B.1w.6N(/4K\\(1b=(.*)\\)/)[1])/57:1;k(W=="1b"&&6.U.36&&N==1)N=0.7X;k(2m[W]){k(N!=Q)B[2m[W]]=N;q B[2m[W]]}H k(N==Q&&6.U.1m&&6.1u(B,"5S")&&(W=="6Q"||W=="7V"))q B.6S(W).60;H k(B.6T){k(N!=Q)B.7R(W,N);q B.3D(W)}H{W=W.1U(/-([a-z])/6W,l(z,b){q b.3u()});k(N!=Q)B[W]=N;q B[W]}},2Z:l(t){q t.1U(/^\\s+|\\s+$/g,"")},3H:l(a){u r=[];k(a.1g!=2A)O(u i=0,2w=a.G;i<2w;i++)r.1h(a[i]);H r=a.3J(0);q r},3g:l(b,a){O(u i=0,2w=a.G;i<2w;i++)k(a[i]==b)q i;q-1},2i:l(2v,3P){u r=[].3J.3s(2v,0);O(u i=0,63=3P.G;i<63;i++)k(6.3g(3P[i],r)==-1)2v.1h(3P[i]);q 2v},2k:l(1Q,C,48){k(1v C=="22")C=1p 4D("a","i","q "+C);u 1d=[];O(u i=0,2G=1Q.G;i<2G;i++)k(!48&&C(1Q[i],i)||48&&!C(1Q[i],i))1d.1h(1Q[i]);q 1d},2X:l(1Q,C){k(1v C=="22")C=1p 4D("a","q "+C);u 1d=[],r=[];O(u i=0,2G=1Q.G;i<2G;i++){u 18=C(1Q[i],i);k(18!==1c&&18!=Q){k(18.1g!=2A)18=[18];1d=1d.70(18)}}u r=1d.G?[1d[0]]:[];5d:O(u i=1,5N=1d.G;i<5N;i++){O(u j=0;j<i;j++)k(1d[i]==r[j])5z 5d;r.1h(1d[i])}q r}});1p l(){u b=7H.72.4P();6.U={2C:/5I/.1s(b),37:/37/.1s(b),1m:/1m/.1s(b)&&!/37/.1s(b),36:/36/.1s(b)&&!/(74|5I)/.1s(b)};6.75=!6.U.1m||12.76=="7B"};6.I({5p:"a.V",4s:"6.4s(a)",78:"6.25(a,2,\'2f\')",7z:"6.25(a,2,\'5o\')",79:"6.2F(a.V.17,a)",7b:"6.2F(a.17)"},l(i,n){6.C[i]=l(a){u J=6.2X(7,n);k(a&&1v a=="22")J=6.3v(a,J);q 7.2q(J)}});6.I({5f:"3t",7d:"5n",2T:"5h",7f:"5i"},l(i,n){6.C[i]=l(){u a=1x;q 7.I(l(){O(u j=0,2w=a.G;j<2w;j++)6(a[j])[n](7)})}});6.I({5j:l(20){6.1E(7,20,"");7.7h(20)},7i:l(c){6.16.1J(7,c)},7j:l(c){6.16.2g(7,c)},7l:l(c){6.16[6.16.2P(7,c)?"2g":"1J"](7,c)},2g:l(a){k(!a||6.1w(a,[7]).r.G)7.V.39(7)},3n:l(){1Z(7.17)7.39(7.17)}},l(i,n){6.C[i]=l(){q 7.I(n,1x)}});6.I(["5m","5l","5e","5r"],l(i,n){6.C[n]=l(1R,C){q 7.1w(":"+n+"("+1R+")",C)}});6.I(["26","40"],l(i,n){6.C[n]=l(h){q h==Q?(7.G?6.1f(7[0],n):1c):7.1f(n,h.1g==3p?h:h+"49")}});6.1A({1n:{"":"m[2]==\'*\'||6.1u(a,m[2])","#":"a.3D(\'3Y\')==m[2]",":":{5l:"i<m[3]-0",5e:"i>m[3]-0",25:"m[3]-0==i",5m:"m[3]-0==i",2v:"i==0",2W:"i==r.G-1",5M:"i%2==0",5O:"i%2","25-3k":"6.25(a.V.17,m[3],\'2f\',a)==a","2v-3k":"6.25(a.V.17,1,\'2f\')==a","2W-3k":"6.25(a.V.7n,1,\'5o\')==a","7o-3k":"6.2F(a.V.17).G==1",5p:"a.17",3n:"!a.17",5r:"6.C.2L.14([a]).15(m[3])>=0",3a:\'a.v!="1C"&&6.1f(a,"1e")!="1Y"&&6.1f(a,"4g")!="1C"\',1C:\'a.v=="1C"||6.1f(a,"1e")=="1Y"||6.1f(a,"4g")=="1C"\',7q:"!a.2R",2R:"a.2R",2S:"a.2S",2Q:"a.2Q||6.1E(a,\'2Q\')",2L:"a.v==\'2L\'",4h:"a.v==\'4h\'",59:"a.v==\'59\'",42:"a.v==\'42\'",58:"a.v==\'58\'",4O:"a.v==\'4O\'",5v:"a.v==\'5v\'",5w:"a.v==\'5w\'",3h:\'a.v=="3h"||6.1u(a,"3h")\',5x:"/5x|3T|7s|3h/i.1s(a.1u)"},".":"6.16.2P(a,m[2])","@":{"=":"z==m[4]","!=":"z!=m[4]","^=":"z&&!z.15(m[4])","$=":"z&&z.2Y(z.G - m[4].G,m[4].G)==m[4]","*=":"z&&z.15(m[4])>=0","":"z",4U:l(m){q["",m[1],m[3],m[2],m[5]]},5J:"z=a[m[3]]||6.1E(a,m[3]);"},"[":"6.2o(m[2],a).G"},5G:[/^\\[ *(@)([a-2l-3y-]*) *([!*$^=]*) *(\'?"?)(.*?)\\4 *\\]/i,/^(\\[)\\s*(.*?(\\[.*?\\])?[^[]*?)\\s*\\]/,/^(:)([a-2l-3y-]*)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/i,/^([:.#]*)([a-2l-3y*-]*)/i],1O:[/^(\\/?\\.\\.)/,"a.V",/^(>|\\/)/,"6.2F(a.17)",/^(\\+)/,"6.25(a,2,\'2f\')",/^(~)/,l(a){u s=6.2F(a.V.17);q s.3J(0,6.3g(a,s))}],3v:l(1n,1Q,2c){u 1H,M=[];1Z(1n&&1n!=1H){1H=1n;u f=6.1w(1n,1Q,2c);1n=f.t.1U(/^\\s*,\\s*/,"");M=2c?1Q=f.r:6.2i(M,f.r)}q M},2o:l(t,1r){k(1v t!="22")q[t];k(1r&&!1r.1V)1r=1c;1r=1r||12;k(!t.15("//")){1r=1r.4y;t=t.2Y(2,t.G)}H k(!t.15("/")){1r=1r.4y;t=t.2Y(1,t.G);k(t.15("/")>=1)t=t.2Y(t.15("/"),t.G)}u J=[1r],29=[],2W=1c;1Z(t&&2W!=t){u r=[];2W=t;t=6.2Z(t).1U(/^\\/\\//i,"");u 3x=Y;u 1G=/^[\\/>]\\s*([a-2l-9*-]+)/i;u m=1G.2B(t);k(m){6.I(J,l(){O(u c=7.17;c;c=c.2f)k(c.1V==1&&(6.1u(c,m[1])||m[1]=="*"))r.1h(c)});J=r;t=t.1U(1G,"");k(t.15(" ")==0)5z;3x=T}H{O(u i=0;i<6.1O.G;i+=2){u 1G=6.1O[i];u m=1G.2B(t);k(m){r=J=6.2X(J,6.1k(6.1O[i+1])?6.1O[i+1]:l(a){q 3B(6.1O[i+1])});t=6.2Z(t.1U(1G,""));3x=T;4q}}}k(t&&!3x){k(!t.15(",")){k(J[0]==1r)J.4m();6.2i(29,J);r=J=[1r];t=" "+t.2Y(1,t.G)}H{u 34=/^([a-2l-3y-]+)(#)([a-2l-9\\\\*2O-]*)/i;u m=34.2B(t);k(m){m=[0,m[2],m[3],m[1]]}H{34=/^([#.]?)([a-2l-9\\\\*2O-]*)/i;m=34.2B(t)}k(m[1]=="#"&&J[J.G-1].4R){u 3z=J[J.G-1].4R(m[2]);J=r=3z&&(!m[3]||6.1u(3z,m[3]))?[3z]:[]}H{k(m[1]==".")u 4k=1p 4V("(^|\\\\s)"+m[2]+"(\\\\s|$)");6.I(J,l(){u 3C=m[1]!=""||m[0]==""?"*":m[2];k(6.1u(7,"7w")&&3C=="*")3C="2U";6.2i(r,m[1]!=""&&J.G!=1?6.4r(7,[],m[1],m[2],4k):7.5E(3C))});k(m[1]=="."&&J.G==1)r=6.2k(r,l(e){q 4k.1s(e.16)});k(m[1]=="#"&&J.G==1){u 5F=r;r=[];6.I(5F,l(){k(7.3D("3Y")==m[2]){r=[7];q Y}})}J=r}t=t.1U(34,"")}}k(t){u 18=6.1w(t,r);J=r=18.r;t=6.2Z(18.t)}}k(J&&J[0]==1r)J.4m();6.2i(29,J);q 29},1w:l(t,r,2c){1Z(t&&/^[a-z[({<*:.#]/i.1s(t)){u p=6.5G,m;6.I(p,l(i,1G){m=1G.2B(t);k(m){t=t.7y(m[0].G);k(6.1n[m[1]].4U)m=6.1n[m[1]].4U(m);q Y}});k(m[1]==":"&&m[2]=="2c")r=6.1w(m[3],r,T).r;H k(m[1]=="."){u 1G=1p 4V("(^|\\\\s)"+m[2]+"(\\\\s|$)");r=6.2k(r,l(e){q 1G.1s(e.16||"")},2c)}H{u f=6.1n[m[1]];k(1v f!="22")f=6.1n[m[1]][m[2]];3B("f = l(a,i){"+(6.1n[m[1]].5J||"")+"q "+f+"}");r=6.2k(r,f,2c)}}q{r:r,t:t}},4r:l(o,r,1O,W,1G){O(u s=o.17;s;s=s.2f)k(s.1V==1){u 1J=T;k(1O==".")1J=s.16&&1G.1s(s.16);H k(1O=="#")1J=s.3D("3Y")==W;k(1J)r.1h(s);k(1O=="#"&&r.G)4q;k(s.17)6.4r(s,r,1O,W,1G)}q r},4s:l(B){u 4N=[];u M=B.V;1Z(M&&M!=12){4N.1h(M);M=M.V}q 4N},25:l(M,1d,3F,B){1d=1d||1;u 1R=0;O(;M;M=M[3F]){k(M.1V==1)1R++;k(1R==1d||1d=="5M"&&1R%2==0&&1R>1&&M==B||1d=="5O"&&1R%2==1&&M==B)q M}},2F:l(n,B){u r=[];O(;n;n=n.2f){k(n.1V==1&&(!B||n!=B))r.1h(n)}q r}});6.E={1J:l(S,v,1j,D){k(6.U.1m&&S.4c!=Q)S=1t;k(D)1j.D=D;k(!1j.2n)1j.2n=7.2n++;k(!S.1I)S.1I={};u 32=S.1I[v];k(!32){32=S.1I[v]={};k(S["3I"+v])32[0]=S["3I"+v]}32[1j.2n]=1j;S["3I"+v]=7.5T;k(!7.1i[v])7.1i[v]=[];7.1i[v].1h(S)},2n:1,1i:{},2g:l(S,v,1j){k(S.1I)k(v&&v.v)4u S.1I[v.v][v.1j.2n];H k(v&&S.1I[v])k(1j)4u S.1I[v][1j.2n];H O(u i 1B S.1I[v])4u S.1I[v][i];H O(u j 1B S.1I)7.2g(S,j)},1M:l(v,D,S){D=6.3H(D||[]);k(!S)6.I(7.1i[v]||[],l(){6.E.1M(v,D,7)});H{u 1j=S["3I"+v],18,C=6.1k(S[v]);k(1j){D.5U(7.2m({v:v,1P:S}));k((18=1j.14(S,D))!==Y)7.4v=T}k(C&&18!==Y)S[v]();7.4v=Y}},5T:l(E){k(1v 6=="Q"||6.E.4v)q;E=6.E.2m(E||1t.E||{});u 3M;u c=7.1I[E.v];u 1y=[].3J.3s(1x,1);1y.5U(E);O(u j 1B c){1y[0].1j=c[j];1y[0].D=c[j].D;k(c[j].14(7,1y)===Y){E.2h();E.2z();3M=Y}}k(6.U.1m)E.1P=E.2h=E.2z=E.1j=E.D=1c;q 3M},2m:l(E){k(!E.1P&&E.5V)E.1P=E.5V;k(E.5W==Q&&E.5Y!=Q){u e=12.4y,b=12.7K;E.5W=E.5Y+(e.5Z||b.5Z);E.7M=E.7N+(e.61||b.61)}k(6.U.2C&&E.1P.1V==3){u 33=E;E=6.1A({},33);E.1P=33.1P.V;E.2h=l(){q 33.2h()};E.2z=l(){q 33.2z()}}k(!E.2h)E.2h=l(){7.3M=Y};k(!E.2z)E.2z=l(){7.7Q=T};q E}};6.C.1A({3R:l(v,D,C){q 7.I(l(){6.E.1J(7,v,C||D,D)})},6n:l(v,D,C){q 7.I(l(){6.E.1J(7,v,l(E){6(7).62(E);q(C||D).14(7,1x)},D)})},62:l(v,C){q 7.I(l(){6.E.2g(7,v,C)})},1M:l(v,D){q 7.I(l(){6.E.1M(v,D,7)})},3r:l(){u a=1x;q 7.69(l(e){7.4F=7.4F==0?1:0;e.2h();q a[7.4F].14(7,[e])||Y})},7T:l(f,g){l 4e(e){u p=(e.v=="3S"?e.7U:e.7Y)||e.7Z;1Z(p&&p!=7)2s{p=p.V}2y(e){p=7};k(p==7)q Y;q(e.v=="3S"?f:g).14(7,[e])}q 7.3S(4e).6b(4e)},28:l(f){k(6.3O)f.14(12,[6]);H{6.3b.1h(l(){q f.14(7,[6])})}q 7}});6.1A({3O:Y,3b:[],28:l(){k(!6.3O){6.3O=T;k(6.3b){6.I(6.3b,l(){7.14(12)});6.3b=1c}k(6.U.36||6.U.37)12.81("6g",6.28,Y)}}});1p l(){6.I(("82,83,2E,84,85,4Y,69,86,"+"87,88,89,3S,6b,8b,3T,"+"4O,8d,8f,8g,2M").3o(","),l(i,o){6.C[o]=l(f){q f?7.3R(o,f):7.1M(o)}});k(6.U.36||6.U.37)12.8h("6g",6.28,Y);H k(6.U.1m){12.8i("<8j"+"8l 3Y=6a 8q=T "+"4B=//:><\\/2d>");u 2d=12.4R("6a");k(2d)2d.2p=l(){k(7.3A!="1X")q;7.V.39(7);6.28()};2d=1c}H k(6.U.2C)6.4W=4c(l(){k(12.3A=="8t"||12.3A=="1X"){5u(6.4W);6.4W=1c;6.28()}},10);6.E.1J(1t,"2E",6.28)};k(6.U.1m)6(1t).6n("4Y",l(){u 1i=6.E.1i;O(u v 1B 1i){u 4X=1i[v],i=4X.G;k(i&&v!=\'4Y\')6p 6.E.2g(4X[i-1],v);1Z(--i)}});6.C.1A({1K:l(P,K){u 1C=7.1w(":1C");P?1C.23({26:"1K",40:"1K",1b:"1K"},P,K):1C.I(l(){7.1q.1e=7.2N?7.2N:"";k(6.1f(7,"1e")=="1Y")7.1q.1e="2t"});q 7},1D:l(P,K){u 3a=7.1w(":3a");P?3a.23({26:"1D",40:"1D",1b:"1D"},P,K):3a.I(l(){7.2N=7.2N||6.1f(7,"1e");k(7.2N=="1Y")7.2N="2t";7.1q.1e="1Y"});q 7},52:6.C.3r,3r:l(C,4S){u 1y=1x;q 6.1k(C)&&6.1k(4S)?7.52(C,4S):7.I(l(){6(7)[6(7).46(":1C")?"1K":"1D"].14(6(7),1y)})},6x:l(P,K){q 7.23({26:"1K"},P,K)},6z:l(P,K){q 7.23({26:"1D"},P,K)},6C:l(P,K){q 7.I(l(){u 56=6(7).46(":1C")?"1K":"1D";6(7).23({26:56},P,K)})},6F:l(P,K){q 7.23({1b:"1K"},P,K)},6I:l(P,K){q 7.23({1b:"1D"},P,K)},6J:l(P,3q,K){q 7.23({1b:3q},P,K)},23:l(F,P,1o,K){q 7.1F(l(){7.2r=6.1A({},F);u 1l=6.P(P,1o,K);O(u p 1B F){u e=1p 6.30(7,1l,p);k(F[p].1g==3N)e.2x(e.M(),F[p]);H e[F[p]](F)}})},1F:l(v,C){k(!C){C=v;v="30"}q 7.I(l(){k(!7.1F)7.1F={};k(!7.1F[v])7.1F[v]=[];7.1F[v].1h(C);k(7.1F[v].G==1)C.14(7)})}});6.1A({P:l(P,1o,C){u 1l=P&&P.1g==6O?P:{1X:C||!C&&1o||6.1k(P)&&P,24:P,1o:C&&1o||1o&&1o.1g!=4D&&1o};1l.24=(1l.24&&1l.24.1g==3N?1l.24:{6U:6X,6Y:51}[1l.24])||6Z;1l.1H=1l.1X;1l.1X=l(){6.5X(7,"30");k(6.1k(1l.1H))1l.1H.14(7)};q 1l},1o:{},1F:{},5X:l(B,v){v=v||"30";k(B.1F&&B.1F[v]){B.1F[v].4m();u f=B.1F[v][0];k(f)f.14(B)}},30:l(B,1a,F){u z=7;u y=B.1q;u 4j=6.1f(B,"1e");y.1e="2t";y.5y="1C";z.a=l(){k(1a.3j)1a.3j.14(B,[z.2j]);k(F=="1b")6.1E(y,"1b",z.2j);H k(5g(z.2j))y[F]=5g(z.2j)+"49"};z.5k=l(){q 4f(6.1f(B,F))};z.M=l(){u r=4f(6.2V(B,F));q r&&r>-7g?r:z.5k()};z.2x=l(4d,3q){z.4o=(1p 5s()).5t();z.2j=4d;z.a();z.47=4c(l(){z.3j(4d,3q)},13)};z.1K=l(){k(!B.1z)B.1z={};B.1z[F]=7.M();1a.1K=T;z.2x(0,B.1z[F]);k(F!="1b")y[F]="5q"};z.1D=l(){k(!B.1z)B.1z={};B.1z[F]=7.M();1a.1D=T;z.2x(B.1z[F],0)};z.3r=l(){k(!B.1z)B.1z={};B.1z[F]=7.M();k(4j=="1Y"){1a.1K=T;k(F!="1b")y[F]="5q";z.2x(0,B.1z[F])}H{1a.1D=T;z.2x(B.1z[F],0)}};z.3j=l(31,3G){u t=(1p 5s()).5t();k(t>1a.24+z.4o){5u(z.47);z.47=1c;z.2j=3G;z.a();k(B.2r)B.2r[F]=T;u 29=T;O(u i 1B B.2r)k(B.2r[i]!==T)29=Y;k(29){y.5y="";y.1e=4j;k(6.1f(B,"1e")=="1Y")y.1e="2t";k(1a.1D)y.1e="1Y";k(1a.1D||1a.1K)O(u p 1B B.2r)k(p=="1b")6.1E(y,p,B.1z[p]);H y[p]=""}k(29&&6.1k(1a.1X))1a.1X.14(B)}H{u n=t-7.4o;u p=n/1a.24;z.2j=1a.1o&&6.1o[1a.1o]?6.1o[1a.1o](p,n,31,(3G-31),1a.24):((-5L.7E(p*5L.7F)/2)+0.5)*(3G-31)+31;z.a()}}}});6.C.1A({7G:l(R,21,K){7.2E(R,21,K,1)},2E:l(R,21,K,1S){k(6.1k(R))q 7.3R("2E",R);K=K||l(){};u v="65";k(21)k(6.1k(21)){K=21;21=1c}H{21=6.2U(21);v="6f"}u 4x=7;6.3d({R:R,v:v,D:21,1S:1S,1X:l(2J,11){k(11=="2K"||!1S&&11=="5H")4x.1E("2H",2J.3L).4T().I(K,[2J.3L,11,2J]);H K.14(4x,[2J.3L,11,2J])}});q 7},7L:l(){q 6.2U(7)},4T:l(){q 7.2o("2d").I(l(){k(7.4B)6.6c(7.4B);H 6.4H(7.2L||7.7P||7.2H||"")}).4E()}});k(!1t.3w)3w=l(){q 1p 7S("7W.80")};6.I("68,5R,5Q,6h,5P,5C".3o(","),l(i,o){6.C[o]=l(f){q 7.3R(o,f)}});6.1A({2a:l(R,D,K,v,1S){k(6.1k(D)){K=D;D=1c}q 6.3d({R:R,D:D,2K:K,4t:v,1S:1S})},8a:l(R,D,K,v){q 6.2a(R,D,K,v,1)},6c:l(R,K){q 6.2a(R,1c,K,"2d")},8c:l(R,D,K){q 6.2a(R,D,K,"67")},8e:l(R,D,K,v){k(6.1k(D)){K=D;D={}}q 6.3d({v:"6f",R:R,D:D,2K:K,4t:v})},8k:l(27){6.3K.27=27},8n:l(6o){6.1A(6.3K,6o)},3K:{1i:T,v:"65",27:0,5a:"8u/x-8w-5S-8D",50:T,4G:T,D:1c},3m:{},3d:l(s){s=6.1A({},6.3K,s);k(s.D){k(s.50&&1v s.D!="22")s.D=6.2U(s.D);k(s.v.4P()=="2a")s.R+=((s.R.15("?")>-1)?"&":"?")+s.D}k(s.1i&&!6.4a++)6.E.1M("68");u 4z=Y;u L=1p 3w();L.6P(s.v,s.R,s.4G);k(s.D)L.3i("6R-6V",s.5a);k(s.1S)L.3i("71-4A-73",6.3m[s.R]||"77, 7a 7c 7e 4b:4b:4b 7k");L.3i("X-7m-7p","3w");k(L.7r)L.3i("7t","7u");k(s.5A)s.5A(L);k(s.1i)6.E.1M("5C",[L,s]);u 2p=l(4n){k(L&&(L.3A==4||4n=="27")){4z=T;u 11;2s{11=6.6i(L)&&4n!="27"?s.1S&&6.6d(L,s.R)?"5H":"2K":"2M";k(11!="2M"){u 3E;2s{3E=L.4l("66-4A")}2y(e){}k(s.1S&&3E)6.3m[s.R]=3E;u D=6.5D(L,s.4t);k(s.2K)s.2K(D,11);k(s.1i)6.E.1M("5P",[L,s])}H 6.3Q(s,L,11)}2y(e){11="2M";6.3Q(s,L,11,e)}k(s.1i)6.E.1M("5Q",[L,s]);k(s.1i&&!--6.4a)6.E.1M("5R");k(s.1X)s.1X(L,11);L.2p=l(){};L=1c}};L.2p=2p;k(s.27>0)5c(l(){k(L){L.7J();k(!4z)2p("27")}},s.27);u 4J=L;2s{4J.7O(s.D)}2y(e){6.3Q(s,L,1c,e)}k(!s.4G)2p();q 4J},3Q:l(s,L,11,e){k(s.2M)s.2M(L,11,e);k(s.1i)6.E.1M("6h",[L,s,e])},4a:0,6i:l(r){2s{q!r.11&&8y.8G=="42:"||(r.11>=51&&r.11<6w)||r.11==5b||6.U.2C&&r.11==Q}2y(e){}q Y},6d:l(L,R){2s{u 5K=L.4l("66-4A");q L.11==5b||5K==6.3m[R]||6.U.2C&&L.11==Q}2y(e){}q Y},5D:l(r,v){u 4p=r.4l("7A-v");u D=!v&&4p&&4p.15("L")>=0;D=v=="L"||D?r.7I:r.3L;k(v=="2d")6.4H(D);k(v=="67")3B("D = "+D);k(v=="4Q")6("<1W>").4Q(D).4T();q D},2U:l(a){u s=[];k(a.1g==2A||a.3e)6.I(a,l(){s.1h(2I(7.W)+"="+2I(7.N))});H O(u j 1B a)k(a[j]&&a[j].1g==2A)6.I(a[j],l(){s.1h(2I(j)+"="+2I(7))});H s.1h(2I(j)+"="+2I(a[j]));q s.55("&")},4H:l(D){k(1t.5B)1t.5B(D);H k(6.U.2C)1t.5c(D,0);H 3B.3s(1t,D)}})}',62,539,'||||||jQuery|this|||||||||||||if|function|||||return||||var|type||||||elem|fn|data|event|prop|length|else|each|ret|callback|xml|cur|value|for|speed|undefined|url|element|true|browser|parentNode|name||false|||status|document||apply|indexOf|className|firstChild|val|obj|options|opacity|null|result|display|css|constructor|push|global|handler|isFunction|opt|msie|expr|easing|new|style|context|test|window|nodeName|typeof|filter|arguments|args|orig|extend|in|hidden|hide|attr|queue|re|old|events|add|show|arg|trigger|table|token|target|elems|num|ifModified|tbody|replace|nodeType|div|complete|none|while|key|params|string|animate|duration|nth|height|timeout|ready|done|get|index|not|script|tb|nextSibling|remove|preventDefault|merge|now|grep|z0|fix|guid|find|onreadystatechange|pushStack|curAnim|try|block|cssFloat|first|al|custom|catch|stopPropagation|Array|exec|safari|wrap|load|sibling|el|innerHTML|encodeURIComponent|res|success|text|error|oldblock|_|has|selected|disabled|checked|insertBefore|param|curCSS|last|map|substr|trim|fx|firstNum|handlers|originalEvent|re2|domManip|mozilla|opera|childNodes|removeChild|visible|readyList|parPos|ajax|jquery|oWidth|inArray|button|setRequestHeader|step|child|styleFloat|lastModified|empty|split|String|to|toggle|call|append|toUpperCase|multiFilter|XMLHttpRequest|foundToken|9_|oid|readyState|eval|tag|getAttribute|modRes|dir|lastNum|makeArray|on|slice|ajaxSettings|responseText|returnValue|Number|isReady|second|handleError|bind|mouseover|select|tr|cloneNode|clean|defaultView|id|position|width|oHeight|file|static|swap|getComputedStyle|is|timer|inv|px|active|00|setInterval|from|handleHover|parseFloat|visibility|radio|appendChild|oldDisplay|rec|getResponseHeader|shift|isTimeout|startTime|ct|break|getAll|parents|dataType|delete|triggered|clone|self|documentElement|requestDone|Modified|src|deep|Function|end|lastToggle|async|globalEval|pos|xml2|alpha|float|setArray|matched|submit|toLowerCase|html|getElementById|fn2|evalScripts|_resort|RegExp|safariTimer|els|unload|currentStyle|processData|200|_toggle|getPropertyValue|newProp|join|state|100|password|checkbox|contentType|304|setTimeout|check|gt|appendTo|parseInt|before|after|removeAttr|max|lt|eq|prepend|previousSibling|parent|1px|contains|Date|getTime|clearInterval|image|reset|input|overflow|continue|beforeSend|execScript|ajaxSend|httpData|getElementsByTagName|tmp|parse|notmodified|webkit|_prefix|xmlRes|Math|even|rl|odd|ajaxSuccess|ajaxComplete|ajaxStop|form|handle|unshift|srcElement|pageX|dequeue|clientX|scrollLeft|nodeValue|scrollTop|unbind|sl|zoom|GET|Last|json|ajaxStart|click|__ie_init|mouseout|getScript|httpNotModified|createElement|POST|DOMContentLoaded|ajaxError|httpSuccess|prevObject|force|ol|exclude|one|settings|do|absolute|left|relative|clientHeight|clientWidth|offsetWidth|300|slideDown|thead|slideUp|tfoot|td|slideToggle|th|offsetHeight|fadeIn|htmlFor|class|fadeOut|fadeTo|readonly|readOnly|gi|match|Object|open|action|Content|getAttributeNode|tagName|slow|Type|ig|600|fast|400|concat|If|userAgent|Since|compatible|boxModel|compatMode|Thu|next|siblings|01|children|Jan|prependTo|1970|insertAfter|10000|removeAttribute|addClass|removeClass|GMT|toggleClass|Requested|lastChild|only|With|enabled|overrideMimeType|textarea|Connection|close|right|object|Top|substring|prev|content|CSS1Compat|font|weight|cos|PI|loadIfModified|navigator|responseXML|abort|body|serialize|pageY|clientY|send|textContent|cancelBubble|setAttribute|ActiveXObject|hover|fromElement|method|Microsoft|9999|toElement|relatedTarget|XMLHTTP|removeEventListener|blur|focus|resize|scroll|dblclick|mousedown|mouseup|mousemove|getIfModified|change|getJSON|keydown|post|keypress|keyup|addEventListener|write|scr|ajaxTimeout|ipt|toString|ajaxSetup|prototype|size|defer|createTextNode|reverse|loaded|application|noConflict|www|line|location|Bottom|Right|Left|padding|urlencoded|border|Width|protocol'.split('|'),0,{}))
/*
 * Interface elements for jQuery - http://interface.eyecon.ro
 *
 * Copyright (c) 2006 Stefan Petre
 * Dual licensed under the MIT (MIT-LICENSE.txt) 
 * and GPL (GPL-LICENSE.txt) licenses.
 */
 eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('6.K={2n:A(e){j x=0;j y=0;j 36=k;j S=e.M;9(6(e).D(\'P\')==\'Y\'){2F=S.1P;2D=S.1f;S.1P=\'3D\';S.P=\'2q\';S.1f=\'2T\';36=J}j u=e;2r(u){x+=u.3d+(u.2B&&!6.1v.2J?F(u.2B.44)||0:0);y+=u.3c+(u.2B&&!6.1v.2J?F(u.2B.3S)||0:0);u=u.3P}u=e;2r(u&&u.3L&&u.3L.3G()!=\'11\'){x-=u.1F||0;y-=u.1C||0;u=u.1R}9(36){S.P=\'Y\';S.1f=2D;S.1P=2F}C{x:x,y:y}},3u:A(u){j x=0,y=0;2r(u){x+=u.3d||0;y+=u.3c||0;u=u.3P}C{x:x,y:y}},1J:A(e){j w=6.D(e,\'2I\');j h=6.D(e,\'2K\');j 13=0;j X=0;j S=e.M;9(6(e).D(\'P\')!=\'Y\'){13=e.37;X=e.38}T{2F=S.1P;2D=S.1f;S.1P=\'3D\';S.P=\'2q\';S.1f=\'2T\';13=e.37;X=e.38;S.P=\'Y\';S.1f=2D;S.1P=2F}C{w:w,h:h,13:13,X:X}},3q:A(u){C{13:u.37||0,X:u.38||0}},3O:A(e){j h,w,22;9(e){w=e.2g;h=e.2d}T{22=G.1e;w=1Z.34||2y.34||(22&&22.2g)||G.11.2g;h=1Z.30||2y.30||(22&&22.2d)||G.11.2d}C{w:w,h:h}},48:A(e){j t,l,w,h,1X,1Y;9(e&&e.4O.3G()!=\'11\'){t=e.1C;l=e.1F;w=e.39;h=e.35;1X=0;1Y=0}T{9(G.1e&&G.1e.1C){t=G.1e.1C;l=G.1e.1F;w=G.1e.39;h=G.1e.35}T 9(G.11){t=G.11.1C;l=G.11.1F;w=G.11.39;h=G.11.35}1X=2y.34||G.1e.2g||G.11.2g||0;1Y=2y.30||G.1e.2d||G.11.2d||0}C{t:t,l:l,w:w,h:h,1X:1X,1Y:1Y}},55:A(e,1K){j u=6(e);j t=u.D(\'3k\')||\'\';j r=u.D(\'3l\')||\'\';j b=u.D(\'3m\')||\'\';j l=u.D(\'2Y\')||\'\';9(1K)C{t:F(t)||0,r:F(r)||0,b:F(b)||0,l:F(l)};T C{t:t,r:r,b:b,l:l}},52:A(e,1K){j u=6(e);j t=u.D(\'51\')||\'\';j r=u.D(\'4L\')||\'\';j b=u.D(\'4Y\')||\'\';j l=u.D(\'4Z\')||\'\';9(1K)C{t:F(t)||0,r:F(r)||0,b:F(b)||0,l:F(l)};T C{t:t,r:r,b:b,l:l}},2L:A(e,1K){j u=6(e);j t=u.D(\'3S\')||\'\';j r=u.D(\'56\')||\'\';j b=u.D(\'4J\')||\'\';j l=u.D(\'44\')||\'\';9(1K)C{t:F(t)||0,r:F(r)||0,b:F(b)||0,l:F(l)||0};T C{t:t,r:r,b:b,l:l}},2X:A(2e){j x=2e.4v||(2e.4y+(G.1e.1F||G.11.1F))||0;j y=2e.4x||(2e.4w+(G.1e.1C||G.11.1C))||0;C{x:x,y:y}},31:A(1h,2Z){2Z(1h);1h=1h.3I;2r(1h){6.K.31(1h,2Z);1h=1h.4I}},4A:A(1h){6.K.31(1h,A(u){1y(j 2h 1U u){9(4u u[2h]===\'A\'){u[2h]=W}}})},4B:A(u,O){j 1o=$.K.48();j 32=$.K.1J(u);9(!O||O==\'24\')$(u).D({1b:1o.t+((18.2p(1o.h,1o.1Y)-1o.t-32.X)/2)+\'19\'});9(!O||O==\'2f\')$(u).D({1a:1o.l+((18.2p(1o.w,1o.1X)-1o.l-32.13)/2)+\'19\'})},5a:A(u,3Y){j 40=$(\'5v[@2G*="2H"]\',u||G),2H;40.1z(A(){2H=g.2G;g.2G=3Y;g.M.3f="5o:5r.5s.5t(2G=\'"+2H+"\')"})}};[].3U||(3z.5p.3U=A(v,n){n=(n==W)?0:n;j m=g.2V;1y(j i=n;i<m;i++)9(g[i]==v)C i;C-1});6.c={L:W,7:W,2C:A(){C g.1z(A(){9(g.2S){g.5.1j.3g(\'3R\',6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.5.Q[0])||0,y:F(8.5.Q[1])||0,w:F(8.5.Q[2])||0,h:F(8.5.Q[3])||0}}8.5.U.I=8.5.U.x-8.5.E.x;8.5.U.H=8.5.U.y-8.5.E.y},2j:A(7){9(7.5.2b||7.5.Q==\'2o\'){6(\'11\',G).2E(6.c.L.10(0))}6.c.L.3M().5h().D(\'1g\',1);9(1Z.2w){6.c.L.D(\'3f\',\'3N(1g=47)\')}},2k:A(e){6(G).3g(\'4k\',6.c.3n).3g(\'4m\',6.c.2k);9(6.c.7==W){C}j 7=6.c.7;6.c.7=W;9(7.5.2N==k){C k}9(7.5.1k==J){6(7).D(\'1f\',7.5.28)}j 2m=7.M;9(7.1D){6.c.L.D(\'3T\',\'4o\')}9(7.5.21){6.c.L.2R(7.5.21)}9(7.5.3A==k){9(7.5.16>0){9(!7.5.O||7.5.O==\'2f\'){j x=4q 6.16(7,{4l:7.5.16},\'1a\');x.4c(7.5.N.x,7.5.2a)}9(!7.5.O||7.5.O==\'24\'){j y=4q 6.16(7,{4l:7.5.16},\'1b\');y.4c(7.5.N.y,7.5.2c)}}T{9(!7.5.O||7.5.O==\'2f\')7.M.1a=7.5.2a+\'19\';9(!7.5.O||7.5.O==\'24\')7.M.1b=7.5.2c+\'19\'}6.c.2j(7);9(7.5.20==k){6(7).D(\'P\',7.5.1M)}}T 9(7.5.16>0){7.5.2i=J;j 1O=k;9(6.B&&6.R&&7.5.1k){1O=6.K.2n(6.R.L.10(0))}6.c.L.5j({1a:1O?1O.x:7.5.E.x,1b:1O?1O.y:7.5.E.y},7.5.16,A(){7.5.2i=k;9(7.5.20==k){7.M.P=7.5.1M}6.c.2j(7)})}T{6.c.2j(7);9(7.5.20==k){6(7).D(\'P\',7.5.1M)}}9(6.B&&6.B.27>0){6.B.46(7)}9(6.R&&7.5.1k){6.R.5f(7)}9(7.5.1i&&(7.5.2a!=7.5.N.x||7.5.2c!=7.5.N.y)){7.5.1i.1m(7,7.5.5e||[0,0,7.5.2a,7.5.2c])}9(7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(q.z.1E&&q.z.h==k){6.B.12[i].2U(q.z.1E)}9(q.z.h==k&&q.z.2v){3s=J}q.z.h=J;6.B.1x=q;9(6.R&&q.z.s&&6.c.7.5.1k){6.R.L.10(0).59=q.z.49;6.R.3p(q)}4a++}T 9(q.z.h==J){9(q.z.2u){q.z.2u.1m(q,[e,1c,q.z.16])}9(q.z.1E){6.B.12[i].2R(q.z.1E)}q.z.h=k}}9(6.R&&!6.B.1x&&6.c.7.1k){6.R.L.10(0).M.P=\'Y\'}9(3s){6.B.1x.z.2v.1m(6.B.1x,[e,1c])}},46:A(e){j i;1y(i 1U 6.B.12){j q=6.B.12[i].10(0);9(q.z.1A){6.B.12[i].2R(q.z.1A)}9(q.z.1E){6.B.12[i].2R(q.z.1E)}9(q.z.s){6.R.3V[6.R.3V.2V]=i}9(q.z.2x&&q.z.h==J){q.z.h=k;q.z.2x.1m(q,[e,q.z.16])}q.z.m=k;q.z.h=k}6.B.12={}},2C:A(){C g.1z(A(){9(g.2z){9(g.z.s){1q=6.2h(g,\'1q\');6.R.3J[1q]=W;6(\'.\'+g.z.a,g).3X()}6.B.15[\'d\'+g.3C]=W;g.2z=k;g.f=W}})},2A:A(o){C g.1z(A(){9(g.2z==J||!o.3Z||!6.K||!6.c){C}g.z={a:o.3Z,1A:o.4E||k,1E:o.4D||k,49:o.4F||k,2x:o.4G||o.2x||k,2v:o.2v||o.4H||k,2u:o.2u||o.4K||k,2s:o.2s||k,t:o.2t&&(o.2t==\'45\'||o.2t==\'43\')?o.2t:\'V\',16:o.16?o.16:k,m:k,h:k};9(o.54==J&&6.R){1q=6.2h(g,\'1q\');6.R.3J[1q]=g.z.a;g.z.s=J;9(o.1i){g.z.1i=o.1i;g.z.4W=6.R.4V(1q).4N}}g.2z=J;g.3C=F(18.4M()*4Q);6.B.15[\'d\'+g.3C]=6(g);6.B.27++})}};6.3Q.1B({4U:6.B.2C,4T:6.B.2A});6.4S=6.B.4e;',62,344,'|||||dragCfg|jQuery|dragged|elm|if|||iDrag||||this|||var|false||||||iEL||||el|||||dropCfg|function|iDrop|return|css|oC|parseInt|document|dy|dx|true|iUtil|helper|style|oR|axis|display|containment|iSort|es|else|cont|pointer|null|hb|none|cursorAt|get|body|highlighted|wb|dhs|zones|fx|currentPointer|Math|px|left|top|clonedEl|constructor|documentElement|position|opacity|nodeEl|onChange|dhe|so|onDragModifier|apply|zoney|clientScroll|zonex|id|els|grid|nx|ny|browser|newCoords|overzone|for|each|ac|extend|scrollTop|si|hc|scrollLeft|0px|onStop|zoneh|getSize|toInteger|gx|oD|zonew|dh|visibility|onStart|parentNode|onDrag|onSlide|in|zIndex|Function|iw|ih|window|ghosting|frameClass|de|user|vertically|gy|contBorders|count|oP|parentBorders|nRx|insideParent|nRy|clientHeight|event|horizontally|clientWidth|attr|prot|hidehelper|dragstop|snapDistance|dEs|getPosition|parent|max|block|while|onActivate|tolerance|onOut|onHover|ActiveXObject|onDrop|self|isDroppable|build|currentStyle|destroy|oldPosition|append|oldVisibility|src|png|width|opera|height|getBorder|dragElem|init|diffX|diffY|msie|removeClass|isDraggable|absolute|addClass|length|iSlider|getPointer|marginLeft|func|innerHeight|traverseDOM|windowSize|parentPos|innerWidth|scrollHeight|restoreStyle|offsetWidth|offsetHeight|scrollWidth|sliderSize|sliderPos|offsetTop|offsetLeft|clnt|filter|unbind|bottom|right|oldBorder|marginTop|marginRight|marginBottom|dragmove|onselectstart|checkhover|getSizeLite|autoSize|applyOnHover|hpc|getPositionLite|oneIsSortable|bind|fractions|draginit|Array|revert|select|idsa|hidden|measure|highlight|toLowerCase|is|firstChild|collected|getContainment|tagName|empty|alpha|getClient|offsetParent|fn|mousedown|borderTopWidth|cursor|indexOf|changed|initialPosition|DraggableDestroy|emptyGIF|accept|images|relative|auto|intersect|borderLeftWidth|fit|checkdrop|100|getScroll|shc|hlt|min|custom|dragstart|remeasure|fitToContainer|String|abs|snapToGrid|handle|mousemove|duration|mouseup|distance|move|pow|new|dragHelper|ondragstart|div|typeof|pageX|clientY|pageY|clientX|find|purgeEvents|centerEl|ondrag|hoverclass|activeclass|helperclass|ondrop|onhover|nextSibling|borderBottomWidth|onout|paddingRight|random|hash|nodeName|overflow|10000|listStyle|recallDroppables|Droppable|DroppableDestroy|serialize|os|selectable|paddingBottom|paddingLeft|userSelect|paddingTop|getPadding|mozUserSelect|sortable|getMargins|borderRightWidth|moz|test|className|fixPNG|sqrt|selectKeyHelper|cloneNode|lastSi|check|number|hide|Draggable|animate|modifyContainer|start|dragmoveBy|parseFloat|progid|prototype|khtml|DXImageTransform|Microsoft|AlphaImageLoader|Object|img|on|fromHandler'.split('|'),0,{}))
/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

var offsetfrommouse=[15,15]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.
var currentimageheight=400;


function gettrailobj(){
if (document.getElementById)
return document.getElementById("minfo").style
else if (document.all)
return document.all.minfo.style
}

function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("minfo")
else if (document.all)
return document.all.minfo
}


function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function showtrail(texte){
	
	$('#minfo').html("Loading...");
	$.get('dplaca.php?idc='+texte,function(data)
	{
		$('#minfo').html(data);
	});
	
	//XMLrq('http://www.xapes.net/dplaca.php?idc='+texte,'minfo');
	gettrailobj().visibility = "visible";
	

	document.onmousemove=followmouse;
	
}


function hidetrail(){
	gettrailobj().visibility="hidden"
	document.onmousemove=""
	//gettrailobj().left="-500px"

}

function followmouse(e){

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

	//if (document.all){
	//	gettrailobjnostyle().innerHTML = 'A = ' + truebody().scrollHeight + '<br>B = ' + truebody().clientHeight;
	//} else {
	//	gettrailobjnostyle().innerHTML = 'C = ' + document.body.offsetHeight + '<br>D = ' + window.innerHeight;
	//}

	if (typeof e != "undefined"){
		if (docwidth - e.pageX < 300){
			xcoord = e.pageX - xcoord - 286; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < (currentimageheight + 110)){
			ycoord += e.pageY - Math.max(0,(110 + currentimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < 300){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - 286; // Move to the left side of the cursor
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (currentimageheight + 110)){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(110 + currentimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
		if(ycoord < 0) { ycoord = ycoord*-1; }
	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"

}
    function getObj(name)	{  		if (document.getElementById)  		{    		this.obj = document.getElementById(name);			this.style = document.getElementById(name).style;  		}  		else if (document.all)  		{    		this.obj = document.all[name];			this.style = document.all[name].style;  		}  		else if (document.layers)  		{   			this.obj = document.layers[name];   			this.style = document.layers[name];  		}	}function ShowText(texte){	/*var x = new getObj('minfo');		//document.getElementById('textmouse').innerHTML = "<span class=icons>"+texte+"</span>";	XMLrq('dplaca.php?idc='+texte,'minfo');	x.style.visibility = "visible";	//alert(document.body.parentNode.scrollTop);	x.style.top = document.body.parentNode.scrollTop+100+"px";	x.style.left = "200px";*/	showtrail(texte);}function ShowTextCataleg(texte){	var x = new getObj('minfo');		XMLrq('dcataleg.php?idc='+texte,'minfo');	x.style.visibility = "visible";	amunt=20;	dreta=20;}function ShowUser(texte){	var x = new getObj('minfo');		XMLrq('duser.php?idu='+texte,'minfo');	x.style.visibility = "visible";	amunt=20;	dreta=20;}function HideText(){	/*var x = new getObj('minfo');		x.style.visibility = "hidden";	amunt=-300;	dreta=400;*/	hidetrail();}var detect = navigator.userAgent.toLowerCase();
function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
function CtObre(me)
{
		x = document.getElementById(me).style;
		
		if (checkIt('msie')) x.height = "";
		else x.height = "auto";
		parent.document.getElementById('l'+me).href="javascript:CtTanca('"+me+"')";
		//parent.document.getElementById('l'+me).style.backgroundImage="url('images/plegar.gif')";
		//parent.document.getElementById('il'+me).href="javascript:CtTanca('"+me+"')";
		//parent.document.getElementById('img'+me).src = "imatges/fletxa2.gif";
		
		
}

function CtTanca(me)
{
		x = document.getElementById(me).style;
		x.marginTop = "0px";
		x.height = "0px";
		
		parent.document.getElementById('l'+me).href="javascript:CtObre('"+me+"')";
		//parent.document.getElementById('l'+me).style.backgroundImage="url('images/desplegar.gif')";
		//parent.document.getElementById('il'+me).href="javascript:CtObre('"+me+"')";
		//parent.document.getElementById('limg'+me).href="javascript:CtObre('"+me+"')";
		//parent.document.getElementById('img'+me).src = "imatges/fletxa1.gif";
}

function CtObreMini(me)
{
		x = document.getElementById(me).style;
		
		if (checkIt('msie')) x.height = "";
		else x.height = "auto";
		parent.document.getElementById('l'+me).href="javascript:CtTancaMini('"+me+"')";
		parent.document.getElementById('img'+me).src = "imatges/fleavall.gif";
		
		
}

function CtTancaMini(me)
{
		x = document.getElementById(me).style;
		x.marginTop = "0px";
		x.height = "0px";
		
		parent.document.getElementById('l'+me).href="javascript:CtObreMini('"+me+"')";
		parent.document.getElementById('img'+me).src = "imatges/fledre.gif";
}              

function Obre(me)
{
		$('#'+me).toggle('show');
}function XMLrq(fragment_url, element_id) {
    var element = document.getElementById(element_id);
    
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        xmlhttp = new XMLHttpRequest();
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }

    element.innerHTML = '<p><em>Loading...</em></p>';
    xmlhttp.open("GET", fragment_url);
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            element.innerHTML = xmlhttp.responseText;
        }
    }
    xmlhttp.send(null);
}

function XMLrqUltimes(fragment_url, element_id,opcio,max) {
	

	for(i=0;i<=max;i++)
	{
		$('#ou'+i).removeClass();
	}
	$('#'+opcio).addClass('active');
	
	$('#'+element_id).html('<p><img src="imatges/indicator.gif"></p>');
	$.get(fragment_url,function(data)
	{
		$('#'+element_id).html(data);
		TB_init();
		JT_init();
	});
	
	
}



function LoadContent(url, element_id)
{
	$('#'+element_id).html('<p><img src="imatges/indicator.gif"><em>Updating...</em></p>');
	$.get(url,function(data)
	{
		$('#'+element_id).html(data);
	});
}

function XMLrqTop(fragment_url, element_id,opcio) {
	
	document.getElementById("tou1").className='';
	document.getElementById("tou2").className='';
	document.getElementById("tou3").className='';
	document.getElementById("tou4").className='';
	document.getElementById(opcio).className='active';
	var element_top = document.getElementById(element_id);
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        xmlhttptop = new XMLHttpRequest();
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        xmlhttptop = new ActiveXObject("Microsoft.XMLHTTP");
    }

    element_top.innerHTML = '<p><img src="imatges/indicator.gif"><em>Updating...</em></p>';
    xmlhttptop.open("GET", fragment_url);
    xmlhttptop.onreadystatechange = function() {
        if (xmlhttptop.readyState == 4 && xmlhttptop.status == 200) {
            element_top.innerHTML = xmlhttptop.responseText;
       }
    }
    xmlhttptop.send(null);
}

function XMLrqForum(fragment_url, element_id) {
	
	var element_forum = document.getElementById(element_id);
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        xmlhttpforum = new XMLHttpRequest();
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        xmlhttpforum = new ActiveXObject("Microsoft.XMLHTTP");
    }

    element_forum.innerHTML = '<p><img src="imatges/indicator.gif"><em>Updating...</em></p>';
    xmlhttpforum.open("GET", fragment_url);
    xmlhttpforum.onreadystatechange = function() {
        if (xmlhttpforum.readyState == 4 && xmlhttpforum.status == 200) {
            element_forum.innerHTML = xmlhttpforum.responseText;
       }
    }
    xmlhttpforum.send(null);
}
function DadesPlaca(action, id, idunic)
{
	correcte=true;
	switch(action)
	{
		case "delcole":
			document.getElementById('IC'+idunic).src="http://www.xapes.net/imatges/red.gif";
			// canvi URL
			document.getElementById('LC'+idunic).href="javascript:DadesPlaca('addcole','"+id+"','"+idunic+"')";
		break;
		case "addcole":
			document.getElementById('IC'+idunic).src="http://www.xapes.net/imatges/green.gif";
			document.getElementById('LC'+idunic).href="javascript:DadesPlaca('delcole','"+id+"','"+idunic+"')";
		break;
		case "delrepe":
			document.getElementById('IR'+idunic).src="http://www.xapes.net/imatges/red.gif";
			// canvi URL
			document.getElementById('LR'+idunic).href="javascript:DadesPlaca('addrepe','"+id+"','"+idunic+"')";
		break;
		case "addrepe":
			document.getElementById('IR'+idunic).src="http://www.xapes.net/imatges/green.gif";
			document.getElementById('LR'+idunic).href="javascript:DadesPlaca('delrepe','"+id+"','"+idunic+"')";
		break;
		case "addint":
			document.getElementById('II'+idunic).src="http://www.xapes.net/imatges/intnom.gif";
			document.getElementById('LI'+idunic).href="javascript:DadesPlaca('delint','"+id+"','"+idunic+"')";
		break;
		case "delint":
			document.getElementById('II'+idunic).src="http://www.xapes.net/imatges/intno.gif";
			document.getElementById('LI'+idunic).href="javascript:DadesPlaca('addint','"+id+"','"+idunic+"')";
		break;
		
	}
	if(correcte)
	{
		
		$('#capuser',parent.document).html("Carregant...");
		$.get('cap_user.inc.php?action='+action+'&idp='+id+'&idunic='+idunic,function(data)
		{
			$('#capuser',parent.document).html(data);
		});
		//XMLrqCap('cap_user.inc.php?action='+action+'&idp='+id+'&idunic='+idunic,'capuser');
	}
}/*
 * JTip
 * By Cody Lindley (http://www.codylindley.com)
 * Under an Attribution, Share Alike License
 * JTip is built on top of the very light weight jquery library.
 */

//on page load (as soon as its ready) call JT_init
$(document).ready(JT_init);

function JT_init(){
	       $("a.jTip")
		   .hover(function(){JT_show(this.href,this.id,this.name)},function(){$('#JT').remove()})
           .click(function(){return false});	   
}

function JT_show(url,linkId,title){
	if(title == false)title="&nbsp;";
	var de = document.documentElement;
	var w = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var hasArea = w - getAbsoluteLeft(linkId);
	var clickElementy = getAbsoluteTop(linkId) - 3; //set y position
	
	var queryString = url.replace(/^[^\?]+\??/,'');
	var params = parseQuery( queryString );
	if(params['width'] === undefined){params['width'] = 250};
	if(params['link'] !== undefined){
	$('#' + linkId).bind('click',function(){window.location = params['link']});
	$('#' + linkId).css('cursor','pointer');
	}
	
	if(hasArea>((params['width']*1)+75)){
		$("body").append("<div id='JT' style='width:"+params['width']*1+"px'><div id='JT_arrow_left'></div><div id='JT_close_left'>"+title+"</div><div id='JT_copy'><div class='JT_loader'><div></div></div>");//right side
		var arrowOffset = getElementWidth(linkId) + 11;
		var clickElementx = getAbsoluteLeft(linkId) + arrowOffset; //set x position
	}else{
		$("body").append("<div id='JT' style='width:"+params['width']*1+"px'><div id='JT_arrow_right' style='left:"+((params['width']*1)+1)+"px'></div><div id='JT_close_right'>"+title+"</div><div id='JT_copy'><div class='JT_loader'><div></div></div>");//left side
		var clickElementx = getAbsoluteLeft(linkId) - ((params['width']*1) + 15); //set x position
	}
	
	$('#JT').css({left: clickElementx+"px", top: clickElementy+"px"});
	$('#JT').show();
	$('#JT_copy').load(url);

}

function getElementWidth(objectId) {
	x = document.getElementById(objectId);
	return x.offsetWidth;
}

function getAbsoluteLeft(objectId) {
	// Get an object left position from the upper left viewport corner
	o = document.getElementById(objectId)
	oLeft = o.offsetLeft            // Get left position from the parent object
	while(o.offsetParent!=null) {   // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent    // Get parent object reference
		oLeft += oParent.offsetLeft // Add parent left position
		o = oParent
	}
	return oLeft
}

function getAbsoluteTop(objectId) {
	// Get an object top position from the upper left viewport corner
	o = document.getElementById(objectId)
	oTop = o.offsetTop            // Get top position from the parent object
	while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent  // Get parent object reference
		oTop += oParent.offsetTop // Add parent top position
		o = oParent
	}
	return oTop
}

function parseQuery ( query ) {
   var Params = new Object ();
   if ( ! query ) return Params; // return empty object
   var Pairs = query.split(/[;&]/);
   for ( var i = 0; i < Pairs.length; i++ ) {
      var KeyVal = Pairs[i].split('=');
      if ( ! KeyVal || KeyVal.length != 2 ) continue;
      var key = unescape( KeyVal[0] );
      var val = unescape( KeyVal[1] );
      val = val.replace(/\+/g, ' ');
      Params[key] = val;
   }
   return Params;
}

function blockEvents(evt) {
              if(evt.target){
              evt.preventDefault();
              }else{
              evt.returnValue = false;
              }
}/*
+-----------------------------------------------------------------------+
| Copyright (c) 2006-2007 Mika Tuupola, Dylan Verheul                   |
| All rights reserved.                                                  |
|                                                                       |
| Redistribution and use in source and binary forms, with or without    |
| modification, are permitted provided that the following conditions    |
| are met:                                                              |
|                                                                       |
| o Redistributions of source code must retain the above copyright      |
|   notice, this list of conditions and the following disclaimer.       |
| o Redistributions in binary form must reproduce the above copyright   |
|   notice, this list of conditions and the following disclaimer in the |
|   documentation and/or other materials provided with the distribution.|
|                                                                       |
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |
| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |
| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |
| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |
| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |
|                                                                       |
+-----------------------------------------------------------------------+
*/

/* $Id: jquery.jeditable.js,v 1.39 2007/01/17 18:04:40 tuupola Exp $ */

/**
  * jQuery inplace editor plugin (version 1.1.0)  
  *
  * Based on editable by Dylan Verheul <dylan@dyve.net>
  * http://www.dyve.net/jquery/?editable
  *
  * @name  jEditable
  * @type  jQuery
  * @param String  url                POST URL to send edited content
  * @param Hash    options            additional options 
  * @param String  options[name]      POST parameter name of edited content
  * @param String  options[id]        POST parameter name of edited div id
  * @param String  options[type]      text or textarea
  * @param Integer options[rows]      number of rows if using textarea
  * @param Integer options[cols]      number of columns if using textarea
  * @param Mixed   options[height]    'auto' or height in pixels
  * @param Mixed   options[width]     'auto' or width in pixels 
  * @param String  options[postload]  POST URL to fetch content before editing
  * @param String  options[getload]   GET URL to fetch content before editing
  * @param String  options[data]      Or content given as paramameter.
  * @param String  options[indicator] indicator html to show when saving
  * @param String  options[tooltip]   optional tooltip text via title attribute
  * @param String  options[event]     jQuery event such as 'click' of 'dblclick'
  * @param String  options[onblur]    'cancel', 'submit' or 'ignore'
  * @param String  options[submit]    submit button value, empty means no button
  * @param String  options[cancel]    cancel button value, empty means no button
  *             
  */

jQuery.fn.editable = function(url, options) {

    /* prevent elem has no properties error */
    if (this.length == 0) { 
        return false; 
    };

    var settings = {
        url    : url,
        name   : 'value',
        id     : 'id',
        type   : 'text',
        width  : 'auto',
        height : 'auto',
        event  : 'click',
        onblur : 'cancel'
    };

    if(options) {
        jQuery.extend(settings, options);
    };
      
    jQuery(this).attr('title', settings.tooltip);

    jQuery(this)[settings.event](function(e) {

        /* save this to self because this changes when scope changes */
        var self = this;

        /* prevent throwing an exeption if edit field is clicked again */
        if (self.editing) {
            return;
        }

        /* figure out how wide and tall we are */
        var width = 
            ('auto' == settings.width)  ? jQuery(self).css('width')  : settings.width;
        var height = 
            ('auto' == settings.height) ? jQuery(self).css('height') : settings.height;

        self.editing    = true;
        self.revert     = jQuery(self).html();
        self.innerHTML  = '';

        /* create the form object */
        var f = document.createElement('form');

        /*  main input element */
        var i;
        switch (settings.type) {
            case 'textarea':
                i = document.createElement('textarea');
                if (settings.rows) {
                    i.rows = settings.rows;
                } else {
                    jQuery(i).css('height', height);
                }
                if (settings.cols) {
                    i.cols = settings.cols;
                } else {
                    jQuery(i).css('width', width);
                }   
                break;
            case 'select':
                i = document.createElement('select');
                break;
            default:
                i = document.createElement('input');
                i.type  = settings.type;
                jQuery(i).css('width', width);
                jQuery(i).css('height', height);
                /* https://bugzilla.mozilla.org/show_bug.cgi?id=236791 */
                i.setAttribute('autocomplete','off');
        }
        
        /* set input content via POST, GET, given data or existing value */
        /* this looks weird because it is for maintaining bc */
        var url;
        var type;
                
        if (settings.getload) {
            url = settings.getload;
            type = 'GET';
        } else if (settings.postload) {
            url = settings.postload;
            type = 'POST';      
        }

        if (url) {
            var data = {};
            data[settings.id] = self.id;
            /*jQuery.ajax({
               type : type,
               url  : url,
               data : data,
               success: function(str) {
                  i.value = str;
               }
            });*/
            url = url + "&rand="+Math.random();
            jQuery.get(url,function(str) {
                  i.value = str;
               }
            );
        } else if (settings.data) {
            i.value = settings.data;
        } else { 
            i.value = self.revert;
        }

        i.name  = settings.name;
        f.appendChild(i);

        if (settings.submit) {
            var b = document.createElement('input');
            b.type = 'submit';
            b.value = settings.submit;
            f.appendChild(b);
        }

        if (settings.cancel) {
            var b = document.createElement('input');
            b.type = 'button';
            b.value = settings.cancel;
            f.appendChild(b);
        }

        /* add created form to self */
        self.appendChild(f);

        i.focus();
 
        /* discard changes if pressing esc */
        jQuery(i).keydown(function(e) {
            if (e.keyCode == 27) {
                e.preventDefault();
                reset();
            }
        });

        /* discard, submit or nothing with changes when clicking outside */
        /* do nothing is usable when navigating with tab */
        var t;
        if ('cancel' == settings.onblur) {
            jQuery(i).blur(function(e) {
                t = setTimeout(reset, 500)
            });
        /* TODO: does not currently work */
        } else if ('submit' == settings.onblur) {
            jQuery(i).blur(function(e) {
                jQuery(f).submit();
            });
        } else {
            jQuery(i).blur(function(e) {
              /* TODO: maybe something here */
            });
        }

        jQuery(f).submit(function(e) {

            if (t) { 
                clearTimeout(t);
            }

            /* do no submit */
            e.preventDefault(); 

            /* add edited content and id of edited element to POST */           
            var p = {};
            p[i.name] = jQuery(i).val();
            p[settings.id] = self.id;

            /* show the saving indicator */
            jQuery(self).html(options.indicator);
            // jQuery(self).load(settings.url, p, function(str) {
            jQuery.post(settings.url, p, function(str) {
                self.innerHTML = str;
                self.editing = false;
            });
            return false;
        });

        function reset() {
            self.innerHTML = self.revert;
            self.editing   = false;
        };

    });

    return(this);
}
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(5($){$.28.8=5(9,2){3(C 9==\'2v\')2=9;2=$.2N({9:(9&&C 9==\'2O\'&&9>0)?--9:0,x:g,j:$.G?1T:R,v:R,1H:g,1L:g,1A:g,1f:g,1G:\'2y\',2e:g,2f:g,2h:R,I:g,O:g,Q:g,P:\'8-2z\',T:\'8-x\',16:\'8-1J\',1k:\'8-2A\',Y:\'H\'},2||{});$.d.1e=$.d.1e||$.d.F&&C 2B==\'5\';5 1q(){27(0,0)}p 6.J(5(){4 f=6;4 8=$(\'>1n:o(0)>1v>a\',6);3(2.v){4 1h={};8.J(5(i){4 n=\'8-v-\'+(i+1);4 7=\'#\'+n;1h[7]=6.1W;6.1W=7;$(f).2C(\'<H n="\'+n+\'" 2W="2E"></H>\')})}3(U.7){8.J(5(i){3(6.7==U.7){2.9=i;3(($.d.F||$.d.2F)&&!2.v){4 c=$(U.7);4 13=c.L(\'n\');c.L(\'n\',\'\');w(5(){c.L(\'n\',13)},2G)}1q();p R}})}3($.d.F){1q()}$(\'>\'+2.Y,6).1E(\':o(\'+2.9+\')\').1I().11().2H(\':o(\'+2.9+\')\').z(2.16);3(!2.v){$(\'>1n:o(0)>1v:o(\'+2.9+\')\',6).z(2.P)}3(2.2h){4 15=$(\'>\'+2.Y,f);4 1D=5(1Y){4 1w=$.2I(15.14(),5(N){4 h,r=$(N);3(1Y){3($.d.1e){N.A.2K(\'20\');N.A.m=\'\';N.18=g}h=r.s({\'V-m\':\'\'}).m()}l{h=r.m()}p h}).2L(5(a,b){p b-a});3($.d.1e){15.J(5(){6.18=1w[0]+\'23\';6.A.2M(\'20\',\'6.A.m = 6.18 ? 6.18 : "2P"\')})}l{15.s({\'V-m\':1w[0]+\'23\'})}};1D();4 17=f.29;4 1g=f.12;4 1C=$(\'#8-24-25-1o\').14(0)||$(\'<1V n="8-24-25-1o">M</1V>\').s({1t:\'2Q\',2R:\'2S\',2T:\'1N\'}).2U(t.1u).14(0);4 1c=1C.12;2V(5(){4 1b=f.29;4 1F=f.12;4 1d=1C.12;3(1F>1g||1b!=17||1d!=1c){1D((1b>17||1d<1c));17=1b;1g=1F;1c=1d}},1x)}4 y={},B={},1r=2.2e||2.1G,1B=2.2f||2.1G;3(2.1L||2.1H){3(2.1L){y[\'m\']=\'1I\';B[\'m\']=\'1J\'}3(2.1H){y[\'D\']=\'1I\';B[\'D\']=\'1J\'}}l{3(2.1A){y=2.1A}l{y[\'V-1M\']=0;1r=2.j?1x:1}3(2.1f){B=2.1f}l{B[\'V-1M\']=0;1B=2.j?1x:1}}4 I=2.I,O=2.O,Q=2.Q;8.X(\'1U\',5(){4 7=6.7;3($(7).S(\':1N\')&&!$(6.K).S(\'.\'+2.T)){3($.d.F){$(6).E();3(2.j){$.G.1z(7);U.7=7.1p(\'#\',\'\')}}l 3($.d.1S){4 1Q=$(\'<1P 2j="\'+7+\'"><H><2k 2l="1R" 2m="h" /></H></1P>\').14(0);1Q.1R();$(6).E();3(2.j){$.G.1z(7)}}l{3(2.j){U.7=7.1p(\'#\',\'\')}l{$(6).E()}}}});8.X(\'1l\',5(){$(6.K).z(2.T)});3(2.x&&2.x.1y){21(4 i=0,k=2.x.1y;i<k;i++){8.o(--2.x[i]).19(\'1l\').11()}};8.X(\'1X\',5(){4 r=$(6.K);r.10(2.T);3($.d.1S){r.2o(1,1.0).s({1t:\'\',D:1});w(5(){r.s({D:\'\'})},2p)}});8.X(\'E\',5(e){4 1O=e.2s;4 1m=$(6.K);3(f.1K||1m.S(\'.\'+2.P)||1m.S(\'.\'+2.T)){6.2d();p R}f[\'1K\']=1T;4 c=$(6.7);3(c.1o()>0){3($.d.F&&2.j){4 13=6.7.1p(\'#\',\'\');c.L(\'n\',\'\');w(5(){c.L(\'n\',13)},0)}4 q=6;4 u=$(\'>\'+2.Y+\':2x\',f);3(C I==\'5\'){w(5(){I(q,c[0],u[0])},0)}5 1i(){3(2.j&&1O){$.G.1z(q.7)}u.22(B,1B,5(){$(q.K).z(2.P).2J().10(2.P);3(C O==\'5\'){O(q,c[0],u[0])}u.z(2.16).s({1t:\'\',26:\'\',m:\'\',D:\'\'});c.10(2.16).22(y,1r,5(){c.s({26:\'\',m:\'\',D:\'\'});3($.d.F){u[0].A.1E=\'\';c[0].A.1E=\'\'}3(C Q==\'5\'){Q(q,c[0],u[0])}f.1K=g})})}3(!2.v){1i()}l{4 1j=$(6);1j.z(2.1k);w(5(){$(q.7).2i(1h[q.7],5(){1i();1j.10(2.1k)})},0)}}l{2q(\'2r S 2t 2u f.\')}4 2a=1s.2w||t.1a&&t.1a.2b||t.1u.2b||0;4 2c=1s.2D||t.1a&&t.1a.1Z||t.1u.1Z||0;w(5(){1s.27(2a,2c)},0);6.2d();p 2.j});3(2.v){8.o(2.9).19(\'E\').11()}3(2.j){$.G.2n(5(){8.o(2.9).19(\'E\').11()})}})};4 Z=[\'1U\',\'1l\',\'1X\'];21(4 i=0;i<Z.1y;i++){$.28[Z[i]]=(5(2g){p 5(W){p 6.J(5(){4 i=W&&W>0&&W-1||0;$(\'>1n:o(0)>1v>a\',6).o(i).19(2g)})}})(Z[i])}})(2X);',62,184,'||settings|if|var|function|this|hash|tabs|initial|||toShow|browser||container|null|||bookmarkable||else|height|id|eq|return|clicked|jq|css|document|toHide|remote|setTimeout|disabled|showAnim|addClass|style|hideAnim|typeof|opacity|click|msie|ajaxHistory|div|onClick|each|parentNode|attr||el|onHide|selectedClass|onShow|false|is|disabledClass|location|min|tabIndex|bind|tabStruct|tabEvents|removeClass|end|offsetHeight|toShowId|get|tabsContents|hideClass|cachedWidth|minHeight|trigger|documentElement|currentWidth|cachedFontSize|currentFontSize|msie6|fxHide|cachedHeight|remoteUrls|switchTab|jqThis|loadingClass|disableTab|jqLi|ul|size|replace|unFocus|showSpeed|window|display|body|li|heights|50|length|update|fxShow|hideSpeed|watchFontSize|_setAutoHeight|filter|currentHeight|fxSpeed|fxFade|show|hide|locked|fxSlide|width|hidden|trueClick|form|tempForm|submit|safari|true|triggerTab|span|href|enableTab|reset|scrollTop|behaviour|for|animate|px|watch|font|overflow|scrollTo|fn|offsetWidth|scrollX|scrollLeft|scrollY|blur|fxShowSpeed|fxHideSpeed|tabEvent|fxAutoHeight|load|action|input|type|value|initialize|fadeTo|30|alert|There|clientX|no|such|object|pageXOffset|visible|normal|selected|loading|XMLHttpRequest|append|pageYOffset|fragment|opera|500|not|map|siblings|removeExpression|sort|setExpression|extend|number|1px|block|position|absolute|visibility|appendTo|setInterval|class|jQuery'.split('|'),0,{}))
/*
 * Thickbox 2.1 - jQuery plugin for displaying content in a box above the page
 * 
 * Copyright (c) 2006, 2007 Cody Lindley (http://www.codylindley.com)
 *
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 */

// on page load call TB_init
$(document).ready(TB_init);

// add thickbox to href elements that have a class of .thickbox
function TB_init(){
	$("a.thickbox").click(function(event){
		// stop default behaviour
		event.preventDefault();
		// remove click border
		this.blur();
	
		// get caption: either title or name attribute
		var caption = this.title || this.name || "";
		
		// get rel attribute for image groups
		var group = this.rel || false;
		
		// display the box for the elements href
		TB_show(caption, this.href, group);
	});
}

// called when the user clicks on a thickbox link
function TB_show(caption, url, rel) {

	// create iframe, overlay and box if non-existent
	if ( !$("#TB_HideSelect").length ) {
		$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
		$("#TB_overlay").click(TB_remove);
	}
	// TODO replace or check if event is already assigned
	$(window).scroll(TB_position);
	
	// TODO replace
	TB_overlaySize();
	
	// TODO create loader only once, hide and show on demand
	$("body").append("<div id='TB_load'><img src='imatges/loader.gif' /></div>");
	TB_load_position();
	
	// check if a query string is involved
	var baseURL = url.match(/(.+)?/)[1] || url;

	// regex to check if a href refers to an image
	var imageURL = /\.(jpe?g|png|gif|bmp)/gi;

	// check for images
	if ( baseURL.match(imageURL) ) {
		var dummy = { caption: "", url: "", html: "" };
		
		var prev = dummy,
			next = dummy,
			imageCount = "";
			
		// if an image group is given
		if ( rel ) {
			function getInfo(image, id, label) {
				return {
					caption: image.title,
					url: image.href,
					html: "<span id='TB_" + id + "'>&nbsp;&nbsp;<a href='#'>" + label + "</a></span>"
				}
			}
		
			// find the anchors that point to the group
			var imageGroup = $("a[@rel="+rel+"]").get();
			var foundSelf = false;
			
			// loop through the anchors, looking for ourself, saving information about previous and next image
			for (var i = 0; i < imageGroup.length; i++) {
				var image = imageGroup[i];
				var urlTypeTemp = image.href.match(imageURL);
				
				// look for ourself
				if ( image.href == url ) {
					foundSelf = true;
					imageCount = "Image " + (i + 1) + " of "+ (imageGroup.length);
				} else {
					// when we found ourself, the current is the next image
					if ( foundSelf ) {
						next = getInfo(image, "next", "Next &gt;");
						// stop searching
						break;
					} else {
						// didn't find ourself yet, so this may be the one before ourself
						prev = getInfo(image, "prev", "&lt; Prev");
					}
				}
			}
		}
		
		imgPreloader = new Image();
		imgPreloader.onload = function() {
			imgPreloader.onload = null;

			// Resizing large images
			var pagesize = TB_getPageSize();
			var x = pagesize[0] - 150;
			var y = pagesize[1] - 150;
			var imageWidth = imgPreloader.width;
			var imageHeight = imgPreloader.height;
			if (imageWidth > x) {
				imageHeight = imageHeight * (x / imageWidth); 
				imageWidth = x; 
				if (imageHeight > y) { 
					imageWidth = imageWidth * (y / imageHeight); 
					imageHeight = y; 
				}
			} else if (imageHeight > y) { 
				imageWidth = imageWidth * (y / imageHeight); 
				imageHeight = y; 
				if (imageWidth > x) { 
					imageHeight = imageHeight * (x / imageWidth); 
					imageWidth = x;
				}
			}
			// End Resizing
			
			// TODO don't use globals
			TB_WIDTH = imageWidth + 30;
			TB_HEIGHT = imageHeight + 60;
			
			// TODO empty window content instead
			$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + imageCount + prev.html + next.html + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>Close</a></div>");
			
			$("#TB_closeWindowButton").click(TB_remove);
			
			function buildClickHandler(image) {
				return function() {
					$("#TB_window").remove();
					$("body").append("<div id='TB_window'></div>");
					TB_show(image.caption, image.url, rel);
					return false;
				};
			}
			var goPrev = buildClickHandler(prev);
			var goNext = buildClickHandler(next);
			if ( prev.html ) {
				$("#TB_prev").click(goPrev);
			}
			
			if ( next.html ) {		
				$("#TB_next").click(goNext);
			}
			
			// TODO use jQuery, maybe with event fix plugin, or just get the necessary parts of it
			document.onkeydown = function(e) {
				if (e == null) { // ie
					keycode = event.keyCode;
				} else { // mozilla
					keycode = e.which;
				}
				switch(keycode) {
				case 27:
					TB_remove();
					break;
				case 190:
					if( next.html ) {
						document.onkeydown = null;
						goNext();
					}
					break;
				case 188:
					if( prev.html ) {
						document.onkeydown = null;
						goPrev();
					}
					break;
				}
			}
			
			// TODO don't remove loader etc., just hide and show later
			TB_position();
			$("#TB_load").remove();
			$("#TB_ImageOff").click(TB_remove);
			
			// for safari using css instead of show
			// TODO is that necessary? can't test safari
			$("#TB_window").css({display:"block"});
		}
		imgPreloader.src = url;
		
	} else { //code to show html pages
		
		var queryString = url.match(/\?(.+)/)[1];
		var params = TB_parseQuery( queryString );
		
		TB_WIDTH = (params['width']*1) + 30;
		TB_HEIGHT = (params['height']*1) + 40;

		var ajaxContentW = TB_WIDTH - 30,
			ajaxContentH = TB_HEIGHT - 45;
		
		if(url.indexOf('TB_iframe') != -1){				
			urlNoQuery = url.split('TB_');		
			$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>Close</a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' onload='TB_showIframe()'> </iframe>");
		} else {
			$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>Close</a></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");
		}
				
		$("#TB_closeWindowButton").click(TB_remove);
		
			if(url.indexOf('TB_inline') != -1){	
				$("#TB_ajaxContent").html($('#' + params['inlineId']).html());
				TB_position();
				$("#TB_load").remove();
				$("#TB_window").css({display:"block"}); 
			}else if(url.indexOf('TB_iframe') != -1){
				TB_position();
				if(frames['TB_iframeContent'] == undefined){//be nice to safari
					$("#TB_load").remove();
					$("#TB_window").css({display:"block"});
					$(document).keyup( function(e){ var key = e.keyCode; if(key == 27){TB_remove()} });
				}
			}else{
				$("#TB_ajaxContent").load(url, function(){
					TB_position();
					$("#TB_load").remove();
					$("#TB_window").css({display:"block"}); 
				});
			}
		
	}
	
	$(window).resize(TB_position);
	
	document.onkeyup = function(e){ 	
		if (e == null) { // ie
			keycode = event.keyCode;
		} else { // mozilla
			keycode = e.which;
		}
		if(keycode == 27){ // close
			TB_remove();
		}	
	}
		
}

//helper functions below

function TB_showIframe(){
	$("#TB_load").remove();
	$("#TB_window").css({display:"block"});
}

function TB_remove() {
 	$("#TB_imageOff").unbind("click");
	$("#TB_overlay").unbind("click");
	$("#TB_closeWindowButton").unbind("click");
	$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').remove();});
	$("#TB_load").remove();
	return false;
}

function TB_position() {
	var pagesize = TB_getPageSize();	
	var arrayPageScroll = TB_getPageScrollTop();
	var style = {width: TB_WIDTH, left: (arrayPageScroll[0] + (pagesize[0] - TB_WIDTH)/2), top: (arrayPageScroll[1] + (pagesize[1]-TB_HEIGHT)/2)};
	$("#TB_window").css(style);
}

function TB_overlaySize(){
	if (window.innerHeight && window.scrollMaxY || window.innerWidth && window.scrollMaxX) {	
		yScroll = window.innerHeight + window.scrollMaxY;
		xScroll = window.innerWidth + window.scrollMaxX;
		var deff = document.documentElement;
		var wff = (deff&&deff.clientWidth) || document.body.clientWidth || window.innerWidth || self.innerWidth;
		var hff = (deff&&deff.clientHeight) || document.body.clientHeight || window.innerHeight || self.innerHeight;
		xScroll -= (window.innerWidth - wff);
		yScroll -= (window.innerHeight - hff);
	} else if (document.body.scrollHeight > document.body.offsetHeight || document.body.scrollWidth > document.body.offsetWidth){ // all but Explorer Mac
		yScroll = document.body.scrollHeight;
		xScroll = document.body.scrollWidth;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		yScroll = document.body.offsetHeight;
		xScroll = document.body.offsetWidth;
  	}
	$("#TB_overlay").css({"height": yScroll, "width": xScroll});
	$("#TB_HideSelect").css({"height": yScroll,"width": xScroll});
}

function TB_load_position() {
	var pagesize = TB_getPageSize();
	var arrayPageScroll = TB_getPageScrollTop();
	$("#TB_load")
		.css({left: (arrayPageScroll[0] + (pagesize[0] - 100)/2), top: (arrayPageScroll[1] + ((pagesize[1]-100)/2)) })
		.css({display:"block"});
}

function TB_parseQuery ( query ) {
	// return empty object
	if( !query )
		return {};
	var params = {};
	
	// parse query
	var pairs = query.split(/[;&]/);
	for ( var i = 0; i < pairs.length; i++ ) {
		var pair = pairs[i].split('=');
		if ( !pair || pair.length != 2 )
			continue;
		// unescape both key and value, replace "+" with spaces in value
		params[unescape(pair[0])] = unescape(pair[1]).replace(/\+/g, ' ');
   }
   return params;
}

function TB_getPageScrollTop(){
	var yScrolltop;
	var xScrollleft;
	if (self.pageYOffset || self.pageXOffset) {
		yScrolltop = self.pageYOffset;
		xScrollleft = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop || document.documentElement.scrollLeft ){	 // Explorer 6 Strict
		yScrolltop = document.documentElement.scrollTop;
		xScrollleft = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		yScrolltop = document.body.scrollTop;
		xScrollleft = document.body.scrollLeft;
	}
	arrayPageScroll = new Array(xScrollleft,yScrolltop) 
	return arrayPageScroll;
}

function TB_getPageSize(){
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight
	arrayPageSize = new Array(w,h) 
	return arrayPageSize;
}


