? jquery_121.patch Index: misc/collapse.js =================================================================== RCS file: /cvs/drupal/drupal/misc/collapse.js,v retrieving revision 1.10 diff -u -p -r1.10 collapse.js --- misc/collapse.js 11 Jan 2007 03:38:31 -0000 1.10 +++ misc/collapse.js 24 Dec 2007 11:00:55 -0000 @@ -7,7 +7,8 @@ Drupal.toggleFieldset = function(fieldse if ($(fieldset).is('.collapsed')) { var content = $('> div', fieldset).hide(); $(fieldset).removeClass('collapsed'); - content.slideDown(300, { + content.slideDown( { + duration: 300, // THE FIX complete: function() { // Make sure we open to height auto $(this).css('height', 'auto'); Index: misc/jquery.js =================================================================== RCS file: /cvs/drupal/drupal/misc/jquery.js,v retrieving revision 1.6 diff -u -p -r1.6 jquery.js --- misc/jquery.js 23 Dec 2006 21:46:35 -0000 1.6 +++ misc/jquery.js 24 Dec 2007 11:00:59 -0000 @@ -1,2 +1,3032 @@ -// $Id: jquery.js,v 1.6 2006/12/23 21:46:35 dries Exp $ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('l(1l 1x.6=="Q"){1x.Q=1x.Q;u 6=q(a,c){l(a&&1l a=="q"&&6.C.21&&!a.1G&&a[0]==Q)v 6(Y).21(a);a=a||Y;l(a.3n)v 6(6.1Q(a,[]));l(c&&c.3n)v 6(c).1X(a);l(1x==7)v 1m 6(a,c);l(1l a=="24"){u m=/^[^<]*(<.+>)[^>]*$/.3c(a);l(m)a=6.3F([m[1]])}7.2a(a.14==2o||a.D&&a!=1x&&!a.1G&&a[0]!=Q&&a[0].1G?6.1Q(a,[]):6.1X(a,c));u C=15[15.D-1];l(C&&1l C=="q")7.V(C);v 7};l(1l $!="Q")6.3W$=$;u $=6;6.C=6.8h={3n:"1.0.4",66:q(){v 7.D},1S:q(2R){v 2R==Q?6.1Q(7,[]):7[2R]},2a:q(64){7.D=0;[].1q.17(7,64);v 7},V:q(C,1h){v 6.V(7,C,1h)},8k:q(1j){u 2h=-1;7.V(q(i){l(7==1j)2h=i});v 2h},1r:q(1I,11,B){v 1I.14!=3X||11!=Q?7.V(q(){l(11==Q)J(u E 1z 1I)6.1r(B?7.1o:7,E,1I[E]);G 6.1r(B?7.1o:7,1I,11)}):6[B||"1r"](7[0],1I)},1a:q(1I,11){v 7.1r(1I,11,"3j")},2D:q(e){e=e||7;u t="";J(u j=0;j0:W},2V:q(1h,23,2T,C){u 4F=7.66()>1;u a=6.3F(1h);v 7.V(q(){u 1j=7;l(23&&7.2t.2d()=="8p"&&a[0].2t.2d()!="8q"){u 25=7.51("25");l(!25.D){1j=Y.5Y("25");7.49(1j)}G 1j=25[0]}J(u i=(2T<0?a.D-1:0);i!=(2T<0?2T:a.D);i+=2T){C.17(1j,[4F?a[i].3I(P):a[i]])}})},2i:q(a,1h){u C=1h&&1h[1h.D-1];u 2m=1h&&1h[1h.D-2];l(C&&C.14!=1A)C=L;l(2m&&2m.14!=1A)2m=L;l(!C){l(!7.2n)7.2n=[];7.2n.1q(7.1S());7.2a(a)}G{u 20=7.1S();7.2a(a);l(2m&&a.D||!2m)7.V(2m||C).2a(20);G 7.2a(20).V(C)}v 7}};6.1y=6.C.1y=q(){u 1T=15[0],a=1;l(15.D==1){1T=7;a=0}u E;1V(E=15[a++])J(u i 1z E)1T[i]=E[i];v 1T};6.1y({5R:q(){6.68=P;6.V(6.2c.5J,q(i,n){6.C[i]=q(a){u R=6.2C(7,n);l(a&&1l a=="24")R=6.18(a,R).r;v 7.2i(R,15)}});6.V(6.2c.2w,q(i,n){6.C[i]=q(){u a=15;v 7.V(q(){J(u j=0;j",""];G l(!s.1f("<6t")||!s.1f("<25"))1W=[1,"<23>",""];G l(!s.1f("<3Q"))1W=[2,"<23>",""];G l(!s.1f("<6v")||!s.1f("<6w"))1W=[3,"<23><25><3Q>",""];2b.31=1W[1]+s+1W[2];1V(1W[0]--)2b=2b.26;1C=2b.2x}l(1C.D!=Q&&((6.T.2l&&1l 1C==\'q\')||!1C.1G))J(u n=0;n<1C.D;n++)r.1q(1C[n]);G r.1q(1C.1G?1C:Y.81(1C.7Z()))}v r},2z:{"":"m[2]== \'*\'||a.2t.2d()==m[2].2d()","#":"a.48(\'35\')&&a.48(\'35\')==m[2]",":":{5G:"im[3]-0",5V:"m[3]-0==i",5F:"m[3]-0==i",2j:"i==0",1R:"i==r.D-1",5f:"i%2==0",5g:"i%2","5V-3z":"6.1B(a,m[3]).1c","2j-3z":"6.1B(a,0).1c","1R-3z":"6.1B(a,0).1R","6A-3z":"6.1B(a).D==1",5L:"a.2x.D",5P:"!a.2x.D",5I:"6.C.2D.17([a]).1f(m[3])>=0",6C:"a.B!=\'1Y\'&&6.1a(a,\'1b\')!=\'1O\'&&6.1a(a,\'4p\')!=\'1Y\'",1Y:"a.B==\'1Y\'||6.1a(a,\'1b\')==\'1O\'||6.1a(a,\'4p\')==\'1Y\'",6D:"!a.2O",2O:"a.2O",2U:"a.2U",4o:"a.4o || 6.1r(a, \'4o\')",2D:"a.B==\'2D\'",4n:"a.B==\'4n\'",5T:"a.B==\'5T\'",4G:"a.B==\'4G\'",5W:"a.B==\'5W\'",4x:"a.B==\'4x\'",4V:"a.B==\'4V\'",4v:"a.B==\'4v\'",4j:"a.B==\'4j\'",4W:"/4W|3E|6H|4j/i.1U(a.2t)"},".":"6.1e.3k(a,m[2])","@":{"=":"z==m[4]","!=":"z!=m[4]","^=":"z && !z.1f(m[4])","$=":"z && z.2Z(z.D - m[4].D,m[4].D)==m[4]","*=":"z && z.1f(m[4])>=0","":"z"},"[":"6.1X(m[2],a).D"},3u:["\\\\.\\\\.|/\\\\.\\\\.","a.1i",">|/","6.1B(a.26)","\\\\+","6.1B(a).3s","~",q(a){u s=6.1B(a);v s.n>=0?s.5o(s.n+1):[]}],1X:q(t,1u){l(1u&&1u.1G==Q)1u=L;1u=1u||Y;l(t.14!=3X)v[t];l(!t.1f("//")){1u=1u.47;t=t.2Z(2,t.D)}G l(!t.1f("/")){1u=1u.47;t=t.2Z(1,t.D);l(t.1f("/")>=1)t=t.2Z(t.1f("/"),t.D)}u R=[1u];u 1N=[];u 1R=L;1V(t.D>0&&1R!=t){u r=[];1R=t;t=6.2Q(t).1E(/^\\/\\//i,"");u 3t=W;J(u i=0;i<6.3u.D;i+=2){l(3t)5e;u 2p=1m 3V("^("+6.3u[i]+")");u m=2p.3c(t);l(m){r=R=6.2C(R,6.3u[i+1]);t=6.2Q(t.1E(2p,""));3t=P}}l(!3t){l(!t.1f(",")||!t.1f("|")){l(R[0]==1u)R.3S();1N=6.1Q(1N,R);r=R=[1u];t=" "+t.2Z(1,t.D)}G{u 4H=/^([#.]?)([a-5c-9\\\\*3W-]*)/i;u m=4H.3c(t);l(m[1]=="#"){u 3R=Y.5b(m[2]);r=R=3R?[3R]:[];t=t.1E(4H,"")}G{l(!m[2]||m[1]==".")m[2]="*";J(u i=0;i<\\/1Z>");u 1Z=Y.5b("59");l(1Z)1Z.2H=q(){l(7.38!="1t")v;7.1i.3v(7);6.21()};1Z=L}G l(6.T.2l){6.3L=4d(q(){l(Y.38=="6d"||Y.38=="1t"){5j(6.3L);6.3L=L;6.21()}},10)}6.F.29(1x,"2Y",6.21)};l(6.T.1n)6(1x).4D(q(){u F=6.F,1k=F.1k;J(u B 1z 1k){u 3N=1k[B],i=3N.D;l(i>0)6m l(B!=\'4D\')F.28(3N[i-1],B);1V(--i)}});6.C.1y({4M:6.C.1s,1s:q(16,K){v 16?7.22({27:"1s",3J:"1s",1g:"1s"},16,K):7.4M()},4P:6.C.1p,1p:q(16,K){v 16?7.22({27:"1p",3J:"1p",1g:"1p"},16,K):7.4P()},6r:q(16,K){v 7.22({27:"1s"},16,K)},6s:q(16,K){v 7.22({27:"1p"},16,K)},6u:q(16,K){v 7.V(q(){u 4T=6(7).4s(":1Y")?"1s":"1p";6(7).22({27:4T},16,K)})},6x:q(16,K){v 7.22({1g:"1s"},16,K)},6y:q(16,K){v 7.22({1g:"1p"},16,K)},6B:q(16,2w,K){v 7.22({1g:2w},16,K)},22:q(E,16,K){v 7.1w(q(){7.2S=6.1y({},E);J(u p 1z E){u e=1m 6.2X(7,6.16(16,K),p);l(E[p].14==4Y)e.2v(e.1c(),E[p]);G e[E[p]](E)}})},1w:q(B,C){l(!C){C=B;B="2X"}v 7.V(q(){l(!7.1w)7.1w={};l(!7.1w[B])7.1w[B]=[];7.1w[B].1q(C);l(7.1w[B].D==1)C.17(7)})}});6.1y({16:q(s,o){o=o||{};l(o.14==1A)o={1t:o};u 4Z={6E:6G,6I:4I};o.2J=(s&&s.14==4Y?s:4Z[s])||53;o.3x=o.1t;o.1t=q(){6.52(7,"2X");l(o.3x&&o.3x.14==1A)o.3x.17(7)};v o},1w:{},52:q(I,B){B=B||"2X";l(I.1w&&I.1w[B]){I.1w[B].3S();u f=I.1w[B][0];l(f)f.17(I)}},2X:q(I,2A,E){u z=7;z.o={2J:2A.2J||53,1t:2A.1t,2u:2A.2u};z.U=I;u y=z.U.1o;u 44=6.1a(z.U,\'1b\');y.1b="2r";y.43="1Y";z.a=q(){l(2A.2u)2A.2u.17(I,[z.2f]);l(E=="1g")6.1r(y,"1g",z.2f);G l(5w(z.2f))y[E]=5w(z.2f)+"6V"};z.57=q(){v 3T(6.1a(z.U,E))};z.1c=q(){u r=3T(6.3j(z.U,E));v r&&r>-70?r:z.57()};z.2v=q(4C,2w){z.4e=(1m 5h()).5i();z.2f=4C;z.a();z.41=4d(q(){z.2u(4C,2w)},13)};z.1s=q(){l(!z.U.1v)z.U.1v={};z.U.1v[E]=7.1c();z.o.1s=P;z.2v(0,z.U.1v[E]);l(E!="1g")y[E]="5d"};z.1p=q(){l(!z.U.1v)z.U.1v={};z.U.1v[E]=7.1c();z.o.1p=P;z.2v(z.U.1v[E],0)};z.3h=q(){l(!z.U.1v)z.U.1v={};z.U.1v[E]=7.1c();l(44==\'1O\'){z.o.1s=P;l(E!="1g")y[E]="5d";z.2v(0,z.U.1v[E])}G{z.o.1p=P;z.2v(z.U.1v[E],0)}};z.2u=q(4l,4f){u t=(1m 5h()).5i();l(t>z.o.2J+z.4e){5j(z.41);z.41=L;z.2f=4f;z.a();z.U.2S[E]=P;u 1N=P;J(u i 1z z.U.2S)l(z.U.2S[i]!==P)1N=W;l(1N){y.43=\'\';y.1b=44;l(6.1a(z.U,\'1b\')==\'1O\')y.1b=\'2r\';l(z.o.1p)y.1b=\'1O\';l(z.o.1p||z.o.1s)J(u p 1z z.U.2S)l(p=="1g")6.1r(y,p,z.U.1v[p]);G y[p]=\'\'}l(1N&&z.o.1t&&z.o.1t.14==1A)z.o.1t.17(z.U)}G{u p=(t-7.4e)/z.o.2J;z.2f=((-5B.7r(p*5B.7v)/2)+0.5)*(4f-4l)+4l;z.a()}}}});6.C.1y({7B:q(N,1P,K){7.2Y(N,1P,K,1)},2Y:q(N,1P,K,1F){l(N.14==1A)v 7.34("2Y",N);K=K||q(){};u B="67";l(1P){l(1P.14==1A){K=1P;1P=L}G{1P=6.3g(1P);B="62"}}u 4i=7;6.3C({N:N,B:B,H:1P,1F:1F,1t:q(2F,1d){l(1d=="2k"||!1F&&1d=="5u"){4i.3D(2F.3p).4y().V(K,[2F.3p,1d,2F])}G K.17(4i,[2F.3p,1d,2F])}});v 7},7G:q(){v 6.3g(7)},4y:q(){v 7.1X(\'1Z\').V(q(){l(7.3w)6.61(7.3w);G{6.4u(7.2D||7.7K||7.31||"")}}).4m()}});l(6.T.1n&&1l 3f=="Q")3f=q(){v 1m 7O("7S.7T")};1m q(){u e="4S,5O,5M,5K,5E,5q".3B(",");J(u i=0;i-1)?"&":"?")+s.H}l(s.1k&&!6.4z++)6.F.1J("4S");u 4q=W;u M=1m 3f();M.6z(s.B,s.N,s.4U);l(s.H)M.3l("6F-6J",s.50);l(s.1F)M.3l("6K-4t-6M",6.3A[s.N]||"6O, 6R 6T 6W 3U:3U:3U 72");M.3l("X-74-75","3f");l(M.76)M.3l("77","79");l(s.46)s.46(M);l(s.1k)6.F.1J("5q",[M,s]);u 2H=q(4b){l(M&&(M.38==4||4b=="1M")){4q=P;u 1d=6.63(M)&&4b!="1M"?s.1F&&6.4K(M,s.N)?"5u":"2k":"2E";l(1d!="2E"){u 3m;37{3m=M.45("4R-4t")}3e(e){}l(s.1F&&3m)6.3A[s.N]=3m;u H=6.5k(M,s.3K);l(s.2k)s.2k(H,1d);l(s.1k)6.F.1J("5E",[M,s])}G{l(s.2E)s.2E(M,1d);l(s.1k)6.F.1J("5K",[M,s])}l(s.1k)6.F.1J("5M",[M,s]);l(s.1k&&!--6.4z)6.F.1J("5O");l(s.1t)s.1t(M,1d);M.2H=q(){};M=L}};M.2H=2H;l(s.1M>0)5Z(q(){l(M){M.7P();l(!4q)2H("1M");M=L}},s.1M);M.88(s.H);v M},4z:0,63:q(r){37{v!r.1d&&8j.8m=="4G:"||(r.1d>=4I&&r.1d<6g)||r.1d==5U||6.T.2l&&r.1d==Q}3e(e){}v W},4K:q(M,N){37{u 4X=M.45("4R-4t");v M.1d==5U||4X==6.3A[N]||6.T.2l&&M.1d==Q}3e(e){}v W},5k:q(r,B){u 4a=r.45("7b-B");u H=!B&&4a&&4a.1f("M")>=0;H=B=="M"||H?r.7w:r.3p;l(B=="1Z"){6.4u(H)}l(B=="5Q")4c("H = "+H);l(B=="3D")6("<2b>").3D(H).4y();v H},3g:q(a){u s=[];l(a.14==2o||a.3n){J(u i=0;i)[^>]*$|^#(\w+)$/; + +jQuery.fn = jQuery.prototype = { + init: function(selector, context) { + // Make sure that a selection was provided + selector = selector || document; + + // Handle HTML strings + if ( typeof selector == "string" ) { + var m = quickExpr.exec(selector); + if ( m && (m[1] || !context) ) { + // HANDLE: $(html) -> $(array) + if ( m[1] ) + selector = jQuery.clean( [ m[1] ], context ); + + // HANDLE: $("#id") + else { + var tmp = document.getElementById( m[3] ); + if ( tmp ) + // Handle the case where IE and Opera return items + // by name instead of ID + if ( tmp.id != m[3] ) + return jQuery().find( selector ); + else { + this[0] = tmp; + this.length = 1; + return this; + } + else + selector = []; + } + + // HANDLE: $(expr) + } else + return new jQuery( context ).find( selector ); + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction(selector) ) + return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( selector ); + + return this.setArray( + // HANDLE: $(array) + selector.constructor == Array && selector || + + // HANDLE: $(arraylike) + // Watch for when an array-like object is passed as the selector + (selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) || + + // HANDLE: $(*) + [ selector ] ); + }, + + jquery: "1.2.1", + + size: function() { + return this.length; + }, + + length: 0, + + get: function( num ) { + return num == undefined ? + + // Return a 'clean' array + jQuery.makeArray( this ) : + + // Return just the object + this[num]; + }, + + pushStack: function( a ) { + var ret = jQuery(a); + ret.prevObject = this; + return ret; + }, + + setArray: function( a ) { + this.length = 0; + Array.prototype.push.apply( this, a ); + return this; + }, + + each: function( fn, args ) { + return jQuery.each( this, fn, args ); + }, + + index: function( obj ) { + var pos = -1; + this.each(function(i){ + if ( this == obj ) pos = i; + }); + return pos; + }, + + attr: function( key, value, type ) { + var obj = key; + + // Look for the case where we're accessing a style value + if ( key.constructor == String ) + if ( value == undefined ) + return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined; + else { + obj = {}; + obj[ key ] = value; + } + + // Check to see if we're setting style values + return this.each(function(index){ + // Set all the styles + for ( var prop in obj ) + jQuery.attr( + type ? this.style : this, + prop, jQuery.prop(this, obj[prop], type, index, prop) + ); + }); + }, + + css: function( key, value ) { + return this.attr( key, value, "curCSS" ); + }, + + text: function(e) { + if ( typeof e != "object" && e != null ) + return this.empty().append( document.createTextNode( e ) ); + + var t = ""; + jQuery.each( e || this, function(){ + jQuery.each( this.childNodes, function(){ + if ( this.nodeType != 8 ) + t += this.nodeType != 1 ? + this.nodeValue : jQuery.fn.text([ this ]); + }); + }); + return t; + }, + + wrapAll: function(html) { + if ( this[0] ) + // The elements to wrap the target around + jQuery(html, this[0].ownerDocument) + .clone() + .insertBefore(this[0]) + .map(function(){ + var elem = this; + while ( elem.firstChild ) + elem = elem.firstChild; + return elem; + }) + .append(this); + + return this; + }, + + wrapInner: function(html) { + return this.each(function(){ + jQuery(this).contents().wrapAll(html); + }); + }, + + wrap: function(html) { + return this.each(function(){ + jQuery(this).wrapAll(html); + }); + }, + + append: function() { + return this.domManip(arguments, true, 1, function(a){ + this.appendChild( a ); + }); + }, + + prepend: function() { + return this.domManip(arguments, true, -1, function(a){ + this.insertBefore( a, this.firstChild ); + }); + }, + + before: function() { + return this.domManip(arguments, false, 1, function(a){ + this.parentNode.insertBefore( a, this ); + }); + }, + + after: function() { + return this.domManip(arguments, false, -1, function(a){ + this.parentNode.insertBefore( a, this.nextSibling ); + }); + }, + + end: function() { + return this.prevObject || jQuery([]); + }, + + find: function(t) { + var data = jQuery.map(this, function(a){ return jQuery.find(t,a); }); + return this.pushStack( /[^+>] [^+>]/.test( t ) || t.indexOf("..") > -1 ? + jQuery.unique( data ) : data ); + }, + + clone: function(events) { + // Do the clone + var ret = this.map(function(){ + return this.outerHTML ? jQuery(this.outerHTML)[0] : this.cloneNode(true); + }); + + // Need to set the expando to null on the cloned set if it exists + // removeData doesn't work here, IE removes it from the original as well + // this is primarily for IE but the data expando shouldn't be copied over in any browser + var clone = ret.find("*").andSelf().each(function(){ + if ( this[ expando ] != undefined ) + this[ expando ] = null; + }); + + // Copy the events from the original to the clone + if (events === true) + this.find("*").andSelf().each(function(i) { + var events = jQuery.data(this, "events"); + for ( var type in events ) + for ( var handler in events[type] ) + jQuery.event.add(clone[i], type, events[type][handler], events[type][handler].data); + }); + + // Return the cloned set + return ret; + }, + + filter: function(t) { + return this.pushStack( + jQuery.isFunction( t ) && + jQuery.grep(this, function(el, index){ + return t.apply(el, [index]); + }) || + + jQuery.multiFilter(t,this) ); + }, + + not: function(t) { + return this.pushStack( + t.constructor == String && + jQuery.multiFilter(t, this, true) || + + jQuery.grep(this, function(a) { + return ( t.constructor == Array || t.jquery ) + ? jQuery.inArray( a, t ) < 0 + : a != t; + }) + ); + }, + + add: function(t) { + return this.pushStack( jQuery.merge( + this.get(), + t.constructor == String ? + jQuery(t).get() : + t.length != undefined && (!t.nodeName || jQuery.nodeName(t, "form")) ? + t : [t] ) + ); + }, + + is: function(expr) { + return expr ? jQuery.multiFilter(expr,this).length > 0 : false; + }, + + hasClass: function(expr) { + return this.is("." + expr); + }, + + val: function( val ) { + if ( val == undefined ) { + if ( this.length ) { + var elem = this[0]; + + // We need to handle select boxes special + if ( jQuery.nodeName(elem, "select") ) { + var index = elem.selectedIndex, + a = [], + options = elem.options, + one = elem.type == "select-one"; + + // Nothing was selected + if ( index < 0 ) + return null; + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[i]; + if ( option.selected ) { + // Get the specifc value for the option + var val = jQuery.browser.msie && !option.attributes["value"].specified ? option.text : option.value; + + // We don't need an array for one selects + if ( one ) + return val; + + // Multi-Selects return an array + a.push(val); + } + } + + return a; + + // Everything else, we just grab the value + } else + return this[0].value.replace(/\r/g, ""); + } + } else + return this.each(function(){ + if ( val.constructor == Array && /radio|checkbox/.test(this.type) ) + this.checked = (jQuery.inArray(this.value, val) >= 0 || + jQuery.inArray(this.name, val) >= 0); + else if ( jQuery.nodeName(this, "select") ) { + var tmp = val.constructor == Array ? val : [val]; + + jQuery("option", this).each(function(){ + this.selected = (jQuery.inArray(this.value, tmp) >= 0 || + jQuery.inArray(this.text, tmp) >= 0); + }); + + if ( !tmp.length ) + this.selectedIndex = -1; + } else + this.value = val; + }); + }, + + html: function( val ) { + return val == undefined ? + ( this.length ? this[0].innerHTML : null ) : + this.empty().append( val ); + }, + + replaceWith: function( val ) { + return this.after( val ).remove(); + }, + + eq: function(i){ + return this.slice(i, i+1); + }, + + slice: function() { + return this.pushStack( Array.prototype.slice.apply( this, arguments ) ); + }, + + map: function(fn) { + return this.pushStack(jQuery.map( this, function(elem,i){ + return fn.call( elem, i, elem ); + })); + }, + + andSelf: function() { + return this.add( this.prevObject ); + }, + + domManip: function(args, table, dir, fn) { + var clone = this.length > 1, a; + + return this.each(function(){ + if ( !a ) { + a = jQuery.clean(args, this.ownerDocument); + if ( dir < 0 ) + a.reverse(); + } + + var obj = this; + + if ( table && jQuery.nodeName(this, "table") && jQuery.nodeName(a[0], "tr") ) + obj = this.getElementsByTagName("tbody")[0] || this.appendChild(document.createElement("tbody")); + + jQuery.each( a, function(){ + var elem = clone ? this.cloneNode(true) : this; + if ( !evalScript(0, elem) ) + fn.call( obj, elem ); + }); + }); + } +}; + +function evalScript(i, elem){ + var script = jQuery.nodeName(elem, "script"); + + if ( script ) { + if ( elem.src ) + jQuery.ajax({ url: elem.src, async: false, dataType: "script" }); + else + jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); + + if ( elem.parentNode ) + elem.parentNode.removeChild(elem); + + } else if ( elem.nodeType == 1 ) + jQuery("script", elem).each(evalScript); + + return script; +} + +jQuery.extend = jQuery.fn.extend = function() { + // copy reference to target object + var target = arguments[0] || {}, a = 1, al = arguments.length, deep = false; + + // Handle a deep copy situation + if ( target.constructor == Boolean ) { + deep = target; + target = arguments[1] || {}; + } + + // extend jQuery itself if only one argument is passed + if ( al == 1 ) { + target = this; + a = 0; + } + + var prop; + + for ( ; a < al; a++ ) + // Only deal with non-null/undefined values + if ( (prop = arguments[a]) != null ) + // Extend the base object + for ( var i in prop ) { + // Prevent never-ending loop + if ( target == prop[i] ) + continue; + + // Recurse if we're merging object values + if ( deep && typeof prop[i] == 'object' && target[i] ) + jQuery.extend( target[i], prop[i] ); + + // Don't bring in undefined values + else if ( prop[i] != undefined ) + target[i] = prop[i]; + } + + // Return the modified object + return target; +}; + +var expando = "jQuery" + (new Date()).getTime(), uuid = 0, win = {}; + +jQuery.extend({ + noConflict: function(deep) { + window.$ = _$; + if ( deep ) + window.jQuery = _jQuery; + return jQuery; + }, + + // This may seem like some crazy code, but trust me when I say that this + // is the only cross-browser way to do this. --John + isFunction: function( fn ) { + return !!fn && typeof fn != "string" && !fn.nodeName && + fn.constructor != Array && /function/i.test( fn + "" ); + }, + + // check if an element is in a XML document + isXMLDoc: function(elem) { + return elem.documentElement && !elem.body || + elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; + }, + + // Evalulates a script in a global context + // Evaluates Async. in Safari 2 :-( + globalEval: function( data ) { + data = jQuery.trim( data ); + if ( data ) { + if ( window.execScript ) + window.execScript( data ); + else if ( jQuery.browser.safari ) + // safari doesn't provide a synchronous global eval + window.setTimeout( data, 0 ); + else + eval.call( window, data ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); + }, + + cache: {}, + + data: function( elem, name, data ) { + elem = elem == window ? win : elem; + + var id = elem[ expando ]; + + // Compute a unique ID for the element + if ( !id ) + id = elem[ expando ] = ++uuid; + + // Only generate the data cache if we're + // trying to access or manipulate it + if ( name && !jQuery.cache[ id ] ) + jQuery.cache[ id ] = {}; + + // Prevent overriding the named cache with undefined values + if ( data != undefined ) + jQuery.cache[ id ][ name ] = data; + + // Return the named cache data, or the ID for the element + return name ? jQuery.cache[ id ][ name ] : id; + }, + + removeData: function( elem, name ) { + elem = elem == window ? win : elem; + + var id = elem[ expando ]; + + // If we want to remove a specific section of the element's data + if ( name ) { + if ( jQuery.cache[ id ] ) { + // Remove the section of cache data + delete jQuery.cache[ id ][ name ]; + + // If we've removed all the data, remove the element's cache + name = ""; + for ( name in jQuery.cache[ id ] ) break; + if ( !name ) + jQuery.removeData( elem ); + } + + // Otherwise, we want to remove all of the element's data + } else { + // Clean up the element expando + try { + delete elem[ expando ]; + } catch(e){ + // IE has trouble directly removing the expando + // but it's ok with using removeAttribute + if ( elem.removeAttribute ) + elem.removeAttribute( expando ); + } + + // Completely remove the data cache + delete jQuery.cache[ id ]; + } + }, + + // args is for internal usage only + each: function( obj, fn, args ) { + if ( args ) { + if ( obj.length == undefined ) + for ( var i in obj ) + fn.apply( obj[i], args ); + else + for ( var i = 0, ol = obj.length; i < ol; i++ ) + if ( fn.apply( obj[i], args ) === false ) break; + + // A special, fast, case for the most common use of each + } else { + if ( obj.length == undefined ) + for ( var i in obj ) + fn.call( obj[i], i, obj[i] ); + else + for ( var i = 0, ol = obj.length, val = obj[0]; + i < ol && fn.call(val,i,val) !== false; val = obj[++i] ){} + } + + return obj; + }, + + prop: function(elem, value, type, index, prop){ + // Handle executable functions + if ( jQuery.isFunction( value ) ) + value = value.call( elem, [index] ); + + // exclude the following css properties to add px + var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i; + + // Handle passing in a number to a CSS property + return value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) ? + value + "px" : + value; + }, + + className: { + // internal only, use addClass("class") + add: function( elem, c ){ + jQuery.each( (c || "").split(/\s+/), function(i, cur){ + if ( !jQuery.className.has( elem.className, cur ) ) + elem.className += ( elem.className ? " " : "" ) + cur; + }); + }, + + // internal only, use removeClass("class") + remove: function( elem, c ){ + elem.className = c != undefined ? + jQuery.grep( elem.className.split(/\s+/), function(cur){ + return !jQuery.className.has( c, cur ); + }).join(" ") : ""; + }, + + // internal only, use is(".class") + has: function( t, c ) { + return jQuery.inArray( c, (t.className || t).toString().split(/\s+/) ) > -1; + } + }, + + swap: function(e,o,f) { + for ( var i in o ) { + e.style["old"+i] = e.style[i]; + e.style[i] = o[i]; + } + f.apply( e, [] ); + for ( var i in o ) + e.style[i] = e.style["old"+i]; + }, + + css: function(e,p) { + if ( p == "height" || p == "width" ) { + var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"]; + + jQuery.each( d, function(){ + old["padding" + this] = 0; + old["border" + this + "Width"] = 0; + }); + + jQuery.swap( e, old, function() { + if ( jQuery(e).is(':visible') ) { + oHeight = e.offsetHeight; + oWidth = e.offsetWidth; + } else { + e = jQuery(e.cloneNode(true)) + .find(":radio").removeAttr("checked").end() + .css({ + visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0" + }).appendTo(e.parentNode)[0]; + + var parPos = jQuery.css(e.parentNode,"position") || "static"; + if ( parPos == "static" ) + e.parentNode.style.position = "relative"; + + oHeight = e.clientHeight; + oWidth = e.clientWidth; + + if ( parPos == "static" ) + e.parentNode.style.position = "static"; + + e.parentNode.removeChild(e); + } + }); + + return p == "height" ? oHeight : oWidth; + } + + return jQuery.curCSS( e, p ); + }, + + curCSS: function(elem, prop, force) { + var ret, stack = [], swap = []; + + // A helper method for determining if an element's values are broken + function color(a){ + if ( !jQuery.browser.safari ) + return false; + + var ret = document.defaultView.getComputedStyle(a,null); + return !ret || ret.getPropertyValue("color") == ""; + } + + if (prop == "opacity" && jQuery.browser.msie) { + ret = jQuery.attr(elem.style, "opacity"); + return ret == "" ? "1" : ret; + } + + if (prop.match(/float/i)) + prop = styleFloat; + + if (!force && elem.style[prop]) + ret = elem.style[prop]; + + else if (document.defaultView && document.defaultView.getComputedStyle) { + + if (prop.match(/float/i)) + prop = "float"; + + prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase(); + var cur = document.defaultView.getComputedStyle(elem, null); + + if ( cur && !color(elem) ) + ret = cur.getPropertyValue(prop); + + // If the element isn't reporting its values properly in Safari + // then some display: none elements are involved + else { + // Locate all of the parent display: none elements + for ( var a = elem; a && color(a); a = a.parentNode ) + stack.unshift(a); + + // Go through and make them visible, but in reverse + // (It would be better if we knew the exact display type that they had) + for ( a = 0; a < stack.length; a++ ) + if ( color(stack[a]) ) { + swap[a] = stack[a].style.display; + stack[a].style.display = "block"; + } + + // Since we flip the display style, we have to handle that + // one special, otherwise get the value + ret = prop == "display" && swap[stack.length-1] != null ? + "none" : + document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop) || ""; + + // Finally, revert the display styles back + for ( a = 0; a < swap.length; a++ ) + if ( swap[a] != null ) + stack[a].style.display = swap[a]; + } + + if ( prop == "opacity" && ret == "" ) + ret = "1"; + + } else if (elem.currentStyle) { + var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();}); + ret = elem.currentStyle[prop] || elem.currentStyle[newProp]; + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + if ( !/^\d+(px)?$/i.test(ret) && /^\d/.test(ret) ) { + var style = elem.style.left; + var runtimeStyle = elem.runtimeStyle.left; + elem.runtimeStyle.left = elem.currentStyle.left; + elem.style.left = ret || 0; + ret = elem.style.pixelLeft + "px"; + elem.style.left = style; + elem.runtimeStyle.left = runtimeStyle; + } + } + + return ret; + }, + + clean: function(a, doc) { + var r = []; + doc = doc || document; + + jQuery.each( a, function(i,arg){ + if ( !arg ) return; + + if ( arg.constructor == Number ) + arg = arg.toString(); + + // Convert html string into DOM nodes + if ( typeof arg == "string" ) { + // Fix "XHTML"-style tags in all browsers + arg = arg.replace(/(<(\w+)[^>]*?)\/>/g, function(m, all, tag){ + return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)? m : all+">"; + }); + + // Trim whitespace, otherwise indexOf won't work as expected + var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = []; + + var wrap = + // option or optgroup + !s.indexOf("", ""] || + + !s.indexOf("", ""] || + + s.match(/^<(thead|tbody|tfoot|colg|cap)/) && + [1, "", "
"] || + + !s.indexOf("", ""] || + + // matched above + (!s.indexOf("", ""] || + + !s.indexOf("", ""] || + + // IE can't serialize and