Make WordPress Core

Changeset 6456


Ignore:
Timestamp:
12/21/2007 06:49:20 PM (19 years ago)
Author:
ryan
Message:

Page walker fixes from hailin. fixes #5498

Location:
trunk/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r6436 r6456  
    466466                if ($max_depth < -1) //invalid parameter
    467467                        return $output;
    468 
     468                       
     469                if (empty($elements)) //nothing to walk
     470                        return $output;
     471                       
    469472                $id_field = $this->db_fields['id'];
    470473                $parent_field = $this->db_fields['parent'];
    471 
    472                 $flat = ($max_depth == -1) ? true : false;
    473                 if ( $flat ) {
     474       
     475                // flat display
     476                if ( -1 == $max_depth ) {
    474477                        $empty_array = array();
    475478                        foreach ( $elements as $e )     
     
    477480                        return $output;
    478481                }
    479                
     482       
    480483                /*
    481484                 * need to display in hierarchical order
    482485                 * splice elements into two buckets: those without parent and those with parent
    483486                 */
    484        
    485487                $top_level_elements = array();
    486488                $children_elements  = array();
    487        
    488489                foreach ( $elements as $e) {
    489490                        if ( 0 == $e->$parent_field )
     
    492493                                $children_elements[] = $e;
    493494                }
    494        
     495               
     496                /*
     497                 * none of the elements is top level
     498                 * the first one must be root of the sub elements
     499                 */
     500                if ( !$top_level_elements ) {
     501                       
     502                        $root = $children_elements[0];
     503                        for ( $i = 0; $i < sizeof( $children_elements ); $i++ ) {
     504                       
     505                                $child = $children_elements[$i];
     506                                if ($root->$parent_field == $child->$parent_field )
     507                                        $top_level_elements[] = $child;
     508                                        array_splice( $children_elements, $i, 1 );
     509                                        $i--;
     510                        }
     511                }
     512               
    495513                foreach ( $top_level_elements as $e )
    496514                        $output = $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );
  • trunk/wp-includes/js/jquery/jquery.js

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

    r6422 r6456  
    7878                $this->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118');
    7979
    80                 $this->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.1.4');
     80                $this->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.2.2b');
    8181                $this->add( 'jquery-form', '/wp-includes/js/jquery/jquery.form.js', array('jquery'), '1.0.3');
    8282                $this->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.2');
Note: See TracChangeset for help on using the changeset viewer.