jbarnette-johnson 1.0.0.20090326122910 → 1.0.0.20090326154650

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