| 11 | | 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}('(9(){6(1f C!="Q")E v=C;E C=19.16=9(a,c){6(19==7||!7.4a)F 1s C(a,c);F 7.4a(a,c)};6(1f $!="Q")E B=$;19.$=C;E q=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;C.15=C.3v={4a:9(a,c){a=a||R;6(1f a=="1E"){E m=q.2d(a);6(m&&(m[1]||!c)){6(m[1])a=C.3c([m[1]]);G{E b=R.37(m[3]);6(b)6(b.2j!=m[3])F C().1F(a);G{7[0]=b;7.H=1;F 7}G a=[]}}G F 1s C(c).1F(a)}G 6(C.1g(a))F 1s C(R)[C.15.1L?"1L":"2f"](a);F 7.5J(a.1b==1K&&a||(a.3w||a.H&&a!=19&&!a.1t&&a[0]!=Q&&a[0].1t)&&C.2V(a)||[a])},3w:"1.1.4",7K:9(){F 7.H},H:0,21:9(a){F a==Q?C.2V(7):7[a]},1O:9(a){E b=C(a);b.5c=7;F b},5J:9(a){7.H=0;1K.3v.Y.T(7,a);F 7},J:9(a,b){F C.J(7,a,b)},45:9(a){E b=-1;7.J(9(i){6(7==a)b=i});F b},1j:9(f,d,e){E c=f;6(f.1b==3n)6(d==Q)F 7.H&&C[e||"1j"](7[0],f)||Q;G{c={};c[f]=d}F 7.J(9(a){I(E b 17 c)C.1j(e?7.S:7,b,C.4Q(7,c[b],e,a,b))})},1h:9(b,a){F 7.1j(b,a,"34")},2Q:9(e){6(1f e!="4P"&&e!=K)F 7.3K().3H(R.60(e));E t="";C.J(e||7,9(){C.J(7.2Z,9(){6(7.1t!=8)t+=7.1t!=1?7.5S:C.15.2Q([7])})});F t},82:9(){E a,2e=1a;F 7.J(9(){6(!a)a=C.3c(2e,7.2I);E b=a[0].3B(O);7.P.2p(b,7);20(b.1k)b=b.1k;b.4p(7)})},3H:9(){F 7.2J(1a,O,1,9(a){7.4p(a)})},5v:9(){F 7.2J(1a,O,-1,9(a){7.2p(a,7.1k)})},5u:9(){F 7.2J(1a,M,1,9(a){7.P.2p(a,7)})},5t:9(){F 7.2J(1a,M,-1,9(a){7.P.2p(a,7.2a)})},3L:9(){F 7.5c||C([])},1F:9(t){E b=C.3M(7,9(a){F C.1F(t,a)});F 7.1O(/[^+>] [^+>]/.1d(t)||t.U("..")>-1?C.4d(b):b)},7o:9(e){e=e!=Q?e:O;E d=7.1r(7.1F("*"));6(C.N.12){d.J(9(){7.2l$1i={};I(E a 17 7.$1i)7.2l$1i[a]=C.14({},7.$1i[a])}).49()}E r=7.1O(C.3M(7,9(a){F a.3B(e)}));6(C.N.12){d.J(9(){E c=7.2l$1i;I(E a 17 c)I(E b 17 c[a])C.1c.1r(7,a,c[a][b],c[a][b].V);7.2l$1i=K})}6(e){E f=r.1r(r.1F(\'*\')).1l(\'2b,39[@L=3i]\');d.1l(\'2b,39[@L=3i]\').J(9(i){6(7.3j)f[i].3j=7.3j;6(7.27)f[i].27=O})}F r},1l:9(t){F 7.1O(C.1g(t)&&C.2B(7,9(b,a){F t.T(b,[a])})||C.2R(t,7))},5l:9(t){F 7.1O(t.1b==3n&&C.2R(t,7,O)||C.2B(7,9(a){F(t.1b==1K||t.3w)?C.4K(a,t)<0:a!=t}))},1r:9(t){F 7.1O(C.29(7.21(),t.1b==3n?C(t).21():t.H!=Q&&(!t.W||t.W=="6s")?t:[t]))},3y:9(a){F a?C.2R(a,7).H>0:M},2G:9(a){F a==Q?(7.H?7[0].2A:K):7.1j("2A",a)},5W:9(a){F a==Q?(7.H?7[0].2W:K):7.3K().3H(a)},3S:9(){F 7.1O(1K.3v.3S.T(7,1a))},2J:9(f,d,g,e){E c=7.H>1,a;F 7.J(9(){6(!a){a=C.3c(f,7.2I);6(g<0)a.8E()}E b=7;6(d&&C.W(7,"1A")&&C.W(a[0],"3O"))b=7.4L("1w")[0]||7.4p(R.6a("1w"));C.J(a,9(){6(C.W(7,"33")){6(7.32)C.31({1G:7.32,2w:M,3G:"33"});G C.4E(7.2Q||7.5Z||7.2W||"")}G e.T(b,[c?7.3B(O):7])})})}};C.14=C.15.14=9(){E c=1a[0]||{},a=1,1M=1a.H,4D=M;6(c.1b==8d){4D=c;c=1a[1]||{}}6(1M==1){c=7;a=0}E b;I(;a<1M;a++)6((b=1a[a])!=K)I(E i 17 b){6(c==b[i])5X;6(4D&&1f b[i]==\'4P\'&&c[i])C.14(c[i],b[i]);G 6(b[i]!=Q)c[i]=b[i]}F c};C.14({8a:9(a){19.$=B;6(a)19.16=v;F C},1g:9(a){F!!a&&1f a!="1E"&&!a.W&&a.1b!=1K&&/9/i.1d(a+"")},3E:9(a){F a.3D&&!a.4z||a.4y&&a.2I&&!a.2I.4z},4E:9(a){a=C.2s(a);6(a){6(19.5N)19.5N(a);G 6(C.N.1H)19.4x(a,0);G 2T.2S(19,a)}},W:9(b,a){F b.W&&b.W.1I()==a.1I()},J:9(a,b,c){6(c){6(a.H==Q)I(E i 17 a)b.T(a[i],c);G I(E i=0,3A=a.H;i<3A;i++)6(b.T(a[i],c)===M)1J}G{6(a.H==Q)I(E i 17 a)b.2S(a[i],i,a[i]);G I(E i=0,3A=a.H,2G=a[0];i<3A&&b.2S(2G,i,2G)!==M;2G=a[++i]){}}F a},4Q:9(c,b,d,e,a){6(C.1g(b))b=b.2S(c,[e]);E f=/z-?45|7S-?7Q|1e|5y|7O-?1u/i;F b&&b.1b==3x&&d=="34"&&!f.1d(a)?b+"4t":b},18:{1r:9(b,c){C.J((c||"").2M(/\\s+/),9(i,a){6(!C.18.2N(b.18,a))b.18+=(b.18?" ":"")+a})},23:9(b,c){b.18=c!=Q?C.2B(b.18.2M(/\\s+/),9(a){F!C.18.2N(c,a)}).5w(" "):""},2N:9(t,c){F C.4K(c,(t.18||t).3s().2M(/\\s+/))>-1}},1V:9(e,o,f){I(E i 17 o){e.S["2U"+i]=e.S[i];e.S[i]=o[i]}f.T(e,[]);I(E i 17 o)e.S[i]=e.S["2U"+i]},1h:9(e,p){6(p=="1u"||p=="24"){E b={},3p,3o,d=["7J","7G","7F","7B"];C.J(d,9(){b["7A"+7]=0;b["7x"+7+"7u"]=0});C.1V(e,b,9(){6(C(e).3y(\':4N\')){3p=e.7t;3o=e.7q}G{e=C(e.3B(O)).1F(":4e").5d("27").3L().1h({3V:"1C",3k:"7n",11:"2m",7h:"0",7e:"0"}).57(e.P)[0];E a=C.1h(e.P,"3k")||"3g";6(a=="3g")e.P.S.3k="76";3p=e.74;3o=e.71;6(a=="3g")e.P.S.3k="3g";e.P.3e(e)}});F p=="1u"?3p:3o}F C.34(e,p)},34:9(h,d,g){E i,1R=[],1V=[];9 2E(a){6(!C.N.1H)F M;E b=R.2L.3b(a,K);F!b||b.44("2E")==""}6(d=="1e"&&C.N.12){i=C.1j(h.S,"1e");F i==""?"1":i}6(d.2k(/3a/i))d=x;6(!g&&h.S[d])i=h.S[d];G 6(R.2L&&R.2L.3b){6(d.2k(/3a/i))d="3a";d=d.1v(/([A-Z])/g,"-$1").2D();E e=R.2L.3b(h,K);6(e&&!2E(h))i=e.44(d);G{I(E a=h;a&&2E(a);a=a.P)1R.42(a);I(a=0;a<1R.H;a++)6(2E(1R[a])){1V[a]=1R[a].S.11;1R[a].S.11="2m"}i=d=="11"&&1V[1R.H-1]!=K?"1T":R.2L.3b(h,K).44(d)||"";I(a=0;a<1V.H;a++)6(1V[a]!=K)1R[a].S.11=1V[a]}6(d=="1e"&&i=="")i="1"}G 6(h.41){E f=d.1v(/\\-(\\w)/g,9(m,c){F c.1I()});i=h.41[d]||h.41[f]}F i},3c:9(a,c){E r=[];c=c||R;C.J(a,9(i,b){6(!b)F;6(b.1b==3x)b=b.3s();6(1f b=="1E"){E s=C.2s(b).2D(),1m=c.6a("1m"),1P=[];E a=!s.U("<1Z")&&[1,"<2b>","</2b>"]||!s.U("<6L")&&[1,"<4V>","</4V>"]||s.2k(/^<(6I|1w|6H|6F|6D)/)&&[1,"<1A>","</1A>"]||!s.U("<3O")&&[2,"<1A><1w>","</1w></1A>"]||(!s.U("<6A")||!s.U("<6y"))&&[3,"<1A><1w><3O>","</3O></1w></1A>"]||!s.U("<6x")&&[2,"<1A><1w></1w><4T>","</4T></1A>"]||C.N.12&&[1,"1m<1m>","</1m>"]||[0,"",""];1m.2W=a[1]+b+a[2];20(a[0]--)1m=1m.3Y;6(C.N.12){6(!s.U("<1A")&&s.U("<1w")<0)1P=1m.1k&&1m.1k.2Z;G 6(a[1]=="<1A>"&&s.U("<1w")<0)1P=1m.2Z;I(E n=1P.H-1;n>=0;--n)6(C.W(1P[n],"1w")&&!1P[n].2Z.H)1P[n].P.3e(1P[n]);6(/^\\s/.1d(b))1m.2p(c.60(b.2k(/^\\s*/)[0]),1m.1k)}b=C.2V(1m.2Z)}6(0===b.H&&(!C.W(b,"38")&&!C.W(b,"2b")))F;6(b[0]==Q||C.W(b,"38")||b.6u)r.Y(b);G r=C.29(r,b)});F r},1j:9(c,d,a){E e=C.3E(c)?{}:C.4q;6(d=="28"&&C.N.1H)c.P.3j;6(e[d]){6(a!=Q)c[e[d]]=a;F c[e[d]]}G 6(C.N.12&&d=="S")F C.1j(c.S,"6p",a);G 6(a==Q&&C.N.12&&C.W(c,"38")&&(d=="6n"||d=="6m"))F c.6k(d).5S;G 6(c.4y){6(a!=Q)c.6j(d,a);6(C.N.12&&/5R|32/.1d(d)&&!C.3E(c))F c.3F(d,2);F c.3F(d)}G{6(d=="1e"&&C.N.12){6(a!=Q){c.5y=1;c.1l=(c.1l||"").1v(/5T\\([^)]*\\)/,"")+(3m(a).3s()=="6d"?"":"5T(1e="+a*6c+")")}F c.1l?(3m(c.1l.2k(/1e=([^)]*)/)[1])/6c).3s():""}d=d.1v(/-([a-z])/8I,9(z,b){F b.1I()});6(a!=Q)c[d]=a;F c[d]}},2s:9(t){F(t||"").1v(/^\\s+|\\s+$/g,"")},2V:9(a){E r=[];6(1f a!="8H")I(E i=0,1M=a.H;i<1M;i++)r.Y(a[i]);G r=a.3S(0);F r},4K:9(b,a){I(E i=0,1M=a.H;i<1M;i++)6(a[i]==b)F i;F-1},29:9(a,b){6(C.N.12){I(E i=0;b[i];i++)6(b[i].1t!=8)a.Y(b[i])}G I(E i=0;b[i];i++)a.Y(b[i]);F a},4d:9(a){E r=[],4O=C.1q++;2g{I(E i=0,69=a.H;i<69;i++)6(4O!=a[i].1q){a[i].1q=4O;r.Y(a[i])}}2h(e){r=a}F r},1q:0,2B:9(b,a,c){6(1f a=="1E")a=2T("M||9(a,i){F "+a+"}");E d=[];I(E i=0,3P=b.H;i<3P;i++)6(!c&&a(b[i],i)||c&&!a(b[i],i))d.Y(b[i]);F d},3M:9(c,b){6(1f b=="1E")b=2T("M||9(a){F "+b+"}");E d=[];I(E i=0,3P=c.H;i<3P;i++){E a=b(c[i],i);6(a!==K&&a!=Q){6(a.1b!=1K)a=[a];d=d.8x(a)}}F d}});E u=8w.8u.2D();C.N={6b:(u.2k(/.+(?:8s|8q|8p|8o)[\\/: ]([\\d.]+)/)||[])[1],1H:/61/.1d(u),2t:/2t/.1d(u),12:/12/.1d(u)&&!/2t/.1d(u),3J:/3J/.1d(u)&&!/(8n|61)/.1d(u)};E x=C.N.12?"3I":"4G";C.14({8m:!C.N.12||R.8l=="8k",3I:C.N.12?"3I":"4G",4q:{"I":"8j","8i":"18","3a":x,4G:x,3I:x,2W:"2W",18:"18",2A:"2A",30:"30",27:"27",8h:"8g",28:"28",8f:"8e"}});C.J({5Y:"a.P",4C:"16.4C(a)",8c:"16.25(a,2,\'2a\')",8b:"16.25(a,2,\'4B\')",88:"16.4A(a.P.1k,a)",87:"16.4A(a.1k)"},9(i,n){C.15[i]=9(a){E b=C.3M(7,n);6(a&&1f a=="1E")b=C.2R(a,b);F 7.1O(C.4d(b))}});C.J({57:"3H",86:"5v",2p:"5u",85:"5t"},9(i,n){C.15[i]=9(){E a=1a;F 7.J(9(){I(E j=0,1M=a.H;j<1M;j++)C(a[j])[n](7)})}});C.J({5d:9(a){C.1j(7,a,"");7.84(a)},83:9(c){C.18.1r(7,c)},81:9(c){C.18.23(7,c)},80:9(c){C.18[C.18.2N(7,c)?"23":"1r"](7,c)},23:9(a){6(!a||C.1l(a,[7]).r.H)7.P.3e(7)},3K:9(){20(7.1k)7.3e(7.1k)}},9(i,n){C.15[i]=9(){F 7.J(n,1a)}});C.J(["5Q","5P","5M","5L"],9(i,n){C.15[n]=9(a,b){F 7.1l(":"+n+"("+a+")",b)}});C.J(["1u","24"],9(i,n){C.15[n]=9(h){F h==Q?(7.H?C.1h(7[0],n):K):7.1h(n,h.1b==3n?h:h+"4t")}});E A=C.N.1H&&5K(C.N.6b)<7Z?"(?:[\\\\w*2l-]|\\\\\\\\.)":"(?:[\\\\w\\7Y-\\7V*2l-]|\\\\\\\\.)",5I=1s 3C("^[/>]\\\\s*("+A+"+)"),5H=1s 3C("^("+A+"+)(#)("+A+"+)"),5G=1s 3C("^([#.]?)("+A+"*)");C.14({4w:{"":"m[2]==\'*\'||16.W(a,m[2])","#":"a.3F(\'2j\')==m[2]",":":{5P:"i<m[3]-0",5M:"i>m[3]-0",25:"m[3]-0==i",5Q:"m[3]-0==i",2H:"i==0",2P:"i==r.H-1",5E:"i%2==0",5D:"i%2","2H-3z":"a.P.4L(\'*\')[0]==a","2P-3z":"16.25(a.P.3Y,1,\'4B\')==a","7U-3z":"!16.25(a.P.3Y,2,\'4B\')",5Y:"a.1k",3K:"!a.1k",5L:"(a.5Z||a.7T||\'\').U(m[3])>=0",4N:\'"1C"!=a.L&&16.1h(a,"11")!="1T"&&16.1h(a,"3V")!="1C"\',1C:\'"1C"==a.L||16.1h(a,"11")=="1T"||16.1h(a,"3V")=="1C"\',7R:"!a.30",30:"a.30",27:"a.27",28:"a.28||16.1j(a,\'28\')",2Q:"\'2Q\'==a.L",4e:"\'4e\'==a.L",3i:"\'3i\'==a.L",4v:"\'4v\'==a.L",5C:"\'5C\'==a.L",4u:"\'4u\'==a.L",5B:"\'5B\'==a.L",5A:"\'5A\'==a.L",1X:\'"1X"==a.L||16.W(a,"1X")\',39:"/39|2b|7P|1X/i.1d(a.W)",2N:"16.1F(m[3],a).H"},"[":"16.1F(m[2],a).H"},5x:[/^\\[ *(@)([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(\\[)\\s*(.*?(\\[.*?\\])?[^[]*?)\\s*\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1s 3C("^([:.#]*)("+A+"+)")],2R:9(a,c,b){E d,1Y=[];20(a&&a!=d){d=a;E f=C.1l(a,c,b);a=f.t.1v(/^\\s*,\\s*/,"");1Y=b?c=f.r:C.29(1Y,f.r)}F 1Y},1F:9(t,l){6(1f t!="1E")F[t];6(l&&!l.1t)l=K;l=l||R;6(!t.U("//")){t=t.2K(2,t.H)}G 6(!t.U("/")&&!l.2I){l=l.3D;t=t.2K(1,t.H);6(t.U("/")>=1)t=t.2K(t.U("/"),t.H)}E d=[l],2q=[],2P;20(t&&2P!=t){E r=[];2P=t;t=C.2s(t).1v(/^\\/\\//,"");E k=M;E g=5I;E m=g.2d(t);6(m){E o=m[1].1I();I(E i=0;d[i];i++)I(E c=d[i].1k;c;c=c.2a)6(c.1t==1&&(o=="*"||c.W.1I()==o.1I()))r.Y(c);d=r;t=t.1v(g,"");6(t.U(" ")==0)5X;k=O}G{g=/^((\\/?\\.\\.)|([>\\/+~]))\\s*(\\w*)/i;6((m=g.2d(t))!=K){r=[];E o=m[4],1q=C.1q++;m=m[1];I(E j=0,2o=d.H;j<2o;j++)6(m.U("..")<0){E n=m=="~"||m=="+"?d[j].2a:d[j].1k;I(;n;n=n.2a)6(n.1t==1){6(m=="~"&&n.1q==1q)1J;6(!o||n.W.1I()==o.1I()){6(m=="~")n.1q=1q;r.Y(n)}6(m=="+")1J}}G r.Y(d[j].P);d=r;t=C.2s(t.1v(g,""));k=O}}6(t&&!k){6(!t.U(",")){6(l==d[0])d.4s();2q=C.29(2q,d);r=d=[l];t=" "+t.2K(1,t.H)}G{E h=5H;E m=h.2d(t);6(m){m=[0,m[2],m[3],m[1]]}G{h=5G;m=h.2d(t)}m[2]=m[2].1v(/\\\\/g,"");E f=d[d.H-1];6(m[1]=="#"&&f&&f.37&&!C.3E(f)){E p=f.37(m[2]);6((C.N.12||C.N.2t)&&p&&1f p.2j=="1E"&&p.2j!=m[2])p=C(\'[@2j="\'+m[2]+\'"]\',f)[0];d=r=p&&(!m[3]||C.W(p,m[3]))?[p]:[]}G{I(E i=0;d[i];i++){E a=m[1]!=""||m[0]==""?"*":m[2];6(a=="*"&&d[i].W.2D()=="4P")a="2O";r=C.29(r,d[i].4L(a))}6(m[1]==".")r=C.4r(r,m[2]);6(m[1]=="#"){E e=[];I(E i=0;r[i];i++)6(r[i].3F("2j")==m[2]){e=[r[i]];1J}r=e}d=r}t=t.1v(h,"")}}6(t){E b=C.1l(t,r);d=r=b.r;t=C.2s(b.t)}}6(t)d=[];6(d&&l==d[0])d.4s();2q=C.29(2q,d);F 2q},4r:9(r,m,a){m=" "+m+" ";E c=[];I(E i=0;r[i];i++){E b=(" "+r[i].18+" ").U(m)>=0;6(!a&&b||a&&!b)c.Y(r[i])}F c},1l:9(t,r,h){E d;20(t&&t!=d){d=t;E p=C.5x,m;I(E i=0;p[i];i++){m=p[i].2d(t);6(m){t=t.7N(m[0].H);m[2]=m[2].1v(/\\\\/g,"");1J}}6(!m)1J;6(m[1]==":"&&m[2]=="5l")r=C.1l(m[3],r,O).r;G 6(m[1]==".")r=C.4r(r,m[2],h);G 6(m[1]=="@"){E g=[],L=m[3];I(E i=0,2o=r.H;i<2o;i++){E a=r[i],z=a[C.4q[m[2]]||m[2]];6(z==K||/5R|32|28/.1d(m[2]))z=C.1j(a,m[2])||\'\';6((L==""&&!!z||L=="="&&z==m[5]||L=="!="&&z!=m[5]||L=="^="&&z&&!z.U(m[5])||L=="$="&&z.2K(z.H-m[5].H)==m[5]||(L=="*="||L=="~=")&&z.U(m[5])>=0)^h)g.Y(a)}r=g}G 6(m[1]==":"&&m[2]=="25-3z"){E e=C.1q++,g=[],1d=/(\\d*)n\\+?(\\d*)/.2d(m[3]=="5E"&&"2n"||m[3]=="5D"&&"2n+1"||!/\\D/.1d(m[3])&&"n+"+m[3]||m[3]),2H=(1d[1]||1)-0,d=1d[2]-0;I(E i=0,2o=r.H;i<2o;i++){E j=r[i],P=j.P;6(e!=P.1q){E c=1;I(E n=P.1k;n;n=n.2a)6(n.1t==1)n.4o=c++;P.1q=e}E b=M;6(2H==1){6(d==0||j.4o==d)b=O}G 6((j.4o+d)%2H==0)b=O;6(b^h)g.Y(j)}r=g}G{E f=C.4w[m[1]];6(1f f!="1E")f=C.4w[m[1]][m[2]];f=2T("M||9(a,i){F "+f+"}");r=C.2B(r,f,h)}}F{r:r,t:t}},4C:9(c){E b=[];E a=c.P;20(a&&a!=R){b.Y(a);a=a.P}F b},25:9(a,e,c,b){e=e||1;E d=0;I(;a;a=a[c])6(a.1t==1&&++d==e)1J;F a},4A:9(n,a){E r=[];I(;n;n=n.2a){6(n.1t==1&&(!a||n!=a))r.Y(n)}F r}});C.1c={1r:9(f,d,c,b){6(C.N.12&&f.3t!=Q)f=19;6(!c.22)c.22=7.22++;6(b!=Q){E e=c;c=9(){F e.T(7,1a)};c.V=b;c.22=e.22}6(!f.$1i)f.$1i={};6(!f.$1y)f.$1y=9(){E a;6(1f C=="Q"||C.1c.4n)F a;a=C.1c.1y.T(f,1a);F a};E g=f.$1i[d];6(!g){g=f.$1i[d]={};6(f.4m)f.4m(d,f.$1y,M);G f.7M("3r"+d,f.$1y)}g[c.22]=c;7.1D[d]=O},22:1,1D:{},23:9(c,b,a){E d=c.$1i,2c,45;6(d){6(b&&b.L){a=b.4l;b=b.L}6(!b){I(b 17 d)7.23(c,b)}G 6(d[b]){6(a)4k d[b][a.22];G I(a 17 c.$1i[b])4k d[b][a];I(2c 17 d[b])1J;6(!2c){6(c.4j)c.4j(b,c.$1y,M);G c.7L("3r"+b,c.$1y);2c=K;4k d[b]}}I(2c 17 d)1J;6(!2c)c.$1y=c.$1i=K}},1z:9(c,b,d){b=C.2V(b||[]);6(!d){6(7.1D[c])C("*").1r([19,R]).1z(c,b)}G{E a,2c,15=C.1g(d[c]||K);b.42(7.4i({L:c,1S:d}));6(C.1g(d.$1y))a=d.$1y.T(d,b);6(!15&&d["3r"+c]&&d["3r"+c].T(d,b)===M)a=M;6(15&&a!==M&&!(C.W(d,\'a\')&&c=="4h")){7.4n=O;d[c]()}7.4n=M}},1y:9(b){E a;b=C.1c.4i(b||19.1c||{});E c=7.$1i&&7.$1i[b.L],2e=1K.3v.3S.2S(1a,1);2e.42(b);I(E j 17 c){2e[0].4l=c[j];2e[0].V=c[j].V;6(c[j].T(7,2e)===M){b.2u();b.2X();a=M}}6(C.N.12)b.1S=b.2u=b.2X=b.4l=b.V=K;F a},4i:9(c){E a=c;c=C.14({},a);c.2u=9(){6(a.2u)a.2u();a.7I=M};c.2X=9(){6(a.2X)a.2X();a.7H=O};6(!c.1S&&c.5r)c.1S=c.5r;6(C.N.1H&&c.1S.1t==3)c.1S=a.1S.P;6(!c.4g&&c.4F)c.4g=c.4F==c.1S?c.7C:c.4F;6(c.5p==K&&c.66!=K){E e=R.3D,b=R.4z;c.5p=c.66+(e&&e.5o||b.5o||0);c.7z=c.7v+(e&&e.5m||b.5m||0)}6(!c.3Q&&(c.5k||c.5j))c.3Q=c.5k||c.5j;6(!c.5i&&c.5g)c.5i=c.5g;6(!c.3Q&&c.1X)c.3Q=(c.1X&1?1:(c.1X&2?3:(c.1X&4?2:0)));F c}};C.15.14({3l:9(c,a,b){F c=="5f"?7.5e(c,a,b):7.J(9(){C.1c.1r(7,c,b||a,b&&a)})},5e:9(d,b,c){F 7.J(9(){C.1c.1r(7,d,9(a){C(7).49(a);F(c||b).T(7,1a)},c&&b)})},49:9(a,b){F 7.J(9(){C.1c.23(7,a,b)})},1z:9(a,b){F 7.J(9(){C.1c.1z(a,b,7)})},1W:9(){E a=1a;F 7.4h(9(e){7.3T=0==7.3T?1:0;e.2u();F a[7.3T].T(7,[e])||M})},7p:9(f,g){9 3U(e){E p=e.4g;20(p&&p!=7)2g{p=p.P}2h(e){p=7};6(p==7)F M;F(e.L=="3W"?f:g).T(7,[e])}F 7.3W(3U).5b(3U)},1L:9(f){5a();6(C.36)f.T(R,[C]);G C.2C.Y(9(){F f.T(7,[C])});F 7}});C.14({36:M,2C:[],1L:9(){6(!C.36){C.36=O;6(C.2C){C.J(C.2C,9(){7.T(R)});C.2C=K}6(C.N.3J||C.N.2t)R.4j("59",C.1L,M);6(!19.7m.H)C(19).2f(9(){C("#4b").23()})}}});C.J(("7l,7k,2f,7j,7i,5f,4h,7g,"+"7f,7d,7c,3W,5b,7b,2b,"+"4u,7a,79,78,3f").2M(","),9(i,o){C.15[o]=9(f){F f?7.3l(o,f):7.1z(o)}});E w=M;9 5a(){6(w)F;w=O;6(C.N.3J||C.N.2t)R.4m("59",C.1L,M);G 6(C.N.12){R.75("<73"+"72 2j=4b 70=O "+"32=//:><\\/33>");E a=R.37("4b");6(a)a.6Z=9(){6(R.3d!="1x")F;C.1L()};a=K}G 6(C.N.1H)C.48=3t(9(){6(R.3d=="6Y"||R.3d=="1x"){47(C.48);C.48=K;C.1L()}},10);C.1c.1r(19,"2f",C.1L)}C.15.14({6X:9(c,b,a){7.2f(c,b,a,1)},2f:9(g,e,c,d){6(C.1g(g))F 7.3l("2f",g);c=c||9(){};E f="46";6(e)6(C.1g(e)){c=e;e=K}G{e=C.2O(e);f="55"}E h=7;C.31({1G:g,L:f,V:e,2F:d,1x:9(a,b){6(b=="1U"||!d&&b=="54")h.5W(a.43);4x(9(){h.J(c,[a.43,b,a])},13)}});F 7},6W:9(){F C.2O(7)},6V:9(){}});C.J("53,52,51,50,4Z,5h".2M(","),9(i,o){C.15[o]=9(f){F 7.3l(o,f)}});C.14({21:9(e,c,a,d,b){6(C.1g(c)){a=c;c=K}F C.31({L:"46",1G:e,V:c,1U:a,3G:d,2F:b})},6U:9(d,b,a,c){F C.21(d,b,a,c,1)},6T:9(b,a){F C.21(b,K,a,"33")},77:9(c,b,a){F C.21(c,b,a,"56")},6S:9(d,b,a,c){6(C.1g(b)){a=b;b={}}F C.31({L:"55",1G:d,V:b,1U:a,3G:c})},6R:9(a){C.3u.1Q=a},6Q:9(a){C.14(C.3u,a)},3u:{1D:O,L:"46",1Q:0,4Y:"6P/x-6O-38-6N",4X:O,2w:O,V:K},3h:{},31:9(s){s=C.14(O,s,C.14(O,{},C.3u,s));6(s.V){6(s.4X&&1f s.V!="1E")s.V=C.2O(s.V);6(s.L.2D()=="21"){s.1G+=(s.1G.U("?")>-1?"&":"?")+s.V;s.V=K}}6(s.1D&&!C.40++)C.1c.1z("53");E f=M;E h=19.4W?1s 4W("6M.6K"):1s 58();h.6J(s.L,s.1G,s.2w);6(s.V)h.4c("7r-7s",s.4Y);6(s.2F)h.4c("6G-3Z-6E",C.3h[s.1G]||"7w, 6C 7y 6B 4J:4J:4J 6z");h.4c("X-7D-7E","58");6(s.4U)s.4U(h);6(s.1D)C.1c.1z("5h",[h,s]);E g=9(d){6(!f&&h&&(h.3d==4||d=="1Q")){f=O;6(i){47(i);i=K}E c=d=="1Q"&&"1Q"||!C.5n(h)&&"3f"||s.2F&&C.5s(h,s.1G)&&"54"||"1U";6(c=="1U"){2g{E a=C.5q(h,s.3G)}2h(e){c="4I"}}6(c=="1U"){E b;2g{b=h.4f("4S-3Z")}2h(e){}6(s.2F&&b)C.3h[s.1G]=b;6(s.1U)s.1U(a,c);6(s.1D)C.1c.1z("4Z",[h,s])}G C.3X(s,h,c);6(s.1D)C.1c.1z("51",[h,s]);6(s.1D&&!--C.40)C.1c.1z("52");6(s.1x)s.1x(h,c);6(s.2w)h=K}};6(s.2w){E i=3t(g,13);6(s.1Q>0)4x(9(){6(h){h.6w();6(!f)g("1Q")}},s.1Q)}2g{h.6v(s.V)}2h(e){C.3X(s,h,K,e)}6(!s.2w)g();F h},3X:9(s,a,b,e){6(s.3f)s.3f(a,b,e);6(s.1D)C.1c.1z("50",[a,s,e])},40:0,5n:9(r){2g{F!r.26&&6t.6r=="4v:"||(r.26>=4R&&r.26<6q)||r.26==5z||C.N.1H&&r.26==Q}2h(e){}F M},5s:9(a,c){2g{E b=a.4f("4S-3Z");F a.26==5z||b==C.3h[c]||C.N.1H&&a.26==Q}2h(e){}F M},5q:9(r,a){E b=r.4f("6o-L");E c=a=="5F"||!a&&b&&b.U("5F")>=0;V=c?r.7W:r.43;6(c&&V.3D.4y=="4I")7X"4I";6(a=="33")C.4E(V);6(a=="56")V=2T("("+V+")");F V},2O:9(a){E s=[];6(a.1b==1K||a.3w)C.J(a,9(){s.Y(2y(7.6l)+"="+2y(7.2A))});G I(E j 17 a)6(a[j]&&a[j].1b==1K)C.J(a[j],9(){s.Y(2y(j)+"="+2y(7))});G s.Y(2y(j)+"="+2y(a[j]));F s.5w("&")}});C.15.14({1o:9(b,a){F b?7.1B({1u:"1o",24:"1o",1e:"1o"},b,a):7.1l(":1C").J(9(){7.S.11=7.2r?7.2r:"";6(C.1h(7,"11")=="1T")7.S.11="2m"}).3L()},1p:9(b,a){F b?7.1B({1u:"1p",24:"1p",1e:"1p"},b,a):7.1l(":4N").J(9(){7.2r=7.2r||C.1h(7,"11");6(7.2r=="1T")7.2r="2m";7.S.11="1T"}).3L()},5O:C.15.1W,1W:9(a,b){F C.1g(a)&&C.1g(b)?7.5O(a,b):a?7.1B({1u:"1W",24:"1W",1e:"1W"},a,b):7.J(9(){C(7)[C(7).3y(":1C")?"1o":"1p"]()})},6i:9(b,a){F 7.1B({1u:"1o"},b,a)},6h:9(b,a){F 7.1B({1u:"1p"},b,a)},6g:9(b,a){F 7.1B({1u:"1W"},b,a)},6f:9(b,a){F 7.1B({1e:"1o"},b,a)},89:9(b,a){F 7.1B({1e:"1p"},b,a)},6e:9(c,a,b){F 7.1B({1e:a},c,b)},1B:9(d,h,f,g){F 7.1n(9(){E c=C(7).3y(":1C"),1Z=C.5V(h,f,g),5U=7;I(E p 17 d){6(d[p]=="1p"&&c||d[p]=="1o"&&!c)F C.1g(1Z.1x)&&1Z.1x.T(7);6(p=="1u"||p=="24"){1Z.11=C.1h(7,"11");1Z.2z=7.S.2z}}6(1Z.2z!=K)7.S.2z="1C";7.2v=C.14({},d);C.J(d,9(a,b){E e=1s C.2Y(5U,1Z,a);6(b.1b==3x)e.3R(e.1Y()||0,b);G e[b=="1W"?c?"1o":"1p":b](d)});F O})},1n:9(a,b){6(!b){b=a;a="2Y"}F 7.J(9(){6(!7.1n)7.1n={};6(!7.1n[a])7.1n[a]=[];7.1n[a].Y(b);6(7.1n[a].H==1)b.T(7)})}});C.14({5V:9(b,a,c){E d=b&&b.1b==8G?b:{1x:c||!c&&a||C.1g(b)&&b,1N:b,35:c&&a||a&&a.1b!=8F&&a};d.1N=(d.1N&&d.1N.1b==3x?d.1N:{8D:8C,8B:4R}[d.1N])||8A;d.2U=d.1x;d.1x=9(){C.68(7,"2Y");6(C.1g(d.2U))d.2U.T(7)};F d},35:{62:9(p,n,b,a){F b+a*p},4H:9(p,n,b,a){F((-67.8z(p*67.8y)/2)+0.5)*a+b}},1n:{},68:9(b,a){a=a||"2Y";6(b.1n&&b.1n[a]){b.1n[a].4s();E f=b.1n[a][0];6(f)f.T(b)}},3N:[],2Y:9(f,e,g){E z=7;E y=f.S;z.a=9(){6(e.3q)e.3q.T(f,[z.2x]);6(g=="1e")C.1j(y,"1e",z.2x);G{y[g]=5K(z.2x)+"4t";6(g=="1u"||g=="24")y.11="2m"}};z.65=9(){F 3m(C.1h(f,g))};z.1Y=9(){E r=3m(C.34(f,g));F r&&r>-8v?r:z.65()};z.3R=9(c,b){z.4M=(1s 64()).63();z.2x=c;z.a();C.3N.Y(9(){F z.3q(c,b)});6(C.3N.H==1){E d=3t(9(){E a=C.3N;I(E i=0;i<a.H;i++)6(!a[i]())a.8t(i--,1);6(!a.H)47(d)},13)}};z.1o=9(){6(!f.2i)f.2i={};f.2i[g]=C.1j(f.S,g);e.1o=O;z.3R(0,7.1Y());6(g!="1e")y[g]="8r";C(f).1o()};z.1p=9(){6(!f.2i)f.2i={};f.2i[g]=C.1j(f.S,g);e.1p=O;z.3R(7.1Y(),0)};z.3q=9(a,c){E t=(1s 64()).63();6(t>e.1N+z.4M){z.2x=c;z.a();6(f.2v)f.2v[g]=O;E b=O;I(E i 17 f.2v)6(f.2v[i]!==O)b=M;6(b){6(e.11!=K){y.2z=e.2z;y.11=e.11;6(C.1h(f,"11")=="1T")y.11="2m"}6(e.1p)y.11="1T";6(e.1p||e.1o)I(E p 17 f.2v)C.1j(y,p,f.2i[p])}6(b&&C.1g(e.1x))e.1x.T(f);F M}G{E n=t-7.4M;E p=n/e.1N;z.2x=C.35[e.35||(C.35.4H?"4H":"62")](p,n,a,(c-a),e.1N);z.a()}F O}}})})();',62,541,'||||||if|this||function|||||||||||||||||||||||||||||||var|return|else|length|for|each|null|type|false|browser|true|parentNode|undefined|document|style|apply|indexOf|data|nodeName||push|||display|msie||extend|fn|jQuery|in|className|window|arguments|constructor|event|test|opacity|typeof|isFunction|css|events|attr|firstChild|filter|div|queue|show|hide|mergeNum|add|new|nodeType|height|replace|tbody|complete|handle|trigger|table|animate|hidden|global|string|find|url|safari|toUpperCase|break|Array|ready|al|duration|pushStack|tb|timeout|stack|target|none|success|swap|toggle|button|cur|opt|while|get|guid|remove|width|nth|status|checked|selected|merge|nextSibling|select|ret|exec|args|load|try|catch|orig|id|match|_|block||rl|insertBefore|done|oldblock|trim|opera|preventDefault|curAnim|async|now|encodeURIComponent|overflow|value|grep|readyList|toLowerCase|color|ifModified|val|first|ownerDocument|domManip|substr|defaultView|split|has|param|last|text|multiFilter|call|eval|old|makeArray|innerHTML|stopPropagation|fx|childNodes|disabled|ajax|src|script|curCSS|easing|isReady|getElementById|form|input|float|getComputedStyle|clean|readyState|removeChild|error|static|lastModified|checkbox|selectedIndex|position|bind|parseFloat|String|oWidth|oHeight|step|on|toString|setInterval|ajaxSettings|prototype|jquery|Number|is|child|ol|cloneNode|RegExp|documentElement|isXMLDoc|getAttribute|dataType|append|styleFloat|mozilla|empty|end|map|timers|tr|el|which|custom|slice|lastToggle|handleHover|visibility|mouseover|handleError|lastChild|Modified|active|currentStyle|unshift|responseText|getPropertyValue|index|GET|clearInterval|safariTimer|unbind|init|__ie_init|setRequestHeader|unique|radio|getResponseHeader|relatedTarget|click|fix|removeEventListener|delete|handler|addEventListener|triggered|nodeIndex|appendChild|props|classFilter|shift|px|submit|file|expr|setTimeout|tagName|body|sibling|previousSibling|parents|deep|globalEval|fromElement|cssFloat|swing|parsererror|00|inArray|getElementsByTagName|startTime|visible|num|object|prop|200|Last|colgroup|beforeSend|fieldset|ActiveXObject|processData|contentType|ajaxSuccess|ajaxError|ajaxComplete|ajaxStop|ajaxStart|notmodified|POST|json|appendTo|XMLHttpRequest|DOMContentLoaded|bindReady|mouseout|prevObject|removeAttr|one|unload|ctrlKey|ajaxSend|metaKey|keyCode|charCode|not|scrollTop|httpSuccess|scrollLeft|pageX|httpData|srcElement|httpNotModified|after|before|prepend|join|parse|zoom|304|reset|image|password|odd|even|xml|quickClass|quickID|quickChild|setArray|parseInt|contains|gt|execScript|_toggle|lt|eq|href|nodeValue|alpha|self|speed|html|continue|parent|textContent|createTextNode|webkit|linear|getTime|Date|max|clientX|Math|dequeue|fl|createElement|version|100|NaN|fadeTo|fadeIn|slideToggle|slideUp|slideDown|setAttribute|getAttributeNode|name|method|action|content|cssText|300|protocol|FORM|location|options|send|abort|col|th|GMT|td|1970|01|cap|Since|colg|If|tfoot|thead|open|XMLHTTP|leg|Microsoft|urlencoded|www|application|ajaxSetup|ajaxTimeout|post|getScript|getIfModified|evalScripts|serialize|loadIfModified|loaded|onreadystatechange|defer|clientWidth|ipt|scr|clientHeight|write|relative|getJSON|keyup|keypress|keydown|change|mousemove|mouseup|left|mousedown|dblclick|right|scroll|resize|focus|blur|frames|absolute|clone|hover|offsetWidth|Content|Type|offsetHeight|Width|clientY|Thu|border|Jan|pageY|padding|Left|toElement|Requested|With|Right|Bottom|cancelBubble|returnValue|Top|size|detachEvent|attachEvent|substring|line|textarea|weight|enabled|font|innerText|only|uFFFF|responseXML|throw|u0128|417|toggleClass|removeClass|wrap|addClass|removeAttribute|insertAfter|prependTo|children|siblings|fadeOut|noConflict|prev|next|Boolean|maxLength|maxlength|readOnly|readonly|class|htmlFor|CSS1Compat|compatMode|boxModel|compatible|ie|ra|it|1px|rv|splice|userAgent|10000|navigator|concat|PI|cos|400|fast|600|slow|reverse|Function|Object|array|ig'.split('|'),0,{})); |
| | 12 | |
| | 13 | // Map over jQuery in case of overwrite |
| | 14 | if ( window.jQuery ) |
| | 15 | var _jQuery = window.jQuery; |
| | 16 | |
| | 17 | var jQuery = window.jQuery = function( selector, context ) { |
| | 18 | // The jQuery object is actually just the init constructor 'enhanced' |
| | 19 | return new jQuery.prototype.init( selector, context ); |
| | 20 | }; |
| | 21 | |
| | 22 | // Map over the $ in case of overwrite |
| | 23 | if ( window.$ ) |
| | 24 | var _$ = window.$; |
| | 25 | |
| | 26 | // Map the jQuery namespace to the '$' one |
| | 27 | window.$ = jQuery; |
| | 28 | |
| | 29 | // A simple way to check for HTML strings or ID strings |
| | 30 | // (both of which we optimize for) |
| | 31 | var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/; |
| | 32 | |
| | 33 | // Is it a simple selector |
| | 34 | var isSimple = /^.[^:#\[\.]*$/; |
| | 35 | |
| | 36 | jQuery.fn = jQuery.prototype = { |
| | 37 | init: function( selector, context ) { |
| | 38 | // Make sure that a selection was provided |
| | 39 | selector = selector || document; |
| | 40 | |
| | 41 | // Handle $(DOMElement) |
| | 42 | if ( selector.nodeType ) { |
| | 43 | this[0] = selector; |
| | 44 | this.length = 1; |
| | 45 | return this; |
| | 46 | |
| | 47 | // Handle HTML strings |
| | 48 | } else if ( typeof selector == "string" ) { |
| | 49 | // Are we dealing with HTML string or an ID? |
| | 50 | var match = quickExpr.exec( selector ); |
| | 51 | |
| | 52 | // Verify a match, and that no context was specified for #id |
| | 53 | if ( match && (match[1] || !context) ) { |
| | 54 | |
| | 55 | // HANDLE: $(html) -> $(array) |
| | 56 | if ( match[1] ) |
| | 57 | selector = jQuery.clean( [ match[1] ], context ); |
| | 58 | |
| | 59 | // HANDLE: $("#id") |
| | 60 | else { |
| | 61 | var elem = document.getElementById( match[3] ); |
| | 62 | |
| | 63 | // Make sure an element was located |
| | 64 | if ( elem ) |
| | 65 | // Handle the case where IE and Opera return items |
| | 66 | // by name instead of ID |
| | 67 | if ( elem.id != match[3] ) |
| | 68 | return jQuery().find( selector ); |
| | 69 | |
| | 70 | // Otherwise, we inject the element directly into the jQuery object |
| | 71 | else { |
| | 72 | this[0] = elem; |
| | 73 | this.length = 1; |
| | 74 | return this; |
| | 75 | } |
| | 76 | |
| | 77 | else |
| | 78 | selector = []; |
| | 79 | } |
| | 80 | |
| | 81 | // HANDLE: $(expr, [context]) |
| | 82 | // (which is just equivalent to: $(content).find(expr) |
| | 83 | } else |
| | 84 | return new jQuery( context ).find( selector ); |
| | 85 | |
| | 86 | // HANDLE: $(function) |
| | 87 | // Shortcut for document ready |
| | 88 | } else if ( jQuery.isFunction( selector ) ) |
| | 89 | return new jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector ); |
| | 90 | |
| | 91 | return this.setArray( |
| | 92 | // HANDLE: $(array) |
| | 93 | selector.constructor == Array && selector || |
| | 94 | |
| | 95 | // HANDLE: $(arraylike) |
| | 96 | // Watch for when an array-like object, contains DOM nodes, is passed in as the selector |
| | 97 | (selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) || |
| | 98 | |
| | 99 | // HANDLE: $(*) |
| | 100 | [ selector ] ); |
| | 101 | }, |
| | 102 | |
| | 103 | // The current version of jQuery being used |
| | 104 | jquery: "@VERSION", |
| | 105 | |
| | 106 | // The number of elements contained in the matched element set |
| | 107 | size: function() { |
| | 108 | return this.length; |
| | 109 | }, |
| | 110 | |
| | 111 | // The number of elements contained in the matched element set |
| | 112 | length: 0, |
| | 113 | |
| | 114 | // Get the Nth element in the matched element set OR |
| | 115 | // Get the whole matched element set as a clean array |
| | 116 | get: function( num ) { |
| | 117 | return num == undefined ? |
| | 118 | |
| | 119 | // Return a 'clean' array |
| | 120 | jQuery.makeArray( this ) : |
| | 121 | |
| | 122 | // Return just the object |
| | 123 | this[ num ]; |
| | 124 | }, |
| | 125 | |
| | 126 | // Take an array of elements and push it onto the stack |
| | 127 | // (returning the new matched element set) |
| | 128 | pushStack: function( elems ) { |
| | 129 | // Build a new jQuery matched element set |
| | 130 | var ret = jQuery( elems ); |
| | 131 | |
| | 132 | // Add the old object onto the stack (as a reference) |
| | 133 | ret.prevObject = this; |
| | 134 | |
| | 135 | // Return the newly-formed element set |
| | 136 | return ret; |
| | 137 | }, |
| | 138 | |
| | 139 | // Force the current matched set of elements to become |
| | 140 | // the specified array of elements (destroying the stack in the process) |
| | 141 | // You should use pushStack() in order to do this, but maintain the stack |
| | 142 | setArray: function( elems ) { |
| | 143 | // Resetting the length to 0, then using the native Array push |
| | 144 | // is a super-fast way to populate an object with array-like properties |
| | 145 | this.length = 0; |
| | 146 | Array.prototype.push.apply( this, elems ); |
| | 147 | |
| | 148 | return this; |
| | 149 | }, |
| | 150 | |
| | 151 | // Execute a callback for every element in the matched set. |
| | 152 | // (You can seed the arguments with an array of args, but this is |
| | 153 | // only used internally.) |
| | 154 | each: function( callback, args ) { |
| | 155 | return jQuery.each( this, callback, args ); |
| | 156 | }, |
| | 157 | |
| | 158 | // Determine the position of an element within |
| | 159 | // the matched set of elements |
| | 160 | index: function( elem ) { |
| | 161 | var ret = -1; |
| | 162 | |
| | 163 | // Locate the position of the desired element |
| | 164 | this.each(function(i){ |
| | 165 | if ( this == elem ) |
| | 166 | ret = i; |
| | 167 | }); |
| | 168 | |
| | 169 | return ret; |
| | 170 | }, |
| | 171 | |
| | 172 | attr: function( name, value, type ) { |
| | 173 | var options = name; |
| | 174 | |
| | 175 | // Look for the case where we're accessing a style value |
| | 176 | if ( name.constructor == String ) |
| | 177 | if ( value == undefined ) |
| | 178 | return this.length && jQuery[ type || "attr" ]( this[0], name ) || undefined; |
| | 179 | |
| | 180 | else { |
| | 181 | options = {}; |
| | 182 | options[ name ] = value; |
| | 183 | } |
| | 184 | |
| | 185 | // Check to see if we're setting style values |
| | 186 | return this.each(function(i){ |
| | 187 | // Set all the styles |
| | 188 | for ( name in options ) |
| | 189 | jQuery.attr( |
| | 190 | type ? |
| | 191 | this.style : |
| | 192 | this, |
| | 193 | name, jQuery.prop( this, options[ name ], type, i, name ) |
| | 194 | ); |
| | 195 | }); |
| | 196 | }, |
| | 197 | |
| | 198 | css: function( key, value ) { |
| | 199 | // ignore negative width and height values |
| | 200 | if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) |
| | 201 | value = undefined; |
| | 202 | return this.attr( key, value, "curCSS" ); |
| | 203 | }, |
| | 204 | |
| | 205 | text: function( text ) { |
| | 206 | if ( typeof text != "object" && text != null ) |
| | 207 | return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); |
| | 208 | |
| | 209 | var ret = ""; |
| | 210 | |
| | 211 | jQuery.each( text || this, function(){ |
| | 212 | jQuery.each( this.childNodes, function(){ |
| | 213 | if ( this.nodeType != 8 ) |
| | 214 | ret += this.nodeType != 1 ? |
| | 215 | this.nodeValue : |
| | 216 | jQuery.fn.text( [ this ] ); |
| | 217 | }); |
| | 218 | }); |
| | 219 | |
| | 220 | return ret; |
| | 221 | }, |
| | 222 | |
| | 223 | wrapAll: function( html ) { |
| | 224 | if ( this[0] ) |
| | 225 | // The elements to wrap the target around |
| | 226 | jQuery( html, this[0].ownerDocument ) |
| | 227 | .clone() |
| | 228 | .insertBefore( this[0] ) |
| | 229 | .map(function(){ |
| | 230 | var elem = this; |
| | 231 | |
| | 232 | while ( elem.firstChild ) |
| | 233 | elem = elem.firstChild; |
| | 234 | |
| | 235 | return elem; |
| | 236 | }) |
| | 237 | .append(this); |
| | 238 | |
| | 239 | return this; |
| | 240 | }, |
| | 241 | |
| | 242 | wrapInner: function( html ) { |
| | 243 | return this.each(function(){ |
| | 244 | jQuery( this ).contents().wrapAll( html ); |
| | 245 | }); |
| | 246 | }, |
| | 247 | |
| | 248 | wrap: function( html ) { |
| | 249 | return this.each(function(){ |
| | 250 | jQuery( this ).wrapAll( html ); |
| | 251 | }); |
| | 252 | }, |
| | 253 | |
| | 254 | append: function() { |
| | 255 | return this.domManip(arguments, true, false, function(elem){ |
| | 256 | if (this.nodeType == 1) |
| | 257 | this.appendChild( elem ); |
| | 258 | }); |
| | 259 | }, |
| | 260 | |
| | 261 | prepend: function() { |
| | 262 | return this.domManip(arguments, true, true, function(elem){ |
| | 263 | if (this.nodeType == 1) |
| | 264 | this.insertBefore( elem, this.firstChild ); |
| | 265 | }); |
| | 266 | }, |
| | 267 | |
| | 268 | before: function() { |
| | 269 | return this.domManip(arguments, false, false, function(elem){ |
| | 270 | this.parentNode.insertBefore( elem, this ); |
| | 271 | }); |
| | 272 | }, |
| | 273 | |
| | 274 | after: function() { |
| | 275 | return this.domManip(arguments, false, true, function(elem){ |
| | 276 | this.parentNode.insertBefore( elem, this.nextSibling ); |
| | 277 | }); |
| | 278 | }, |
| | 279 | |
| | 280 | end: function() { |
| | 281 | return this.prevObject || jQuery( [] ); |
| | 282 | }, |
| | 283 | |
| | 284 | find: function( selector ) { |
| | 285 | var elems = jQuery.map(this, function(elem){ |
| | 286 | return jQuery.find( selector, elem ); |
| | 287 | }); |
| | 288 | |
| | 289 | return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ? |
| | 290 | jQuery.unique( elems ) : |
| | 291 | elems ); |
| | 292 | }, |
| | 293 | |
| | 294 | clone: function( events ) { |
| | 295 | // Do the clone |
| | 296 | var ret = this.map(function(){ |
| | 297 | if ( jQuery.browser.msie && !jQuery.isXMLDoc(this) ) { |
| | 298 | // IE copies events bound via attachEvent when |
| | 299 | // using cloneNode. Calling detachEvent on the |
| | 300 | // clone will also remove the events from the orignal |
| | 301 | // In order to get around this, we use innerHTML. |
| | 302 | // Unfortunately, this means some modifications to |
| | 303 | // attributes in IE that are actually only stored |
| | 304 | // as properties will not be copied (such as the |
| | 305 | // the name attribute on an input). |
| | 306 | var clone = this.cloneNode(true), |
| | 307 | container = document.createElement("div"), |
| | 308 | container2 = document.createElement("div"); |
| | 309 | container.appendChild(clone); |
| | 310 | container2.innerHTML = container.innerHTML; |
| | 311 | return container2.firstChild; |
| | 312 | } else |
| | 313 | return this.cloneNode(true); |
| | 314 | }); |
| | 315 | |
| | 316 | // Need to set the expando to null on the cloned set if it exists |
| | 317 | // removeData doesn't work here, IE removes it from the original as well |
| | 318 | // this is primarily for IE but the data expando shouldn't be copied over in any browser |
| | 319 | var clone = ret.find("*").andSelf().each(function(){ |
| | 320 | if ( this[ expando ] != undefined ) |
| | 321 | this[ expando ] = null; |
| | 322 | }); |
| | 323 | |
| | 324 | // Copy the events from the original to the clone |
| | 325 | if ( events === true ) |
| | 326 | this.find("*").andSelf().each(function(i){ |
| | 327 | if (this.nodeType == 3) |
| | 328 | return; |
| | 329 | var events = jQuery.data( this, "events" ); |
| | 330 | |
| | 331 | for ( var type in events ) |
| | 332 | for ( var handler in events[ type ] ) |
| | 333 | jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data ); |
| | 334 | }); |
| | 335 | |
| | 336 | // Return the cloned set |
| | 337 | return ret; |
| | 338 | }, |
| | 339 | |
| | 340 | filter: function( selector ) { |
| | 341 | return this.pushStack( |
| | 342 | jQuery.isFunction( selector ) && |
| | 343 | jQuery.grep(this, function(elem, i){ |
| | 344 | return selector.call( elem, i ); |
| | 345 | }) || |
| | 346 | |
| | 347 | jQuery.multiFilter( selector, this ) ); |
| | 348 | }, |
| | 349 | |
| | 350 | not: function( selector ) { |
| | 351 | if ( selector.constructor == String ) |
| | 352 | // test special case where just one selector is passed in |
| | 353 | if ( isSimple.test( selector ) ) |
| | 354 | return this.pushStack( jQuery.multiFilter( selector, this, true ) ); |
| | 355 | else |
| | 356 | selector = jQuery.multiFilter( selector, this ); |
| | 357 | |
| | 358 | var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; |
| | 359 | return this.filter(function() { |
| | 360 | return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; |
| | 361 | }); |
| | 362 | }, |
| | 363 | |
| | 364 | add: function( selector ) { |
| | 365 | return !selector ? this : this.pushStack( jQuery.merge( |
| | 366 | this.get(), |
| | 367 | selector.constructor == String ? |
| | 368 | jQuery( selector ).get() : |
| | 369 | selector.length != undefined && (!selector.nodeName || jQuery.nodeName(selector, "form")) ? |
| | 370 | selector : [selector] ) ); |
| | 371 | }, |
| | 372 | |
| | 373 | is: function( selector ) { |
| | 374 | return selector ? |
| | 375 | jQuery.multiFilter( selector, this ).length > 0 : |
| | 376 | false; |
| | 377 | }, |
| | 378 | |
| | 379 | hasClass: function( selector ) { |
| | 380 | return this.is( "." + selector ); |
| | 381 | }, |
| | 382 | |
| | 383 | val: function( value ) { |
| | 384 | if ( value == undefined ) { |
| | 385 | |
| | 386 | if ( this.length ) { |
| | 387 | var elem = this[0]; |
| | 388 | |
| | 389 | // We need to handle select boxes special |
| | 390 | if ( jQuery.nodeName( elem, "select" ) ) { |
| | 391 | var index = elem.selectedIndex, |
| | 392 | values = [], |
| | 393 | options = elem.options, |
| | 394 | one = elem.type == "select-one"; |
| | 395 | |
| | 396 | // Nothing was selected |
| | 397 | if ( index < 0 ) |
| | 398 | return null; |
| | 399 | |
| | 400 | // Loop through all the selected options |
| | 401 | for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { |
| | 402 | var option = options[ i ]; |
| | 403 | |
| | 404 | if ( option.selected ) { |
| | 405 | // Get the specifc value for the option |
| | 406 | value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value; |
| | 407 | |
| | 408 | // We don't need an array for one selects |
| | 409 | if ( one ) |
| | 410 | return value; |
| | 411 | |
| | 412 | // Multi-Selects return an array |
| | 413 | values.push( value ); |
| | 414 | } |
| | 415 | } |
| | 416 | |
| | 417 | return values; |
| | 418 | |
| | 419 | // Everything else, we just grab the value |
| | 420 | } else |
| | 421 | return (this[0].value || "").replace(/\r/g, ""); |
| | 422 | |
| | 423 | } |
| | 424 | |
| | 425 | return undefined; |
| | 426 | } |
| | 427 | |
| | 428 | return this.each(function(){ |
| | 429 | if ( this.nodeType != 1 ) |
| | 430 | return; |
| | 431 | |
| | 432 | if ( value.constructor == Array && /radio|checkbox/.test( this.type ) ) |
| | 433 | this.checked = (jQuery.inArray(this.value, value) >= 0 || |
| | 434 | jQuery.inArray(this.name, value) >= 0); |
| | 435 | |
| | 436 | else if ( jQuery.nodeName( this, "select" ) ) { |
| | 437 | var values = value.constructor == Array ? |
| | 438 | value : |
| | 439 | [ value ]; |
| | 440 | |
| | 441 | jQuery( "option", this ).each(function(){ |
| | 442 | this.selected = (jQuery.inArray( this.value, values ) >= 0 || |
| | 443 | jQuery.inArray( this.text, values ) >= 0); |
| | 444 | }); |
| | 445 | |
| | 446 | if ( !values.length ) |
| | 447 | this.selectedIndex = -1; |
| | 448 | |
| | 449 | } else |
| | 450 | this.value = value; |
| | 451 | }); |
| | 452 | }, |
| | 453 | |
| | 454 | html: function( value ) { |
| | 455 | return value == undefined ? |
| | 456 | (this.length ? |
| | 457 | this[0].innerHTML : |
| | 458 | null) : |
| | 459 | this.empty().append( value ); |
| | 460 | }, |
| | 461 | |
| | 462 | replaceWith: function( value ) { |
| | 463 | return this.after( value ).remove(); |
| | 464 | }, |
| | 465 | |
| | 466 | eq: function( i ) { |
| | 467 | return this.slice( i, i + 1 ); |
| | 468 | }, |
| | 469 | |
| | 470 | slice: function() { |
| | 471 | return this.pushStack( Array.prototype.slice.apply( this, arguments ) ); |
| | 472 | }, |
| | 473 | |
| | 474 | map: function( callback ) { |
| | 475 | return this.pushStack( jQuery.map(this, function(elem, i){ |
| | 476 | return callback.call( elem, i, elem ); |
| | 477 | })); |
| | 478 | }, |
| | 479 | |
| | 480 | andSelf: function() { |
| | 481 | return this.add( this.prevObject ); |
| | 482 | }, |
| | 483 | |
| | 484 | domManip: function( args, table, reverse, callback ) { |
| | 485 | var clone = this.length > 1, elems; |
| | 486 | |
| | 487 | return this.each(function(){ |
| | 488 | if ( !elems ) { |
| | 489 | elems = jQuery.clean( args, this.ownerDocument ); |
| | 490 | |
| | 491 | if ( reverse ) |
| | 492 | elems.reverse(); |
| | 493 | } |
| | 494 | |
| | 495 | var obj = this; |
| | 496 | |
| | 497 | if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) ) |
| | 498 | obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") ); |
| | 499 | |
| | 500 | var scripts = jQuery( [] ); |
| | 501 | |
| | 502 | jQuery.each(elems, function(){ |
| | 503 | var elem = clone ? |
| | 504 | jQuery( this ).clone( true )[0] : |
| | 505 | this; |
| | 506 | |
| | 507 | // execute all scripts after the elements have been injected |
| | 508 | if ( jQuery.nodeName( elem, "script" ) ) { |
| | 509 | scripts = scripts.add( elem ); |
| | 510 | } else { |
| | 511 | // Remove any inner scripts for later evaluation |
| | 512 | if ( elem.nodeType == 1 ) |
| | 513 | scripts = scripts.add( jQuery( "script", elem ).remove() ); |
| | 514 | |
| | 515 | // Inject the elements into the document |
| | 516 | callback.call( obj, elem ); |
| | 517 | } |
| | 518 | }); |
| | 519 | |
| | 520 | scripts.each( evalScript ); |
| | 521 | }); |
| | 522 | } |
| | 523 | }; |
| | 524 | |
| | 525 | // Give the init function the jQuery prototype for later instantiation |
| | 526 | jQuery.prototype.init.prototype = jQuery.prototype; |
| | 527 | |
| | 528 | function evalScript( i, elem ) { |
| | 529 | if ( elem.src ) |
| | 530 | jQuery.ajax({ |
| | 531 | url: elem.src, |
| | 532 | async: false, |
| | 533 | dataType: "script" |
| | 534 | }); |
| | 535 | |
| | 536 | else |
| | 537 | jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); |
| | 538 | |
| | 539 | if ( elem.parentNode ) |
| | 540 | elem.parentNode.removeChild( elem ); |
| | 541 | } |
| | 542 | |
| | 543 | jQuery.extend = jQuery.fn.extend = function() { |
| | 544 | // copy reference to target object |
| | 545 | var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; |
| | 546 | |
| | 547 | // Handle a deep copy situation |
| | 548 | if ( target.constructor == Boolean ) { |
| | 549 | deep = target; |
| | 550 | target = arguments[1] || {}; |
| | 551 | // skip the boolean and the target |
| | 552 | i = 2; |
| | 553 | } |
| | 554 | |
| | 555 | // Handle case when target is a string or something (possible in deep copy) |
| | 556 | if ( typeof target != "object" && typeof target != "function" ) |
| | 557 | target = {}; |
| | 558 | |
| | 559 | // extend jQuery itself if only one argument is passed |
| | 560 | if ( length == 1 ) { |
| | 561 | target = this; |
| | 562 | i = 0; |
| | 563 | } |
| | 564 | |
| | 565 | for ( ; i < length; i++ ) |
| | 566 | // Only deal with non-null/undefined values |
| | 567 | if ( (options = arguments[ i ]) != null ) |
| | 568 | // Extend the base object |
| | 569 | for ( var name in options ) { |
| | 570 | // Prevent never-ending loop |
| | 571 | if ( target === options[ name ] ) |
| | 572 | continue; |
| | 573 | |
| | 574 | // Recurse if we're merging object values |
| | 575 | if ( deep && options[ name ] && typeof options[ name ] == "object" && target[ name ] && !options[ name ].nodeType ) |
| | 576 | target[ name ] = jQuery.extend( target[ name ], options[ name ] ); |
| | 577 | |
| | 578 | // Don't bring in undefined values |
| | 579 | else if ( options[ name ] != undefined ) |
| | 580 | target[ name ] = options[ name ]; |
| | 581 | |
| | 582 | } |
| | 583 | |
| | 584 | // Return the modified object |
| | 585 | return target; |
| | 586 | }; |
| | 587 | |
| | 588 | var expando = "jQuery" + (new Date()).getTime(), uuid = 0, windowData = {}; |
| | 589 | |
| | 590 | // exclude the following css properties to add px |
| | 591 | var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i; |
| | 592 | |
| | 593 | jQuery.extend({ |
| | 594 | noConflict: function( deep ) { |
| | 595 | window.$ = _$; |
| | 596 | |
| | 597 | if ( deep ) |
| | 598 | window.jQuery = _jQuery; |
| | 599 | |
| | 600 | return jQuery; |
| | 601 | }, |
| | 602 | |
| | 603 | // This may seem like some crazy code, but trust me when I say that this |
| | 604 | // is the only cross-browser way to do this. --John |
| | 605 | isFunction: function( fn ) { |
| | 606 | return !!fn && typeof fn != "string" && !fn.nodeName && |
| | 607 | fn.constructor != Array && /function/i.test( fn + "" ); |
| | 608 | }, |
| | 609 | |
| | 610 | // check if an element is in a (or is an) XML document |
| | 611 | isXMLDoc: function( elem ) { |
| | 612 | return elem.documentElement && !elem.body || |
| | 613 | elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; |
| | 614 | }, |
| | 615 | |
| | 616 | // Evalulates a script in a global context |
| | 617 | globalEval: function( data ) { |
| | 618 | data = jQuery.trim( data ); |
| | 619 | |
| | 620 | if ( data ) { |
| | 621 | // Inspired by code by Andrea Giammarchi |
| | 622 | // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html |
| | 623 | var head = document.getElementsByTagName("head")[0] || document.documentElement, |
| | 624 | script = document.createElement("script"); |
| | 625 | |
| | 626 | script.type = "text/javascript"; |
| | 627 | if ( jQuery.browser.msie ) |
| | 628 | script.text = data; |
| | 629 | else |
| | 630 | script.appendChild( document.createTextNode( data ) ); |
| | 631 | |
| | 632 | head.appendChild( script ); |
| | 633 | head.removeChild( script ); |
| | 634 | } |
| | 635 | }, |
| | 636 | |
| | 637 | nodeName: function( elem, name ) { |
| | 638 | return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); |
| | 639 | }, |
| | 640 | |
| | 641 | cache: {}, |
| | 642 | |
| | 643 | data: function( elem, name, data ) { |
| | 644 | elem = elem == window ? |
| | 645 | windowData : |
| | 646 | elem; |
| | 647 | |
| | 648 | var id = elem[ expando ]; |
| | 649 | |
| | 650 | // Compute a unique ID for the element |
| | 651 | if ( !id ) |
| | 652 | id = elem[ expando ] = ++uuid; |
| | 653 | |
| | 654 | // Only generate the data cache if we're |
| | 655 | // trying to access or manipulate it |
| | 656 | if ( name && !jQuery.cache[ id ] ) |
| | 657 | jQuery.cache[ id ] = {}; |
| | 658 | |
| | 659 | // Prevent overriding the named cache with undefined values |
| | 660 | if ( data != undefined ) |
| | 661 | jQuery.cache[ id ][ name ] = data; |
| | 662 | |
| | 663 | // Return the named cache data, or the ID for the element |
| | 664 | return name ? |
| | 665 | jQuery.cache[ id ][ name ] : |
| | 666 | id; |
| | 667 | }, |
| | 668 | |
| | 669 | removeData: function( elem, name ) { |
| | 670 | elem = elem == window ? |
| | 671 | windowData : |
| | 672 | elem; |
| | 673 | |
| | 674 | var id = elem[ expando ]; |
| | 675 | |
| | 676 | // If we want to remove a specific section of the element's data |
| | 677 | if ( name ) { |
| | 678 | if ( jQuery.cache[ id ] ) { |
| | 679 | // Remove the section of cache data |
| | 680 | delete jQuery.cache[ id ][ name ]; |
| | 681 | |
| | 682 | // If we've removed all the data, remove the element's cache |
| | 683 | name = ""; |
| | 684 | |
| | 685 | for ( name in jQuery.cache[ id ] ) |
| | 686 | break; |
| | 687 | |
| | 688 | if ( !name ) |
| | 689 | jQuery.removeData( elem ); |
| | 690 | } |
| | 691 | |
| | 692 | // Otherwise, we want to remove all of the element's data |
| | 693 | } else { |
| | 694 | // Clean up the element expando |
| | 695 | try { |
| | 696 | delete elem[ expando ]; |
| | 697 | } catch(e){ |
| | 698 | // IE has trouble directly removing the expando |
| | 699 | // but it's ok with using removeAttribute |
| | 700 | if ( elem.removeAttribute ) |
| | 701 | elem.removeAttribute( expando ); |
| | 702 | } |
| | 703 | |
| | 704 | // Completely remove the data cache |
| | 705 | delete jQuery.cache[ id ]; |
| | 706 | } |
| | 707 | }, |
| | 708 | |
| | 709 | // args is for internal usage only |
| | 710 | each: function( object, callback, args ) { |
| | 711 | if ( args ) { |
| | 712 | if ( object.length == undefined ) |
| | 713 | for ( var name in object ) |
| | 714 | callback.apply( object[ name ], args ); |
| | 715 | else |
| | 716 | for ( var i = 0, length = object.length; i < length; i++ ) |
| | 717 | if ( callback.apply( object[ i ], args ) === false ) |
| | 718 | break; |
| | 719 | |
| | 720 | // A special, fast, case for the most common use of each |
| | 721 | } else { |
| | 722 | if ( object.length == undefined ) |
| | 723 | for ( var name in object ) |
| | 724 | callback.call( object[ name ], name, object[ name ] ); |
| | 725 | else |
| | 726 | for ( var i = 0, length = object.length, value = object[0]; |
| | 727 | i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} |
| | 728 | } |
| | 729 | |
| | 730 | return object; |
| | 731 | }, |
| | 732 | |
| | 733 | prop: function( elem, value, type, i, name ) { |
| | 734 | // Handle executable functions |
| | 735 | if ( jQuery.isFunction( value ) ) |
| | 736 | value = value.call( elem, i ); |
| | 737 | |
| | 738 | // Handle passing in a number to a CSS property |
| | 739 | return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ? |
| | 740 | value + "px" : |
| | 741 | value; |
| | 742 | }, |
| | 743 | |
| | 744 | className: { |
| | 745 | // internal only, use addClass("class") |
| | 746 | add: function( elem, classNames ) { |
| | 747 | jQuery.each((classNames || "").split(/\s+/), function(i, className){ |
| | 748 | if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) ) |
| | 749 | elem.className += (elem.className ? " " : "") + className; |
| | 750 | }); |
| | 751 | }, |
| | 752 | |
| | 753 | // internal only, use removeClass("class") |
| | 754 | remove: function( elem, classNames ) { |
| | 755 | if (elem.nodeType == 1) |
| | 756 | elem.className = classNames != undefined ? |
| | 757 | jQuery.grep(elem.className.split(/\s+/), function(className){ |
| | 758 | return !jQuery.className.has( classNames, className ); |
| | 759 | }).join(" ") : |
| | 760 | ""; |
| | 761 | }, |
| | 762 | |
| | 763 | // internal only, use is(".class") |
| | 764 | has: function( elem, className ) { |
| | 765 | return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1; |
| | 766 | } |
| | 767 | }, |
| | 768 | |
| | 769 | // A method for quickly swapping in/out CSS properties to get correct calculations |
| | 770 | swap: function( elem, options, callback ) { |
| | 771 | var old = {}; |
| | 772 | // Remember the old values, and insert the new ones |
| | 773 | for ( var name in options ) { |
| | 774 | old[ name ] = elem.style[ name ]; |
| | 775 | elem.style[ name ] = options[ name ]; |
| | 776 | } |
| | 777 | |
| | 778 | callback.call( elem ); |
| | 779 | |
| | 780 | // Revert the old values |
| | 781 | for ( var name in options ) |
| | 782 | elem.style[ name ] = old[ name ]; |
| | 783 | }, |
| | 784 | |
| | 785 | css: function( elem, name, force ) { |
| | 786 | if ( name == "width" || name == "height" ) { |
| | 787 | var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; |
| | 788 | |
| | 789 | function getWH() { |
| | 790 | val = name == "width" ? elem.offsetWidth : elem.offsetHeight; |
| | 791 | var padding = 0, border = 0; |
| | 792 | jQuery.each( which, function() { |
| | 793 | padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0; |
| | 794 | border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0; |
| | 795 | }); |
| | 796 | val -= Math.round(padding + border); |
| | 797 | } |
| | 798 | |
| | 799 | if ( jQuery(elem).is(":visible") ) |
| | 800 | getWH(); |
| | 801 | else |
| | 802 | jQuery.swap( elem, props, getWH ); |
| | 803 | |
| | 804 | return Math.max(0, val); |
| | 805 | } |
| | 806 | |
| | 807 | return jQuery.curCSS( elem, name, force ); |
| | 808 | }, |
| | 809 | |
| | 810 | curCSS: function( elem, name, force ) { |
| | 811 | var ret; |
| | 812 | |
| | 813 | // A helper method for determining if an element's values are broken |
| | 814 | function color( elem ) { |
| | 815 | if ( !jQuery.browser.safari ) |
| | 816 | return false; |
| | 817 | |
| | 818 | var ret = document.defaultView.getComputedStyle( elem, null ); |
| | 819 | return !ret || ret.getPropertyValue("color") == ""; |
| | 820 | } |
| | 821 | |
| | 822 | // We need to handle opacity special in IE |
| | 823 | if ( name == "opacity" && jQuery.browser.msie ) { |
| | 824 | ret = jQuery.attr( elem.style, "opacity" ); |
| | 825 | |
| | 826 | return ret == "" ? |
| | 827 | "1" : |
| | 828 | ret; |
| | 829 | } |
| | 830 | // Opera sometimes will give the wrong display answer, this fixes it, see #2037 |
| | 831 | if ( jQuery.browser.opera && name == "display" ) { |
| | 832 | var save = elem.style.display; |
| | 833 | elem.style.display = "block"; |
| | 834 | elem.style.display = save; |
| | 835 | } |
| | 836 | |
| | 837 | // Make sure we're using the right name for getting the float value |
| | 838 | if ( name.match( /float/i ) ) |
| | 839 | name = styleFloat; |
| | 840 | |
| | 841 | if ( !force && elem.style[ name ] ) |
| | 842 | ret = elem.style[ name ]; |
| | 843 | |
| | 844 | else if ( document.defaultView && document.defaultView.getComputedStyle ) { |
| | 845 | |
| | 846 | // Only "float" is needed here |
| | 847 | if ( name.match( /float/i ) ) |
| | 848 | name = "float"; |
| | 849 | |
| | 850 | name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); |
| | 851 | |
| | 852 | var getComputedStyle = document.defaultView.getComputedStyle( elem, null ); |
| | 853 | |
| | 854 | if ( getComputedStyle && !color( elem ) ) |
| | 855 | ret = getComputedStyle.getPropertyValue( name ); |
| | 856 | |
| | 857 | // If the element isn't reporting its values properly in Safari |
| | 858 | // then some display: none elements are involved |
| | 859 | else { |
| | 860 | var swap = [], stack = []; |
| | 861 | |
| | 862 | // Locate all of the parent display: none elements |
| | 863 | for ( var a = elem; a && color(a); a = a.parentNode ) |
| | 864 | stack.unshift(a); |
| | 865 | |
| | 866 | // Go through and make them visible, but in reverse |
| | 867 | // (It would be better if we knew the exact display type that they had) |
| | 868 | for ( var i = 0; i < stack.length; i++ ) |
| | 869 | if ( color( stack[ i ] ) ) { |
| | 870 | swap[ i ] = stack[ i ].style.display; |
| | 871 | stack[ i ].style.display = "block"; |
| | 872 | } |
| | 873 | |
| | 874 | // Since we flip the display style, we have to handle that |
| | 875 | // one special, otherwise get the value |
| | 876 | ret = name == "display" && swap[ stack.length - 1 ] != null ? |
| | 877 | "none" : |
| | 878 | ( getComputedStyle && getComputedStyle.getPropertyValue( name ) ) || ""; |
| | 879 | |
| | 880 | // Finally, revert the display styles back |
| | 881 | for ( var i = 0; i < swap.length; i++ ) |
| | 882 | if ( swap[ i ] != null ) |
| | 883 | stack[ i ].style.display = swap[ i ]; |
| | 884 | } |
| | 885 | |
| | 886 | // We should always get a number back from opacity |
| | 887 | if ( name == "opacity" && ret == "" ) |
| | 888 | ret = "1"; |
| | 889 | |
| | 890 | } else if ( elem.currentStyle ) { |
| | 891 | var camelCase = name.replace(/\-(\w)/g, function(all, letter){ |
| | 892 | return letter.toUpperCase(); |
| | 893 | }); |
| | 894 | |
| | 895 | ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; |
| | 896 | |
| | 897 | // From the awesome hack by Dean Edwards |
| | 898 | // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 |
| | 899 | |
| | 900 | // If we're not dealing with a regular pixel number |
| | 901 | // but a number that has a weird ending, we need to convert it to pixels |
| | 902 | if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { |
| | 903 | // Remember the original values |
| | 904 | var style = elem.style.left, runtimeStyle = elem.runtimeStyle.left; |
| | 905 | |
| | 906 | // Put in the new values to get a computed value out |
| | 907 | elem.runtimeStyle.left = elem.currentStyle.left; |
| | 908 | elem.style.left = ret || 0; |
| | 909 | ret = elem.style.pixelLeft + "px"; |
| | 910 | |
| | 911 | // Revert the changed values |
| | 912 | elem.style.left = style; |
| | 913 | elem.runtimeStyle.left = runtimeStyle; |
| | 914 | } |
| | 915 | } |
| | 916 | |
| | 917 | return ret; |
| | 918 | }, |
| | 919 | |
| | 920 | clean: function( elems, context ) { |
| | 921 | var ret = []; |
| | 922 | context = context || document; |
| | 923 | // !context.createElement fails in IE with an error but returns typeof 'object' |
| | 924 | if (typeof context.createElement == 'undefined') |
| | 925 | context = context.ownerDocument || context[0] && context[0].ownerDocument || document; |
| | 926 | |
| | 927 | jQuery.each(elems, function(i, elem){ |
| | 928 | if ( !elem ) |
| | 929 | return; |
| | 930 | |
| | 931 | if ( elem.constructor == Number ) |
| | 932 | elem = elem.toString(); |
| | 933 | |
| | 934 | // Convert html string into DOM nodes |
| | 935 | if ( typeof elem == "string" ) { |
| | 936 | // Fix "XHTML"-style tags in all browsers |
| | 937 | elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ |
| | 938 | return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? |
| | 939 | all : |
| | 940 | front + "></" + tag + ">"; |
| | 941 | }); |
| | 942 | |
| | 943 | // Trim whitespace, otherwise indexOf won't work as expected |
| | 944 | var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div"); |
| | 945 | |
| | 946 | var wrap = |
| | 947 | // option or optgroup |
| | 948 | !tags.indexOf("<opt") && |
| | 949 | [ 1, "<select multiple='multiple'>", "</select>" ] || |
| | 950 | |
| | 951 | !tags.indexOf("<leg") && |
| | 952 | [ 1, "<fieldset>", "</fieldset>" ] || |
| | 953 | |
| | 954 | tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && |
| | 955 | [ 1, "<table>", "</table>" ] || |
| | 956 | |
| | 957 | !tags.indexOf("<tr") && |
| | 958 | [ 2, "<table><tbody>", "</tbody></table>" ] || |
| | 959 | |
| | 960 | // <thead> matched above |
| | 961 | (!tags.indexOf("<td") || !tags.indexOf("<th")) && |
| | 962 | [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] || |
| | 963 | |
| | 964 | !tags.indexOf("<col") && |
| | 965 | [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] || |
| | 966 | |
| | 967 | // IE can't serialize <link> and <script> tags normally |
| | 968 | jQuery.browser.msie && |
| | 969 | [ 1, "div<div>", "</div>" ] || |
| | 970 | |
| | 971 | [ 0, "", "" ]; |
| | 972 | |
| | 973 | // Go to html and back, then peel off extra wrappers |
| | 974 | div.innerHTML = wrap[1] + elem + wrap[2]; |
| | 975 | |
| | 976 | // Move to the right depth |
| | 977 | while ( wrap[0]-- ) |
| | 978 | div = div.lastChild; |
| | 979 | |
| | 980 | // Remove IE's autoinserted <tbody> from table fragments |
| | 981 | if ( jQuery.browser.msie ) { |
| | 982 | |
| | 983 | // String was a <table>, *may* have spurious <tbody> |
| | 984 | var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ? |
| | 985 | div.firstChild && div.firstChild.childNodes : |
| | 986 | |
| | 987 | // String was a bare <thead> or <tfoot> |
| | 988 | wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ? |
| | 989 | div.childNodes : |
| | 990 | []; |
| | 991 | |
| | 992 | for ( var j = tbody.length - 1; j >= 0 ; --j ) |
| | 993 | if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) |
| | 994 | tbody[ j ].parentNode.removeChild( tbody[ j ] ); |
| | 995 | |
| | 996 | // IE completely kills leading whitespace when innerHTML is used |
| | 997 | if ( /^\s/.test( elem ) ) |
| | 998 | div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild ); |
| | 999 | |
| | 1000 | } |
| | 1001 | |
| | 1002 | elem = jQuery.makeArray( div.childNodes ); |
| | 1003 | } |
| | 1004 | |
| | 1005 | if ( elem.length === 0 && (!jQuery.nodeName( elem, "form" ) && !jQuery.nodeName( elem, "select" )) ) |
| | 1006 | return; |
| | 1007 | |
| | 1008 | if ( elem[0] == undefined || jQuery.nodeName( elem, "form" ) || elem.options ) |
| | 1009 | ret.push( elem ); |
| | 1010 | |
| | 1011 | else |
| | 1012 | ret = jQuery.merge( ret, elem ); |
| | 1013 | |
| | 1014 | }); |
| | 1015 | |
| | 1016 | return ret; |
| | 1017 | }, |
| | 1018 | |
| | 1019 | attr: function( elem, name, value ) { |
| | 1020 | // don't set attributes on text and comment nodes |
| | 1021 | if (!elem || elem.nodeType == 3 || elem.nodeType == 8) |
| | 1022 | return undefined; |
| | 1023 | |
| | 1024 | var fix = jQuery.isXMLDoc( elem ) ? |
| | 1025 | {} : |
| | 1026 | jQuery.props; |
| | 1027 | |
| | 1028 | // Safari mis-reports the default selected property of a hidden option |
| | 1029 | // Accessing the parent's selectedIndex property fixes it |
| | 1030 | if ( name == "selected" && jQuery.browser.safari ) |
| | 1031 | elem.parentNode.selectedIndex; |
| | 1032 | |
| | 1033 | // Certain attributes only work when accessed via the old DOM 0 way |
| | 1034 | if ( fix[ name ] ) { |
| | 1035 | if ( value != undefined ) |
| | 1036 | elem[ fix[ name ] ] = value; |
| | 1037 | |
| | 1038 | return elem[ fix[ name ] ]; |
| | 1039 | |
| | 1040 | } else if ( jQuery.browser.msie && name == "style" ) |
| | 1041 | return jQuery.attr( elem.style, "cssText", value ); |
| | 1042 | |
| | 1043 | else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName( elem, "form" ) && (name == "action" || name == "method") ) |
| | 1044 | return elem.getAttributeNode( name ).nodeValue; |
| | 1045 | |
| | 1046 | // IE elem.getAttribute passes even for style |
| | 1047 | else if ( elem.tagName ) { |
| | 1048 | |
| | 1049 | if ( value != undefined ) { |
| | 1050 | // We can't allow the type property to be changed (since it causes problems in IE) |
| | 1051 | if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode ) |
| | 1052 | throw "type property can't be changed"; |
| | 1053 | |
| | 1054 | // convert the value to a string (all browsers do this but IE) see #1070 |
| | 1055 | elem.setAttribute( name, "" + value ); |
| | 1056 | } |
| | 1057 | |
| | 1058 | if ( jQuery.browser.msie && /href|src/.test( name ) && !jQuery.isXMLDoc( elem ) ) |
| | 1059 | return elem.getAttribute( name, 2 ); |
| | 1060 | |
| | 1061 | return elem.getAttribute( name ); |
| | 1062 | |
| | 1063 | // elem is actually elem.style ... set the style |
| | 1064 | } else { |
| | 1065 | // IE actually uses filters for opacity |
| | 1066 | if ( name == "opacity" && jQuery.browser.msie ) { |
| | 1067 | if ( value != undefined ) { |
| | 1068 | // IE has trouble with opacity if it does not have layout |
| | 1069 | // Force it by setting the zoom level |
| | 1070 | elem.zoom = 1; |
| | 1071 | |
| | 1072 | // Set the alpha filter to set the opacity |
| | 1073 | elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) + |
| | 1074 | (parseFloat( value ).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"); |
| | 1075 | } |
| | 1076 | |
| | 1077 | return elem.filter && elem.filter.indexOf("opacity=") >= 0 ? |
| | 1078 | (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100).toString() : |
| | 1079 | ""; |
| | 1080 | } |
| | 1081 | |
| | 1082 | name = name.replace(/-([a-z])/ig, function(all, letter){ |
| | 1083 | return letter.toUpperCase(); |
| | 1084 | }); |
| | 1085 | |
| | 1086 | if ( value != undefined ) |
| | 1087 | elem[ name ] = value; |
| | 1088 | |
| | 1089 | return elem[ name ]; |
| | 1090 | } |
| | 1091 | }, |
| | 1092 | |
| | 1093 | trim: function( text ) { |
| | 1094 | return (text || "").replace( /^\s+|\s+$/g, "" ); |
| | 1095 | }, |
| | 1096 | |
| | 1097 | makeArray: function( array ) { |
| | 1098 | var ret = []; |
| | 1099 | |
| | 1100 | // Need to use typeof to fight Safari childNodes crashes |
| | 1101 | if ( typeof array != "array" ) |
| | 1102 | for ( var i = 0, length = array.length; i < length; i++ ) |
| | 1103 | ret.push( array[ i ] ); |
| | 1104 | else |
| | 1105 | ret = array.slice( 0 ); |
| | 1106 | |
| | 1107 | return ret; |
| | 1108 | }, |
| | 1109 | |
| | 1110 | inArray: function( elem, array ) { |
| | 1111 | for ( var i = 0, length = array.length; i < length; i++ ) |
| | 1112 | if ( array[ i ] == elem ) |
| | 1113 | return i; |
| | 1114 | |
| | 1115 | return -1; |
| | 1116 | }, |
| | 1117 | |
| | 1118 | merge: function( first, second ) { |
| | 1119 | // We have to loop this way because IE & Opera overwrite the length |
| | 1120 | // expando of getElementsByTagName |
| | 1121 | |
| | 1122 | // Also, we need to make sure that the correct elements are being returned |
| | 1123 | // (IE returns comment nodes in a '*' query) |
| | 1124 | if ( jQuery.browser.msie ) { |
| | 1125 | for ( var i = 0; second[ i ]; i++ ) |
| | 1126 | if ( second[ i ].nodeType != 8 ) |
| | 1127 | first.push( second[ i ] ); |
| | 1128 | |
| | 1129 | } else |
| | 1130 | for ( var i = 0; second[ i ]; i++ ) |
| | 1131 | first.push( second[ i ] ); |
| | 1132 | |
| | 1133 | return first; |
| | 1134 | }, |
| | 1135 | |
| | 1136 | unique: function( array ) { |
| | 1137 | var ret = [], done = {}; |
| | 1138 | |
| | 1139 | try { |
| | 1140 | |
| | 1141 | for ( var i = 0, length = array.length; i < length; i++ ) { |
| | 1142 | var id = jQuery.data( array[ i ] ); |
| | 1143 | |
| | 1144 | if ( !done[ id ] ) { |
| | 1145 | done[ id ] = true; |
| | 1146 | ret.push( array[ i ] ); |
| | 1147 | } |
| | 1148 | } |
| | 1149 | |
| | 1150 | } catch( e ) { |
| | 1151 | ret = array; |
| | 1152 | } |
| | 1153 | |
| | 1154 | return ret; |
| | 1155 | }, |
| | 1156 | |
| | 1157 | grep: function( elems, callback, inv ) { |
| | 1158 | // If a string is passed in for the function, make a function |
| | 1159 | // for it (a handy shortcut) |
| | 1160 | if ( typeof callback == "string" ) |
| | 1161 | callback = eval("false||function(a,i){return " + callback + "}"); |
| | 1162 | |
| | 1163 | var ret = []; |
| | 1164 | |
| | 1165 | // Go through the array, only saving the items |
| | 1166 | // that pass the validator function |
| | 1167 | for ( var i = 0, length = elems.length; i < length; i++ ) |
| | 1168 | if ( !inv && callback( elems[ i ], i ) || inv && !callback( elems[ i ], i ) ) |
| | 1169 | ret.push( elems[ i ] ); |
| | 1170 | |
| | 1171 | return ret; |
| | 1172 | }, |
| | 1173 | |
| | 1174 | map: function( elems, callback ) { |
| | 1175 | var ret = []; |
| | 1176 | |
| | 1177 | // Go through the array, translating each of the items to their |
| | 1178 | // new value (or values). |
| | 1179 | for ( var i = 0, length = elems.length; i < length; i++ ) { |
| | 1180 | var value = callback( elems[ i ], i ); |
| | 1181 | |
| | 1182 | if ( value !== null && value != undefined ) { |
| | 1183 | if ( value.constructor != Array ) |
| | 1184 | value = [ value ]; |
| | 1185 | |
| | 1186 | ret = ret.concat( value ); |
| | 1187 | } |
| | 1188 | } |
| | 1189 | |
| | 1190 | return ret; |
| | 1191 | } |
| | 1192 | }); |
| | 1193 | |
| | 1194 | var userAgent = navigator.userAgent.toLowerCase(); |
| | 1195 | |
| | 1196 | // Figure out what browser is being used |
| | 1197 | jQuery.browser = { |
| | 1198 | version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1], |
| | 1199 | safari: /webkit/.test( userAgent ), |
| | 1200 | opera: /opera/.test( userAgent ), |
| | 1201 | msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), |
| | 1202 | mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) |
| | 1203 | }; |
| | 1204 | |
| | 1205 | var styleFloat = jQuery.browser.msie ? |
| | 1206 | "styleFloat" : |
| | 1207 | "cssFloat"; |
| | 1208 | |
| | 1209 | jQuery.extend({ |
| | 1210 | // Check to see if the W3C box model is being used |
| | 1211 | boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat", |
| | 1212 | |
| | 1213 | props: { |
| | 1214 | "for": "htmlFor", |
| | 1215 | "class": "className", |
| | 1216 | "float": styleFloat, |
| | 1217 | cssFloat: styleFloat, |
| | 1218 | styleFloat: styleFloat, |
| | 1219 | innerHTML: "innerHTML", |
| | 1220 | className: "className", |
| | 1221 | value: "value", |
| | 1222 | disabled: "disabled", |
| | 1223 | checked: "checked", |
| | 1224 | readonly: "readOnly", |
| | 1225 | selected: "selected", |
| | 1226 | maxlength: "maxLength", |
| | 1227 | selectedIndex: "selectedIndex", |
| | 1228 | defaultValue: "defaultValue", |
| | 1229 | tagName: "tagName", |
| | 1230 | nodeName: "nodeName" |
| | 1231 | } |
| | 1232 | }); |
| | 1233 | |
| | 1234 | jQuery.each({ |
| | 1235 | parent: "elem.parentNode", |
| | 1236 | parents: "jQuery.dir(elem,'parentNode')", |
| | 1237 | next: "jQuery.nth(elem,2,'nextSibling')", |
| | 1238 | prev: "jQuery.nth(elem,2,'previousSibling')", |
| | 1239 | nextAll: "jQuery.dir(elem,'nextSibling')", |
| | 1240 | prevAll: "jQuery.dir(elem,'previousSibling')", |
| | 1241 | siblings: "jQuery.sibling(elem.parentNode.firstChild,elem)", |
| | 1242 | children: "jQuery.sibling(elem.firstChild)", |
| | 1243 | contents: "jQuery.nodeName(elem,'iframe')?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes)" |
| | 1244 | }, function(name, fn){ |
| | 1245 | fn = eval("false||function(elem){return " + fn + "}"); |
| | 1246 | |
| | 1247 | jQuery.fn[ name ] = function( selector ) { |
| | 1248 | var ret = jQuery.map( this, fn ); |
| | 1249 | |
| | 1250 | if ( selector && typeof selector == "string" ) |
| | 1251 | ret = jQuery.multiFilter( selector, ret ); |
| | 1252 | |
| | 1253 | return this.pushStack( jQuery.unique( ret ) ); |
| | 1254 | }; |
| | 1255 | }); |
| | 1256 | |
| | 1257 | jQuery.each({ |
| | 1258 | appendTo: "append", |
| | 1259 | prependTo: "prepend", |
| | 1260 | insertBefore: "before", |
| | 1261 | insertAfter: "after", |
| | 1262 | replaceAll: "replaceWith" |
| | 1263 | }, function(name, original){ |
| | 1264 | jQuery.fn[ name ] = function() { |
| | 1265 | var args = arguments; |
| | 1266 | |
| | 1267 | return this.each(function(){ |
| | 1268 | for ( var i = 0, length = args.length; i < length; i++ ) |
| | 1269 | jQuery( args[ i ] )[ original ]( this ); |
| | 1270 | }); |
| | 1271 | }; |
| | 1272 | }); |
| | 1273 | |
| | 1274 | jQuery.each({ |
| | 1275 | removeAttr: function( name ) { |
| | 1276 | jQuery.attr( this, name, "" ); |
| | 1277 | if (this.nodeType == 1) |
| | 1278 | this.removeAttribute( name ); |
| | 1279 | }, |
| | 1280 | |
| | 1281 | addClass: function( classNames ) { |
| | 1282 | jQuery.className.add( this, classNames ); |
| | 1283 | }, |
| | 1284 | |
| | 1285 | removeClass: function( classNames ) { |
| | 1286 | jQuery.className.remove( this, classNames ); |
| | 1287 | }, |
| | 1288 | |
| | 1289 | toggleClass: function( classNames ) { |
| | 1290 | jQuery.className[ jQuery.className.has( this, classNames ) ? "remove" : "add" ]( this, classNames ); |
| | 1291 | }, |
| | 1292 | |
| | 1293 | remove: function( selector ) { |
| | 1294 | if ( !selector || jQuery.filter( selector, [ this ] ).r.length ) { |
| | 1295 | // Prevent memory leaks |
| | 1296 | jQuery( "*", this ).add(this).each(function(){ |
| | 1297 | jQuery.event.remove(this); |
| | 1298 | jQuery.removeData(this); |
| | 1299 | }); |
| | 1300 | if (this.parentNode) |
| | 1301 | this.parentNode.removeChild( this ); |
| | 1302 | } |
| | 1303 | }, |
| | 1304 | |
| | 1305 | empty: function() { |
| | 1306 | // Remove element nodes and prevent memory leaks |
| | 1307 | jQuery( ">*", this ).remove(); |
| | 1308 | |
| | 1309 | // Remove any remaining nodes |
| | 1310 | while ( this.firstChild ) |
| | 1311 | this.removeChild( this.firstChild ); |
| | 1312 | } |
| | 1313 | }, function(name, fn){ |
| | 1314 | jQuery.fn[ name ] = function(){ |
| | 1315 | return this.each( fn, arguments ); |
| | 1316 | }; |
| | 1317 | }); |
| | 1318 | |
| | 1319 | jQuery.each([ "Height", "Width" ], function(i, name){ |
| | 1320 | var type = name.toLowerCase(); |
| | 1321 | |
| | 1322 | jQuery.fn[ type ] = function( size ) { |
| | 1323 | // Get window width or height |
| | 1324 | return this[0] == window ? |
| | 1325 | // Opera reports document.body.client[Width/Height] properly in both quirks and standards |
| | 1326 | jQuery.browser.opera && document.body[ "client" + name ] || |
| | 1327 | |
| | 1328 | // Safari reports inner[Width/Height] just fine (Mozilla and Opera include scroll bar widths) |
| | 1329 | jQuery.browser.safari && window[ "inner" + name ] || |
| | 1330 | |
| | 1331 | // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode |
| | 1332 | document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ] : |
| | 1333 | |
| | 1334 | // Get document width or height |
| | 1335 | this[0] == document ? |
| | 1336 | // Either scroll[Width/Height] or offset[Width/Height], whichever is greater |
| | 1337 | Math.max( |
| | 1338 | Math.max(document.body["scroll" + name], document.documentElement["scroll" + name]), |
| | 1339 | Math.max(document.body["offset" + name], document.documentElement["offset" + name]) |
| | 1340 | ) : |
| | 1341 | |
| | 1342 | // Get or set width or height on the element |
| | 1343 | size == undefined ? |
| | 1344 | // Get width or height on the element |
| | 1345 | (this.length ? jQuery.css( this[0], type ) : null) : |
| | 1346 | |
| | 1347 | // Set the width or height on the element (default to pixels if value is unitless) |
| | 1348 | this.css( type, size.constructor == String ? size : size + "px" ); |
| | 1349 | }; |
| | 1350 | }); |
| | 1351 | |
| | 1352 | var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ? |
| | 1353 | "(?:[\\w*_-]|\\\\.)" : |
| | 1354 | "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)", |
| | 1355 | quickChild = new RegExp("^>\\s*(" + chars + "+)"), |
| | 1356 | quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"), |
| | 1357 | quickClass = new RegExp("^([#.]?)(" + chars + "*)"); |
| | 1358 | |
| | 1359 | jQuery.extend({ |
| | 1360 | expr: { |
| | 1361 | "": "m[2]=='*'||jQuery.nodeName(a,m[2])", |
| | 1362 | "#": "a.getAttribute('id')==m[2]", |
| | 1363 | ":": { |
| | 1364 | // Position Checks |
| | 1365 | lt: "i<m[3]-0", |
| | 1366 | gt: "i>m[3]-0", |
| | 1367 | nth: "m[3]-0==i", |
| | 1368 | eq: "m[3]-0==i", |
| | 1369 | first: "i==0", |
| | 1370 | last: "i==r.length-1", |
| | 1371 | even: "i%2==0", |
| | 1372 | odd: "i%2", |
| | 1373 | |
| | 1374 | // Child Checks |
| | 1375 | "first-child": "a.parentNode.getElementsByTagName('*')[0]==a", |
| | 1376 | "last-child": "jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a", |
| | 1377 | "only-child": "!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')", |
| | 1378 | |
| | 1379 | // Parent Checks |
| | 1380 | parent: "a.firstChild", |
| | 1381 | empty: "!a.firstChild", |
| | 1382 | |
| | 1383 | // Text Check |
| | 1384 | contains: "(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0", |
| | 1385 | |
| | 1386 | // Visibility |
| | 1387 | visible: '"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"', |
| | 1388 | hidden: '"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"', |
| | 1389 | |
| | 1390 | // Form attributes |
| | 1391 | enabled: "!a.disabled", |
| | 1392 | disabled: "a.disabled", |
| | 1393 | checked: "a.checked", |
| | 1394 | selected: "a.selected||jQuery.attr(a,'selected')", |
| | 1395 | |
| | 1396 | // Form elements |
| | 1397 | text: "'text'==a.type", |
| | 1398 | radio: "'radio'==a.type", |
| | 1399 | checkbox: "'checkbox'==a.type", |
| | 1400 | file: "'file'==a.type", |
| | 1401 | password: "'password'==a.type", |
| | 1402 | submit: "'submit'==a.type", |
| | 1403 | image: "'image'==a.type", |
| | 1404 | reset: "'reset'==a.type", |
| | 1405 | button: '"button"==a.type||jQuery.nodeName(a,"button")', |
| | 1406 | input: "/input|select|textarea|button/i.test(a.nodeName)", |
| | 1407 | |
| | 1408 | // :has() |
| | 1409 | has: "jQuery.find(m[3],a).length", |
| | 1410 | |
| | 1411 | // :header |
| | 1412 | header: "/h\\d/i.test(a.nodeName)", |
| | 1413 | |
| | 1414 | // :animated |
| | 1415 | animated: "jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length" |
| | 1416 | } |
| | 1417 | }, |
| | 1418 | |
| | 1419 | // The regular expressions that power the parsing engine |
| | 1420 | parse: [ |
| | 1421 | // Match: [@value='test'], [@foo] |
| | 1422 | /^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/, |
| | 1423 | |
| | 1424 | // Match: :contains('foo') |
| | 1425 | /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/, |
| | 1426 | |
| | 1427 | // Match: :even, :last-chlid, #id, .class |
| | 1428 | new RegExp("^([:.#]*)(" + chars + "+)") |
| | 1429 | ], |
| | 1430 | |
| | 1431 | multiFilter: function( expr, elems, not ) { |
| | 1432 | var old, cur = []; |
| | 1433 | |
| | 1434 | while ( expr && expr != old ) { |
| | 1435 | old = expr; |
| | 1436 | var f = jQuery.filter( expr, elems, not ); |
| | 1437 | expr = f.t.replace(/^\s*,\s*/, "" ); |
| | 1438 | cur = not ? elems = f.r : jQuery.merge( cur, f.r ); |
| | 1439 | } |
| | 1440 | |
| | 1441 | return cur; |
| | 1442 | }, |
| | 1443 | |
| | 1444 | find: function( t, context ) { |
| | 1445 | // Quickly handle non-string expressions |
| | 1446 | if ( typeof t != "string" ) |
| | 1447 | return [ t ]; |
| | 1448 | |
| | 1449 | // check to make sure context is a DOM element or a document |
| | 1450 | if ( context && context.nodeType != 1 && context.nodeType != 9) |
| | 1451 | return [ ]; |
| | 1452 | |
| | 1453 | // Set the correct context (if none is provided) |
| | 1454 | context = context || document; |
| | 1455 | |
| | 1456 | // Initialize the search |
| | 1457 | var ret = [context], done = [], last, nodeName; |
| | 1458 | |
| | 1459 | // Continue while a selector expression exists, and while |
| | 1460 | // we're no longer looping upon ourselves |
| | 1461 | while ( t && last != t ) { |
| | 1462 | var r = []; |
| | 1463 | last = t; |
| | 1464 | |
| | 1465 | t = jQuery.trim(t); |
| | 1466 | |
| | 1467 | var foundToken = false; |
| | 1468 | |
| | 1469 | // An attempt at speeding up child selectors that |
| | 1470 | // point to a specific element tag |
| | 1471 | var re = quickChild; |
| | 1472 | var m = re.exec(t); |
| | 1473 | |
| | 1474 | if ( m ) { |
| | 1475 | nodeName = m[1].toUpperCase(); |
| | 1476 | |
| | 1477 | // Perform our own iteration and filter |
| | 1478 | for ( var i = 0; ret[i]; i++ ) |
| | 1479 | for ( var c = ret[i].firstChild; c; c = c.nextSibling ) |
| | 1480 | if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName) ) |
| | 1481 | r.push( c ); |
| | 1482 | |
| | 1483 | ret = r; |
| | 1484 | t = t.replace( re, "" ); |
| | 1485 | if ( t.indexOf(" ") == 0 ) continue; |
| | 1486 | foundToken = true; |
| | 1487 | } else { |
| | 1488 | re = /^([>+~])\s*(\w*)/i; |
| | 1489 | |
| | 1490 | if ( (m = re.exec(t)) != null ) { |
| | 1491 | r = []; |
| | 1492 | |
| | 1493 | var merge = {}; |
| | 1494 | nodeName = m[2].toUpperCase(); |
| | 1495 | m = m[1]; |
| | 1496 | |
| | 1497 | for ( var j = 0, rl = ret.length; j < rl; j++ ) { |
| | 1498 | var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild; |
| | 1499 | for ( ; n; n = n.nextSibling ) |
| | 1500 | if ( n.nodeType == 1 ) { |
| | 1501 | var id = jQuery.data(n); |
| | 1502 | |
| | 1503 | if ( m == "~" && merge[id] ) break; |
| | 1504 | |
| | 1505 | if (!nodeName || n.nodeName.toUpperCase() == nodeName ) { |
| | 1506 | if ( m == "~" ) merge[id] = true; |
| | 1507 | r.push( n ); |
| | 1508 | } |
| | 1509 | |
| | 1510 | if ( m == "+" ) break; |
| | 1511 | } |
| | 1512 | } |
| | 1513 | |
| | 1514 | ret = r; |
| | 1515 | |
| | 1516 | // And remove the token |
| | 1517 | t = jQuery.trim( t.replace( re, "" ) ); |
| | 1518 | foundToken = true; |
| | 1519 | } |
| | 1520 | } |
| | 1521 | |
| | 1522 | // See if there's still an expression, and that we haven't already |
| | 1523 | // matched a token |
| | 1524 | if ( t && !foundToken ) { |
| | 1525 | // Handle multiple expressions |
| | 1526 | if ( !t.indexOf(",") ) { |
| | 1527 | // Clean the result set |
| | 1528 | if ( context == ret[0] ) ret.shift(); |
| | 1529 | |
| | 1530 | // Merge the result sets |
| | 1531 | done = jQuery.merge( done, ret ); |
| | 1532 | |
| | 1533 | // Reset the context |
| | 1534 | r = ret = [context]; |
| | 1535 | |
| | 1536 | // Touch up the selector string |
| | 1537 | t = " " + t.substr(1,t.length); |
| | 1538 | |
| | 1539 | } else { |
| | 1540 | // Optimize for the case nodeName#idName |
| | 1541 | var re2 = quickID; |
| | 1542 | var m = re2.exec(t); |
| | 1543 | |
| | 1544 | // Re-organize the results, so that they're consistent |
| | 1545 | if ( m ) { |
| | 1546 | m = [ 0, m[2], m[3], m[1] ]; |
| | 1547 | |
| | 1548 | } else { |
| | 1549 | // Otherwise, do a traditional filter check for |
| | 1550 | // ID, class, and element selectors |
| | 1551 | re2 = quickClass; |
| | 1552 | m = re2.exec(t); |
| | 1553 | } |
| | 1554 | |
| | 1555 | m[2] = m[2].replace(/\\/g, ""); |
| | 1556 | |
| | 1557 | var elem = ret[ret.length-1]; |
| | 1558 | |
| | 1559 | // Try to do a global search by ID, where we can |
| | 1560 | if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) { |
| | 1561 | // Optimization for HTML document case |
| | 1562 | var oid = elem.getElementById(m[2]); |
| | 1563 | |
| | 1564 | // Do a quick check for the existence of the actual ID attribute |
| | 1565 | // to avoid selecting by the name attribute in IE |
| | 1566 | // also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form |
| | 1567 | if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] ) |
| | 1568 | oid = jQuery('[@id="'+m[2]+'"]', elem)[0]; |
| | 1569 | |
| | 1570 | // Do a quick check for node name (where applicable) so |
| | 1571 | // that div#foo searches will be really fast |
| | 1572 | ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : []; |
| | 1573 | } else { |
| | 1574 | // We need to find all descendant elements |
| | 1575 | for ( var i = 0; ret[i]; i++ ) { |
| | 1576 | // Grab the tag name being searched for |
| | 1577 | var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2]; |
| | 1578 | |
| | 1579 | // Handle IE7 being really dumb about <object>s |
| | 1580 | if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" ) |
| | 1581 | tag = "param"; |
| | 1582 | |
| | 1583 | r = jQuery.merge( r, ret[i].getElementsByTagName( tag )); |
| | 1584 | } |
| | 1585 | |
| | 1586 | // It's faster to filter by class and be done with it |
| | 1587 | if ( m[1] == "." ) |
| | 1588 | r = jQuery.classFilter( r, m[2] ); |
| | 1589 | |
| | 1590 | // Same with ID filtering |
| | 1591 | if ( m[1] == "#" ) { |
| | 1592 | var tmp = []; |
| | 1593 | |
| | 1594 | // Try to find the element with the ID |
| | 1595 | for ( var i = 0; r[i]; i++ ) |
| | 1596 | if ( r[i].getAttribute("id") == m[2] ) { |
| | 1597 | tmp = [ r[i] ]; |
| | 1598 | break; |
| | 1599 | } |
| | 1600 | |
| | 1601 | r = tmp; |
| | 1602 | } |
| | 1603 | |
| | 1604 | ret = r; |
| | 1605 | } |
| | 1606 | |
| | 1607 | t = t.replace( re2, "" ); |
| | 1608 | } |
| | 1609 | |
| | 1610 | } |
| | 1611 | |
| | 1612 | // If a selector string still exists |
| | 1613 | if ( t ) { |
| | 1614 | // Attempt to filter it |
| | 1615 | var val = jQuery.filter(t,r); |
| | 1616 | ret = r = val.r; |
| | 1617 | t = jQuery.trim(val.t); |
| | 1618 | } |
| | 1619 | } |
| | 1620 | |
| | 1621 | // An error occurred with the selector; |
| | 1622 | // just return an empty set instead |
| | 1623 | if ( t ) |
| | 1624 | ret = []; |
| | 1625 | |
| | 1626 | // Remove the root context |
| | 1627 | if ( ret && context == ret[0] ) |
| | 1628 | ret.shift(); |
| | 1629 | |
| | 1630 | // And combine the results |
| | 1631 | done = jQuery.merge( done, ret ); |
| | 1632 | |
| | 1633 | return done; |
| | 1634 | }, |
| | 1635 | |
| | 1636 | classFilter: function(r,m,not){ |
| | 1637 | m = " " + m + " "; |
| | 1638 | var tmp = []; |
| | 1639 | for ( var i = 0; r[i]; i++ ) { |
| | 1640 | var pass = (" " + r[i].className + " ").indexOf( m ) >= 0; |
| | 1641 | if ( !not && pass || not && !pass ) |
| | 1642 | tmp.push( r[i] ); |
| | 1643 | } |
| | 1644 | return tmp; |
| | 1645 | }, |
| | 1646 | |
| | 1647 | filter: function(t,r,not) { |
| | 1648 | var last; |
| | 1649 | |
| | 1650 | // Look for common filter expressions |
| | 1651 | while ( t && t != last ) { |
| | 1652 | last = t; |
| | 1653 | |
| | 1654 | var p = jQuery.parse, m; |
| | 1655 | |
| | 1656 | for ( var i = 0; p[i]; i++ ) { |
| | 1657 | m = p[i].exec( t ); |
| | 1658 | |
| | 1659 | if ( m ) { |
| | 1660 | // Remove what we just matched |
| | 1661 | t = t.substring( m[0].length ); |
| | 1662 | |
| | 1663 | m[2] = m[2].replace(/\\/g, ""); |
| | 1664 | break; |
| | 1665 | } |
| | 1666 | } |
| | 1667 | |
| | 1668 | if ( !m ) |
| | 1669 | break; |
| | 1670 | |
| | 1671 | // :not() is a special case that can be optimized by |
| | 1672 | // keeping it out of the expression list |
| | 1673 | if ( m[1] == ":" && m[2] == "not" ) |
| | 1674 | // optimize if only one selector found (most common case) |
| | 1675 | r = isSimple.test( m[3] ) ? |
| | 1676 | jQuery.filter(m[3], r, true).r : |
| | 1677 | jQuery( r ).not( m[3] ); |
| | 1678 | |
| | 1679 | // We can get a big speed boost by filtering by class here |
| | 1680 | else if ( m[1] == "." ) |
| | 1681 | r = jQuery.classFilter(r, m[2], not); |
| | 1682 | |
| | 1683 | else if ( m[1] == "[" ) { |
| | 1684 | var tmp = [], type = m[3]; |
| | 1685 | |
| | 1686 | for ( var i = 0, rl = r.length; i < rl; i++ ) { |
| | 1687 | var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ]; |
| | 1688 | |
| | 1689 | if ( z == null || /href|src|selected/.test(m[2]) ) |
| | 1690 | z = jQuery.attr(a,m[2]) || ''; |
| | 1691 | |
| | 1692 | if ( (type == "" && !!z || |
| | 1693 | type == "=" && z == m[5] || |
| | 1694 | type == "!=" && z != m[5] || |
| | 1695 | type == "^=" && z && !z.indexOf(m[5]) || |
| | 1696 | type == "$=" && z.substr(z.length - m[5].length) == m[5] || |
| | 1697 | (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not ) |
| | 1698 | tmp.push( a ); |
| | 1699 | } |
| | 1700 | |
| | 1701 | r = tmp; |
| | 1702 | |
| | 1703 | // We can get a speed boost by handling nth-child here |
| | 1704 | } else if ( m[1] == ":" && m[2] == "nth-child" ) { |
| | 1705 | var merge = {}, tmp = [], |
| | 1706 | // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' |
| | 1707 | test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( |
| | 1708 | m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" || |
| | 1709 | !/\D/.test(m[3]) && "0n+" + m[3] || m[3]), |
| | 1710 | // calculate the numbers (first)n+(last) including if they are negative |
| | 1711 | first = (test[1] + (test[2] || 1)) - 0, last = test[3] - 0; |
| | 1712 | |
| | 1713 | // loop through all the elements left in the jQuery object |
| | 1714 | for ( var i = 0, rl = r.length; i < rl; i++ ) { |
| | 1715 | var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode); |
| | 1716 | |
| | 1717 | if ( !merge[id] ) { |
| | 1718 | var c = 1; |
| | 1719 | |
| | 1720 | for ( var n = parentNode.firstChild; n; n = n.nextSibling ) |
| | 1721 | if ( n.nodeType == 1 ) |
| | 1722 | n.nodeIndex = c++; |
| | 1723 | |
| | 1724 | merge[id] = true; |
| | 1725 | } |
| | 1726 | |
| | 1727 | var add = false; |
| | 1728 | |
| | 1729 | if ( first == 0 ) { |
| | 1730 | if ( node.nodeIndex == last ) |
| | 1731 | add = true; |
| | 1732 | } else if ( (node.nodeIndex - last) % first == 0 && (node.nodeIndex - last) / first >= 0 ) |
| | 1733 | add = true; |
| | 1734 | |
| | 1735 | if ( add ^ not ) |
| | 1736 | tmp.push( node ); |
| | 1737 | } |
| | 1738 | |
| | 1739 | r = tmp; |
| | 1740 | |
| | 1741 | // Otherwise, find the expression to execute |
| | 1742 | } else { |
| | 1743 | var f = jQuery.expr[m[1]]; |
| | 1744 | if ( typeof f != "string" ) |
| | 1745 | f = jQuery.expr[m[1]][m[2]]; |
| | 1746 | |
| | 1747 | // Build a custom macro to enclose it |
| | 1748 | f = eval("false||function(a,i){return " + f + "}"); |
| | 1749 | |
| | 1750 | // Execute it against the current filter |
| | 1751 | r = jQuery.grep( r, f, not ); |
| | 1752 | } |
| | 1753 | } |
| | 1754 | |
| | 1755 | // Return an array of filtered elements (r) |
| | 1756 | // and the modified expression string (t) |
| | 1757 | return { r: r, t: t }; |
| | 1758 | }, |
| | 1759 | |
| | 1760 | dir: function( elem, dir ){ |
| | 1761 | var matched = []; |
| | 1762 | var cur = elem[dir]; |
| | 1763 | while ( cur && cur != document ) { |
| | 1764 | if ( cur.nodeType == 1 ) |
| | 1765 | matched.push( cur ); |
| | 1766 | cur = cur[dir]; |
| | 1767 | } |
| | 1768 | return matched; |
| | 1769 | }, |
| | 1770 | |
| | 1771 | nth: function(cur,result,dir,elem){ |
| | 1772 | result = result || 1; |
| | 1773 | var num = 0; |
| | 1774 | |
| | 1775 | for ( ; cur; cur = cur[dir] ) |
| | 1776 | if ( cur.nodeType == 1 && ++num == result ) |
| | 1777 | break; |
| | 1778 | |
| | 1779 | return cur; |
| | 1780 | }, |
| | 1781 | |
| | 1782 | sibling: function( n, elem ) { |
| | 1783 | var r = []; |
| | 1784 | |
| | 1785 | for ( ; n; n = n.nextSibling ) { |
| | 1786 | if ( n.nodeType == 1 && (!elem || n != elem) ) |
| | 1787 | r.push( n ); |
| | 1788 | } |
| | 1789 | |
| | 1790 | return r; |
| | 1791 | } |
| | 1792 | }); |
| | 1793 | |
| | 1794 | /* |
| | 1795 | * A number of helper functions used for managing events. |
| | 1796 | * Many of the ideas behind this code orignated from |
| | 1797 | * Dean Edwards' addEvent library. |
| | 1798 | */ |
| | 1799 | jQuery.event = { |
| | 1800 | |
| | 1801 | // Bind an event to an element |
| | 1802 | // Original by Dean Edwards |
| | 1803 | add: function(elem, types, handler, data) { |
| | 1804 | if ( elem.nodeType == 3 || elem.nodeType == 8 ) |
| | 1805 | return; |
| | 1806 | |
| | 1807 | // For whatever reason, IE has trouble passing the window object |
| | 1808 | // around, causing it to be cloned in the process |
| | 1809 | if ( jQuery.browser.msie && elem.setInterval != undefined ) |
| | 1810 | elem = window; |
| | 1811 | |
| | 1812 | // Make sure that the function being executed has a unique ID |
| | 1813 | if ( !handler.guid ) |
| | 1814 | handler.guid = this.guid++; |
| | 1815 | |
| | 1816 | // if data is passed, bind to handler |
| | 1817 | if( data != undefined ) { |
| | 1818 | // Create temporary function pointer to original handler |
| | 1819 | var fn = handler; |
| | 1820 | |
| | 1821 | // Create unique handler function, wrapped around original handler |
| | 1822 | handler = function() { |
| | 1823 | // Pass arguments and context to original handler |
| | 1824 | return fn.apply(this, arguments); |
| | 1825 | }; |
| | 1826 | |
| | 1827 | // Store data in unique handler |
| | 1828 | handler.data = data; |
| | 1829 | |
| | 1830 | // Set the guid of unique handler to the same of original handler, so it can be removed |
| | 1831 | handler.guid = fn.guid; |
| | 1832 | } |
| | 1833 | |
| | 1834 | // Init the element's event structure |
| | 1835 | var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}), |
| | 1836 | handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){ |
| | 1837 | // returned undefined or false |
| | 1838 | var val; |
| | 1839 | |
| | 1840 | // Handle the second event of a trigger and when |
| | 1841 | // an event is called after a page has unloaded |
| | 1842 | if ( typeof jQuery == "undefined" || jQuery.event.triggered ) |
| | 1843 | return val; |
| | 1844 | |
| | 1845 | val = jQuery.event.handle.apply(arguments.callee.elem, arguments); |
| | 1846 | |
| | 1847 | return val; |
| | 1848 | }); |
| | 1849 | // Add elem as a property of the handle function |
| | 1850 | // This is to prevent a memory leak with non-native |
| | 1851 | // event in IE. |
| | 1852 | handle.elem = elem; |
| | 1853 | |
| | 1854 | // Handle multiple events seperated by a space |
| | 1855 | // jQuery(...).bind("mouseover mouseout", fn); |
| | 1856 | jQuery.each(types.split(/\s+/), function(index, type) { |
| | 1857 | // Namespaced event handlers |
| | 1858 | var parts = type.split("."); |
| | 1859 | type = parts[0]; |
| | 1860 | handler.type = parts[1]; |
| | 1861 | |
| | 1862 | // Get the current list of functions bound to this event |
| | 1863 | var handlers = events[type]; |
| | 1864 | |
| | 1865 | // Init the event handler queue |
| | 1866 | if (!handlers) { |
| | 1867 | handlers = events[type] = {}; |
| | 1868 | |
| | 1869 | // Check for a special event handler |
| | 1870 | // Only use addEventListener/attachEvent if the special |
| | 1871 | // events handler returns false |
| | 1872 | if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem) === false ) { |
| | 1873 | // Bind the global event handler to the element |
| | 1874 | if (elem.addEventListener) |
| | 1875 | elem.addEventListener(type, handle, false); |
| | 1876 | else if (elem.attachEvent) |
| | 1877 | elem.attachEvent("on" + type, handle); |
| | 1878 | } |
| | 1879 | } |
| | 1880 | |
| | 1881 | // Add the function to the element's handler list |
| | 1882 | handlers[handler.guid] = handler; |
| | 1883 | |
| | 1884 | // Keep track of which events have been used, for global triggering |
| | 1885 | jQuery.event.global[type] = true; |
| | 1886 | }); |
| | 1887 | |
| | 1888 | // Nullify elem to prevent memory leaks in IE |
| | 1889 | elem = null; |
| | 1890 | }, |
| | 1891 | |
| | 1892 | guid: 1, |
| | 1893 | global: {}, |
| | 1894 | |
| | 1895 | // Detach an event or set of events from an element |
| | 1896 | remove: function(elem, types, handler) { |
| | 1897 | // don't do events on text and comment nodes |
| | 1898 | if ( elem.nodeType == 3 || elem.nodeType == 8 ) |
| | 1899 | return; |
| | 1900 | |
| | 1901 | var events = jQuery.data(elem, "events"), ret, index; |
| | 1902 | |
| | 1903 | if ( events ) { |
| | 1904 | // Unbind all events for the element |
| | 1905 | if ( types == undefined ) |
| | 1906 | for ( var type in events ) |
| | 1907 | this.remove( elem, type ); |
| | 1908 | else { |
| | 1909 | // types is actually an event object here |
| | 1910 | if ( types.type ) { |
| | 1911 | handler = types.handler; |
| | 1912 | types = types.type; |
| | 1913 | } |
| | 1914 | |
| | 1915 | // Handle multiple events seperated by a space |
| | 1916 | // jQuery(...).unbind("mouseover mouseout", fn); |
| | 1917 | jQuery.each(types.split(/\s+/), function(index, type){ |
| | 1918 | // Namespaced event handlers |
| | 1919 | var parts = type.split("."); |
| | 1920 | type = parts[0]; |
| | 1921 | |
| | 1922 | if ( events[type] ) { |
| | 1923 | // remove the given handler for the given type |
| | 1924 | if ( handler ) |
| | 1925 | delete events[type][handler.guid]; |
| | 1926 | |
| | 1927 | // remove all handlers for the given type |
| | 1928 | else |
| | 1929 | for ( handler in events[type] ) |
| | 1930 | // Handle the removal of namespaced events |
| | 1931 | if ( !parts[1] || events[type][handler].type == parts[1] ) |
| | 1932 | delete events[type][handler]; |
| | 1933 | |
| | 1934 | // remove generic event handler if no more handlers exist |
| | 1935 | for ( ret in events[type] ) break; |
| | 1936 | if ( !ret ) { |
| | 1937 | if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem) === false ) { |
| | 1938 | if (elem.removeEventListener) |
| | 1939 | elem.removeEventListener(type, jQuery.data(elem, "handle"), false); |
| | 1940 | else if (elem.detachEvent) |
| | 1941 | elem.detachEvent("on" + type, jQuery.data(elem, "handle")); |
| | 1942 | } |
| | 1943 | ret = null; |
| | 1944 | delete events[type]; |
| | 1945 | } |
| | 1946 | } |
| | 1947 | }); |
| | 1948 | } |
| | 1949 | |
| | 1950 | // Remove the expando if it's no longer used |
| | 1951 | for ( ret in events ) break; |
| | 1952 | if ( !ret ) { |
| | 1953 | var handle = jQuery.data( elem, "handle" ); |
| | 1954 | if ( handle ) handle.elem = null; |
| | 1955 | jQuery.removeData( elem, "events" ); |
| | 1956 | jQuery.removeData( elem, "handle" ); |
| | 1957 | } |
| | 1958 | } |
| | 1959 | }, |
| | 1960 | |
| | 1961 | trigger: function(type, data, elem, donative, extra) { |
| | 1962 | // Clone the incoming data, if any |
| | 1963 | data = jQuery.makeArray(data || []); |
| | 1964 | |
| | 1965 | // Handle a global trigger |
| | 1966 | if ( !elem ) { |
| | 1967 | // Only trigger if we've ever bound an event for it |
| | 1968 | if ( this.global[type] ) |
| | 1969 | jQuery("*").add([window, document]).trigger(type, data); |
| | 1970 | |
| | 1971 | // Handle triggering a single element |
| | 1972 | } else { |
| | 1973 | // don't do events on text and comment nodes |
| | 1974 | if ( elem.nodeType == 3 || elem.nodeType == 8 ) |
| | 1975 | return undefined; |
| | 1976 | |
| | 1977 | var val, ret, fn = jQuery.isFunction( elem[ type ] || null ), |
| | 1978 | // Check to see if we need to provide a fake event, or not |
| | 1979 | event = !data[0] || !data[0].preventDefault; |
| | 1980 | |
| | 1981 | // Pass along a fake event |
| | 1982 | if ( event ) |
| | 1983 | data.unshift( this.fix({ type: type, target: elem }) ); |
| | 1984 | |
| | 1985 | // Enforce the right trigger type |
| | 1986 | data[0].type = type; |
| | 1987 | |
| | 1988 | // Trigger the event |
| | 1989 | if ( jQuery.isFunction( jQuery.data(elem, "handle") ) ) |
| | 1990 | val = jQuery.data(elem, "handle").apply( elem, data ); |
| | 1991 | |
| | 1992 | // Handle triggering native .onfoo handlers |
| | 1993 | if ( !fn && elem["on"+type] && elem["on"+type].apply( elem, data ) === false ) |
| | 1994 | val = false; |
| | 1995 | |
| | 1996 | // Extra functions don't get the custom event object |
| | 1997 | if ( event ) |
| | 1998 | data.shift(); |
| | 1999 | |
| | 2000 | // Handle triggering of extra function |
| | 2001 | if ( extra && jQuery.isFunction( extra ) ) { |
| | 2002 | // call the extra function and tack the current return value on the end for possible inspection |
| | 2003 | ret = extra.apply( elem, data.concat( val ) ); |
| | 2004 | // if anything is returned, give it precedence and have it overwrite the previous value |
| | 2005 | if (ret !== undefined) |
| | 2006 | val = ret; |
| | 2007 | } |
| | 2008 | |
| | 2009 | // Trigger the native events (except for clicks on links) |
| | 2010 | if ( fn && donative !== false && val !== false && !(jQuery.nodeName(elem, 'a') && type == "click") ) { |
| | 2011 | this.triggered = true; |
| | 2012 | try { |
| | 2013 | elem[ type ](); |
| | 2014 | // prevent IE from throwing an error for some hidden elements |
| | 2015 | } catch (e) {} |
| | 2016 | } |
| | 2017 | |
| | 2018 | this.triggered = false; |
| | 2019 | } |
| | 2020 | |
| | 2021 | return val; |
| | 2022 | }, |
| | 2023 | |
| | 2024 | handle: function(event) { |
| | 2025 | // returned undefined or false |
| | 2026 | var val; |
| | 2027 | |
| | 2028 | // Empty object is for triggered events with no data |
| | 2029 | event = jQuery.event.fix( event || window.event || {} ); |
| | 2030 | |
| | 2031 | // Namespaced event handlers |
| | 2032 | var parts = event.type.split("."); |
| | 2033 | event.type = parts[0]; |
| | 2034 | |
| | 2035 | var handlers = jQuery.data(this, "events") && jQuery.data(this, "events")[event.type], args = Array.prototype.slice.call( arguments, 1 ); |
| | 2036 | args.unshift( event ); |
| | 2037 | |
| | 2038 | for ( var j in handlers ) { |
| | 2039 | var handler = handlers[j]; |
| | 2040 | // Pass in a reference to the handler function itself |
| | 2041 | // So that we can later remove it |
| | 2042 | args[0].handler = handler; |
| | 2043 | args[0].data = handler.data; |
| | 2044 | |
| | 2045 | // Filter the functions by class |
| | 2046 | if ( !parts[1] || handler.type == parts[1] ) { |
| | 2047 | var ret = handler.apply( this, args ); |
| | 2048 | |
| | 2049 | if ( val !== false ) |
| | 2050 | val = ret; |
| | 2051 | |
| | 2052 | if ( ret === false ) { |
| | 2053 | event.preventDefault(); |
| | 2054 | event.stopPropagation(); |
| | 2055 | } |
| | 2056 | } |
| | 2057 | } |
| | 2058 | |
| | 2059 | // Clean up added properties in IE to prevent memory leak |
| | 2060 | if (jQuery.browser.msie) |
| | 2061 | event.target = event.preventDefault = event.stopPropagation = |
| | 2062 | event.handler = event.data = null; |
| | 2063 | |
| | 2064 | return val; |
| | 2065 | }, |
| | 2066 | |
| | 2067 | fix: function(event) { |
| | 2068 | // store a copy of the original event object |
| | 2069 | // and clone to set read-only properties |
| | 2070 | var originalEvent = event; |
| | 2071 | event = jQuery.extend({}, originalEvent); |
| | 2072 | |
| | 2073 | // add preventDefault and stopPropagation since |
| | 2074 | // they will not work on the clone |
| | 2075 | event.preventDefault = function() { |
| | 2076 | // if preventDefault exists run it on the original event |
| | 2077 | if (originalEvent.preventDefault) |
| | 2078 | originalEvent.preventDefault(); |
| | 2079 | // otherwise set the returnValue property of the original event to false (IE) |
| | 2080 | originalEvent.returnValue = false; |
| | 2081 | }; |
| | 2082 | event.stopPropagation = function() { |
| | 2083 | // if stopPropagation exists run it on the original event |
| | 2084 | if (originalEvent.stopPropagation) |
| | 2085 | originalEvent.stopPropagation(); |
| | 2086 | // otherwise set the cancelBubble property of the original event to true (IE) |
| | 2087 | originalEvent.cancelBubble = true; |
| | 2088 | }; |
| | 2089 | |
| | 2090 | // Fix target property, if necessary |
| | 2091 | if ( !event.target ) |
| | 2092 | event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either |
| | 2093 | |
| | 2094 | // check if target is a textnode (safari) |
| | 2095 | if ( event.target.nodeType == 3 ) |
| | 2096 | event.target = originalEvent.target.parentNode; |
| | 2097 | |
| | 2098 | // Add relatedTarget, if necessary |
| | 2099 | if ( !event.relatedTarget && event.fromElement ) |
| | 2100 | event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement; |
| | 2101 | |
| | 2102 | // Calculate pageX/Y if missing and clientX/Y available |
| | 2103 | if ( event.pageX == null && event.clientX != null ) { |
| | 2104 | var doc = document.documentElement, body = document.body; |
| | 2105 | event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0); |
| | 2106 | event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0); |
| | 2107 | } |
| | 2108 | |
| | 2109 | // Add which for key events |
| | 2110 | if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) |
| | 2111 | event.which = event.charCode || event.keyCode; |
| | 2112 | |
| | 2113 | // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) |
| | 2114 | if ( !event.metaKey && event.ctrlKey ) |
| | 2115 | event.metaKey = event.ctrlKey; |
| | 2116 | |
| | 2117 | // Add which for click: 1 == left; 2 == middle; 3 == right |
| | 2118 | // Note: button is not normalized, so don't use it |
| | 2119 | if ( !event.which && event.button ) |
| | 2120 | event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); |
| | 2121 | |
| | 2122 | return event; |
| | 2123 | }, |
| | 2124 | |
| | 2125 | special: { |
| | 2126 | ready: { |
| | 2127 | setup: function() { |
| | 2128 | // Make sure the ready event is setup |
| | 2129 | bindReady(); |
| | 2130 | return; |
| | 2131 | }, |
| | 2132 | |
| | 2133 | teardown: function() { return; } |
| | 2134 | }, |
| | 2135 | |
| | 2136 | mouseenter: { |
| | 2137 | setup: function() { |
| | 2138 | if ( jQuery.browser.msie ) return false; |
| | 2139 | jQuery(this).bind("mouseover", jQuery.event.special.mouseenter.handler); |
| | 2140 | return true; |
| | 2141 | }, |
| | 2142 | |
| | 2143 | teardown: function() { |
| | 2144 | if ( jQuery.browser.msie ) return false; |
| | 2145 | jQuery(this).unbind("mouseover", jQuery.event.special.mouseenter.handler); |
| | 2146 | return true; |
| | 2147 | }, |
| | 2148 | |
| | 2149 | handler: function(event) { |
| | 2150 | // If we actually just moused on to a sub-element, ignore it |
| | 2151 | if ( withinElement(event, this) ) return true; |
| | 2152 | // Execute the right handlers by setting the event type to mouseenter |
| | 2153 | arguments[0].type = "mouseenter"; |
| | 2154 | return jQuery.event.handle.apply(this, arguments); |
| | 2155 | } |
| | 2156 | }, |
| | 2157 | |
| | 2158 | mouseleave: { |
| | 2159 | setup: function() { |
| | 2160 | if ( jQuery.browser.msie ) return false; |
| | 2161 | jQuery(this).bind("mouseout", jQuery.event.special.mouseleave.handler); |
| | 2162 | return true; |
| | 2163 | }, |
| | 2164 | |
| | 2165 | teardown: function() { |
| | 2166 | if ( jQuery.browser.msie ) return false; |
| | 2167 | jQuery(this).unbind("mouseout", jQuery.event.special.mouseleave.handler); |
| | 2168 | return true; |
| | 2169 | }, |
| | 2170 | |
| | 2171 | handler: function(event) { |
| | 2172 | // If we actually just moused on to a sub-element, ignore it |
| | 2173 | if ( withinElement(event, this) ) return true; |
| | 2174 | // Execute the right handlers by setting the event type to mouseleave |
| | 2175 | arguments[0].type = "mouseleave"; |
| | 2176 | return jQuery.event.handle.apply(this, arguments); |
| | 2177 | } |
| | 2178 | } |
| | 2179 | } |
| | 2180 | }; |
| | 2181 | |
| | 2182 | jQuery.fn.extend({ |
| | 2183 | bind: function( type, data, fn ) { |
| | 2184 | return type == "unload" ? this.one(type, data, fn) : this.each(function(){ |
| | 2185 | jQuery.event.add( this, type, fn || data, fn && data ); |
| | 2186 | }); |
| | 2187 | }, |
| | 2188 | |
| | 2189 | one: function( type, data, fn ) { |
| | 2190 | return this.each(function(){ |
| | 2191 | jQuery.event.add( this, type, function(event) { |
| | 2192 | jQuery(this).unbind(event); |
| | 2193 | return (fn || data).apply( this, arguments); |
| | 2194 | }, fn && data); |
| | 2195 | }); |
| | 2196 | }, |
| | 2197 | |
| | 2198 | unbind: function( type, fn ) { |
| | 2199 | return this.each(function(){ |
| | 2200 | jQuery.event.remove( this, type, fn ); |
| | 2201 | }); |
| | 2202 | }, |
| | 2203 | |
| | 2204 | trigger: function( type, data, fn ) { |
| | 2205 | return this.each(function(){ |
| | 2206 | jQuery.event.trigger( type, data, this, true, fn ); |
| | 2207 | }); |
| | 2208 | }, |
| | 2209 | |
| | 2210 | triggerHandler: function( type, data, fn ) { |
| | 2211 | if ( this[0] ) |
| | 2212 | return jQuery.event.trigger( type, data, this[0], false, fn ); |
| | 2213 | return undefined; |
| | 2214 | }, |
| | 2215 | |
| | 2216 | toggle: function() { |
| | 2217 | // Save reference to arguments for access in closure |
| | 2218 | var args = arguments; |
| | 2219 | |
| | 2220 | return this.click(function(event) { |
| | 2221 | // Figure out which function to execute |
| | 2222 | this.lastToggle = 0 == this.lastToggle ? 1 : 0; |
| | 2223 | |
| | 2224 | // Make sure that clicks stop |
| | 2225 | event.preventDefault(); |
| | 2226 | |
| | 2227 | // and execute the function |
| | 2228 | return args[this.lastToggle].apply( this, arguments ) || false; |
| | 2229 | }); |
| | 2230 | }, |
| | 2231 | |
| | 2232 | hover: function(fnOver, fnOut) { |
| | 2233 | return this.bind('mouseenter', fnOver).bind('mouseleave', fnOut); |
| | 2234 | }, |
| | 2235 | |
| | 2236 | ready: function(fn) { |
| | 2237 | // Attach the listeners |
| | 2238 | bindReady(); |
| | 2239 | |
| | 2240 | // If the DOM is already ready |
| | 2241 | if ( jQuery.isReady ) |
| | 2242 | // Execute the function immediately |
| | 2243 | fn.call( document, jQuery ); |
| | 2244 | |
| | 2245 | // Otherwise, remember the function for later |
| | 2246 | else |
| | 2247 | // Add the function to the wait list |
| | 2248 | jQuery.readyList.push( function() { return fn.call(this, jQuery); } ); |
| | 2249 | |
| | 2250 | return this; |
| | 2251 | } |
| | 2252 | }); |
| | 2253 | |
| | 2254 | jQuery.extend({ |
| | 2255 | isReady: false, |
| | 2256 | readyList: [], |
| | 2257 | // Handle when the DOM is ready |
| | 2258 | ready: function() { |
| | 2259 | // Make sure that the DOM is not already loaded |
| | 2260 | if ( !jQuery.isReady ) { |
| | 2261 | // Remember that the DOM is ready |
| | 2262 | jQuery.isReady = true; |
| | 2263 | |
| | 2264 | // If there are functions bound, to execute |
| | 2265 | if ( jQuery.readyList ) { |
| | 2266 | // Execute all of them |
| | 2267 | jQuery.each( jQuery.readyList, function(){ |
| | 2268 | this.apply( document ); |
| | 2269 | }); |
| | 2270 | |
| | 2271 | // Reset the list of functions |
| | 2272 | jQuery.readyList = null; |
| | 2273 | } |
| | 2274 | |
| | 2275 | // Trigger any bound ready events |
| | 2276 | jQuery(document).triggerHandler("ready"); |
| | 2277 | } |
| | 2278 | } |
| | 2279 | }); |
| | 2280 | |
| | 2281 | var readyBound = false; |
| | 2282 | |
| | 2283 | function bindReady(){ |
| | 2284 | if ( readyBound ) return; |
| | 2285 | readyBound = true; |
| | 2286 | |
| | 2287 | // Mozilla, Opera (see further below for it) and webkit nightlies currently support this event |
| | 2288 | if ( document.addEventListener && !jQuery.browser.opera) |
| | 2289 | // Use the handy event callback |
| | 2290 | document.addEventListener( "DOMContentLoaded", jQuery.ready, false ); |
| | 2291 | |
| | 2292 | // If IE is used and is not in a frame |
| | 2293 | // Continually check to see if the document is ready |
| | 2294 | if ( jQuery.browser.msie && window == top ) (function(){ |
| | 2295 | if (jQuery.isReady) return; |
| | 2296 | try { |
| | 2297 | // If IE is used, use the trick by Diego Perini |
| | 2298 | // http://javascript.nwbox.com/IEContentLoaded/ |
| | 2299 | document.documentElement.doScroll("left"); |
| | 2300 | } catch( error ) { |
| | 2301 | setTimeout( arguments.callee, 0 ); |
| | 2302 | return; |
| | 2303 | } |
| | 2304 | // and execute any waiting functions |
| | 2305 | jQuery.ready(); |
| | 2306 | })(); |
| | 2307 | |
| | 2308 | if ( jQuery.browser.opera ) |
| | 2309 | document.addEventListener( "DOMContentLoaded", function () { |
| | 2310 | if (jQuery.isReady) return; |
| | 2311 | for (var i = 0; i < document.styleSheets.length; i++) |
| | 2312 | if (document.styleSheets[i].disabled) { |
| | 2313 | setTimeout( arguments.callee, 0 ); |
| | 2314 | return; |
| | 2315 | } |
| | 2316 | // and execute any waiting functions |
| | 2317 | jQuery.ready(); |
| | 2318 | }, false); |
| | 2319 | |
| | 2320 | if ( jQuery.browser.safari ) { |
| | 2321 | var numStyles; |
| | 2322 | (function(){ |
| | 2323 | if (jQuery.isReady) return; |
| | 2324 | if ( document.readyState != "loaded" && document.readyState != "complete" ) { |
| | 2325 | setTimeout( arguments.callee, 0 ); |
| | 2326 | return; |
| | 2327 | } |
| | 2328 | if ( numStyles === undefined ) |
| | 2329 | numStyles = jQuery("style, link[rel=stylesheet]").length; |
| | 2330 | if ( document.styleSheets.length != numStyles ) { |
| | 2331 | setTimeout( arguments.callee, 0 ); |
| | 2332 | return; |
| | 2333 | } |
| | 2334 | // and execute any waiting functions |
| | 2335 | jQuery.ready(); |
| | 2336 | })(); |
| | 2337 | } |
| | 2338 | |
| | 2339 | // A fallback to window.onload, that will always work |
| | 2340 | jQuery.event.add( window, "load", jQuery.ready ); |
| | 2341 | } |
| | 2342 | |
| | 2343 | jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," + |
| | 2344 | "mousedown,mouseup,mousemove,mouseover,mouseout,change,select," + |
| | 2345 | "submit,keydown,keypress,keyup,error").split(","), function(i, name){ |
| | 2346 | |
| | 2347 | // Handle event binding |
| | 2348 | jQuery.fn[name] = function(fn){ |
| | 2349 | return fn ? this.bind(name, fn) : this.trigger(name); |
| | 2350 | }; |
| | 2351 | }); |
| | 2352 | |
| | 2353 | // Checks if an event happened on an element within another element |
| | 2354 | // Used in jQuery.event.special.mouseenter and mouseleave handlers |
| | 2355 | var withinElement = function(event, elem) { |
| | 2356 | // Check if mouse(over|out) are still within the same parent element |
| | 2357 | var parent = event.relatedTarget; |
| | 2358 | // Traverse up the tree |
| | 2359 | while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { parent = elem; } |
| | 2360 | // Return true if we actually just moused on to a sub-element |
| | 2361 | return parent == elem; |
| | 2362 | }; |
| | 2363 | |
| | 2364 | // Prevent memory leaks in IE |
| | 2365 | // And prevent errors on refresh with events like mouseover in other browsers |
| | 2366 | // Window isn't included so as not to unbind existing unload events |
| | 2367 | jQuery(window).bind("unload", function() { |
| | 2368 | jQuery("*").add(document).unbind(); |
| | 2369 | }); |
| | 2370 | jQuery.fn.extend({ |
| | 2371 | load: function( url, params, callback ) { |
| | 2372 | if ( jQuery.isFunction( url ) ) |
| | 2373 | return this.bind("load", url); |
| | 2374 | |
| | 2375 | var off = url.indexOf(" "); |
| | 2376 | if ( off >= 0 ) { |
| | 2377 | var selector = url.slice(off, url.length); |
| | 2378 | url = url.slice(0, off); |
| | 2379 | } |
| | 2380 | |
| | 2381 | callback = callback || function(){}; |
| | 2382 | |
| | 2383 | // Default to a GET request |
| | 2384 | var type = "GET"; |
| | 2385 | |
| | 2386 | // If the second parameter was provided |
| | 2387 | if ( params ) |
| | 2388 | // If it's a function |
| | 2389 | if ( jQuery.isFunction( params ) ) { |
| | 2390 | // We assume that it's the callback |
| | 2391 | callback = params; |
| | 2392 | params = null; |
| | 2393 | |
| | 2394 | // Otherwise, build a param string |
| | 2395 | } else { |
| | 2396 | params = jQuery.param( params ); |
| | 2397 | type = "POST"; |
| | 2398 | } |
| | 2399 | |
| | 2400 | var self = this; |
| | 2401 | |
| | 2402 | // Request the remote document |
| | 2403 | jQuery.ajax({ |
| | 2404 | url: url, |
| | 2405 | type: type, |
| | 2406 | dataType: "html", |
| | 2407 | data: params, |
| | 2408 | complete: function(res, status){ |
| | 2409 | // If successful, inject the HTML into all the matched elements |
| | 2410 | if ( status == "success" || status == "notmodified" ) |
| | 2411 | // See if a selector was specified |
| | 2412 | self.html( selector ? |
| | 2413 | // Create a dummy div to hold the results |
| | 2414 | jQuery("<div/>") |
| | 2415 | // inject the contents of the document in, removing the scripts |
| | 2416 | // to avoid any 'Permission Denied' errors in IE |
| | 2417 | .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, "")) |
| | 2418 | |
| | 2419 | // Locate the specified elements |
| | 2420 | .find(selector) : |
| | 2421 | |
| | 2422 | // If not, just inject the full result |
| | 2423 | res.responseText ); |
| | 2424 | |
| | 2425 | self.each( callback, [res.responseText, status, res] ); |
| | 2426 | } |
| | 2427 | }); |
| | 2428 | return this; |
| | 2429 | }, |
| | 2430 | |
| | 2431 | serialize: function() { |
| | 2432 | return jQuery.param(this.serializeArray()); |
| | 2433 | }, |
| | 2434 | serializeArray: function() { |
| | 2435 | return this.map(function(){ |
| | 2436 | return jQuery.nodeName(this, "form") ? |
| | 2437 | jQuery.makeArray(this.elements) : this; |
| | 2438 | }) |
| | 2439 | .filter(function(){ |
| | 2440 | return this.name && !this.disabled && |
| | 2441 | (this.checked || /select|textarea/i.test(this.nodeName) || |
| | 2442 | /text|hidden|password/i.test(this.type)); |
| | 2443 | }) |
| | 2444 | .map(function(i, elem){ |
| | 2445 | var val = jQuery(this).val(); |
| | 2446 | return val == null ? null : |
| | 2447 | val.constructor == Array ? |
| | 2448 | jQuery.map( val, function(val, i){ |
| | 2449 | return {name: elem.name, value: val}; |
| | 2450 | }) : |
| | 2451 | {name: elem.name, value: val}; |
| | 2452 | }).get(); |
| | 2453 | } |
| | 2454 | }); |
| | 2455 | |
| | 2456 | // Attach a bunch of functions for handling common AJAX events |
| | 2457 | jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){ |
| | 2458 | jQuery.fn[o] = function(f){ |
| | 2459 | return this.bind(o, f); |
| | 2460 | }; |
| | 2461 | }); |
| | 2462 | |
| | 2463 | var jsc = (new Date).getTime(); |
| | 2464 | |
| | 2465 | jQuery.extend({ |
| | 2466 | get: function( url, data, callback, type ) { |
| | 2467 | // shift arguments if data argument was ommited |
| | 2468 | if ( jQuery.isFunction( data ) ) { |
| | 2469 | callback = data; |
| | 2470 | data = null; |
| | 2471 | } |
| | 2472 | |
| | 2473 | return jQuery.ajax({ |
| | 2474 | type: "GET", |
| | 2475 | url: url, |
| | 2476 | data: data, |
| | 2477 | success: callback, |
| | 2478 | dataType: type |
| | 2479 | }); |
| | 2480 | }, |
| | 2481 | |
| | 2482 | getScript: function( url, callback ) { |
| | 2483 | return jQuery.get(url, null, callback, "script"); |
| | 2484 | }, |
| | 2485 | |
| | 2486 | getJSON: function( url, data, callback ) { |
| | 2487 | return jQuery.get(url, data, callback, "json"); |
| | 2488 | }, |
| | 2489 | |
| | 2490 | post: function( url, data, callback, type ) { |
| | 2491 | if ( jQuery.isFunction( data ) ) { |
| | 2492 | callback = data; |
| | 2493 | data = {}; |
| | 2494 | } |
| | 2495 | |
| | 2496 | return jQuery.ajax({ |
| | 2497 | type: "POST", |
| | 2498 | url: url, |
| | 2499 | data: data, |
| | 2500 | success: callback, |
| | 2501 | dataType: type |
| | 2502 | }); |
| | 2503 | }, |
| | 2504 | |
| | 2505 | ajaxSetup: function( settings ) { |
| | 2506 | jQuery.extend( jQuery.ajaxSettings, settings ); |
| | 2507 | }, |
| | 2508 | |
| | 2509 | ajaxSettings: { |
| | 2510 | global: true, |
| | 2511 | type: "GET", |
| | 2512 | timeout: 0, |
| | 2513 | contentType: "application/x-www-form-urlencoded", |
| | 2514 | processData: true, |
| | 2515 | async: true, |
| | 2516 | data: null |
| | 2517 | }, |
| | 2518 | |
| | 2519 | // Last-Modified header cache for next request |
| | 2520 | lastModified: {}, |
| | 2521 | |
| | 2522 | ajax: function( s ) { |
| | 2523 | var jsonp, jsre = /=\?(&|$)/g, status, data; |
| | 2524 | |
| | 2525 | // Extend the settings, but re-extend 's' so that it can be |
| | 2526 | // checked again later (in the test suite, specifically) |
| | 2527 | s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s)); |
| | 2528 | |
| | 2529 | // convert data if not already a string |
| | 2530 | if ( s.data && s.processData && typeof s.data != "string" ) |
| | 2531 | s.data = jQuery.param(s.data); |
| | 2532 | |
| | 2533 | // Handle JSONP Parameter Callbacks |
| | 2534 | if ( s.dataType == "jsonp" ) { |
| | 2535 | if ( s.type.toLowerCase() == "get" ) { |
| | 2536 | if ( !s.url.match(jsre) ) |
| | 2537 | s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?"; |
| | 2538 | } else if ( !s.data || !s.data.match(jsre) ) |
| | 2539 | s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?"; |
| | 2540 | s.dataType = "json"; |
| | 2541 | } |
| | 2542 | |
| | 2543 | // Build temporary JSONP function |
| | 2544 | if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) { |
| | 2545 | jsonp = "jsonp" + jsc++; |
| | 2546 | |
| | 2547 | // Replace the =? sequence both in the query string and the data |
| | 2548 | if ( s.data ) |
| | 2549 | s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1"); |
| | 2550 | s.url = s.url.replace(jsre, "=" + jsonp + "$1"); |
| | 2551 | |
| | 2552 | // We need to make sure |
| | 2553 | // that a JSONP style response is executed properly |
| | 2554 | s.dataType = "script"; |
| | 2555 | |
| | 2556 | // Handle JSONP-style loading |
| | 2557 | window[ jsonp ] = function(tmp){ |
| | 2558 | data = tmp; |
| | 2559 | success(); |
| | 2560 | complete(); |
| | 2561 | // Garbage collect |
| | 2562 | window[ jsonp ] = undefined; |
| | 2563 | try{ delete window[ jsonp ]; } catch(e){} |
| | 2564 | if ( head ) |
| | 2565 | head.removeChild( script ); |
| | 2566 | }; |
| | 2567 | } |
| | 2568 | |
| | 2569 | if ( s.dataType == "script" && s.cache == null ) |
| | 2570 | s.cache = false; |
| | 2571 | |
| | 2572 | if ( s.cache === false && s.type.toLowerCase() == "get" ) { |
| | 2573 | var ts = (new Date()).getTime(); |
| | 2574 | // try replacing _= if it is there |
| | 2575 | var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2"); |
| | 2576 | // if nothing was replaced, add timestamp to the end |
| | 2577 | s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : ""); |
| | 2578 | } |
| | 2579 | |
| | 2580 | // If data is available, append data to url for get requests |
| | 2581 | if ( s.data && s.type.toLowerCase() == "get" ) { |
| | 2582 | s.url += (s.url.match(/\?/) ? "&" : "?") + s.data; |
| | 2583 | |
| | 2584 | // IE likes to send both get and post data, prevent this |
| | 2585 | s.data = null; |
| | 2586 | } |
| | 2587 | |
| | 2588 | // Watch for a new set of requests |
| | 2589 | if ( s.global && ! jQuery.active++ ) |
| | 2590 | jQuery.event.trigger( "ajaxStart" ); |
| | 2591 | |
| | 2592 | // If we're requesting a remote document |
| | 2593 | // and trying to load JSON or Script with a GET |
| | 2594 | if ( (!s.url.indexOf("http") || !s.url.indexOf("//")) && ( s.dataType == "script" || s.dataType =="json" ) && s.type.toLowerCase() == "get" ) { |
| | 2595 | var head = document.getElementsByTagName("head")[0]; |
| | 2596 | var script = document.createElement("script"); |
| | 2597 | script.src = s.url; |
| | 2598 | if (s.scriptCharset) |
| | 2599 | script.charset = s.scriptCharset; |
| | 2600 | |
| | 2601 | // Handle Script loading |
| | 2602 | if ( !jsonp ) { |
| | 2603 | var done = false; |
| | 2604 | |
| | 2605 | // Attach handlers for all browsers |
| | 2606 | script.onload = script.onreadystatechange = function(){ |
| | 2607 | if ( !done && (!this.readyState || |
| | 2608 | this.readyState == "loaded" || this.readyState == "complete") ) { |
| | 2609 | done = true; |
| | 2610 | success(); |
| | 2611 | complete(); |
| | 2612 | head.removeChild( script ); |
| | 2613 | } |
| | 2614 | }; |
| | 2615 | } |
| | 2616 | |
| | 2617 | head.appendChild(script); |
| | 2618 | |
| | 2619 | // We handle everything using the script element injection |
| | 2620 | return undefined; |
| | 2621 | } |
| | 2622 | |
| | 2623 | var requestDone = false; |
| | 2624 | |
| | 2625 | // Create the request object; Microsoft failed to properly |
| | 2626 | // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available |
| | 2627 | var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); |
| | 2628 | |
| | 2629 | // Open the socket |
| | 2630 | xml.open(s.type, s.url, s.async); |
| | 2631 | |
| | 2632 | // Need an extra try/catch for cross domain requests in Firefox 3 |
| | 2633 | try { |
| | 2634 | // Set the correct header, if data is being sent |
| | 2635 | if ( s.data ) |
| | 2636 | xml.setRequestHeader("Content-Type", s.contentType); |
| | 2637 | |
| | 2638 | // Set the If-Modified-Since header, if ifModified mode. |
| | 2639 | if ( s.ifModified ) |
| | 2640 | xml.setRequestHeader("If-Modified-Since", |
| | 2641 | jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" ); |
| | 2642 | |
| | 2643 | // Set header so the called script knows that it's an XMLHttpRequest |
| | 2644 | xml.setRequestHeader("X-Requested-With", "XMLHttpRequest"); |
| | 2645 | } catch(e){} |
| | 2646 | |
| | 2647 | // Allow custom headers/mimetypes |
| | 2648 | if ( s.beforeSend ) |
| | 2649 | s.beforeSend(xml); |
| | 2650 | |
| | 2651 | if ( s.global ) |
| | 2652 | jQuery.event.trigger("ajaxSend", [xml, s]); |
| | 2653 | |
| | 2654 | // Wait for a response to come back |
| | 2655 | var onreadystatechange = function(isTimeout){ |
| | 2656 | // The transfer is complete and the data is available, or the request timed out |
| | 2657 | if ( !requestDone && xml && (xml.readyState == 4 || isTimeout == "timeout") ) { |
| | 2658 | requestDone = true; |
| | 2659 | |
| | 2660 | // clear poll interval |
| | 2661 | if (ival) { |
| | 2662 | clearInterval(ival); |
| | 2663 | ival = null; |
| | 2664 | } |
| | 2665 | |
| | 2666 | status = isTimeout == "timeout" && "timeout" || |
| | 2667 | !jQuery.httpSuccess( xml ) && "error" || |
| | 2668 | s.ifModified && jQuery.httpNotModified( xml, s.url ) && "notmodified" || |
| | 2669 | "success"; |
| | 2670 | |
| | 2671 | if ( status == "success" ) { |
| | 2672 | // Watch for, and catch, XML document parse errors |
| | 2673 | try { |
| | 2674 | // process the data (runs the xml through httpData regardless of callback) |
| | 2675 | data = jQuery.httpData( xml, s.dataType ); |
| | 2676 | } catch(e) { |
| | 2677 | status = "parsererror"; |
| | 2678 | } |
| | 2679 | } |
| | 2680 | |
| | 2681 | // Make sure that the request was successful or notmodified |
| | 2682 | if ( status == "success" ) { |
| | 2683 | // Cache Last-Modified header, if ifModified mode. |
| | 2684 | var modRes; |
| | 2685 | try { |
| | 2686 | modRes = xml.getResponseHeader("Last-Modified"); |
| | 2687 | } catch(e) {} // swallow exception thrown by FF if header is not available |
| | 2688 | |
| | 2689 | if ( s.ifModified && modRes ) |
| | 2690 | jQuery.lastModified[s.url] = modRes; |
| | 2691 | |
| | 2692 | // JSONP handles its own success callback |
| | 2693 | if ( !jsonp ) |
| | 2694 | success(); |
| | 2695 | } else |
| | 2696 | jQuery.handleError(s, xml, status); |
| | 2697 | |
| | 2698 | // Fire the complete handlers |
| | 2699 | complete(); |
| | 2700 | |
| | 2701 | // Stop memory leaks |
| | 2702 | if ( s.async ) |
| | 2703 | xml = null; |
| | 2704 | } |
| | 2705 | }; |
| | 2706 | |
| | 2707 | if ( s.async ) { |
| | 2708 | // don't attach the handler to the request, just poll it instead |
| | 2709 | var ival = setInterval(onreadystatechange, 13); |
| | 2710 | |
| | 2711 | // Timeout checker |
| | 2712 | if ( s.timeout > 0 ) |
| | 2713 | setTimeout(function(){ |
| | 2714 | // Check to see if the request is still happening |
| | 2715 | if ( xml ) { |
| | 2716 | // Cancel the request |
| | 2717 | xml.abort(); |
| | 2718 | |
| | 2719 | if( !requestDone ) |
| | 2720 | onreadystatechange( "timeout" ); |
| | 2721 | } |
| | 2722 | }, s.timeout); |
| | 2723 | } |
| | 2724 | |
| | 2725 | // Send the data |
| | 2726 | try { |
| | 2727 | xml.send(s.data); |
| | 2728 | } catch(e) { |
| | 2729 | jQuery.handleError(s, xml, null, e); |
| | 2730 | } |
| | 2731 | |
| | 2732 | // firefox 1.5 doesn't fire statechange for sync requests |
| | 2733 | if ( !s.async ) |
| | 2734 | onreadystatechange(); |
| | 2735 | |
| | 2736 | function success(){ |
| | 2737 | // If a local callback was specified, fire it and pass it the data |
| | 2738 | if ( s.success ) |
| | 2739 | s.success( data, status ); |
| | 2740 | |
| | 2741 | // Fire the global callback |
| | 2742 | if ( s.global ) |
| | 2743 | jQuery.event.trigger( "ajaxSuccess", [xml, s] ); |
| | 2744 | } |
| | 2745 | |
| | 2746 | function complete(){ |
| | 2747 | // Process result |
| | 2748 | if ( s.complete ) |
| | 2749 | s.complete(xml, status); |
| | 2750 | |
| | 2751 | // The request was completed |
| | 2752 | if ( s.global ) |
| | 2753 | jQuery.event.trigger( "ajaxComplete", [xml, s] ); |
| | 2754 | |
| | 2755 | // Handle the global AJAX counter |
| | 2756 | if ( s.global && ! --jQuery.active ) |
| | 2757 | jQuery.event.trigger( "ajaxStop" ); |
| | 2758 | } |
| | 2759 | |
| | 2760 | // return XMLHttpRequest to allow aborting the request etc. |
| | 2761 | return xml; |
| | 2762 | }, |
| | 2763 | |
| | 2764 | handleError: function( s, xml, status, e ) { |
| | 2765 | // If a local callback was specified, fire it |
| | 2766 | if ( s.error ) s.error( xml, status, e ); |
| | 2767 | |
| | 2768 | // Fire the global callback |
| | 2769 | if ( s.global ) |
| | 2770 | jQuery.event.trigger( "ajaxError", [xml, s, e] ); |
| | 2771 | }, |
| | 2772 | |
| | 2773 | // Counter for holding the number of active queries |
| | 2774 | active: 0, |
| | 2775 | |
| | 2776 | // Determines if an XMLHttpRequest was successful or not |
| | 2777 | httpSuccess: function( r ) { |
| | 2778 | try { |
| | 2779 | // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450 |
| | 2780 | return !r.status && location.protocol == "file:" || |
| | 2781 | ( r.status >= 200 && r.status < 300 ) || r.status == 304 || r.status == 1223 || |
| | 2782 | jQuery.browser.safari && r.status == undefined; |
| | 2783 | } catch(e){} |
| | 2784 | return false; |
| | 2785 | }, |
| | 2786 | |
| | 2787 | // Determines if an XMLHttpRequest returns NotModified |
| | 2788 | httpNotModified: function( xml, url ) { |
| | 2789 | try { |
| | 2790 | var xmlRes = xml.getResponseHeader("Last-Modified"); |
| | 2791 | |
| | 2792 | // Firefox always returns 200. check Last-Modified date |
| | 2793 | return xml.status == 304 || xmlRes == jQuery.lastModified[url] || |
| | 2794 | jQuery.browser.safari && xml.status == undefined; |
| | 2795 | } catch(e){} |
| | 2796 | return false; |
| | 2797 | }, |
| | 2798 | |
| | 2799 | httpData: function( r, type ) { |
| | 2800 | var ct = r.getResponseHeader("content-type"); |
| | 2801 | var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0; |
| | 2802 | var data = xml ? r.responseXML : r.responseText; |
| | 2803 | |
| | 2804 | if ( xml && data.documentElement.tagName == "parsererror" ) |
| | 2805 | throw "parsererror"; |
| | 2806 | |
| | 2807 | // If the type is "script", eval it in global context |
| | 2808 | if ( type == "script" ) |
| | 2809 | jQuery.globalEval( data ); |
| | 2810 | |
| | 2811 | // Get the JavaScript object, if JSON is used. |
| | 2812 | if ( type == "json" ) |
| | 2813 | data = eval("(" + data + ")"); |
| | 2814 | |
| | 2815 | return data; |
| | 2816 | }, |
| | 2817 | |
| | 2818 | // Serialize an array of form elements or a set of |
| | 2819 | // key/values into a query string |
| | 2820 | param: function( a ) { |
| | 2821 | var s = []; |
| | 2822 | |
| | 2823 | // If an array was passed in, assume that it is an array |
| | 2824 | // of form elements |
| | 2825 | if ( a.constructor == Array || a.jquery ) |
| | 2826 | // Serialize the form elements |
| | 2827 | jQuery.each( a, function(){ |
| | 2828 | s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) ); |
| | 2829 | }); |
| | 2830 | |
| | 2831 | // Otherwise, assume that it's an object of key/value pairs |
| | 2832 | else |
| | 2833 | // Serialize the key/values |
| | 2834 | for ( var j in a ) |
| | 2835 | // If the value is an array then the key names need to be repeated |
| | 2836 | if ( a[j] && a[j].constructor == Array ) |
| | 2837 | jQuery.each( a[j], function(){ |
| | 2838 | s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) ); |
| | 2839 | }); |
| | 2840 | else |
| | 2841 | s.push( encodeURIComponent(j) + "=" + encodeURIComponent( a[j] ) ); |
| | 2842 | |
| | 2843 | // Return the resulting serialization |
| | 2844 | return s.join("&").replace(/%20/g, "+"); |
| | 2845 | } |
| | 2846 | |
| | 2847 | }); |
| | 2848 | jQuery.fn.extend({ |
| | 2849 | show: function(speed,callback){ |
| | 2850 | return speed ? |
| | 2851 | this.animate({ |
| | 2852 | height: "show", width: "show", opacity: "show" |
| | 2853 | }, speed, callback) : |
| | 2854 | |
| | 2855 | this.filter(":hidden").each(function(){ |
| | 2856 | this.style.display = this.oldblock || ""; |
| | 2857 | if ( jQuery.css(this,"display") == "none" ) { |
| | 2858 | var elem = jQuery("<" + this.tagName + " />").appendTo("body"); |
| | 2859 | this.style.display = elem.css("display"); |
| | 2860 | elem.remove(); |
| | 2861 | } |
| | 2862 | }).end(); |
| | 2863 | }, |
| | 2864 | |
| | 2865 | hide: function(speed,callback){ |
| | 2866 | return speed ? |
| | 2867 | this.animate({ |
| | 2868 | height: "hide", width: "hide", opacity: "hide" |
| | 2869 | }, speed, callback) : |
| | 2870 | |
| | 2871 | this.filter(":visible").each(function(){ |
| | 2872 | this.oldblock = this.oldblock || jQuery.css(this,"display"); |
| | 2873 | this.style.display = "none"; |
| | 2874 | }).end(); |
| | 2875 | }, |
| | 2876 | |
| | 2877 | // Save the old toggle function |
| | 2878 | _toggle: jQuery.fn.toggle, |
| | 2879 | |
| | 2880 | toggle: function( fn, fn2 ){ |
| | 2881 | return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? |
| | 2882 | this._toggle( fn, fn2 ) : |
| | 2883 | fn ? |
| | 2884 | this.animate({ |
| | 2885 | height: "toggle", width: "toggle", opacity: "toggle" |
| | 2886 | }, fn, fn2) : |
| | 2887 | this.each(function(){ |
| | 2888 | jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ](); |
| | 2889 | }); |
| | 2890 | }, |
| | 2891 | |
| | 2892 | slideDown: function(speed,callback){ |
| | 2893 | return this.animate({height: "show"}, speed, callback); |
| | 2894 | }, |
| | 2895 | |
| | 2896 | slideUp: function(speed,callback){ |
| | 2897 | return this.animate({height: "hide"}, speed, callback); |
| | 2898 | }, |
| | 2899 | |
| | 2900 | slideToggle: function(speed, callback){ |
| | 2901 | return this.animate({height: "toggle"}, speed, callback); |
| | 2902 | }, |
| | 2903 | |
| | 2904 | fadeIn: function(speed, callback){ |
| | 2905 | return this.animate({opacity: "show"}, speed, callback); |
| | 2906 | }, |
| | 2907 | |
| | 2908 | fadeOut: function(speed, callback){ |
| | 2909 | return this.animate({opacity: "hide"}, speed, callback); |
| | 2910 | }, |
| | 2911 | |
| | 2912 | fadeTo: function(speed,to,callback){ |
| | 2913 | return this.animate({opacity: to}, speed, callback); |
| | 2914 | }, |
| | 2915 | |
| | 2916 | animate: function( prop, speed, easing, callback ) { |
| | 2917 | var optall = jQuery.speed(speed, easing, callback); |
| | 2918 | |
| | 2919 | return this[ optall.queue === false ? "each" : "queue" ](function(){ |
| | 2920 | if ( this.nodeType != 1) |
| | 2921 | return false; |
| | 2922 | |
| | 2923 | var opt = jQuery.extend({}, optall); |
| | 2924 | var hidden = jQuery(this).is(":hidden"), self = this; |
| | 2925 | |
| | 2926 | for ( var p in prop ) { |
| | 2927 | if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden ) |
| | 2928 | return jQuery.isFunction(opt.complete) && opt.complete.apply(this); |
| | 2929 | |
| | 2930 | if ( p == "height" || p == "width" ) { |
| | 2931 | // Store display property |
| | 2932 | opt.display = jQuery.css(this, "display"); |
| | 2933 | |
| | 2934 | // Make sure that nothing sneaks out |
| | 2935 | opt.overflow = this.style.overflow; |
| | 2936 | } |
| | 2937 | } |
| | 2938 | |
| | 2939 | if ( opt.overflow != null ) |
| | 2940 | this.style.overflow = "hidden"; |
| | 2941 | |
| | 2942 | opt.curAnim = jQuery.extend({}, prop); |
| | 2943 | |
| | 2944 | jQuery.each( prop, function(name, val){ |
| | 2945 | var e = new jQuery.fx( self, opt, name ); |
| | 2946 | |
| | 2947 | if ( /toggle|show|hide/.test(val) ) |
| | 2948 | e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop ); |
| | 2949 | else { |
| | 2950 | var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/), |
| | 2951 | start = e.cur(true) || 0; |
| | 2952 | |
| | 2953 | if ( parts ) { |
| | 2954 | var end = parseFloat(parts[2]), |
| | 2955 | unit = parts[3] || "px"; |
| | 2956 | |
| | 2957 | // We need to compute starting value |
| | 2958 | if ( unit != "px" ) { |
| | 2959 | self.style[ name ] = (end || 1) + unit; |
| | 2960 | start = ((end || 1) / e.cur(true)) * start; |
| | 2961 | self.style[ name ] = start + unit; |
| | 2962 | } |
| | 2963 | |
| | 2964 | // If a +=/-= token was provided, we're doing a relative animation |
| | 2965 | if ( parts[1] ) |
| | 2966 | end = ((parts[1] == "-=" ? -1 : 1) * end) + start; |
| | 2967 | |
| | 2968 | e.custom( start, end, unit ); |
| | 2969 | } else |
| | 2970 | e.custom( start, val, "" ); |
| | 2971 | } |
| | 2972 | }); |
| | 2973 | |
| | 2974 | // For JS strict compliance |
| | 2975 | return true; |
| | 2976 | }); |
| | 2977 | }, |
| | 2978 | |
| | 2979 | queue: function(type, fn){ |
| | 2980 | if ( jQuery.isFunction(type) || ( type && type.constructor == Array )) { |
| | 2981 | fn = type; |
| | 2982 | type = "fx"; |
| | 2983 | } |
| | 2984 | |
| | 2985 | if ( !type || (typeof type == "string" && !fn) ) |
| | 2986 | return queue( this[0], type ); |
| | 2987 | |
| | 2988 | return this.each(function(){ |
| | 2989 | if ( fn.constructor == Array ) |
| | 2990 | queue(this, type, fn); |
| | 2991 | else { |
| | 2992 | queue(this, type).push( fn ); |
| | 2993 | |
| | 2994 | if ( queue(this, type).length == 1 ) |
| | 2995 | fn.apply(this); |
| | 2996 | } |
| | 2997 | }); |
| | 2998 | }, |
| | 2999 | |
| | 3000 | stop: function(clearQueue, gotoEnd){ |
| | 3001 | var timers = jQuery.timers; |
| | 3002 | |
| | 3003 | if (clearQueue) |
| | 3004 | this.queue([]); |
| | 3005 | |
| | 3006 | this.each(function(){ |
| | 3007 | // go in reverse order so anything added to the queue during the loop is ignored |
| | 3008 | for ( var i = timers.length - 1; i >= 0; i-- ) |
| | 3009 | if ( timers[i].elem == this ) { |
| | 3010 | if (gotoEnd) |
| | 3011 | // force the next step to be the last |
| | 3012 | timers[i](true); |
| | 3013 | timers.splice(i, 1); |
| | 3014 | } |
| | 3015 | }); |
| | 3016 | |
| | 3017 | // start the next in the queue if the last step wasn't forced |
| | 3018 | if (!gotoEnd) |
| | 3019 | this.dequeue(); |
| | 3020 | |
| | 3021 | return this; |
| | 3022 | } |
| | 3023 | |
| | 3024 | }); |
| | 3025 | |
| | 3026 | var queue = function( elem, type, array ) { |
| | 3027 | if ( !elem ) |
| | 3028 | return undefined; |
| | 3029 | |
| | 3030 | type = type || "fx"; |
| | 3031 | |
| | 3032 | var q = jQuery.data( elem, type + "queue" ); |
| | 3033 | |
| | 3034 | if ( !q || array ) |
| | 3035 | q = jQuery.data( elem, type + "queue", |
| | 3036 | array ? jQuery.makeArray(array) : [] ); |
| | 3037 | |
| | 3038 | return q; |
| | 3039 | }; |
| | 3040 | |
| | 3041 | jQuery.fn.dequeue = function(type){ |
| | 3042 | type = type || "fx"; |
| | 3043 | |
| | 3044 | return this.each(function(){ |
| | 3045 | var q = queue(this, type); |
| | 3046 | |
| | 3047 | q.shift(); |
| | 3048 | |
| | 3049 | if ( q.length ) |
| | 3050 | q[0].apply( this ); |
| | 3051 | }); |
| | 3052 | }; |
| | 3053 | |
| | 3054 | jQuery.extend({ |
| | 3055 | |
| | 3056 | speed: function(speed, easing, fn) { |
| | 3057 | var opt = speed && speed.constructor == Object ? speed : { |
| | 3058 | complete: fn || !fn && easing || |
| | 3059 | jQuery.isFunction( speed ) && speed, |
| | 3060 | duration: speed, |
| | 3061 | easing: fn && easing || easing && easing.constructor != Function && easing |
| | 3062 | }; |
| | 3063 | |
| | 3064 | opt.duration = (opt.duration && opt.duration.constructor == Number ? |
| | 3065 | opt.duration : |
| | 3066 | { slow: 600, fast: 200 }[opt.duration]) || 400; |
| | 3067 | |
| | 3068 | // Queueing |
| | 3069 | opt.old = opt.complete; |
| | 3070 | opt.complete = function(){ |
| | 3071 | if ( opt.queue !== false ) |
| | 3072 | jQuery(this).dequeue(); |
| | 3073 | if ( jQuery.isFunction( opt.old ) ) |
| | 3074 | opt.old.apply( this ); |
| | 3075 | }; |
| | 3076 | |
| | 3077 | return opt; |
| | 3078 | }, |
| | 3079 | |
| | 3080 | easing: { |
| | 3081 | linear: function( p, n, firstNum, diff ) { |
| | 3082 | return firstNum + diff * p; |
| | 3083 | }, |
| | 3084 | swing: function( p, n, firstNum, diff ) { |
| | 3085 | return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; |
| | 3086 | } |
| | 3087 | }, |
| | 3088 | |
| | 3089 | timers: [], |
| | 3090 | timerId: null, |
| | 3091 | |
| | 3092 | fx: function( elem, options, prop ){ |
| | 3093 | this.options = options; |
| | 3094 | this.elem = elem; |
| | 3095 | this.prop = prop; |
| | 3096 | |
| | 3097 | if ( !options.orig ) |
| | 3098 | options.orig = {}; |
| | 3099 | } |
| | 3100 | |
| | 3101 | }); |
| | 3102 | |
| | 3103 | jQuery.fx.prototype = { |
| | 3104 | |
| | 3105 | // Simple function for setting a style value |
| | 3106 | update: function(){ |
| | 3107 | if ( this.options.step ) |
| | 3108 | this.options.step.apply( this.elem, [ this.now, this ] ); |
| | 3109 | |
| | 3110 | (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); |
| | 3111 | |
| | 3112 | // Set display property to block for height/width animations |
| | 3113 | if ( this.prop == "height" || this.prop == "width" ) |
| | 3114 | this.elem.style.display = "block"; |
| | 3115 | }, |
| | 3116 | |
| | 3117 | // Get the current size |
| | 3118 | cur: function(force){ |
| | 3119 | if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null ) |
| | 3120 | return this.elem[ this.prop ]; |
| | 3121 | |
| | 3122 | var r = parseFloat(jQuery.css(this.elem, this.prop, force)); |
| | 3123 | return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0; |
| | 3124 | }, |
| | 3125 | |
| | 3126 | // Start an animation from one number to another |
| | 3127 | custom: function(from, to, unit){ |
| | 3128 | this.startTime = (new Date()).getTime(); |
| | 3129 | this.start = from; |
| | 3130 | this.end = to; |
| | 3131 | this.unit = unit || this.unit || "px"; |
| | 3132 | this.now = this.start; |
| | 3133 | this.pos = this.state = 0; |
| | 3134 | this.update(); |
| | 3135 | |
| | 3136 | var self = this; |
| | 3137 | function t(gotoEnd){ |
| | 3138 | return self.step(gotoEnd); |
| | 3139 | } |
| | 3140 | |
| | 3141 | t.elem = this.elem; |
| | 3142 | |
| | 3143 | jQuery.timers.push(t); |
| | 3144 | |
| | 3145 | if ( jQuery.timerId == null ) { |
| | 3146 | jQuery.timerId = setInterval(function(){ |
| | 3147 | var timers = jQuery.timers; |
| | 3148 | |
| | 3149 | for ( var i = 0; i < timers.length; i++ ) |
| | 3150 | if ( !timers[i]() ) |
| | 3151 | timers.splice(i--, 1); |
| | 3152 | |
| | 3153 | if ( !timers.length ) { |
| | 3154 | clearInterval( jQuery.timerId ); |
| | 3155 | jQuery.timerId = null; |
| | 3156 | } |
| | 3157 | }, 13); |
| | 3158 | } |
| | 3159 | }, |
| | 3160 | |
| | 3161 | // Simple 'show' function |
| | 3162 | show: function(){ |
| | 3163 | // Remember where we started, so that we can go back to it later |
| | 3164 | this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); |
| | 3165 | this.options.show = true; |
| | 3166 | |
| | 3167 | // Begin the animation |
| | 3168 | this.custom(0, this.cur()); |
| | 3169 | |
| | 3170 | // Make sure that we start at a small width/height to avoid any |
| | 3171 | // flash of content |
| | 3172 | if ( this.prop == "width" || this.prop == "height" ) |
| | 3173 | this.elem.style[this.prop] = "1px"; |
| | 3174 | |
| | 3175 | // Start by showing the element |
| | 3176 | jQuery(this.elem).show(); |
| | 3177 | }, |
| | 3178 | |
| | 3179 | // Simple 'hide' function |
| | 3180 | hide: function(){ |
| | 3181 | // Remember where we started, so that we can go back to it later |
| | 3182 | this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); |
| | 3183 | this.options.hide = true; |
| | 3184 | |
| | 3185 | // Begin the animation |
| | 3186 | this.custom(this.cur(), 0); |
| | 3187 | }, |
| | 3188 | |
| | 3189 | // Each step of an animation |
| | 3190 | step: function(gotoEnd){ |
| | 3191 | var t = (new Date()).getTime(); |
| | 3192 | |
| | 3193 | if ( gotoEnd || t > this.options.duration + this.startTime ) { |
| | 3194 | this.now = this.end; |
| | 3195 | this.pos = this.state = 1; |
| | 3196 | this.update(); |
| | 3197 | |
| | 3198 | this.options.curAnim[ this.prop ] = true; |
| | 3199 | |
| | 3200 | var done = true; |
| | 3201 | for ( var i in this.options.curAnim ) |
| | 3202 | if ( this.options.curAnim[i] !== true ) |
| | 3203 | done = false; |
| | 3204 | |
| | 3205 | if ( done ) { |
| | 3206 | if ( this.options.display != null ) { |
| | 3207 | // Reset the overflow |
| | 3208 | this.elem.style.overflow = this.options.overflow; |
| | 3209 | |
| | 3210 | // Reset the display |
| | 3211 | this.elem.style.display = this.options.display; |
| | 3212 | if ( jQuery.css(this.elem, "display") == "none" ) |
| | 3213 | this.elem.style.display = "block"; |
| | 3214 | } |
| | 3215 | |
| | 3216 | // Hide the element if the "hide" operation was done |
| | 3217 | if ( this.options.hide ) |
| | 3218 | this.elem.style.display = "none"; |
| | 3219 | |
| | 3220 | // Reset the properties, if the item has been hidden or shown |
| | 3221 | if ( this.options.hide || this.options.show ) |
| | 3222 | for ( var p in this.options.curAnim ) |
| | 3223 | jQuery.attr(this.elem.style, p, this.options.orig[p]); |
| | 3224 | } |
| | 3225 | |
| | 3226 | // If a callback was provided, execute it |
| | 3227 | if ( done && jQuery.isFunction( this.options.complete ) ) |
| | 3228 | // Execute the complete function |
| | 3229 | this.options.complete.apply( this.elem ); |
| | 3230 | |
| | 3231 | return false; |
| | 3232 | } else { |
| | 3233 | var n = t - this.startTime; |
| | 3234 | this.state = n / this.options.duration; |
| | 3235 | |
| | 3236 | // Perform the easing function, defaults to swing |
| | 3237 | this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration); |
| | 3238 | this.now = this.start + ((this.end - this.start) * this.pos); |
| | 3239 | |
| | 3240 | // Perform the next step of the animation |
| | 3241 | this.update(); |
| | 3242 | } |
| | 3243 | |
| | 3244 | return true; |
| | 3245 | } |
| | 3246 | |
| | 3247 | }; |
| | 3248 | |
| | 3249 | jQuery.fx.step = { |
| | 3250 | scrollLeft: function(fx){ |
| | 3251 | fx.elem.scrollLeft = fx.now; |
| | 3252 | }, |
| | 3253 | |
| | 3254 | scrollTop: function(fx){ |
| | 3255 | fx.elem.scrollTop = fx.now; |
| | 3256 | }, |
| | 3257 | |
| | 3258 | opacity: function(fx){ |
| | 3259 | jQuery.attr(fx.elem.style, "opacity", fx.now); |
| | 3260 | }, |
| | 3261 | |
| | 3262 | _default: function(fx){ |
| | 3263 | fx.elem.style[ fx.prop ] = fx.now + fx.unit; |
| | 3264 | } |
| | 3265 | }; |
| | 3266 | // The Offset Method |
| | 3267 | // Originally By Brandon Aaron, part of the Dimension Plugin |
| | 3268 | // http://jquery.com/plugins/project/dimensions |
| | 3269 | jQuery.fn.offset = function() { |
| | 3270 | var left = 0, top = 0, elem = this[0], results; |
| | 3271 | |
| | 3272 | if ( elem ) with ( jQuery.browser ) { |
| | 3273 | var parent = elem.parentNode, |
| | 3274 | offsetChild = elem, |
| | 3275 | offsetParent = elem.offsetParent, |
| | 3276 | doc = elem.ownerDocument, |
| | 3277 | safari2 = safari && parseInt(version) < 522, |
| | 3278 | fixed = jQuery.css(elem, "position") == "fixed"; |
| | 3279 | |
| | 3280 | // Use getBoundingClientRect if available |
| | 3281 | if ( elem.getBoundingClientRect ) { |
| | 3282 | var box = elem.getBoundingClientRect(); |
| | 3283 | |
| | 3284 | // Add the document scroll offsets |
| | 3285 | add(box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft), |
| | 3286 | box.top + Math.max(doc.documentElement.scrollTop, doc.body.scrollTop)); |
| | 3287 | |
| | 3288 | // IE adds the HTML element's border, by default it is medium which is 2px |
| | 3289 | // IE 6 and 7 quirks mode the border width is overwritable by the following css html { border: 0; } |
| | 3290 | // IE 7 standards mode, the border is always 2px |
| | 3291 | // This border/offset is typically represented by the clientLeft and clientTop properties |
| | 3292 | // However, in IE6 and 7 quirks mode the clientLeft and clientTop properties are not updated when overwriting it via CSS |
| | 3293 | // Therefore this method will be off by 2px in IE while in quirksmode |
| | 3294 | add( -doc.documentElement.clientLeft, -doc.documentElement.clientTop ); |
| | 3295 | |
| | 3296 | // Otherwise loop through the offsetParents and parentNodes |
| | 3297 | } else { |
| | 3298 | |
| | 3299 | // Initial element offsets |
| | 3300 | add( elem.offsetLeft, elem.offsetTop ); |
| | 3301 | |
| | 3302 | // Get parent offsets |
| | 3303 | while ( offsetParent ) { |
| | 3304 | // Add offsetParent offsets |
| | 3305 | add( offsetParent.offsetLeft, offsetParent.offsetTop ); |
| | 3306 | |
| | 3307 | // Mozilla and Safari > 2 does not include the border on offset parents |
| | 3308 | // However Mozilla adds the border for table or table cells |
| | 3309 | if ( mozilla && !/^t(able|d|h)$/i.test(offsetParent.tagName) || safari && !safari2 ) |
| | 3310 | border( offsetParent ); |
| | 3311 | |
| | 3312 | // Add the document scroll offsets if position is fixed on any offsetParent |
| | 3313 | if ( !fixed && jQuery.css(offsetParent, "position") == "fixed" ) |
| | 3314 | fixed = true; |
| | 3315 | |
| | 3316 | // Set offsetChild to previous offsetParent unless it is the body element |
| | 3317 | offsetChild = /^body$/i.test(offsetParent.tagName) ? offsetChild : offsetParent; |
| | 3318 | // Get next offsetParent |
| | 3319 | offsetParent = offsetParent.offsetParent; |
| | 3320 | } |
| | 3321 | |
| | 3322 | // Get parent scroll offsets |
| | 3323 | while ( parent && parent.tagName && !/^body|html$/i.test(parent.tagName) ) { |
| | 3324 | // Remove parent scroll UNLESS that parent is inline or a table to work around Opera inline/table scrollLeft/Top bug |
| | 3325 | if ( !/^inline|table.*$/i.test(jQuery.css(parent, "display")) ) |
| | 3326 | // Subtract parent scroll offsets |
| | 3327 | add( -parent.scrollLeft, -parent.scrollTop ); |
| | 3328 | |
| | 3329 | // Mozilla does not add the border for a parent that has overflow != visible |
| | 3330 | if ( mozilla && jQuery.css(parent, "overflow") != "visible" ) |
| | 3331 | border( parent ); |
| | 3332 | |
| | 3333 | // Get next parent |
| | 3334 | parent = parent.parentNode; |
| | 3335 | } |
| | 3336 | |
| | 3337 | // Safari <= 2 doubles body offsets with a fixed position element/offsetParent or absolutely positioned offsetChild |
| | 3338 | // Mozilla doubles body offsets with a non-absolutely positioned offsetChild |
| | 3339 | if ( (safari2 && (fixed || jQuery.css(offsetChild, "position") == "absolute")) || |
| | 3340 | (mozilla && jQuery.css(offsetChild, "position") != "absolute") ) |
| | 3341 | add( -doc.body.offsetLeft, -doc.body.offsetTop ); |
| | 3342 | |
| | 3343 | // Add the document scroll offsets if position is fixed |
| | 3344 | if ( fixed ) |
| | 3345 | add(Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft), |
| | 3346 | Math.max(doc.documentElement.scrollTop, doc.body.scrollTop)); |
| | 3347 | } |
| | 3348 | |
| | 3349 | // Return an object with top and left properties |
| | 3350 | results = { top: top, left: left }; |
| | 3351 | } |
| | 3352 | |
| | 3353 | function border(elem) { |
| | 3354 | add( jQuery.curCSS(elem, "borderLeftWidth", true), jQuery.curCSS(elem, "borderTopWidth", true) ); |
| | 3355 | } |
| | 3356 | |
| | 3357 | function add(l, t) { |
| | 3358 | left += parseInt(l) || 0; |
| | 3359 | top += parseInt(t) || 0; |
| | 3360 | } |
| | 3361 | |
| | 3362 | return results; |
| | 3363 | }; |
| | 3364 | })(); |