Хранилища Subversion ant

Редакция

Редакция 290 | Только различия | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS

Редакция 290 Редакция 293
1
/*!
1
/*!
2
 * jQuery JavaScript Library v1.3.3pre
2
 * jQuery JavaScript Library v1.4pre
3
 * http://jquery.com/
3
 * http://jquery.com/
4
 *
4
 *
5
 * Copyright (c) 2009 John Resig
5
 * Copyright (c) 2009 John Resig
6
 * Dual licensed under the MIT and GPL licenses.
6
 * Dual licensed under the MIT and GPL licenses.
7
 * http://docs.jquery.com/License
7
 * http://docs.jquery.com/License
8
 *
8
 *
9
 * Date: 2009-07-28 03:48:42 +0700 (Втр, 28 Июл 2009)
9
 * Date: 2009-10-12 23:26:01 +0700 (Пнд, 12 Окт 2009)
10
 * Revision: 6514
10
 * Revision: 6617
11
 */
11
 */
12
(function(window, undefined){
12
(function(window, undefined){
13
13
14
// Define a local copy of jQuery
14
// Define a local copy of jQuery
15
var jQuery = function( selector, context ) {
15
var jQuery = function( selector, context ) {
16
                // The jQuery object is actually just the init constructor 'enhanced'
16
                // The jQuery object is actually just the init constructor 'enhanced'
17
                return arguments.length === 0 ?
17
                return arguments.length === 0 ?
18
                        rootjQuery :
18
                        rootjQuery :
19
                        new jQuery.fn.init( selector, context );
19
                        new jQuery.fn.init( selector, context );
20
        },
20
        },
21
21
22
        // Map over jQuery in case of overwrite
22
        // Map over jQuery in case of overwrite
23
        _jQuery = window.jQuery,
23
        _jQuery = window.jQuery,
24
24
25
        // Map over the $ in case of overwrite
25
        // Map over the $ in case of overwrite
26
        _$ = window.$,
26
        _$ = window.$,
27
27
28
        // Use the correct document accordingly with window argument (sandbox)
28
        // Use the correct document accordingly with window argument (sandbox)
29
        document = window.document,
29
        document = window.document,
30
30
31
        // A central reference to the root jQuery(document)
31
        // A central reference to the root jQuery(document)
32
        rootjQuery,
32
        rootjQuery,
33
33
34
        // A simple way to check for HTML strings or ID strings
34
        // A simple way to check for HTML strings or ID strings
35
        // (both of which we optimize for)
35
        // (both of which we optimize for)
36
        quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
36
        quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
37
37
38
        // Is it a simple selector
38
        // Is it a simple selector
39
        isSimple = /^.[^:#\[\.,]*$/,
39
        isSimple = /^.[^:#\[\.,]*$/,
40
40
41
        // Check if a string has a non-whitespace character in it
41
        // Check if a string has a non-whitespace character in it
42
        rnotwhite = /\S/,
42
        rnotwhite = /\S/,
43
43
44
        // Used for trimming whitespace
44
        // Used for trimming whitespace
45
        rtrim = /^\s+|\s+$/g,
45
        rtrim = /^\s+|\s+$/g,
46
46
-
 
47
        // Match a standalone tag
-
 
48
        rsingleTag = /^<(\w+)\s*\/?>$/,
-
 
49
47
        // Keep a UserAgent string for use with jQuery.browser
50
        // Keep a UserAgent string for use with jQuery.browser
48
        userAgent = navigator.userAgent.toLowerCase(),
51
        userAgent = navigator.userAgent.toLowerCase(),
49
52
50
        // Save a reference to some core methods
53
        // Save a reference to some core methods
51
        toString = Object.prototype.toString,
54
        toString = Object.prototype.toString,
52
        push = Array.prototype.push,
55
        push = Array.prototype.push,
53
        slice = Array.prototype.slice;
56
        slice = Array.prototype.slice,
54
-
 
55
// Expose jQuery to the global object
-
 
56
window.jQuery = window.$ = jQuery;
57
        indexOf = Array.prototype.indexOf;
57
58
58
jQuery.fn = jQuery.prototype = {
59
jQuery.fn = jQuery.prototype = {
59
        init: function( selector, context ) {
60
        init: function( selector, context ) {
60
                var match, elem, ret;
61
                var match, elem, ret, doc;
61
62
62
                // Handle $(""), $(null), or $(undefined)
63
                // Handle $(""), $(null), or $(undefined)
63
                if ( !selector ) {
64
                if ( !selector ) {
64
                        return this;
65
                        return this;
65
                }
66
                }
66
67
67
                // Handle $(DOMElement)
68
                // Handle $(DOMElement)
68
                if ( selector.nodeType ) {
69
                if ( selector.nodeType ) {
69
                        this.context = this[0] = selector;
70
                        this.context = this[0] = selector;
70
                        this.length++;
71
                        this.length++;
71
                        return this;
72
                        return this;
72
                }
73
                }
73
74
74
                // Handle HTML strings
75
                // Handle HTML strings
75
                if ( typeof selector === "string" ) {
76
                if ( typeof selector === "string" ) {
76
                        // Are we dealing with HTML string or an ID?
77
                        // Are we dealing with HTML string or an ID?
77
                        match = quickExpr.exec( selector );
78
                        match = quickExpr.exec( selector );
78
79
79
                        // Verify a match, and that no context was specified for #id
80
                        // Verify a match, and that no context was specified for #id
80
                        if ( match && (match[1] || !context) ) {
81
                        if ( match && (match[1] || !context) ) {
81
82
82
                                // HANDLE: $(html) -> $(array)
83
                                // HANDLE: $(html) -> $(array)
83
                                if ( match[1] ) {
84
                                if ( match[1] ) {
-
 
85
                                        doc = (context ? context.ownerDocument || context : document);
-
 
86
-
 
87
                                        // If a single string is passed in and it's a single tag
-
 
88
                                        // just do a createElement and skip the rest
-
 
89
                                        ret = rsingleTag.exec( selector );
-
 
90
-
 
91
                                        if ( ret ) {
-
 
92
                                                selector = [ doc.createElement( ret[1] ) ];
-
 
93
-
 
94
                                        } else {
84
                                        selector = jQuery.clean( [ match[1] ], context );
95
                                                ret = buildFragment( [ match[1] ], [ doc ] );
-
 
96
                                                selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
-
 
97
                                        }
85
98
86
                                // HANDLE: $("#id")
99
                                // HANDLE: $("#id")
87
                                } else {
100
                                } else {
88
                                        elem = document.getElementById( match[2] );
101
                                        elem = document.getElementById( match[2] );
89
102
90
                                        if ( elem ) {
103
                                        if ( elem ) {
91
                                                // Handle the case where IE and Opera return items
104
                                                // Handle the case where IE and Opera return items
92
                                                // by name instead of ID
105
                                                // by name instead of ID
93
                                                if ( elem.id !== match[2] ) {
106
                                                if ( elem.id !== match[2] ) {
94
                                                        return rootjQuery.find( selector );
107
                                                        return rootjQuery.find( selector );
95
                                                }
108
                                                }
96
109
97
                                                // Otherwise, we inject the element directly into the jQuery object
110
                                                // Otherwise, we inject the element directly into the jQuery object
98
                                                this.length++;
111
                                                this.length++;
99
                                                this[0] = elem;
112
                                                this[0] = elem;
100
                                        }
113
                                        }
101
114
102
                                        this.context = document;
115
                                        this.context = document;
103
                                        this.selector = selector;
116
                                        this.selector = selector;
104
                                        return this;
117
                                        return this;
105
                                }
118
                                }
106
119
-
 
120
                        // HANDLE: $("TAG")
-
 
121
                        } else if ( !context && /^\w+$/.test( selector ) ) {
-
 
122
                                this.selector = selector;
-
 
123
                                this.context = document;
-
 
124
                                selector = document.getElementsByTagName( selector );
-
 
125
107
                        // HANDLE: $(expr, $(...))
126
                        // HANDLE: $(expr, $(...))
108
                        } else if ( !context || context.jquery ) {
127
                        } else if ( !context || context.jquery ) {
109
                                return (context || rootjQuery).find( selector );
128
                                return (context || rootjQuery).find( selector );
110
129
111
                        // HANDLE: $(expr, context)
130
                        // HANDLE: $(expr, context)
112
                        // (which is just equivalent to: $(context).find(expr)
131
                        // (which is just equivalent to: $(context).find(expr)
113
                        } else {
132
                        } else {
114
                                return jQuery( context ).find( selector );
133
                                return jQuery( context ).find( selector );
115
                        }
134
                        }
116
135
117
                // HANDLE: $(function)
136
                // HANDLE: $(function)
118
                // Shortcut for document ready
137
                // Shortcut for document ready
119
                } else if ( jQuery.isFunction( selector ) ) {
138
                } else if ( jQuery.isFunction( selector ) ) {
120
                        return rootjQuery.ready( selector );
139
                        return rootjQuery.ready( selector );
121
                }
140
                }
122
141
123
                // Make sure that old selector state is passed along
-
 
124
                if ( selector.selector && selector.context ) {
142
                if (selector.selector !== undefined) {
125
                        this.selector = selector.selector;
143
                        this.selector = selector.selector;
126
                        this.context = selector.context;
144
                        this.context = selector.context;
127
                }
145
                }
128
146
129
                return this.setArray(jQuery.isArray( selector ) ?
147
                return this.setArray(jQuery.isArray( selector ) ?
130
                        selector :
148
                        selector :
131
                        jQuery.makeArray(selector));
149
                        jQuery.makeArray(selector));
132
        },
150
        },
133
151
134
        // Start with an empty selector
152
        // Start with an empty selector
135
        selector: "",
153
        selector: "",
136
154
137
        // The current version of jQuery being used
155
        // The current version of jQuery being used
138
        jquery: "1.3.3pre",
156
        jquery: "1.4pre",
139
157
140
        // The default length of a jQuery object is 0
158
        // The default length of a jQuery object is 0
141
        length: 0,
159
        length: 0,
142
160
143
        // The number of elements contained in the matched element set
161
        // The number of elements contained in the matched element set
144
        size: function() {
162
        size: function() {
145
                return this.length;
163
                return this.length;
146
        },
164
        },
147
165
148
        toArray: function(){
166
        toArray: function(){
149
                return slice.call( this, 0 );
167
                return slice.call( this, 0 );
150
        },
168
        },
151
169
152
        // Get the Nth element in the matched element set OR
170
        // Get the Nth element in the matched element set OR
153
        // Get the whole matched element set as a clean array
171
        // Get the whole matched element set as a clean array
154
        get: function( num ) {
172
        get: function( num ) {
155
                return num == null ?
173
                return num == null ?
156
174
157
                        // Return a 'clean' array
175
                        // Return a 'clean' array
158
                        this.toArray() :
176
                        this.toArray() :
159
177
160
                        // Return just the object
178
                        // Return just the object
161
                        ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
179
                        ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
162
        },
180
        },
163
181
164
        // Take an array of elements and push it onto the stack
182
        // Take an array of elements and push it onto the stack
165
        // (returning the new matched element set)
183
        // (returning the new matched element set)
166
        pushStack: function( elems, name, selector ) {
184
        pushStack: function( elems, name, selector ) {
167
                // Build a new jQuery matched element set
185
                // Build a new jQuery matched element set
168
                var ret = jQuery( elems || null );
186
                var ret = jQuery( elems || null );
169
187
170
                // Add the old object onto the stack (as a reference)
188
                // Add the old object onto the stack (as a reference)
171
                ret.prevObject = this;
189
                ret.prevObject = this;
172
190
173
                ret.context = this.context;
191
                ret.context = this.context;
174
192
175
                if ( name === "find" ) {
193
                if ( name === "find" ) {
176
                        ret.selector = this.selector + (this.selector ? " " : "") + selector;
194
                        ret.selector = this.selector + (this.selector ? " " : "") + selector;
177
                } else if ( name ) {
195
                } else if ( name ) {
178
                        ret.selector = this.selector + "." + name + "(" + selector + ")";
196
                        ret.selector = this.selector + "." + name + "(" + selector + ")";
179
                }
197
                }
180
198
181
                // Return the newly-formed element set
199
                // Return the newly-formed element set
182
                return ret;
200
                return ret;
183
        },
201
        },
184
202
185
        // Force the current matched set of elements to become
203
        // Force the current matched set of elements to become
186
        // the specified array of elements (destroying the stack in the process)
204
        // the specified array of elements (destroying the stack in the process)
187
        // You should use pushStack() in order to do this, but maintain the stack
205
        // You should use pushStack() in order to do this, but maintain the stack
188
        setArray: function( elems ) {
206
        setArray: function( elems ) {
189
                // Resetting the length to 0, then using the native Array push
207
                // Resetting the length to 0, then using the native Array push
190
                // is a super-fast way to populate an object with array-like properties
208
                // is a super-fast way to populate an object with array-like properties
191
                this.length = 0;
209
                this.length = 0;
192
                push.apply( this, elems );
210
                push.apply( this, elems );
193
211
194
                return this;
212
                return this;
195
        },
213
        },
196
214
197
        // Execute a callback for every element in the matched set.
215
        // Execute a callback for every element in the matched set.
198
        // (You can seed the arguments with an array of args, but this is
216
        // (You can seed the arguments with an array of args, but this is
199
        // only used internally.)
217
        // only used internally.)
200
        each: function( callback, args ) {
218
        each: function( callback, args ) {
201
                return jQuery.each( this, callback, args );
219
                return jQuery.each( this, callback, args );
202
        },
220
        },
203
221
204
        // Determine the position of an element within
222
        // Determine the position of an element within
205
        // the matched set of elements
223
        // the matched set of elements
206
        index: function( elem ) {
224
        index: function( elem ) {
207
                if ( !elem || typeof elem === "string" ) {
225
                if ( !elem || typeof elem === "string" ) {
208
                        return jQuery.inArray( this[0],
226
                        return jQuery.inArray( this[0],
209
                                // If it receives a string, the selector is used
227
                                // If it receives a string, the selector is used
210
                                // If it receives nothing, the siblings are used
228
                                // If it receives nothing, the siblings are used
211
                                elem ? jQuery( elem ) : this.parent().children() );
229
                                elem ? jQuery( elem ) : this.parent().children() );
212
                }
230
                }
213
                // Locate the position of the desired element
231
                // Locate the position of the desired element
214
                return jQuery.inArray(
232
                return jQuery.inArray(
215
                        // If it receives a jQuery object, the first element is used
233
                        // If it receives a jQuery object, the first element is used
216
                        elem.jquery ? elem[0] : elem, this );
234
                        elem.jquery ? elem[0] : elem, this );
217
        },
235
        },
218
236
219
        is: function( selector ) {
237
        is: function( selector ) {
220
                return !!selector && jQuery.multiFilter( selector, this ).length > 0;
238
                return !!selector && jQuery.multiFilter( selector, this ).length > 0;
221
        },
239
        },
222
240
223
        // For internal use only.
241
        // For internal use only.
224
        // Behaves like an Array's method, not like a jQuery method.
242
        // Behaves like an Array's method, not like a jQuery method.
225
        push: push,
243
        push: push,
226
        sort: [].sort,
244
        sort: [].sort,
227
        splice: [].splice
245
        splice: [].splice
228
};
246
};
229
247
230
// Give the init function the jQuery prototype for later instantiation
248
// Give the init function the jQuery prototype for later instantiation
231
jQuery.fn.init.prototype = jQuery.fn;
249
jQuery.fn.init.prototype = jQuery.fn;
232
250
233
jQuery.extend = jQuery.fn.extend = function() {
251
jQuery.extend = jQuery.fn.extend = function() {
234
        // copy reference to target object
252
        // copy reference to target object
235
        var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
253
        var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
236
254
237
        // Handle a deep copy situation
255
        // Handle a deep copy situation
238
        if ( typeof target === "boolean" ) {
256
        if ( typeof target === "boolean" ) {
239
                deep = target;
257
                deep = target;
240
                target = arguments[1] || {};
258
                target = arguments[1] || {};
241
                // skip the boolean and the target
259
                // skip the boolean and the target
242
                i = 2;
260
                i = 2;
243
        }
261
        }
244
262
245
        // Handle case when target is a string or something (possible in deep copy)
263
        // Handle case when target is a string or something (possible in deep copy)
246
        if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
264
        if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
247
                target = {};
265
                target = {};
248
        }
266
        }
249
267
250
        // extend jQuery itself if only one argument is passed
268
        // extend jQuery itself if only one argument is passed
251
        if ( length === i ) {
269
        if ( length === i ) {
252
                target = this;
270
                target = this;
253
                --i;
271
                --i;
254
        }
272
        }
255
273
256
        for ( ; i < length; i++ ) {
274
        for ( ; i < length; i++ ) {
257
                // Only deal with non-null/undefined values
275
                // Only deal with non-null/undefined values
258
                if ( (options = arguments[ i ]) != null ) {
276
                if ( (options = arguments[ i ]) != null ) {
259
                        // Extend the base object
277
                        // Extend the base object
260
                        for ( name in options ) {
278
                        for ( name in options ) {
261
                                src = target[ name ];
279
                                src = target[ name ];
262
                                copy = options[ name ];
280
                                copy = options[ name ];
263
281
264
                                // Prevent never-ending loop
282
                                // Prevent never-ending loop
265
                                if ( target === copy ) {
283
                                if ( target === copy ) {
266
                                        continue;
284
                                        continue;
267
                                }
285
                                }
268
286
269
                                // Recurse if we're merging object values
287
                                // Recurse if we're merging object values
270
                                if ( deep && copy && typeof copy === "object" && !copy.nodeType ) {
288
                                if ( deep && copy && typeof copy === "object" && !copy.nodeType ) {
271
                                        var clone;
289
                                        var clone;
272
290
273
                                        if ( src ) {
291
                                        if ( src ) {
274
                                                clone = src;
292
                                                clone = src;
275
                                        } else if ( jQuery.isArray(copy) ) {
293
                                        } else if ( jQuery.isArray(copy) ) {
276
                                                clone = [];
294
                                                clone = [];
277
                                        } else if ( jQuery.isObject(copy) ) {
295
                                        } else if ( jQuery.isObject(copy) ) {
278
                                                clone = {};
296
                                                clone = {};
279
                                        } else {
297
                                        } else {
280
                                                clone = copy;
298
                                                clone = copy;
281
                                        }
299
                                        }
282
300
283
                                        // Never move original objects, clone them
301
                                        // Never move original objects, clone them
284
                                        target[ name ] = jQuery.extend( deep, clone, copy );
302
                                        target[ name ] = jQuery.extend( deep, clone, copy );
285
303
286
                                // Don't bring in undefined values
304
                                // Don't bring in undefined values
287
                                } else if ( copy !== undefined ) {
305
                                } else if ( copy !== undefined ) {
288
                                        target[ name ] = copy;
306
                                        target[ name ] = copy;
289
                                }
307
                                }
290
                        }
308
                        }
291
                }
309
                }
292
        }
310
        }
293
311
294
        // Return the modified object
312
        // Return the modified object
295
        return target;
313
        return target;
296
};
314
};
297
315
298
jQuery.extend({
316
jQuery.extend({
299
        noConflict: function( deep ) {
317
        noConflict: function( deep ) {
300
                window.$ = _$;
318
                window.$ = _$;
301
319
302
                if ( deep ) {
320
                if ( deep ) {
303
                        window.jQuery = _jQuery;
321
                        window.jQuery = _jQuery;
304
                }
322
                }
305
323
306
                return jQuery;
324
                return jQuery;
307
        },
325
        },
308
326
309
        // See test/unit/core.js for details concerning isFunction.
327
        // See test/unit/core.js for details concerning isFunction.
310
        // Since version 1.3, DOM methods and functions like alert
328
        // Since version 1.3, DOM methods and functions like alert
311
        // aren't supported. They return false on IE (#2968).
329
        // aren't supported. They return false on IE (#2968).
312
        isFunction: function( obj ) {
330
        isFunction: function( obj ) {
313
                return toString.call(obj) === "[object Function]";
331
                return toString.call(obj) === "[object Function]";
314
        },
332
        },
315
333
316
        isArray: function( obj ) {
334
        isArray: function( obj ) {
317
                return toString.call(obj) === "[object Array]";
335
                return toString.call(obj) === "[object Array]";
318
        },
336
        },
319
337
320
        isObject: function( obj ) {
338
        isObject: function( obj ) {
321
                return this.constructor.call(obj) === Object;
339
                return this.constructor.call(obj) === Object;
322
        },
340
        },
323
341
324
        isEmptyObject: function( obj ) {
342
        isEmptyObject: function( obj ) {
325
                for ( var name in obj ) {
343
                for ( var name in obj ) {
326
                        return false;
344
                        return false;
327
                }
345
                }
328
                return true;
346
                return true;
329
        },
347
        },
330
348
331
        // check if an element is in a (or is an) XML document
349
        // check if an element is in a (or is an) XML document
332
        isXMLDoc: function( elem ) {
350
        isXMLDoc: function( elem ) {
333
                // documentElement is verified for cases where it doesn't yet exist
351
                // documentElement is verified for cases where it doesn't yet exist
334
                // (such as loading iframes in IE - #4833)
352
                // (such as loading iframes in IE - #4833)
-
 
353
                var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
335
                return ((elem.ownerDocument || elem).documentElement || 0).nodeName !== "HTML";
354
                return documentElement ? documentElement.nodeName !== "HTML" : false;
336
        },
355
        },
337
356
338
        // Evalulates a script in a global context
357
        // Evalulates a script in a global context
339
        globalEval: function( data ) {
358
        globalEval: function( data ) {
340
                if ( data && rnotwhite.test(data) ) {
359
                if ( data && rnotwhite.test(data) ) {
341
                        // Inspired by code by Andrea Giammarchi
360
                        // Inspired by code by Andrea Giammarchi
342
                        // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
361
                        // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
343
                        var head = document.getElementsByTagName("head")[0] || document.documentElement,
362
                        var head = document.getElementsByTagName("head")[0] || document.documentElement,
344
                                script = document.createElement("script");
363
                                script = document.createElement("script");
345
364
346
                        script.type = "text/javascript";
365
                        script.type = "text/javascript";
347
366
348
                        if ( jQuery.support.scriptEval ) {
367
                        if ( jQuery.support.scriptEval ) {
349
                                script.appendChild( document.createTextNode( data ) );
368
                                script.appendChild( document.createTextNode( data ) );
350
                        } else {
369
                        } else {
351
                                script.text = data;
370
                                script.text = data;
352
                        }
371
                        }
353
372
354
                        // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
373
                        // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
355
                        // This arises when a base node is used (#2709).
374
                        // This arises when a base node is used (#2709).
356
                        head.insertBefore( script, head.firstChild );
375
                        head.insertBefore( script, head.firstChild );
357
                        head.removeChild( script );
376
                        head.removeChild( script );
358
                }
377
                }
359
        },
378
        },
360
379
361
        nodeName: function( elem, name ) {
380
        nodeName: function( elem, name ) {
362
                return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
381
                return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
363
        },
382
        },
364
383
365
        // args is for internal usage only
384
        // args is for internal usage only
366
        each: function( object, callback, args ) {
385
        each: function( object, callback, args ) {
367
                var name, i = 0,
386
                var name, i = 0,
368
                        length = object.length,
387
                        length = object.length,
369
                        isObj = length === undefined || jQuery.isFunction(object);
388
                        isObj = length === undefined || jQuery.isFunction(object);
370
389
371
                if ( args ) {
390
                if ( args ) {
372
                        if ( isObj ) {
391
                        if ( isObj ) {
373
                                for ( name in object ) {
392
                                for ( name in object ) {
374
                                        if ( callback.apply( object[ name ], args ) === false ) {
393
                                        if ( callback.apply( object[ name ], args ) === false ) {
375
                                                break;
394
                                                break;
376
                                        }
395
                                        }
377
                                }
396
                                }
378
                        } else {
397
                        } else {
379
                                for ( ; i < length; ) {
398
                                for ( ; i < length; ) {
380
                                        if ( callback.apply( object[ i++ ], args ) === false ) {
399
                                        if ( callback.apply( object[ i++ ], args ) === false ) {
381
                                                break;
400
                                                break;
382
                                        }
401
                                        }
383
                                }
402
                                }
384
                        }
403
                        }
385
404
386
                // A special, fast, case for the most common use of each
405
                // A special, fast, case for the most common use of each
387
                } else {
406
                } else {
388
                        if ( isObj ) {
407
                        if ( isObj ) {
389
                                for ( name in object ) {
408
                                for ( name in object ) {
390
                                        if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
409
                                        if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
391
                                                break;
410
                                                break;
392
                                        }
411
                                        }
393
                                }
412
                                }
394
                        } else {
413
                        } else {
395
                                for ( var value = object[0];
414
                                for ( var value = object[0];
396
                                        i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
415
                                        i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
397
                        }
416
                        }
398
                }
417
                }
399
418
400
                return object;
419
                return object;
401
        },
420
        },
402
421
403
        trim: function( text ) {
422
        trim: function( text ) {
404
                return (text || "").replace( rtrim, "" );
423
                return (text || "").replace( rtrim, "" );
405
        },
424
        },
406
425
407
        makeArray: function( array ) {
426
        makeArray: function( array ) {
408
                var ret = [], i;
427
                var ret = [], i;
409
428
410
                if ( array != null ) {
429
                if ( array != null ) {
411
                        i = array.length;
430
                        i = array.length;
412
431
413
                        // The window, strings (and functions) also have 'length'
432
                        // The window, strings (and functions) also have 'length'
414
                        if ( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval ) {
433
                        if ( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval ) {
415
                                ret[0] = array;
434
                                ret[0] = array;
416
                        } else {
435
                        } else {
417
                                while ( i ) {
436
                                while ( i ) {
418
                                        ret[--i] = array[i];
437
                                        ret[--i] = array[i];
419
                                }
438
                                }
420
                        }
439
                        }
421
                }
440
                }
422
441
423
                return ret;
442
                return ret;
424
        },
443
        },
425
444
426
        inArray: function( elem, array ) {
445
        inArray: function( elem, array ) {
427
                for ( var i = 0, length = array.length; i < length; i++ ) {
446
                for ( var i = 0, length = array.length; i < length; i++ ) {
428
                        if ( array[ i ] === elem ) {
447
                        if ( array[ i ] === elem ) {
429
                                return i;
448
                                return i;
430
                        }
449
                        }
431
                }
450
                }
432
451
433
                return -1;
452
                return -1;
434
        },
453
        },
435
454
436
        merge: function( first, second ) {
455
        merge: function( first, second ) {
437
                // We have to loop this way because IE & Opera overwrite the length
456
                // We have to loop this way because IE & Opera overwrite the length
438
                // expando of getElementsByTagName
457
                // expando of getElementsByTagName
439
                var i = 0, elem, pos = first.length;
458
                var i = 0, elem, pos = first.length;
440
459
441
                // Also, we need to make sure that the correct elements are being returned
460
                // Also, we need to make sure that the correct elements are being returned
442
                // (IE returns comment nodes in a '*' query)
461
                // (IE returns comment nodes in a '*' query)
443
                if ( !jQuery.support.getAll ) {
462
                if ( !jQuery.support.getAll ) {
444
                        while ( (elem = second[ i++ ]) != null ) {
463
                        while ( (elem = second[ i++ ]) != null ) {
445
                                if ( elem.nodeType !== 8 ) {
464
                                if ( elem.nodeType !== 8 ) {
446
                                        first[ pos++ ] = elem;
465
                                        first[ pos++ ] = elem;
447
                                }
466
                                }
448
                        }
467
                        }
449
468
450
                } else {
469
                } else {
451
                        while ( (elem = second[ i++ ]) != null ) {
470
                        while ( (elem = second[ i++ ]) != null ) {
452
                                first[ pos++ ] = elem;
471
                                first[ pos++ ] = elem;
453
                        }
472
                        }
454
                }
473
                }
455
474
456
                return first;
475
                return first;
457
        },
476
        },
458
477
459
        unique: function( array ) {
-
 
460
                var ret = [], done = {}, id;
-
 
461
-
 
462
                try {
-
 
463
                        for ( var i = 0, length = array.length; i < length; i++ ) {
-
 
464
                                id = jQuery.data( array[ i ] );
-
 
465
-
 
466
                                if ( !done[ id ] ) {
-
 
467
                                        done[ id ] = true;
-
 
468
                                        ret.push( array[ i ] );
-
 
469
                                }
-
 
470
                        }
-
 
471
                } catch( e ) {
-
 
472
                        ret = array;
-
 
473
                }
-
 
474
-
 
475
                return ret;
-
 
476
        },
-
 
477
-
 
478
        grep: function( elems, callback, inv ) {
478
        grep: function( elems, callback, inv ) {
479
                var ret = [];
479
                var ret = [];
480
480
481
                // Go through the array, only saving the items
481
                // Go through the array, only saving the items
482
                // that pass the validator function
482
                // that pass the validator function
483
                for ( var i = 0, length = elems.length; i < length; i++ ) {
483
                for ( var i = 0, length = elems.length; i < length; i++ ) {
484
                        if ( !inv !== !callback( elems[ i ], i ) ) {
484
                        if ( !inv !== !callback( elems[ i ], i ) ) {
485
                                ret.push( elems[ i ] );
485
                                ret.push( elems[ i ] );
486
                        }
486
                        }
487
                }
487
                }
488
488
489
                return ret;
489
                return ret;
490
        },
490
        },
491
491
492
        map: function( elems, callback ) {
492
        map: function( elems, callback ) {
493
                var ret = [], value;
493
                var ret = [], value;
494
494
495
                // Go through the array, translating each of the items to their
495
                // Go through the array, translating each of the items to their
496
                // new value (or values).
496
                // new value (or values).
497
                for ( var i = 0, length = elems.length; i < length; i++ ) {
497
                for ( var i = 0, length = elems.length; i < length; i++ ) {
498
                        value = callback( elems[ i ], i );
498
                        value = callback( elems[ i ], i );
499
499
500
                        if ( value != null ) {
500
                        if ( value != null ) {
501
                                ret[ ret.length ] = value;
501
                                ret[ ret.length ] = value;
502
                        }
502
                        }
503
                }
503
                }
504
504
505
                return ret.concat.apply( [], ret );
505
                return ret.concat.apply( [], ret );
506
        },
506
        },
507
507
508
        // Use of jQuery.browser is deprecated.
508
        // Use of jQuery.browser is deprecated.
509
        // It's included for backwards compatibility and plugins,
509
        // It's included for backwards compatibility and plugins,
510
        // although they should work to migrate away.
510
        // although they should work to migrate away.
511
        browser: {
511
        browser: {
512
                version: (/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/.exec(userAgent) || [0,'0'])[1],
512
                version: (/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/.exec(userAgent) || [0,'0'])[1],
513
                safari: /webkit/.test( userAgent ),
513
                safari: /webkit/.test( userAgent ),
514
                opera: /opera/.test( userAgent ),
514
                opera: /opera/.test( userAgent ),
515
                msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
515
                msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
516
                mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
516
                mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
517
        }
517
        }
518
});
518
});
519
519
-
 
520
if ( indexOf ) {
-
 
521
        jQuery.inArray = function( elem, array ) {
-
 
522
                return indexOf.call( array, elem );
-
 
523
        };
-
 
524
}
-
 
525
520
// All jQuery objects should point back to these
526
// All jQuery objects should point back to these
521
rootjQuery = jQuery(document);
527
rootjQuery = jQuery(document);
522
528
523
function evalScript( i, elem ) {
529
function evalScript( i, elem ) {
524
        if ( elem.src ) {
530
        if ( elem.src ) {
525
                jQuery.ajax({
531
                jQuery.ajax({
526
                        url: elem.src,
532
                        url: elem.src,
527
                        async: false,
533
                        async: false,
528
                        dataType: "script"
534
                        dataType: "script"
529
                });
535
                });
530
        } else {
536
        } else {
531
                jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
537
                jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
532
        }
538
        }
533
539
534
        if ( elem.parentNode ) {
540
        if ( elem.parentNode ) {
535
                elem.parentNode.removeChild( elem );
541
                elem.parentNode.removeChild( elem );
536
        }
542
        }
537
}
543
}
538
544
-
 
545
// Mutifunctional method to get and set values to a collection
-
 
546
// The value/s can be optionally by executed if its a function
-
 
547
function access( elems, key, value, exec, fn ) {
-
 
548
        var l = elems.length;
-
 
549
       
-
 
550
        // Setting many attributes
-
 
551
        if ( typeof key === "object" ) {
-
 
552
                        for (var k in key) {
-
 
553
                                access(elems, k, key[k], exec, fn);
-
 
554
                        }
-
 
555
                return elems;
-
 
556
        }
-
 
557
       
-
 
558
        // Setting one attribute
-
 
559
        if (value !== undefined) {
-
 
560
                // Optionally, function values get executed if exec is true
-
 
561
                exec = exec && jQuery.isFunction(value);
-
 
562
               
-
 
563
                for (var i = 0; i < l; i++) {
-
 
564
                        var elem = elems[i],
-
 
565
                                val = exec ? value.call(elem, i) : value;
-
 
566
                        fn(elem, key, val);
-
 
567
                }
-
 
568
                return elems;
-
 
569
        }
-
 
570
       
-
 
571
        // Getting an attribute
-
 
572
        return l ? fn(elems[0], key) : null;
-
 
573
}
-
 
574
539
function now() {
575
function now() {
540
        return (new Date).getTime();
576
        return (new Date).getTime();
541
}
577
}
542
var expando = "jQuery" + now(), uuid = 0, windowData = {};
578
var expando = "jQuery" + now(), uuid = 0, windowData = {};
-
 
579
var emptyObject = {};
543
580
544
jQuery.extend({
581
jQuery.extend({
545
        cache: {},
582
        cache: {},
546
583
       
-
 
584
        expando:expando,
-
 
585
547
        data: function( elem, name, data ) {
586
        data: function( elem, name, data ) {
548
                elem = elem == window ?
587
                elem = elem == window ?
549
                        windowData :
588
                        windowData :
550
                        elem;
589
                        elem;
551
590
552
                var id = elem[ expando ], cache = jQuery.cache;
591
                var id = elem[ expando ], cache = jQuery.cache, thisCache;
553
592
554
                // Compute a unique ID for the element
593
                // Handle the case where there's no name immediately
555
                if(!id) id = elem[ expando ] = ++uuid;
594
                if ( !name && !id ) {
-
 
595
                        return null;
-
 
596
                }
556
597
557
                // Only generate the data cache if we're
-
 
558
                // trying to access or manipulate it
598
                // Compute a unique ID for the element
559
                if ( name && !cache[ id ] )
599
                if ( !id ) {
560
                        cache[ id ] = {};
600
                        id = ++uuid;
-
 
601
                }
561
602
-
 
603
                // Avoid generating a new cache unless none exists and we
-
 
604
                // want to manipulate it.
-
 
605
                if ( cache[ id ] ) {
562
                var thisCache = cache[ id ];
606
                        thisCache = cache[ id ];
-
 
607
                } else if ( typeof data === "undefined" ) {
-
 
608
                        thisCache = emptyObject;
-
 
609
                } else {
-
 
610
                        thisCache = cache[ id ] = {};
-
 
611
                }
563
612
               
564
                // Prevent overriding the named cache with undefined values
613
                // Prevent overriding the named cache with undefined values
565
                if ( data !== undefined ) thisCache[ name ] = data;
614
                if ( data !== undefined ) {
-
 
615
                        elem[ expando ] = id;
-
 
616
                        thisCache[ name ] = data;
-
 
617
                }
566
618
               
567
                if(name === true) return thisCache
619
                return name ? thisCache[ name ] : thisCache;
568
                else if(name) return thisCache[name]
-
 
569
                else return id
-
 
570
        },
620
        },
571
621
572
        removeData: function( elem, name ) {
622
        removeData: function( elem, name ) {
573
                elem = elem == window ?
623
                elem = elem == window ?
574
                        windowData :
624
                        windowData :
575
                        elem;
625
                        elem;
576
626
577
                var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
627
                var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
578
628
579
                // If we want to remove a specific section of the element's data
629
                // If we want to remove a specific section of the element's data
580
                if ( name ) {
630
                if ( name ) {
581
                        if ( thisCache ) {
631
                        if ( thisCache ) {
582
                                // Remove the section of cache data
632
                                // Remove the section of cache data
583
                                delete thisCache[ name ];
633
                                delete thisCache[ name ];
584
634
585
                                // If we've removed all the data, remove the element's cache
635
                                // If we've removed all the data, remove the element's cache
586
                                if( jQuery.isEmptyObject(thisCache) )
636
                                if ( jQuery.isEmptyObject(thisCache) ) {
587
                                        jQuery.removeData( elem );
637
                                        jQuery.removeData( elem );
588
                        }
638
                                }
-
 
639
                        }
589
640
590
                // Otherwise, we want to remove all of the element's data
641
                // Otherwise, we want to remove all of the element's data
591
                } else {
642
                } else {
592
                        // Clean up the element expando
643
                        // Clean up the element expando
593
                        try {
644
                        try {
594
                                delete elem[ expando ];
645
                                delete elem[ expando ];
595
                        } catch(e){
646
                        } catch( e ) {
596
                                // IE has trouble directly removing the expando
647
                                // IE has trouble directly removing the expando
597
                                // but it's ok with using removeAttribute
648
                                // but it's ok with using removeAttribute
598
                                if ( elem.removeAttribute )
649
                                if ( elem.removeAttribute ) {
599
                                        elem.removeAttribute( expando );
650
                                        elem.removeAttribute( expando );
600
                        }
651
                                }
-
 
652
                        }
601
653
602
                        // Completely remove the data cache
654
                        // Completely remove the data cache
603
                        delete cache[ id ];
655
                        delete cache[ id ];
604
                }
656
                }
605
        },
657
        },
-
 
658
       
606
        queue: function( elem, type, data ) {
659
        queue: function( elem, type, data ) {
607
                if( !elem ) return;
660
                if( !elem ) return;
608
661
609
                type = (type || "fx") + "queue";
662
                type = (type || "fx") + "queue";
610
                var q = jQuery.data( elem, type );
663
                var q = jQuery.data( elem, type );
611
664
612
                // Speed up dequeue by getting out quickly if this is just a lookup
665
                // Speed up dequeue by getting out quickly if this is just a lookup
613
                if( !data ) return q || [];
666
                if( !data ) return q || [];
614
667
615
                if ( !q || jQuery.isArray(data) )
668
                if ( !q || jQuery.isArray(data) )
616
                        q = jQuery.data( elem, type, jQuery.makeArray(data) );
669
                        q = jQuery.data( elem, type, jQuery.makeArray(data) );
617
                else
670
                else
618
                        q.push( data );
671
                        q.push( data );
619
672
620
                return q;
673
                return q;
621
        },
674
        },
622
675
623
        dequeue: function( elem, type ){
676
        dequeue: function( elem, type ){
624
                type = type || "fx";
677
                type = type || "fx";
625
678
626
                var queue = jQuery.queue( elem, type ), fn = queue.shift();
679
                var queue = jQuery.queue( elem, type ), fn = queue.shift();
627
680
628
                // If the fx queue is dequeued, always remove the progress sentinel
681
                // If the fx queue is dequeued, always remove the progress sentinel
629
                if( fn === "inprogress" ) fn = queue.shift();
682
                if( fn === "inprogress" ) fn = queue.shift();
630
683
631
                if( fn ) {
684
                if( fn ) {
632
                        // Add a progress sentinel to prevent the fx queue from being
685
                        // Add a progress sentinel to prevent the fx queue from being
633
                        // automatically dequeued
686
                        // automatically dequeued
634
                        if( type == "fx" ) queue.unshift("inprogress");
687
                        if( type == "fx" ) queue.unshift("inprogress");
635
688
636
                        fn.call(elem, function() { jQuery.dequeue(elem, type); });
689
                        fn.call(elem, function() { jQuery.dequeue(elem, type); });
637
                }
690
                }
638
        }
691
        }
639
});
692
});
640
693
641
jQuery.fn.extend({
694
jQuery.fn.extend({
642
        data: function( key, value ){
695
        data: function( key, value ){
643
                if(typeof key === "undefined" && this.length) return jQuery.data(this[0], true);
696
                if ( typeof key === "undefined" && this.length ) {
-
 
697
                        return jQuery.data( this[0] );
-
 
698
                }
644
699
645
                var parts = key.split(".");
700
                var parts = key.split(".");
646
                parts[1] = parts[1] ? "." + parts[1] : "";
701
                parts[1] = parts[1] ? "." + parts[1] : "";
647
702
648
                if ( value === undefined ) {
703
                if ( value === undefined ) {
649
                        var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
704
                        var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
650
705
651
                        if ( data === undefined && this.length )
706
                        if ( data === undefined && this.length )
652
                                data = jQuery.data( this[0], key );
707
                                data = jQuery.data( this[0], key );
653
708
654
                        return data === undefined && parts[1] ?
709
                        return data === undefined && parts[1] ?
655
                                this.data( parts[0] ) :
710
                                this.data( parts[0] ) :
656
                                data;
711
                                data;
657
                } else
712
                } else
658
                        return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
713
                        return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
659
                                jQuery.data( this, key, value );
714
                                jQuery.data( this, key, value );
660
                        });
715
                        });
661
        },
716
        },
662
717
663
        removeData: function( key ){
718
        removeData: function( key ){
664
                return this.each(function(){
719
                return this.each(function(){
665
                        jQuery.removeData( this, key );
720
                        jQuery.removeData( this, key );
666
                });
721
                });
667
        },
722
        },
668
        queue: function(type, data){
723
        queue: function(type, data){
669
                if ( typeof type !== "string" ) {
724
                if ( typeof type !== "string" ) {
670
                        data = type;
725
                        data = type;
671
                        type = "fx";
726
                        type = "fx";
672
                }
727
                }
673
728
674
                if ( data === undefined )
729
                if ( data === undefined )
675
                        return jQuery.queue( this[0], type );
730
                        return jQuery.queue( this[0], type );
676
731
677
                return this.each(function(i, elem){
732
                return this.each(function(i, elem){
678
                        var queue = jQuery.queue( this, type, data );
733
                        var queue = jQuery.queue( this, type, data );
679
734
680
                        if( type == "fx" && queue[0] !== "inprogress" )
735
                        if( type == "fx" && queue[0] !== "inprogress" )
681
                                jQuery.dequeue( this, type )
736
                                jQuery.dequeue( this, type )
682
                });
737
                });
683
        },
738
        },
684
        dequeue: function(type){
739
        dequeue: function(type){
685
                return this.each(function(){
740
                return this.each(function(){
686
                        jQuery.dequeue( this, type );
741
                        jQuery.dequeue( this, type );
687
                });
742
                });
688
        },
743
        },
689
        clearQueue: function(type){
744
        clearQueue: function(type){
690
                return this.queue( type || "fx", [] );
745
                return this.queue( type || "fx", [] );
691
        }
746
        }
692
});/*!
747
});
-
 
748
/*
693
 * Sizzle CSS Selector Engine - v1.0
749
 * A number of helper functions used for managing events.
694
 *  Copyright 2009, The Dojo Foundation
-
 
695
 *  Released under the MIT, BSD, and GPL Licenses.
750
 * Many of the ideas behind this code originated from
696
 *  More information: http://sizzlejs.com/
751
 * Dean Edwards' addEvent library.
697
 */
752
 */
698
(function(){
753
jQuery.event = {
699
754
700
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,
755
        // Bind an event to an element
701
        done = 0,
756
        // Original by Dean Edwards
702
        toString = Object.prototype.toString,
757
        add: function( elem, types, handler, data ) {
-
 
758
                if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
703
        hasDuplicate = false;
759
                        return;
-
 
760
                }
704
761
705
var Sizzle = function(selector, context, results, seed) {
762
                // For whatever reason, IE has trouble passing the window object
706
        results = results || [];
763
                // around, causing it to be cloned in the process
707
        var origContext = context = context || document;
764
                if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
-
 
765
                        elem = window;
-
 
766
                }
708
767
709
        if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
768
                // Make sure that the function being executed has a unique ID
710
                return [];
769
                if ( !handler.guid ) {
-
 
770
                        handler.guid = this.guid++;
711
        }
771
                }
712
       
772
-
 
773
                // if data is passed, bind to handler
-
 
774
                if ( data !== undefined ) {
713
        if ( !selector || typeof selector !== "string" ) {
775
                        // Create temporary function pointer to original handler
714
                return results;
776
                        var fn = handler;
-
 
777
-
 
778
                        // Create unique handler function, wrapped around original handler
-
 
779
                        handler = this.proxy( fn );
-
 
780
-
 
781
                        // Store data in unique handler
-
 
782
                        handler.data = data;
715
        }
783
                }
716
784
-
 
785
                // Init the element's event structure
717
        var parts = [], m, set, checkSet, check, mode, extra, prune = true, contextXML = isXML(context);
786
                var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ),
-
 
787
                        handle = jQuery.data( elem, "handle" ) || jQuery.data( elem, "handle", function() {
-
 
788
                                // Handle the second event of a trigger and when
-
 
789
                                // an event is called after a page has unloaded
-
 
790
                                return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
-
 
791
                                        jQuery.event.handle.apply( arguments.callee.elem, arguments ) :
-
 
792
                                        undefined;
-
 
793
                        });
-
 
794
                // Add elem as a property of the handle function
-
 
795
                // This is to prevent a memory leak with non-native
-
 
796
                // event in IE.
-
 
797
                handle.elem = elem;
718
       
798
719
        // Reset the position of the chunker regexp (start from head)
799
                // Handle multiple events separated by a space
-
 
800
                // jQuery(...).bind("mouseover mouseout", fn);
-
 
801
                types = types.split( /\s+/ );
720
        chunker.lastIndex = 0;
802
                var type, i=0;
-
 
803
                while ( (type = types[ i++ ]) ) {
-
 
804
                        // Namespaced event handlers
-
 
805
                        var namespaces = type.split(".");
-
 
806
                        type = namespaces.shift();
-
 
807
                        handler.type = namespaces.slice(0).sort().join(".");
721
       
808
722
        while ( (m = chunker.exec(selector)) !== null ) {
809
                        // Get the current list of functions bound to this event
723
                parts.push( m[1] );
810
                        var handlers = events[ type ],
-
 
811
                                special = this.special[ type ] || {};
724
               
812
725
                if ( m[2] ) {
813
                        if ( special.add ) {
-
 
814
                                var modifiedHandler = special.add.call( elem, handler, data, namespaces );
-
 
815
                                if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) {
726
                        extra = RegExp.rightContext;
816
                                        modifiedHandler.guid = modifiedHandler.guid || handler.guid;
727
                        break;
817
                                        handler = modifiedHandler;
728
                }
818
                                }
729
        }
819
                        }
730
820
731
        if ( parts.length > 1 && origPOS.exec( selector ) ) {
-
 
732
                if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
-
 
733
                        set = posProcess( parts[0] + parts[1], context );
-
 
734
                } else {
-
 
735
                        set = Expr.relative[ parts[0] ] ?
821
                        // Init the event handler queue
736
                                [ context ] :
-
 
737
                                Sizzle( parts.shift(), context );
-
 
738
-
 
739
                        while ( parts.length ) {
822
                        if ( !handlers ) {
740
                                selector = parts.shift();
-
 
741
-
 
742
                                if ( Expr.relative[ selector ] )
823
                                handlers = events[ type ] = {};
743
                                        selector += parts.shift();
-
 
744
824
-
 
825
                                // Check for a special event handler
-
 
826
                                // Only use addEventListener/attachEvent if the special
-
 
827
                                // events handler returns false
-
 
828
                                if ( !special.setup || special.setup.call( elem, data, namespaces ) === false ) {
-
 
829
                                        // Bind the global event handler to the element
-
 
830
                                        if ( elem.addEventListener ) {
-
 
831
                                                elem.addEventListener( type, handle, false );
745
                                set = posProcess( selector, set );
832
                                        } else if ( elem.attachEvent ) {
-
 
833
                                                elem.attachEvent( "on" + type, handle );
746
                        }
834
                                        }
747
                }
835
                                }
748
        } else {
-
 
749
                // Take a shortcut and set the context if the root selector is an ID
-
 
750
                // (but not if it'll be faster if the inner selector is an ID)
-
 
751
                if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
-
 
752
                                Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
-
 
753
                        var ret = Sizzle.find( parts.shift(), context, contextXML );
-
 
754
                        context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
-
 
755
                }
836
                        }
756
837
757
                if ( context ) {
-
 
758
                        var ret = seed ?
-
 
759
                                { expr: parts.pop(), set: makeArray(seed) } :
838
                        // Add the function to the element's handler list
760
                                Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
-
 
761
                        set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
839
                        handlers[ handler.guid ] = handler;
762
840
763
                        if ( parts.length > 0 ) {
841
                        // Keep track of which events have been used, for global triggering
764
                                checkSet = makeArray(set);
842
                        this.global[ type ] = true;
765
                        } else {
-
 
766
                                prune = false;
-
 
767
                        }
843
                }
768
844
769
                        while ( parts.length ) {
845
                // Nullify elem to prevent memory leaks in IE
770
                                var cur = parts.pop(), pop = cur;
846
                elem = null;
-
 
847
        },
771
848
772
                                if ( !Expr.relative[ cur ] ) {
-
 
773
                                        cur = "";
849
        guid: 1,
774
                                } else {
850
        global: {},
775
                                        pop = parts.pop();
-
 
776
                                }
-
 
777
851
-
 
852
        // Detach an event or set of events from an element
778
                                if ( pop == null ) {
853
        remove: function( elem, types, handler ) {
-
 
854
                // don't do events on text and comment nodes
-
 
855
                if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
779
                                        pop = context;
856
                        return;
780
                                }
857
                }
781
858
-
 
859
                var events = jQuery.data( elem, "events" ), ret, type;
-
 
860
-
 
861
                if ( events ) {
-
 
862
                        // Unbind all events for the element
-
 
863
                        if ( types === undefined || (typeof types === "string" && types.charAt(0) === ".") ) {
-
 
864
                                for ( type in events ) {
782
                                Expr.relative[ cur ]( checkSet, pop, contextXML );
865
                                        this.remove( elem, type + (types || "") );
783
                        }
866
                                }
784
                } else {
867
                        } else {
-
 
868
                                // types is actually an event object here
-
 
869
                                if ( types.type ) {
785
                        checkSet = parts = [];
870
                                        handler = types.handler;
786
                }
871
                                        types = types.type;
787
        }
872
                                }
788
873
-
 
874
                                // Handle multiple events seperated by a space
-
 
875
                                // jQuery(...).unbind("mouseover mouseout", fn);
789
        if ( !checkSet ) {
876
                                types = types.split(/\s+/);
790
                checkSet = set;
877
                                var i = 0;
791
        }
-
 
-
 
878
                                while ( (type = types[ i++ ]) ) {
-
 
879
                                        // Namespaced event handlers
-
 
880
                                        var namespaces = type.split(".");
-
 
881
                                        type = namespaces.shift();
-
 
882
                                        var all = !namespaces.length,
-
 
883
                                                namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join(".*\\.") + "(\\.|$)"),
-
 
884
                                                special = this.special[ type ] || {};
792
885
793
        if ( !checkSet ) {
886
                                        if ( events[ type ] ) {
794
                throw "Syntax error, unrecognized expression: " + (cur || selector);
887
                                                // remove the given handler for the given type
795
        }
888
                                                if ( handler ) {
-
 
889
                                                        delete events[ type ][ handler.guid ];
796
890
797
        if ( toString.call(checkSet) === "[object Array]" ) {
-
 
798
                if ( !prune ) {
-
 
799
                        results.push.apply( results, checkSet );
891
                                                // remove all handlers for the given type
800
                } else if ( context && context.nodeType === 1 ) {
-
 
801
                        for ( var i = 0; checkSet[i] != null; i++ ) {
-
 
802
                                if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
-
 
803
                                        results.push( set[i] );
-
 
804
                                }
-
 
805
                        }
-
 
806
                } else {
892
                                                } else {
807
                        for ( var i = 0; checkSet[i] != null; i++ ) {
893
                                                        for ( var handle in events[ type ] ) {
-
 
894
                                                                // Handle the removal of namespaced events
808
                                if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
895
                                                                if ( all || namespace.test( events[ type ][ handle ].type ) ) {
809
                                        results.push( set[i] );
896
                                                                        delete events[ type ][ handle ];
810
                                }
897
                                                                }
811
                        }
898
                                                        }
812
                }
899
                                                }
813
        } else {
-
 
814
                makeArray( checkSet, results );
-
 
815
        }
-
 
816
900
817
        if ( extra ) {
901
                                                if ( special.remove ) {
818
                Sizzle( extra, origContext, results, seed );
902
                                                        special.remove.call( elem, namespaces );
819
                Sizzle.uniqueSort( results );
-
 
820
        }
903
                                                }
821
904
-
 
905
                                                // remove generic event handler if no more handlers exist
-
 
906
                                                for ( ret in events[ type ] ) {
822
        return results;
907
                                                        break;
823
};
908
                                                }
824
-
 
-
 
909
                                                if ( !ret ) {
-
 
910
                                                        if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
825
Sizzle.uniqueSort = function(results){
911
                                                                if ( elem.removeEventListener ) {
-
 
912
                                                                        elem.removeEventListener( type, jQuery.data( elem, "handle" ), false );
826
        if ( sortOrder ) {
913
                                                                } else if ( elem.detachEvent ) {
-
 
914
                                                                        elem.detachEvent( "on" + type, jQuery.data( elem, "handle" ) );
-
 
915
                                                                }
-
 
916
                                                        }
827
                hasDuplicate = false;
917
                                                        ret = null;
828
                results.sort(sortOrder);
918
                                                        delete events[ type ];
-
 
919
                                                }
-
 
920
                                        }
-
 
921
                                }
-
 
922
                        }
829
923
830
                if ( hasDuplicate ) {
-
 
831
                        for ( var i = 1; i < results.length; i++ ) {
924
                        // Remove the expando if it's no longer used
832
                                if ( results[i] === results[i-1] ) {
925
                        for ( ret in events ) {
833
                                        results.splice(i--, 1);
926
                                break;
834
                                }
927
                        }
-
 
928
                        if ( !ret ) {
-
 
929
                                var handle = jQuery.data( elem, "handle" );
-
 
930
                                if ( handle ) {
-
 
931
                                        handle.elem = null;
835
                        }
932
                                }
-
 
933
                                jQuery.removeData( elem, "events" );
-
 
934
                                jQuery.removeData( elem, "handle" );
836
                }
935
                        }
837
        }
936
                }
838
};
937
        },
839
938
-
 
939
        // bubbling is internal
-
 
940
        trigger: function( event, data, elem /*, bubbling */ ) {
-
 
941
                // Event object or event type
840
Sizzle.matches = function(expr, set){
942
                var type = event.type || event,
841
        return Sizzle(expr, null, null, set);
943
                        bubbling = arguments[3];
842
};
-
 
843
944
-
 
945
                if ( !bubbling ) {
844
Sizzle.find = function(expr, context, isXML){
946
                        event = typeof event === "object" ?
-
 
947
                                // jQuery.Event object
-
 
948
                                event[expando] ? event :
845
        var set, match;
949
                                // Object literal
-
 
950
                                jQuery.extend( jQuery.Event(type), event ) :
-
 
951
                                // Just the event type (string)
-
 
952
                                jQuery.Event(type);
846
953
847
        if ( !expr ) {
954
                        if ( type.indexOf("!") >= 0 ) {
-
 
955
                                event.type = type = type.slice(0, -1);
848
                return [];
956
                                event.exclusive = true;
849
        }
957
                        }
850
958
851
        for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
959
                        // Handle a global trigger
852
                var type = Expr.order[i], match;
960
                        if ( !elem ) {
853
               
-
 
854
                if ( (match = Expr.match[ type ].exec( expr )) ) {
961
                                // Don't bubble custom events when global (to avoid too much overhead)
855
                        var left = RegExp.leftContext;
962
                                event.stopPropagation();
856
-
 
857
                        if ( left.substr( left.length - 1 ) !== "\\" ) {
963
                                // Only trigger if we've ever bound an event for it
858
                                match[1] = (match[1] || "").replace(/\\/g, "");
964
                                if ( this.global[ type ] ) {
859
                                set = Expr.find[ type ]( match, context, isXML );
965
                                        jQuery.each( jQuery.cache, function() {
860
                                if ( set != null ) {
966
                                                if ( this.events && this.events[type] ) {
861
                                        expr = expr.replace( Expr.match[ type ], "" );
967
                                                        jQuery.event.trigger( event, data, this.handle.elem );
862
                                        break;
-
 
863
                                }
968
                                                }
-
 
969
                                        });
864
                        }
970
                                }
865
                }
971
                        }
-
 
972
-
 
973
                        // Handle triggering a single element
-
 
974
-
 
975
                        // don't do events on text and comment nodes
-
 
976
                        if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
-
 
977
                                return undefined;
866
        }
978
                        }
867
979
-
 
980
                        // Clean up in case it is reused
-
 
981
                        event.result = undefined;
868
        if ( !set ) {
982
                        event.target = elem;
-
 
983
869
                set = context.getElementsByTagName("*");
984
                        // Clone the incoming data, if any
-
 
985
                        data = jQuery.makeArray( data );
-
 
986
                        data.unshift( event );
870
        }
987
                }
871
988
872
        return {set: set, expr: expr};
989
                event.currentTarget = elem;
873
};
-
 
874
990
875
Sizzle.filter = function(expr, set, inplace, not){
991
                // Trigger the event, it is assumed that "handle" is a function
876
        var old = expr, result = [], curLoop = set, match, anyFound,
992
                var handle = jQuery.data( elem, "handle" );
-
 
993
                if ( handle ) {
877
                isXMLFilter = set && set[0] && isXML(set[0]);
994
                        handle.apply( elem, data );
-
 
995
                }
878
996
879
        while ( expr && set.length ) {
997
                var nativeFn, nativeHandler;
-
 
998
                try {
880
                for ( var type in Expr.filter ) {
999
                        nativeFn = elem[ type ];
881
                        if ( (match = Expr.match[ type ].exec( expr )) != null ) {
1000
                        nativeHandler = elem[ "on" + type ];
882
                                var filter = Expr.filter[ type ], found, item;
1001
                // prevent IE from throwing an error for some elements with some event types, see #3533
-
 
1002
                } catch (e) {}
-
 
1003
                // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
-
 
1004
                if ( (!nativeFn || (jQuery.nodeName(elem, 'a') && type === "click")) && nativeHandler && nativeHandler.apply( elem, data ) === false ) {
883
                                anyFound = false;
1005
                        event.result = false;
-
 
1006
                }
884
1007
-
 
1008
                // Trigger the native events (except for clicks on links)
-
 
1009
                if ( !bubbling && nativeFn && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type === "click") ) {
885
                                if ( curLoop == result ) {
1010
                        this.triggered = true;
-
 
1011
                        try {
886
                                        result = [];
1012
                                nativeFn();
-
 
1013
                        // prevent IE from throwing an error for some hidden elements
-
 
1014
                        } catch (e) {}
887
                                }
1015
                }
888
1016
889
                                if ( Expr.preFilter[ type ] ) {
1017
                this.triggered = false;
890
                                        match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
-
 
891
1018
892
                                        if ( !match ) {
1019
                if ( !event.isPropagationStopped() ) {
893
                                                anyFound = found = true;
1020
                        var parent = elem.parentNode || elem.ownerDocument;
894
                                        } else if ( match === true ) {
1021
                        if ( parent ) {
895
                                                continue;
1022
                                jQuery.event.trigger( event, data, parent, true );
896
                                        }
1023
                        }
897
                                }
1024
                }
-
 
1025
        },
898
1026
899
                                if ( match ) {
-
 
900
                                        for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
-
 
901
                                                if ( item ) {
1027
        handle: function( event ) {
902
                                                        found = filter( item, match, i, curLoop );
1028
                // returned undefined or false
903
                                                        var pass = not ^ !!found;
1029
                var all, handlers;
904
1030
-
 
1031
                event = arguments[0] = jQuery.event.fix( event || window.event );
-
 
1032
                event.currentTarget = this;
-
 
1033
-
 
1034
                // Namespaced event handlers
-
 
1035
                var namespaces = event.type.split(".");
-
 
1036
                event.type = namespaces.shift();
-
 
1037
-
 
1038
                // Cache this now, all = true means, any handler
-
 
1039
                all = !namespaces.length && !event.exclusive;
-
 
1040
-
 
1041
                var namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join(".*\\.") + "(\\.|$)");
-
 
1042
-
 
1043
                handlers = ( jQuery.data(this, "events") || {} )[ event.type ];
-
 
1044
905
                                                        if ( inplace && found != null ) {
1045
                for ( var j in handlers ) {
-
 
1046
                        var handler = handlers[ j ];
-
 
1047
-
 
1048
                        // Filter the functions by class
-
 
1049
                        if ( all || namespace.test(handler.type) ) {
-
 
1050
                                // Pass in a reference to the handler function itself
-
 
1051
                                // So that we can later remove it
-
 
1052
                                event.handler = handler;
-
 
1053
                                event.data = handler.data;
-
 
1054
-
 
1055
                                var ret = handler.apply( this, arguments );
-
 
1056
906
                                                                if ( pass ) {
1057
                                if ( ret !== undefined ) {
907
                                                                        anyFound = true;
1058
                                        event.result = ret;
908
                                                                } else {
1059
                                        if ( ret === false ) {
909
                                                                        curLoop[i] = false;
1060
                                                event.preventDefault();
-
 
1061
                                                event.stopPropagation();
910
                                                                }
1062
                                        }
911
                                                        } else if ( pass ) {
-
 
912
                                                                result.push( item );
-
 
913
                                                                anyFound = true;
-
 
914
                                                        }
1063
                                }
-
 
1064
-
 
1065
                                if ( event.isImmediatePropagationStopped() ) {
-
 
1066
                                        break;
915
                                                }
1067
                                }
-
 
1068
916
                                        }
1069
                        }
917
                                }
1070
                }
-
 
1071
        },
918
1072
919
                                if ( found !== undefined ) {
1073
        props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
-
 
1074
920
                                        if ( !inplace ) {
1075
        fix: function( event ) {
-
 
1076
                if ( event[ expando ] ) {
921
                                                curLoop = result;
1077
                        return event;
922
                                        }
1078
                }
923
1079
-
 
1080
                // store a copy of the original event object
-
 
1081
                // and "clone" to set read-only properties
-
 
1082
                var originalEvent = event;
924
                                        expr = expr.replace( Expr.match[ type ], "" );
1083
                event = jQuery.Event( originalEvent );
925
1084
-
 
1085
                for ( var i = this.props.length, prop; i; ) {
926
                                        if ( !anyFound ) {
1086
                        prop = this.props[ --i ];
927
                                                return [];
1087
                        event[ prop ] = originalEvent[ prop ];
928
                                        }
1088
                }
929
1089
-
 
1090
                // Fix target property, if necessary
930
                                        break;
1091
                if ( !event.target ) {
-
 
1092
                        event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
931
                                }
1093
                }
-
 
1094
-
 
1095
                // check if target is a textnode (safari)
-
 
1096
                if ( event.target.nodeType === 3 ) {
-
 
1097
                        event.target = event.target.parentNode;
932
                        }
1098
                }
-
 
1099
-
 
1100
                // Add relatedTarget, if necessary
-
 
1101
                if ( !event.relatedTarget && event.fromElement ) {
-
 
1102
                        event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
933
                }
1103
                }
934
1104
935
                // Improper expression
1105
                // Calculate pageX/Y if missing and clientX/Y available
936
                if ( expr == old ) {
1106
                if ( event.pageX == null && event.clientX != null ) {
937
                        if ( anyFound == null ) {
1107
                        var doc = document.documentElement, body = document.body;
938
                                throw "Syntax error, unrecognized expression: " + expr;
1108
                        event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
939
                        } else {
-
 
940
                                break;
-
 
-
 
1109
                        event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
941
                        }
1110
                }
-
 
1111
-
 
1112
                // Add which for key events
-
 
1113
                if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
-
 
1114
                        event.which = event.charCode || event.keyCode;
942
                }
1115
                }
943
1116
-
 
1117
                // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
-
 
1118
                if ( !event.metaKey && event.ctrlKey ) {
944
                old = expr;
1119
                        event.metaKey = event.ctrlKey;
945
        }
1120
                }
946
1121
-
 
1122
                // Add which for click: 1 == left; 2 == middle; 3 == right
947
        return curLoop;
1123
                // Note: button is not normalized, so don't use it
-
 
1124
                if ( !event.which && event.button !== undefined ) {
-
 
1125
                        event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
948
};
1126
                }
949
1127
950
var Expr = Sizzle.selectors = {
-
 
951
        order: [ "ID", "NAME", "TAG" ],
-
 
952
        match: {
-
 
953
                ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
-
 
954
                CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
-
 
955
                NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,
-
 
956
                ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
-
 
957
                TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,
-
 
958
                CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
-
 
959
                POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
-
 
960
                PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
-
 
961
        },
-
 
962
        attrMap: {
1128
                return event;
963
                "class": "className",
-
 
964
                "for": "htmlFor"
-
 
965
        },
1129
        },
-
 
1130
966
        attrHandle: {
1131
        proxy: function( fn, proxy, thisObject ) {
-
 
1132
                if ( proxy !== undefined && !jQuery.isFunction( proxy ) ) {
967
                href: function(elem){
1133
                        thisObject = proxy;
968
                        return elem.getAttribute("href");
1134
                        proxy = undefined;
969
                }
1135
                }
-
 
1136
                // FIXME: Should proxy be redefined to be applied with thisObject if defined?
-
 
1137
                proxy = proxy || function() { return fn.apply( thisObject !== undefined ? thisObject : this, arguments ); };
-
 
1138
                // Set the guid of unique handler to the same of original handler, so it can be removed
-
 
1139
                proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
-
 
1140
                // So proxy can be declared as an argument
-
 
1141
                return proxy;
970
        },
1142
        },
971
        relative: {
-
 
972
                "+": function(checkSet, part, isXML){
-
 
973
                        var isPartStr = typeof part === "string",
-
 
974
                                isTag = isPartStr && !/\W/.test(part),
-
 
975
                                isPartStrNotTag = isPartStr && !isTag;
-
 
976
1143
-
 
1144
        special: {
-
 
1145
                ready: {
-
 
1146
                        // Make sure the ready event is setup
977
                        if ( isTag && !isXML ) {
1147
                        setup: bindReady,
978
                                part = part.toUpperCase();
1148
                        teardown: function() {}
979
                        }
1149
                },
980
1150
-
 
1151
                live: {
981
                        for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
1152
                        add: function( proxy, data, namespaces ) {
982
                                if ( (elem = checkSet[i]) ) {
1153
                                jQuery.extend( proxy, data || {} );
-
 
1154
                                proxy.guid += data.selector + data.live;
983
                                        while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
1155
                                jQuery.event.add( this, data.live, liveHandler, data );
-
 
1156
                        },
984
1157
985
                                        checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?
1158
                        remove: function( namespaces ) {
986
                                                elem || false :
1159
                                if ( namespaces.length ) {
987
                                                elem === part;
1160
                                        var remove = 0, name = new RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
988
                                }
-
 
989
                        }
-
 
990
1161
-
 
1162
                                        jQuery.each( (jQuery.data(this, "events").live || {}), function() {
991
                        if ( isPartStrNotTag ) {
1163
                                                if ( name.test(this.type) ) {
992
                                Sizzle.filter( part, checkSet, true );
1164
                                                        remove++;
993
                        }
1165
                                                }
994
                },
1166
                                        });
995
                ">": function(checkSet, part, isXML){
-
 
996
                        var isPartStr = typeof part === "string";
-
 
997
-
 
998
                        if ( isPartStr && !/\W/.test(part) ) {
-
 
999
                                part = isXML ? part : part.toUpperCase();
-
 
1000
1167
1001
                                for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-
 
1002
                                        var elem = checkSet[i];
-
 
1003
                                        if ( elem ) {
1168
                                        if ( remove < 1 ) {
1004
                                                var parent = elem.parentNode;
-
 
1005
                                                checkSet[i] = parent.nodeName === part ? parent : false;
1169
                                                jQuery.event.remove( this, namespaces[0], liveHandler );
1006
                                        }
1170
                                        }
1007
                                }
1171
                                }
1008
                        } else {
-
 
1009
                                for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-
 
1010
                                        var elem = checkSet[i];
-
 
1011
                                        if ( elem ) {
-
 
1012
                                                checkSet[i] = isPartStr ?
-
 
1013
                                                        elem.parentNode :
-
 
1014
                                                        elem.parentNode === part;
-
 
1015
                                        }
1172
                        }
1016
                                }
1173
                }
1017
-
 
1018
                                if ( isPartStr ) {
-
 
1019
                                        Sizzle.filter( part, checkSet, true );
-
 
1020
                                }
1174
        }
-
 
1175
};
-
 
1176
-
 
1177
jQuery.Event = function( src ){
-
 
1178
        // Allow instantiation without the 'new' keyword
-
 
1179
        if ( !this.preventDefault ) {
-
 
1180
                return new jQuery.Event( src );
1021
                        }
1181
        }
1022
                },
-
 
1023
                "": function(checkSet, part, isXML){
-
 
1024
                        var doneName = done++, checkFn = dirCheck;
-
 
1025
1182
-
 
1183
        // Event object
1026
                        if ( !/\W/.test(part) ) {
1184
        if ( src && src.type ) {
1027
                                var nodeCheck = part = isXML ? part : part.toUpperCase();
1185
                this.originalEvent = src;
1028
                                checkFn = dirNodeCheck;
1186
                this.type = src.type;
-
 
1187
        // Event type
-
 
1188
        } else {
-
 
1189
                this.type = src;
1029
                        }
1190
        }
1030
1191
1031
                        checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
1192
        // timeStamp is buggy for some events on Firefox(#3843)
1032
                },
-
 
1033
                "~": function(checkSet, part, isXML){
1193
        // So we won't rely on the native value
1034
                        var doneName = done++, checkFn = dirCheck;
1194
        this.timeStamp = now();
1035
1195
1036
                        if ( typeof part === "string" && !/\W/.test(part) ) {
1196
        // Mark it as fixed
1037
                                var nodeCheck = part = isXML ? part : part.toUpperCase();
-
 
1038
                                checkFn = dirNodeCheck;
1197
        this[ expando ] = true;
1039
                        }
1198
};
1040
1199
1041
                        checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
1200
function returnFalse() {
-
 
1201
        return false;
1042
                }
1202
}
1043
        },
-
 
1044
        find: {
-
 
1045
                ID: function(match, context, isXML){
1203
function returnTrue() {
1046
                        if ( typeof context.getElementById !== "undefined" && !isXML ) {
-
 
1047
                                var m = context.getElementById(match[1]);
-
 
1048
                                return m ? [m] : [];
1204
        return true;
1049
                        }
1205
}
1050
                },
-
 
1051
                NAME: function(match, context, isXML){
-
 
1052
                        if ( typeof context.getElementsByName !== "undefined" ) {
-
 
1053
                                var ret = [], results = context.getElementsByName(match[1]);
-
 
1054
1206
1055
                                for ( var i = 0, l = results.length; i < l; i++ ) {
1207
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-
 
1208
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-
 
1209
jQuery.Event.prototype = {
-
 
1210
        preventDefault: function() {
1056
                                        if ( results[i].getAttribute("name") === match[1] ) {
1211
                this.isDefaultPrevented = returnTrue;
-
 
1212
1057
                                                ret.push( results[i] );
1213
                var e = this.originalEvent;
-
 
1214
                if ( !e ) {
1058
                                        }
1215
                        return;
1059
                                }
1216
                }
1060
1217
               
-
 
1218
                // if preventDefault exists run it on the original event
1061
                                return ret.length === 0 ? null : ret;
1219
                if ( e.preventDefault ) {
-
 
1220
                        e.preventDefault();
1062
                        }
1221
                }
-
 
1222
                // otherwise set the returnValue property of the original event to false (IE)
-
 
1223
                e.returnValue = false;
1063
                },
1224
        },
1064
                TAG: function(match, context){
1225
        stopPropagation: function() {
1065
                        return context.getElementsByTagName(match[1]);
1226
                this.isPropagationStopped = returnTrue;
-
 
1227
-
 
1228
                var e = this.originalEvent;
-
 
1229
                if ( !e ) {
-
 
1230
                        return;
-
 
1231
                }
-
 
1232
                // if stopPropagation exists run it on the original event
-
 
1233
                if ( e.stopPropagation ) {
-
 
1234
                        e.stopPropagation();
1066
                }
1235
                }
-
 
1236
                // otherwise set the cancelBubble property of the original event to true (IE)
-
 
1237
                e.cancelBubble = true;
1067
        },
1238
        },
1068
        preFilter: {
1239
        stopImmediatePropagation: function(){
1069
                CLASS: function(match, curLoop, inplace, result, not, isXML){
1240
                this.isImmediatePropagationStopped = returnTrue;
-
 
1241
                this.stopPropagation();
-
 
1242
        },
-
 
1243
        isDefaultPrevented: returnFalse,
-
 
1244
        isPropagationStopped: returnFalse,
1070
                        match = " " + match[1].replace(/\\/g, "") + " ";
1245
        isImmediatePropagationStopped: returnFalse
1071
1246
};
-
 
1247
// Checks if an event happened on an element within another element
-
 
1248
// Used in jQuery.event.special.mouseenter and mouseleave handlers
-
 
1249
var withinElement = function( event ) {
-
 
1250
        // Check if mouse(over|out) are still within the same parent element
-
 
1251
        var parent = event.relatedTarget;
1072
                        if ( isXML ) {
1252
        // Traverse up the tree
-
 
1253
        while ( parent && parent != this ) {
-
 
1254
                // Firefox sometimes assigns relatedTarget a XUL element
-
 
1255
                // which we cannot access the parentNode property of
-
 
1256
                try { parent = parent.parentNode; }
-
 
1257
                // assuming we've left the element since we most likely mousedover a xul element
1073
                                return match;
1258
                catch(e) { break; }
1074
                        }
1259
        }
1075
1260
1076
                        for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
-
 
1077
                                if ( elem ) {
1261
        if ( parent != this ) {
1078
                                        if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {
-
 
1079
                                                if ( !inplace )
1262
                // set the correct event type
1080
                                                        result.push( elem );
1263
                event.type = event.data;
1081
                                        } else if ( inplace ) {
1264
                // handle event if we actually just moused on to a non sub-element
1082
                                                curLoop[i] = false;
1265
                jQuery.event.handle.apply( this, arguments );
1083
                                        }
1266
        }
-
 
1267
};
-
 
1268
-
 
1269
// Create mouseenter and mouseleave events
-
 
1270
jQuery.each({
-
 
1271
        mouseover: "mouseenter",
-
 
1272
        mouseout: "mouseleave"
-
 
1273
}, function( orig, fix ) {
-
 
1274
        jQuery.event.special[ fix ] = {
-
 
1275
                setup: function(){
-
 
1276
                        jQuery.event.add( this, orig, withinElement, fix );
-
 
1277
                },
-
 
1278
                teardown: function(){
-
 
1279
                        jQuery.event.remove( this, orig, withinElement );
1084
                                }
1280
                }
-
 
1281
        };
-
 
1282
});
-
 
1283
-
 
1284
(function() {
-
 
1285
       
-
 
1286
        var event = jQuery.event,
-
 
1287
                special = event.special,
-
 
1288
                handle  = event.handle;
-
 
1289
-
 
1290
        special.submit = {
-
 
1291
                setup: function(data, namespaces) {
-
 
1292
                        if(data.selector) {
-
 
1293
                                event.add(this, 'click.specialSubmit', function(e, eventData) {
-
 
1294
                                        if(jQuery(e.target).filter(":submit, :image").closest(data.selector).length) {
-
 
1295
                                                e.type = "submit";
-
 
1296
                                                return handle.call( this, e, eventData );
1085
                        }
1297
                                        }
-
 
1298
                                });
1086
1299
                               
-
 
1300
                                event.add(this, 'keypress.specialSubmit', function( e, eventData ) {
-
 
1301
                                        if(jQuery(e.target).filter(":text, :password").closest(data.selector).length) {
-
 
1302
                                                e.type = "submit";
-
 
1303
                                                return handle.call( this, e, eventData );
-
 
1304
                                        }
-
 
1305
                                });
-
 
1306
                        } else {
1087
                        return false;
1307
                                return false;
-
 
1308
                        }
1088
                },
1309
                },
1089
                ID: function(match){
-
 
1090
                        return match[1].replace(/\\/g, "");
-
 
1091
                },
-
 
1092
                TAG: function(match, curLoop){
-
 
1093
                        for ( var i = 0; curLoop[i] === false; i++ ){}
-
 
1094
                        return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
-
 
1095
                },
-
 
1096
                CHILD: function(match){
-
 
1097
                        if ( match[1] == "nth" ) {
-
 
1098
                                // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
-
 
1099
                                var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
-
 
1100
                                        match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
-
 
1101
                                        !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
-
 
1102
1310
               
1103
                                // calculate the numbers (first)n+(last) including if they are negative
1311
                remove: function(namespaces) {
1104
                                match[2] = (test[1] + (test[2] || 1)) - 0;
1312
                        event.remove(this, 'click.specialSubmit');
1105
                                match[3] = test[3] - 0;
1313
                        event.remove(this, 'keypress.specialSubmit');
1106
                        }
1314
                }
-
 
1315
        };
1107
1316
       
1108
                        // TODO: Move to normal caching system
-
 
1109
                        match[0] = done++;
1317
})();
1110
1318
-
 
1319
// Create "bubbling" focus and blur events
1111
                        return match;
1320
jQuery.each({
1112
                },
1321
        focus: "focusin",
-
 
1322
        blur: "focusout"
1113
                ATTR: function(match, curLoop, inplace, result, not, isXML){
1323
}, function( orig, fix ){
1114
                        var name = match[1].replace(/\\/g, "");
1324
        var event = jQuery.event,
1115
                       
-
 
1116
                        if ( !isXML && Expr.attrMap[name] ) {
1325
                special = event.special,
1117
                                match[1] = Expr.attrMap[name];
1326
                handle = event.handle;
1118
                        }
-
 
1119
1327
       
-
 
1328
        function ieHandler() {
1120
                        if ( match[2] === "~=" ) {
1329
                arguments[0].type = orig;
1121
                                match[4] = " " + match[4] + " ";
1330
                return handle.apply(this, arguments);
1122
                        }
1331
        }
1123
1332
-
 
1333
        special[orig] = {
1124
                        return match;
1334
                setup:function() {
-
 
1335
                        if ( this.addEventListener )
-
 
1336
                                this.addEventListener( orig, handle, true );
-
 
1337
                        else
-
 
1338
                                jQuery.event.add( this, fix, ieHandler );
1125
                },
1339
                },
1126
                PSEUDO: function(match, curLoop, inplace, result, not){
1340
                teardown:function() {
1127
                        if ( match[1] === "not" ) {
1341
                        if ( this.removeEventListener )
1128
                                // If we're dealing with a complex expression, or a simple one
-
 
1129
                                if ( chunker.exec(match[3]).length > 1 || /^\w/.test(match[3]) ) {
-
 
1130
                                        match[3] = Sizzle(match[3], null, null, curLoop);
1342
                                this.removeEventListener( orig, handle, true );
1131
                                } else {
1343
                        else
1132
                                        var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
-
 
1133
                                        if ( !inplace ) {
-
 
1134
                                                result.push.apply( result, ret );
1344
                                jQuery.event.remove( this, fix, ieHandler );
1135
                                        }
1345
                }
-
 
1346
        };
-
 
1347
});
-
 
1348
-
 
1349
jQuery.fn.extend({
-
 
1350
        // TODO: make bind(), unbind() and one() DRY!
-
 
1351
        bind: function( type, data, fn, thisObject ) {
-
 
1352
                // Handle object literals
-
 
1353
                if ( typeof type === "object" ) {
1136
                                        return false;
1354
                        for ( var key in type ) {
-
 
1355
                                this.bind(key, data, type[key], fn);
1137
                                }
1356
                        }
1138
                        } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
-
 
1139
                                return true;
1357
                        return this;
1140
                        }
1358
                }
1141
                       
1359
               
1142
                        return match;
1360
                if ( jQuery.isFunction( data ) ) {
1143
                },
-
 
1144
                POS: function(match){
1361
                        thisObject = fn;
1145
                        match.unshift( true );
1362
                        fn = data;
1146
                        return match;
1363
                        data = undefined;
1147
                }
1364
                }
-
 
1365
                fn = thisObject === undefined ? fn : jQuery.event.proxy( fn, thisObject );
-
 
1366
                return type === "unload" ? this.one(type, data, fn, thisObject) : this.each(function() {
-
 
1367
                        jQuery.event.add( this, type, fn, data );
-
 
1368
                });
1148
        },
1369
        },
1149
        filters: {
-
 
1150
                enabled: function(elem){
-
 
1151
                        return elem.disabled === false && elem.type !== "hidden";
-
 
1152
                },
-
 
1153
                disabled: function(elem){
-
 
1154
                        return elem.disabled === true;
-
 
1155
                },
1370
1156
                checked: function(elem){
-
 
1157
                        return elem.checked === true;
-
 
1158
                },
-
 
1159
                selected: function(elem){
-
 
1160
                        // Accessing this property makes selected-by-default
-
 
1161
                        // options in Safari work properly
-
 
1162
                        elem.parentNode.selectedIndex;
-
 
1163
                        return elem.selected === true;
-
 
1164
                },
-
 
1165
                parent: function(elem){
-
 
1166
                        return !!elem.firstChild;
-
 
1167
                },
-
 
1168
                empty: function(elem){
-
 
1169
                        return !elem.firstChild;
-
 
1170
                },
-
 
1171
                has: function(elem, i, match){
1371
        one: function( type, data, fn, thisObject ) {
1172
                        return !!Sizzle( match[3], elem ).length;
-
 
1173
                },
-
 
1174
                header: function(elem){
1372
                // Handle object literals
1175
                        return /h\d/i.test( elem.nodeName );
-
 
1176
                },
-
 
1177
                text: function(elem){
-
 
1178
                        return "text" === elem.type;
-
 
1179
                },
-
 
1180
                radio: function(elem){
-
 
1181
                        return "radio" === elem.type;
-
 
1182
                },
-
 
1183
                checkbox: function(elem){
-
 
1184
                        return "checkbox" === elem.type;
-
 
1185
                },
-
 
1186
                file: function(elem){
-
 
1187
                        return "file" === elem.type;
1373
                if ( typeof type === "object" ) {
1188
                },
-
 
1189
                password: function(elem){
-
 
1190
                        return "password" === elem.type;
-
 
1191
                },
-
 
1192
                submit: function(elem){
-
 
1193
                        return "submit" === elem.type;
-
 
1194
                },
-
 
1195
                image: function(elem){
-
 
1196
                        return "image" === elem.type;
1374
                        for ( var key in type ) {
1197
                },
-
 
1198
                reset: function(elem){
-
 
1199
                        return "reset" === elem.type;
1375
                                this.one(key, data, type[key], fn);
1200
                },
-
 
1201
                button: function(elem){
-
 
1202
                        return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
-
 
1203
                },
-
 
1204
                input: function(elem){
-
 
1205
                        return /input|select|textarea|button/i.test(elem.nodeName);
-
 
1206
                }
1376
                        }
-
 
1377
                        return this;
-
 
1378
                }
-
 
1379
               
-
 
1380
                if ( jQuery.isFunction( data ) ) {
-
 
1381
                        thisObject = fn;
-
 
1382
                        fn = data;
-
 
1383
                        data = undefined;
-
 
1384
                }
-
 
1385
                fn = thisObject === undefined ? fn : jQuery.event.proxy( fn, thisObject );
-
 
1386
                var one = jQuery.event.proxy( fn, function( event ) {
-
 
1387
                        jQuery( this ).unbind( event, one );
-
 
1388
                        return fn.apply( this, arguments );
-
 
1389
                });
-
 
1390
                return this.each(function() {
-
 
1391
                        jQuery.event.add( this, type, one, data );
-
 
1392
                });
1207
        },
1393
        },
1208
        setFilters: {
1394
1209
                first: function(elem, i){
1395
        unbind: function( type, fn ) {
1210
                        return i === 0;
1396
                // Handle object literals
1211
                },
-
 
1212
                last: function(elem, i, match, array){
1397
                if ( typeof type === "object" && !type.preventDefault ) {
1213
                        return i === array.length - 1;
1398
                        for ( var key in type ) {
1214
                },
-
 
1215
                even: function(elem, i){
1399
                                this.unbind(key, type[key]);
1216
                        return i % 2 === 0;
-
 
1217
                },
1400
                        }
1218
                odd: function(elem, i){
-
 
1219
                        return i % 2 === 1;
1401
                        return this;
1220
                },
1402
                }
-
 
1403
               
1221
                lt: function(elem, i, match){
1404
                return this.each(function() {
1222
                        return i < match[3] - 0;
1405
                        jQuery.event.remove( this, type, fn );
1223
                },
1406
                });
1224
                gt: function(elem, i, match){
-
 
1225
                        return i > match[3] - 0;
-
 
1226
                },
1407
        },
-
 
1408
1227
                nth: function(elem, i, match){
1409
        trigger: function( type, data ) {
1228
                        return match[3] - 0 == i;
1410
                return this.each(function() {
-
 
1411
                        jQuery.event.trigger( type, data, this );
-
 
1412
                });
1229
                },
1413
        },
-
 
1414
1230
                eq: function(elem, i, match){
1415
        triggerHandler: function( type, data ) {
-
 
1416
                if ( this[0] ) {
-
 
1417
                        var event = jQuery.Event( type );
-
 
1418
                        event.preventDefault();
-
 
1419
                        event.stopPropagation();
-
 
1420
                        jQuery.event.trigger( event, data, this[0] );
1231
                        return match[3] - 0 == i;
1421
                        return event.result;
1232
                }
1422
                }
1233
        },
1423
        },
1234
        filter: {
-
 
1235
                PSEUDO: function(elem, match, i, array){
-
 
1236
                        var name = match[1], filter = Expr.filters[ name ];
-
 
1237
1424
1238
                        if ( filter ) {
1425
        toggle: function( fn ) {
1239
                                return filter( elem, i, match, array );
-
 
1240
                        } else if ( name === "contains" ) {
1426
                // Save reference to arguments for access in closure
1241
                                return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
-
 
1242
                        } else if ( name === "not" ) {
-
 
1243
                                var not = match[3];
1427
                var args = arguments, i = 1;
1244
1428
1245
                                for ( i = 0, l = not.length; i < l; i++ ) {
1429
                // link all the functions, so any of them can unbind this click handler
1246
                                        if ( not[i] === elem ) {
1430
                while( i < args.length ) {
1247
                                                return false;
1431
                        jQuery.event.proxy( fn, args[ i++ ] );
1248
                                        }
-
 
1249
                                }
1432
                }
1250
1433
-
 
1434
                return this.click( jQuery.event.proxy( fn, function( event ) {
-
 
1435
                        // Figure out which function to execute
-
 
1436
                        this.lastToggle = ( this.lastToggle || 0 ) % i;
-
 
1437
-
 
1438
                        // Make sure that clicks stop
1251
                                return true;
1439
                        event.preventDefault();
-
 
1440
-
 
1441
                        // and execute the function
-
 
1442
                        return args[ this.lastToggle++ ].apply( this, arguments ) || false;
1252
                        }
1443
                }));
1253
                },
1444
        },
1254
                CHILD: function(elem, match){
-
 
1255
                        var type = match[1], node = elem;
-
 
1256
                        switch (type) {
-
 
1257
                                case 'only':
-
 
1258
                                case 'first':
-
 
1259
                                        while ( (node = node.previousSibling) )  {
-
 
1260
                                                if ( node.nodeType === 1 ) return false;
-
 
1261
                                        }
-
 
1262
                                        if ( type == 'first') return true;
-
 
1263
                                        node = elem;
-
 
1264
                                case 'last':
-
 
1265
                                        while ( (node = node.nextSibling) )  {
-
 
1266
                                                if ( node.nodeType === 1 ) return false;
-
 
1267
                                        }
-
 
1268
                                        return true;
-
 
1269
                                case 'nth':
-
 
1270
                                        var first = match[2], last = match[3];
-
 
1271
1445
1272
                                        if ( first == 1 && last == 0 ) {
1446
        hover: function( fnOver, fnOut ) {
1273
                                                return true;
1447
                return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
1274
                                        }
1448
        },
1275
                                       
1449
1276
                                        var doneName = match[0],
1450
        ready: function( fn ) {
1277
                                                parent = elem.parentNode;
1451
                // Attach the listeners
-
 
1452
                bindReady();
1278
       
1453
1279
                                        if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
-
 
1280
                                                var count = 0;
1454
                // If the DOM is already ready
1281
                                                for ( node = parent.firstChild; node; node = node.nextSibling ) {
-
 
1282
                                                        if ( node.nodeType === 1 ) {
1455
                if ( jQuery.isReady ) {
1283
                                                                node.nodeIndex = ++count;
1456
                        // Execute the function immediately
1284
                                                        }
-
 
1285
                                                }
-
 
1286
                                                parent.sizcache = doneName;
1457
                        fn.call( document, jQuery );
1287
                                        }
-
 
1288
                                       
1458
1289
                                        var diff = elem.nodeIndex - last;
1459
                // Otherwise, remember the function for later
1290
                                        if ( first == 0 ) {
-
 
1291
                                                return diff == 0;
-
 
1292
                                        } else {
1460
                } else {
1293
                                                return ( diff % first == 0 && diff / first >= 0 );
1461
                        // Add the function to the wait list
1294
                                        }
1462
                        jQuery.readyList.push( fn );
1295
                        }
1463
                }
-
 
1464
-
 
1465
                return this;
1296
                },
1466
        },
1297
                ID: function(elem, match){
-
 
1298
                        return elem.nodeType === 1 && elem.getAttribute("id") === match;
-
 
1299
                },
-
 
1300
                TAG: function(elem, match){
-
 
1301
                        return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
-
 
1302
                },
-
 
1303
                CLASS: function(elem, match){
-
 
1304
                        return (" " + (elem.className || elem.getAttribute("class")) + " ")
-
 
1305
                                .indexOf( match ) > -1;
-
 
1306
                },
-
 
1307
                ATTR: function(elem, match){
-
 
1308
                        var name = match[1],
-
 
1309
                                result = Expr.attrHandle[ name ] ?
-
 
1310
                                        Expr.attrHandle[ name ]( elem ) :
-
 
1311
                                        elem[ name ] != null ?
-
 
1312
                                                elem[ name ] :
-
 
1313
                                                elem.getAttribute( name ),
-
 
1314
                                value = result + "",
-
 
1315
                                type = match[2],
-
 
1316
                                check = match[4];
-
 
1317
-
 
1318
                        return result == null ?
-
 
1319
                                type === "!=" :
-
 
1320
                                type === "=" ?
-
 
1321
                                value === check :
-
 
1322
                                type === "*=" ?
-
 
1323
                                value.indexOf(check) >= 0 :
-
 
1324
                                type === "~=" ?
-
 
1325
                                (" " + value + " ").indexOf(check) >= 0 :
-
 
1326
                                !check ?
-
 
1327
                                value && result !== false :
-
 
1328
                                type === "!=" ?
-
 
1329
                                value != check :
-
 
1330
                                type === "^=" ?
-
 
1331
                                value.indexOf(check) === 0 :
-
 
1332
                                type === "$=" ?
-
 
1333
                                value.substr(value.length - check.length) === check :
-
 
1334
                                type === "|=" ?
-
 
1335
                                value === check || value.substr(0, check.length + 1) === check + "-" :
-
 
1336
                                false;
-
 
1337
                },
-
 
1338
                POS: function(elem, match, i, array){
-
 
1339
                        var name = match[2], filter = Expr.setFilters[ name ];
-
 
1340
1467
-
 
1468
        live: function( type, data, fn, thisObject ) {
-
 
1469
                if ( jQuery.isFunction( data ) ) {
1341
                        if ( filter ) {
1470
                        if ( fn !== undefined ) {
1342
                                return filter( elem, i, match, array );
1471
                                thisObject = fn;
1343
                        }
1472
                        }
-
 
1473
                        fn = data;
-
 
1474
                        data = undefined;
1344
                }
1475
                }
-
 
1476
                jQuery( this.context ).bind( liveConvert( type, this.selector ), {
-
 
1477
                        data: data, selector: this.selector, live: type
-
 
1478
                }, fn, thisObject );
-
 
1479
                return this;
-
 
1480
        },
-
 
1481
-
 
1482
        die: function( type, fn ) {
-
 
1483
                jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null );
-
 
1484
                return this;
1345
        }
1485
        }
1346
};
1486
});
1347
1487
-
 
1488
function liveHandler( event ) {
1348
var origPOS = Expr.match.POS;
1489
        var stop = true, elems = [], args = arguments;
1349
1490
-
 
1491
        jQuery.each( jQuery.data( this, "events" ).live || [], function( i, fn ) {
1350
for ( var type in Expr.match ) {
1492
                if ( fn.live === event.type ) {
1351
        Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
1493
                        var elem = jQuery( event.target ).closest( fn.selector )[0];
-
 
1494
                        if ( elem ) {
-
 
1495
                                elems.push({ elem: elem, fn: fn });
1352
}
1496
                        }
-
 
1497
                }
-
 
1498
        });
1353
1499
1354
var makeArray = function(array, results) {
1500
        elems.sort(function( a, b ) {
1355
        array = Array.prototype.slice.call( array, 0 );
1501
                return jQuery.data( a.elem, "closest" ) - jQuery.data( b.elem, "closest" );
-
 
1502
        });
1356
1503
1357
        if ( results ) {
1504
        jQuery.each(elems, function() {
-
 
1505
                event.currentTarget = this.elem;
-
 
1506
                event.data = this.fn.data;
1358
                results.push.apply( results, array );
1507
                if ( this.fn.apply( this.elem, args ) === false ) {
1359
                return results;
1508
                        return (stop = false);
1360
        }
1509
                }
-
 
1510
        });
1361
       
1511
1362
        return array;
1512
        return stop;
1363
};
1513
}
1364
1514
1365
// Perform a simple check to determine if the browser is capable of
1515
function liveConvert( type, selector ) {
1366
// converting a NodeList to an array using builtin methods.
1516
        return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join(".");
1367
try {
1517
}
1368
        Array.prototype.slice.call( document.documentElement.childNodes, 0 );
-
 
1369
1518
-
 
1519
jQuery.extend({
-
 
1520
        isReady: false,
-
 
1521
        readyList: [],
1370
// Provide a fallback method if it does not work
1522
        // Handle when the DOM is ready
1371
} catch(e){
1523
        ready: function() {
1372
        makeArray = function(array, results) {
1524
                // Make sure that the DOM is not already loaded
-
 
1525
                if ( !jQuery.isReady ) {
-
 
1526
                        // Remember that the DOM is ready
1373
                var ret = results || [];
1527
                        jQuery.isReady = true;
1374
1528
1375
                if ( toString.call(array) === "[object Array]" ) {
1529
                        // If there are functions bound, to execute
1376
                        Array.prototype.push.apply( ret, array );
1530
                        if ( jQuery.readyList ) {
1377
                } else {
1531
                                // Execute all of them
1378
                        if ( typeof array.length === "number" ) {
1532
                                var fn, i = 0;
1379
                                for ( var i = 0, l = array.length; i < l; i++ ) {
1533
                                while ( (fn = jQuery.readyList[ i++ ]) ) {
1380
                                        ret.push( array[i] );
1534
                                        fn.call( document, jQuery );
1381
                                }
1535
                                }
1382
                        } else {
1536
1383
                                for ( var i = 0; array[i]; i++ ) {
1537
                                // Reset the list of functions
1384
                                        ret.push( array[i] );
1538
                                jQuery.readyList = null;
1385
                                }
1539
                        }
-
 
1540
-
 
1541
                        // Trigger any bound ready events
-
 
1542
                        jQuery( document ).triggerHandler( "ready" );
1386
                        }
1543
                }
1387
                }
1544
        }
-
 
1545
});
1388
1546
1389
                return ret;
1547
var readyBound = false;
1390
        };
-
 
1391
}
-
 
1392
1548
-
 
1549
function bindReady() {
-
 
1550
        if ( readyBound ) return;
1393
var sortOrder;
1551
        readyBound = true;
1394
1552
1395
if ( document.documentElement.compareDocumentPosition ) {
-
 
1396
        sortOrder = function( a, b ) {
-
 
1397
                var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
1553
        // Catch cases where $(document).ready() is called after the
1398
                if ( ret === 0 ) {
-
 
1399
                        hasDuplicate = true;
-
 
1400
                }
-
 
1401
                return ret;
-
 
1402
        };
-
 
1403
} else if ( "sourceIndex" in document.documentElement ) {
-
 
1404
        sortOrder = function( a, b ) {
-
 
1405
                var ret = a.sourceIndex - b.sourceIndex;
1554
        // browser event has already occurred.
1406
                if ( ret === 0 ) {
-
 
1407
                        hasDuplicate = true;
-
 
1408
                }
-
 
1409
                return ret;
-
 
1410
        };
-
 
1411
} else if ( document.createRange ) {
1555
        if ( document.readyState === "complete" ) {
1412
        sortOrder = function( a, b ) {
-
 
1413
                var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
-
 
1414
                aRange.selectNode(a);
-
 
1415
                aRange.collapse(true);
-
 
1416
                bRange.selectNode(b);
-
 
1417
                bRange.collapse(true);
-
 
1418
                var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
-
 
1419
                if ( ret === 0 ) {
-
 
1420
                        hasDuplicate = true;
-
 
1421
                }
-
 
1422
                return ret;
1556
                return jQuery.ready();
1423
        };
-
 
1424
}
1557
        }
1425
1558
1426
// Check to see if the browser returns elements by name when
1559
        // Mozilla, Opera and webkit nightlies currently support this event
1427
// querying by getElementById (and provide a workaround)
1560
        if ( document.addEventListener ) {
1428
(function(){
1561
                // Use the handy event callback
1429
        // We're going to inject a fake input element with a specified name
1562
                document.addEventListener( "DOMContentLoaded", function() {
1430
        var form = document.createElement("div"),
1563
                        document.removeEventListener( "DOMContentLoaded", arguments.callee, false );
1431
                id = "script" + (new Date).getTime();
1564
                        jQuery.ready();
1432
        form.innerHTML = "<a name='" + id + "'/>";
1565
                }, false );
1433
1566
1434
        // Inject it into the root element, check its status, and remove it quickly
1567
        // If IE event model is used
1435
        var root = document.documentElement;
1568
        } else if ( document.attachEvent ) {
1436
        root.insertBefore( form, root.firstChild );
1569
                // ensure firing before onload,
-
 
1570
                // maybe late but safe also for iframes
-
 
1571
                document.attachEvent("onreadystatechange", function() {
-
 
1572
                        if ( document.readyState === "complete" ) {
-
 
1573
                                document.detachEvent( "onreadystatechange", arguments.callee );
-
 
1574
                                jQuery.ready();
-
 
1575
                        }
-
 
1576
                });
1437
1577
1438
        // The workaround has to do additional checks after a getElementById
1578
                // If IE and not an iframe
1439
        // Which slows things down for other browsers (hence the branching)
1579
                // continually check to see if the document is ready
1440
        if ( !!document.getElementById( id ) ) {
1580
                // NOTE: DO NOT CHANGE TO ===, FAILS IN IE.
1441
                Expr.find.ID = function(match, context, isXML){
1581
                if ( document.documentElement.doScroll && window == window.top ) (function() {
1442
                        if ( typeof context.getElementById !== "undefined" && !isXML ) {
1582
                        if ( jQuery.isReady ) {
1443
                                var m = context.getElementById(match[1]);
1583
                                return;
1444
                                return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
-
 
1445
                        }
1584
                        }
1446
                };
-
 
1447
1585
-
 
1586
                        try {
1448
                Expr.filter.ID = function(elem, match){
1587
                                // If IE is used, use the trick by Diego Perini
1449
                        var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
1588
                                // http://javascript.nwbox.com/IEContentLoaded/
1450
                        return elem.nodeType === 1 && node && node.nodeValue === match;
1589
                                document.documentElement.doScroll("left");
-
 
1590
                        } catch( error ) {
-
 
1591
                                setTimeout( arguments.callee, 0 );
1451
                };
1592
                                return;
1452
        }
1593
                        }
1453
1594
1454
        root.removeChild( form );
1595
                        // and execute any waiting functions
1455
        root = form = null; // release memory in IE
1596
                        jQuery.ready();
1456
})();
1597
                })();
1457
-
 
1458
(function(){
-
 
1459
        // Check to see if the browser returns only elements
-
 
1460
        // when doing getElementsByTagName("*")
-
 
1461
-
 
1462
        // Create a fake element
-
 
1463
        var div = document.createElement("div");
-
 
1464
        div.appendChild( document.createComment("") );
-
 
1465
-
 
1466
        // Make sure no comments are found
-
 
1467
        if ( div.getElementsByTagName("*").length > 0 ) {
-
 
1468
                Expr.find.TAG = function(match, context){
-
 
1469
                        var results = context.getElementsByTagName(match[1]);
-
 
1470
-
 
1471
                        // Filter out possible comments
-
 
1472
                        if ( match[1] === "*" ) {
-
 
1473
                                var tmp = [];
-
 
1474
-
 
1475
                                for ( var i = 0; results[i]; i++ ) {
-
 
1476
                                        if ( results[i].nodeType === 1 ) {
-
 
1477
                                                tmp.push( results[i] );
-
 
1478
                                        }
-
 
1479
                                }
1598
        }
1480
1599
-
 
1600
        // A fallback to window.onload, that will always work
1481
                                results = tmp;
1601
        jQuery.event.add( window, "load", jQuery.ready );
1482
                        }
1602
}
1483
1603
-
 
1604
jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
-
 
1605
        "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," +
-
 
1606
        "change,select,submit,keydown,keypress,keyup,error").split(","), function( i, name ) {
-
 
1607
1484
                        return results;
1608
        // Handle event binding
-
 
1609
        jQuery.fn[ name ] = function( fn ) {
-
 
1610
                return fn ? this.bind( name, fn ) : this.trigger( name );
1485
                };
1611
        };
1486
        }
1612
});
1487
1613
-
 
1614
// Prevent memory leaks in IE
1488
        // Check to see if an attribute returns normalized href attributes
1615
// Window isn't included so as not to unbind existing unload events
-
 
1616
// More info:
1489
        div.innerHTML = "<a href='#'></a>";
1617
//  - http://isaacschlueter.com/2006/10/msie-memory-leaks/
-
 
1618
/*@cc_on
1490
        if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
1619
jQuery( window ).bind( 'unload', function() {
1491
                        div.firstChild.getAttribute("href") !== "#" ) {
1620
        for ( var id in jQuery.cache ) {
-
 
1621
                // Skip the window
1492
                Expr.attrHandle.href = function(elem){
1622
                if ( id != 1 && jQuery.cache[ id ].handle ) {
1493
                        return elem.getAttribute("href", 2);
1623
                        jQuery.event.remove( jQuery.cache[ id ].handle.elem );
1494
                };
-
 
1495
        }
1624
                }
-
 
1625
        }
-
 
1626
});
-
 
1627
@*/
-
 
1628
(function(){
1496
1629
1497
        div = null; // release memory in IE
1630
        jQuery.support = {};
1498
})();
-
 
1499
1631
-
 
1632
        var root = document.documentElement,
1500
if ( document.querySelectorAll ) (function(){
1633
                script = document.createElement("script"),
1501
        var oldSizzle = Sizzle, div = document.createElement("div");
1634
                div = document.createElement("div"),
1502
        div.innerHTML = "<p class='TEST'></p>";
1635
                id = "script" + (new Date).getTime();
1503
1636
1504
        // Safari can't handle uppercase or unicode characters when
-
 
1505
        // in quirks mode.
1637
        div.style.display = "none";
1506
        if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
1638
        div.innerHTML = '   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select>';
1507
                return;
-
 
1508
        }
-
 
1509
       
1639
1510
        Sizzle = function(query, context, extra, seed){
1640
        var all = div.getElementsByTagName("*"),
1511
                context = context || document;
1641
                a = div.getElementsByTagName("a")[0];
1512
1642
1513
                // Only use querySelectorAll on non-XML documents
-
 
1514
                // (ID selectors don't work in non-HTML documents)
1643
        // Can't get basic test support
1515
                if ( !seed && context.nodeType === 9 && !isXML(context) ) {
1644
        if ( !all || !all.length || !a ) {
1516
                        try {
1645
                return;
1517
                                return makeArray( context.querySelectorAll(query), extra );
-
 
1518
                        } catch(e){}
-
 
1519
                }
1646
        }
1520
               
1647
-
 
1648
        jQuery.support = {
1521
                return oldSizzle(query, context, extra, seed);
1649
                // IE strips leading whitespace when .innerHTML is used
1522
        };
-
 
-
 
1650
                leadingWhitespace: div.firstChild.nodeType == 3,
1523
1651
-
 
1652
                // Make sure that tbody elements aren't automatically inserted
1524
        for ( var prop in oldSizzle ) {
1653
                // IE will insert them into empty tables
1525
                Sizzle[ prop ] = oldSizzle[ prop ];
1654
                tbody: !div.getElementsByTagName("tbody").length,
1526
        }
-
 
1527
1655
-
 
1656
                // Make sure that link elements get serialized correctly by innerHTML
1528
        div = null; // release memory in IE
1657
                // This requires a wrapper element in IE
1529
})();
-
 
-
 
1658
                htmlSerialize: !!div.getElementsByTagName("link").length,
1530
1659
1531
if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
1660
                // Get the style information from getAttribute
1532
        var div = document.createElement("div");
1661
                // (IE uses .cssText insted)
1533
        div.innerHTML = "<div class='test e'></div><div class='test'></div>";
1662
                style: /red/.test( a.getAttribute("style") ),
1534
1663
1535
        // Opera can't find a second classname (in 9.6)
1664
                // Make sure that URLs aren't manipulated
1536
        if ( div.getElementsByClassName("e").length === 0 )
1665
                // (IE normalizes it by default)
1537
                return;
1666
                hrefNormalized: a.getAttribute("href") === "/a",
1538
1667
1539
        // Safari caches class attributes, doesn't catch changes (in 3.2)
1668
                // Make sure that element opacity exists
-
 
1669
                // (IE uses filter instead)
1540
        div.lastChild.className = "e";
1670
                opacity: a.style.opacity === "0.5",
1541
1671
-
 
1672
                // Verify style float existence
1542
        if ( div.getElementsByClassName("e").length === 1 )
1673
                // (IE uses styleFloat instead of cssFloat)
1543
                return;
1674
                cssFloat: !!a.style.cssFloat,
1544
1675
1545
        Expr.order.splice(1, 0, "CLASS");
1676
                // Will be defined later
1546
        Expr.find.CLASS = function(match, context, isXML) {
1677
                scriptEval: false,
1547
                if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
-
 
1548
                        return context.getElementsByClassName(match[1]);
1678
                noCloneEvent: true,
1549
                }
1679
                boxModel: null
1550
        };
1680
        };
1551
1681
1552
        div = null; // release memory in IE
1682
        script.type = "text/javascript";
1553
})();
1683
        try {
-
 
1684
                script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
-
 
1685
        } catch(e){}
1554
1686
1555
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-
 
1556
        var sibDir = dir == "previousSibling" && !isXML;
1687
        root.insertBefore( script, root.firstChild );
1557
        for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-
 
1558
                var elem = checkSet[i];
-
 
1559
                if ( elem ) {
-
 
1560
                        if ( sibDir && elem.nodeType === 1 ){
-
 
1561
                                elem.sizcache = doneName;
-
 
1562
                                elem.sizset = i;
-
 
1563
                        }
-
 
1564
                        elem = elem[dir];
-
 
1565
                        var match = false;
-
 
1566
1688
-
 
1689
        // Make sure that the execution of code works by injecting a script
1567
                        while ( elem ) {
1690
        // tag with appendChild/createTextNode
-
 
1691
        // (IE doesn't support this, fails, and uses .text instead)
1568
                                if ( elem.sizcache === doneName ) {
1692
        if ( window[ id ] ) {
1569
                                        match = checkSet[elem.sizset];
1693
                jQuery.support.scriptEval = true;
1570
                                        break;
1694
                delete window[ id ];
1571
                                }
1695
        }
1572
1696
1573
                                if ( elem.nodeType === 1 && !isXML ){
-
 
1574
                                        elem.sizcache = doneName;
-
 
1575
                                        elem.sizset = i;
1697
        root.removeChild( script );
1576
                                }
-
 
1577
1698
-
 
1699
        if ( div.attachEvent && div.fireEvent ) {
-
 
1700
                div.attachEvent("onclick", function click(){
1578
                                if ( elem.nodeName === cur ) {
1701
                        // Cloning a node shouldn't copy over any
-
 
1702
                        // bound event handlers (IE does this)
-
 
1703
                        jQuery.support.noCloneEvent = false;
1579
                                        match = elem;
1704
                        div.detachEvent("onclick", click);
1580
                                        break;
1705
                });
-
 
1706
                div.cloneNode(true).fireEvent("onclick");
1581
                                }
1707
        }
1582
1708
-
 
1709
        // Figure out if the W3C box model works as expected
1583
                                elem = elem[dir];
1710
        // document.body must exist before we can do this
1584
                        }
1711
        jQuery(function(){
-
 
1712
                var div = document.createElement("div");
-
 
1713
                div.style.width = div.style.paddingLeft = "1px";
1585
1714
1586
                        checkSet[i] = match;
1715
                document.body.appendChild( div );
-
 
1716
                jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
-
 
1717
                document.body.removeChild( div ).style.display = 'none';
1587
                }
1718
                div = null;
1588
        }
1719
        });
1589
}
-
 
1590
1720
1591
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-
 
1592
        var sibDir = dir == "previousSibling" && !isXML;
-
 
1593
        for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-
 
1594
                var elem = checkSet[i];
1721
        // release memory in IE
1595
                if ( elem ) {
-
 
1596
                        if ( sibDir && elem.nodeType === 1 ) {
1722
        root = script = div = all = a = null;
1597
                                elem.sizcache = doneName;
-
 
1598
                                elem.sizset = i;
-
 
1599
                        }
1723
})();
1600
                        elem = elem[dir];
-
 
1601
                        var match = false;
-
 
1602
1724
1603
                        while ( elem ) {
1725
jQuery.props = {
-
 
1726
        "for": "htmlFor",
1604
                                if ( elem.sizcache === doneName ) {
1727
        "class": "className",
-
 
1728
        readonly: "readOnly",
-
 
1729
        maxlength: "maxLength",
1605
                                        match = checkSet[elem.sizset];
1730
        cellspacing: "cellSpacing",
1606
                                        break;
1731
        rowspan: "rowSpan",
-
 
1732
        colspan: "colSpan",
-
 
1733
        tabindex: "tabIndex"
-
 
1734
};
-
 
1735
/*!
-
 
1736
 * Sizzle CSS Selector Engine - v1.0
-
 
1737
 *  Copyright 2009, The Dojo Foundation
-
 
1738
 *  Released under the MIT, BSD, and GPL Licenses.
-
 
1739
 *  More information: http://sizzlejs.com/
1607
                                }
1740
 */
-
 
1741
(function(){
1608
1742
1609
                                if ( elem.nodeType === 1 ) {
1743
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,
1610
                                        if ( !isXML ) {
-
 
1611
                                                elem.sizcache = doneName;
-
 
1612
                                                elem.sizset = i;
-
 
1613
                                        }
1744
        done = 0,
1614
                                        if ( typeof cur !== "string" ) {
1745
        toString = Object.prototype.toString,
1615
                                                if ( elem === cur ) {
-
 
1616
                                                        match = true;
1746
        hasDuplicate = false;
1617
                                                        break;
-
 
1618
                                                }
-
 
1619
1747
1620
                                        } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
1748
var Sizzle = function(selector, context, results, seed) {
1621
                                                match = elem;
1749
        results = results || [];
1622
                                                break;
1750
        var origContext = context = context || document;
1623
                                        }
-
 
1624
                                }
-
 
1625
1751
-
 
1752
        if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
1626
                                elem = elem[dir];
1753
                return [];
1627
                        }
1754
        }
1628
1755
       
1629
                        checkSet[i] = match;
1756
        if ( !selector || typeof selector !== "string" ) {
1630
                }
1757
                return results;
1631
        }
-
 
1632
}
1758
        }
1633
1759
1634
var contains = document.compareDocumentPosition ?  function(a, b){
1760
        var parts = [], m, set, checkSet, check, mode, extra, prune = true, contextXML = isXML(context);
1635
        return a.compareDocumentPosition(b) & 16;
-
 
1636
} : function(a, b){
-
 
1637
        return a !== b && (a.contains ? a.contains(b) : true);
-
 
1638
};
-
 
1639
1761
       
1640
var isXML = function(elem){
-
 
1641
        return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
1762
        // Reset the position of the chunker regexp (start from head)
1642
                !!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";
1763
        chunker.lastIndex = 0;
1643
};
-
 
1644
1764
       
1645
var posProcess = function(selector, context){
1765
        while ( (m = chunker.exec(selector)) !== null ) {
1646
        var tmpSet = [], later = "", match,
1766
                parts.push( m[1] );
1647
                root = context.nodeType ? [context] : context;
-
 
1648
1767
               
1649
        // Position selectors must be done after the filter
1768
                if ( m[2] ) {
1650
        // And so must :not(positional) so we move all PSEUDOs to the end
-
 
1651
        while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
1769
                        extra = RegExp.rightContext;
1652
                later += match[0];
1770
                        break;
1653
                selector = selector.replace( Expr.match.PSEUDO, "" );
-
 
1654
        }
1771
                }
1655
-
 
1656
        selector = Expr.relative[selector] ? selector + "*" : selector;
-
 
1657
-
 
1658
        for ( var i = 0, l = root.length; i < l; i++ ) {
-
 
1659
                Sizzle( selector, root[i], tmpSet );
-
 
1660
        }
1772
        }
1661
1773
1662
        return Sizzle.filter( later, tmpSet );
-
 
1663
};
-
 
1664
-
 
1665
// EXPOSE
-
 
1666
jQuery.find = Sizzle;
-
 
1667
jQuery.expr = Sizzle.selectors;
-
 
1668
jQuery.expr[":"] = jQuery.expr.filters;
-
 
1669
-
 
1670
Sizzle.selectors.filters.hidden = function(elem){
1774
        if ( parts.length > 1 && origPOS.exec( selector ) ) {
1671
        var width = elem.offsetWidth, height = elem.offsetHeight,
-
 
1672
                 force = /^tr$/i.test( elem.nodeName ); // ticket #4512
1775
                if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
1673
        return ( width === 0 && height === 0 && !force ) ?
1776
                        set = posProcess( parts[0] + parts[1], context );
1674
                true :
1777
                } else {
1675
                        ( width !== 0 && height !== 0 && !force ) ?
1778
                        set = Expr.relative[ parts[0] ] ?
1676
                                false :
1779
                                [ context ] :
1677
                                        !!( jQuery.curCSS(elem, "display") === "none" );
1780
                                Sizzle( parts.shift(), context );
1678
};
-
 
1679
1781
1680
Sizzle.selectors.filters.visible = function(elem){
1782
                        while ( parts.length ) {
1681
        return !Sizzle.selectors.filters.hidden(elem);
1783
                                selector = parts.shift();
1682
};
-
 
1683
1784
1684
Sizzle.selectors.filters.animated = function(elem){
-
 
1685
        return jQuery.grep(jQuery.timers, function(fn){
1785
                                if ( Expr.relative[ selector ] )
1686
                return elem === fn.elem;
1786
                                        selector += parts.shift();
1687
        }).length;
-
 
1688
};
-
 
1689
1787
1690
jQuery.filter = jQuery.multiFilter = function( expr, elems, not ) {
-
 
1691
        if ( not ) {
-
 
1692
                expr = ":not(" + expr + ")";
1788
                                set = posProcess( selector, set );
1693
        }
1789
                        }
1694
-
 
1695
        return Sizzle.matches(expr, elems);
-
 
1696
};
-
 
1697
-
 
1698
jQuery.dir = function( elem, dir ){
-
 
1699
        var matched = [], cur = elem[dir];
-
 
1700
        while ( cur && cur != document ) {
-
 
1701
                if ( cur.nodeType == 1 )
-
 
1702
                        matched.push( cur );
-
 
1703
                cur = cur[dir];
-
 
1704
        }
1790
                }
1705
        return matched;
1791
        } else {
1706
};
-
 
1707
-
 
1708
jQuery.nth = function(cur, result, dir, elem){
1792
                // Take a shortcut and set the context if the root selector is an ID
1709
        result = result || 1;
-
 
1710
        var num = 0;
-
 
1711
-
 
1712
        for ( ; cur; cur = cur[dir] )
1793
                // (but not if it'll be faster if the inner selector is an ID)
1713
                if ( cur.nodeType == 1 && ++num == result )
1794
                if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
1714
                        break;
-
 
1715
-
 
1716
        return cur;
-
 
1717
};
-
 
1718
-
 
1719
jQuery.sibling = function(n, elem){
1795
                                Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
1720
        var r = [];
-
 
1721
-
 
1722
        for ( ; n; n = n.nextSibling ) {
1796
                        var ret = Sizzle.find( parts.shift(), context, contextXML );
1723
                if ( n.nodeType == 1 && n != elem )
1797
                        context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
1724
                        r.push( n );
-
 
1725
        }
1798
                }
1726
1799
1727
        return r;
1800
                if ( context ) {
1728
};
1801
                        var ret = seed ?
-
 
1802
                                { expr: parts.pop(), set: makeArray(seed) } :
-
 
1803
                                Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
-
 
1804
                        set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
1729
1805
-
 
1806
                        if ( parts.length > 0 ) {
-
 
1807
                                checkSet = makeArray(set);
1730
return;
1808
                        } else {
-
 
1809
                                prune = false;
-
 
1810
                        }
1731
1811
1732
window.Sizzle = Sizzle;
1812
                        while ( parts.length ) {
-
 
1813
                                var cur = parts.pop(), pop = cur;
1733
1814
1734
})();
-
 
1735
jQuery.winnow = function( elements, qualifier, keep ) {
-
 
1736
        if(jQuery.isFunction( qualifier )) {
1815
                                if ( !Expr.relative[ cur ] ) {
1737
                return jQuery.grep(elements, function(elem, i) {
-
 
1738
                        return !!qualifier.call( elem, i ) === keep;
1816
                                        cur = "";
1739
                });
1817
                                } else {
1740
        } else if( qualifier.nodeType ) {
1818
                                        pop = parts.pop();
1741
                return jQuery.grep(elements, function(elem, i) {
-
 
1742
                        return (elem === qualifier) === keep;
-
 
1743
                })
1819
                                }
1744
        } else if( typeof qualifier === "string" ) {
-
 
1745
                var filtered = jQuery.grep(elements, function(elem) { return elem.nodeType === 1 });
-
 
1746
1820
1747
                if(isSimple.test( qualifier )) return jQuery.multiFilter(qualifier, filtered, !keep);
1821
                                if ( pop == null ) {
1748
                else qualifier = jQuery.multiFilter( qualifier, elements );
1822
                                        pop = context;
1749
        }
1823
                                }
1750
1824
1751
        return jQuery.grep(elements, function(elem, i) {
1825
                                Expr.relative[ cur ]( checkSet, pop, contextXML );
-
 
1826
                        }
-
 
1827
                } else {
1752
                return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
1828
                        checkSet = parts = [];
1753
        });
1829
                }
1754
}
1830
        }
1755
1831
1756
jQuery.fn.extend({
1832
        if ( !checkSet ) {
1757
        find: function( selector ) {
1833
                checkSet = set;
1758
                var ret = this.pushStack( "", "find", selector ), length = 0;
-
 
-
 
1834
        }
1759
1835
1760
                for ( var i = 0, l = this.length; i < l; i++ ) {
-
 
1761
                        length = ret.length;
1836
        if ( !checkSet ) {
1762
                        jQuery.find( selector, this[i], ret );
1837
                throw "Syntax error, unrecognized expression: " + (cur || selector);
-
 
1838
        }
1763
1839
-
 
1840
        if ( toString.call(checkSet) === "[object Array]" ) {
1764
                        if ( i > 0 ) {
1841
                if ( !prune ) {
1765
                                // Make sure that the results are unique
1842
                        results.push.apply( results, checkSet );
1766
                                for ( var n = length; n < ret.length; n++ ) {
1843
                } else if ( context && context.nodeType === 1 ) {
1767
                                        for ( var r = 0; r < length; r++ ) {
1844
                        for ( var i = 0; checkSet[i] != null; i++ ) {
1768
                                                if ( ret[r] === ret[n] ) {
1845
                                if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
1769
                                                        ret.splice(n--, 1);
1846
                                        results.push( set[i] );
1770
                                                        break;
1847
                                }
1771
                                                }
1848
                        }
-
 
1849
                } else {
-
 
1850
                        for ( var i = 0; checkSet[i] != null; i++ ) {
-
 
1851
                                if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
-
 
1852
                                        results.push( set[i] );
1772
                                        }
1853
                                }
1773
                                }
1854
                        }
1774
                        }
1855
                }
-
 
1856
        } else {
-
 
1857
                makeArray( checkSet, results );
1775
                }
1858
        }
1776
1859
1777
                return ret;
1860
        if ( extra ) {
1778
        },
-
 
1779
-
 
1780
        not: function( selector ) {
1861
                Sizzle( extra, origContext, results, seed );
1781
                return this.pushStack( jQuery.winnow(this, selector, false), "not", selector);
1862
                Sizzle.uniqueSort( results );
1782
        },
1863
        }
1783
1864
1784
        filter: function( selector ) {
1865
        return results;
1785
                return this.pushStack( jQuery.winnow(this, selector, true), "filter", selector );
-
 
1786
        },
1866
};
1787
1867
1788
        closest: function( selector ) {
1868
Sizzle.uniqueSort = function(results){
1789
                var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null,
1869
        if ( sortOrder ) {
1790
                        closer = 0,
1870
                hasDuplicate = false;
1791
                        context = this.context;
1871
                results.sort(sortOrder);
1792
1872
1793
                return this.map(function(){
1873
                if ( hasDuplicate ) {
1794
                        var cur = this;
-
 
1795
                        while ( cur && cur.ownerDocument && cur !== context ) {
1874
                        for ( var i = 1; i < results.length; i++ ) {
1796
                                if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) {
1875
                                if ( results[i] === results[i-1] ) {
1797
                                        jQuery.data(cur, "closest", closer);
1876
                                        results.splice(i--, 1);
1798
                                        return cur;
1877
                                }
-
 
1878
                        }
1799
                                }
1879
                }
1800
                                cur = cur.parentNode;
-
 
1801
                                closer++;
-
 
1802
                        }
1880
        }
1803
                });
-
 
1804
        },
-
 
1805
-
 
1806
        add: function( selector ) {
-
 
1807
                return this.pushStack( jQuery.unique( jQuery.merge(
-
 
1808
                        this.get(),
-
 
1809
                        typeof selector === "string" ?
-
 
1810
                                jQuery( selector ) :
-
 
1811
                                jQuery.makeArray( selector )
-
 
1812
                )));
-
 
1813
        },
-
 
1814
-
 
1815
        eq: function( i ) {
-
 
1816
                return this.slice( i, +i + 1 );
-
 
1817
        },
-
 
1818
1881
1819
        slice: function() {
1882
        return results;
1820
                return this.pushStack( Array.prototype.slice.apply( this, arguments ),
-
 
1821
                        "slice", Array.prototype.slice.call(arguments).join(",") );
-
 
1822
        },
1883
};
1823
1884
1824
        map: function( callback ) {
1885
Sizzle.matches = function(expr, set){
1825
                return this.pushStack( jQuery.map(this, function(elem, i){
-
 
1826
                        return callback.call( elem, i, elem );
1886
        return Sizzle(expr, null, null, set);
1827
                }));
-
 
1828
        },
1887
};
1829
1888
1830
        andSelf: function() {
1889
Sizzle.find = function(expr, context, isXML){
1831
                return this.add( this.prevObject );
1890
        var set, match;
1832
        },
-
 
1833
1891
1834
        end: function() {
1892
        if ( !expr ) {
1835
                return this.prevObject || jQuery(null);
1893
                return [];
1836
        }
1894
        }
1837
});
-
 
1838
-
 
1839
jQuery.each({
-
 
1840
        parent: function(elem){return elem.parentNode;},
-
 
1841
        parents: function(elem){return jQuery.dir(elem,"parentNode");},
-
 
1842
        next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
-
 
1843
        prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
-
 
1844
        nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
-
 
1845
        prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
-
 
1846
        siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
-
 
1847
        children: function(elem){return jQuery.sibling(elem.firstChild);},
-
 
1848
        contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
-
 
1849
}, function(name, fn){
-
 
1850
        jQuery.fn[ name ] = function( selector ) {
-
 
1851
                var ret = jQuery.map( this, fn );
-
 
1852
1895
1853
                if ( selector && typeof selector == "string" )
1896
        for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
1854
                        ret = jQuery.multiFilter( selector, ret );
1897
                var type = Expr.order[i], match;
1855
1898
               
1856
                return this.pushStack( jQuery.unique( ret ), name, selector );
1899
                if ( (match = Expr.match[ type ].exec( expr )) ) {
1857
        };
-
 
1858
});
-
 
1859
jQuery.fn.extend({
-
 
1860
        attr: function( name, value ) {
1900
                        var left = RegExp.leftContext;
1861
                var elem, options, isFunction = jQuery.isFunction(value);
-
 
1862
1901
1863
                if ( typeof name === "string" ) {     // A single attribute
1902
                        if ( left.substr( left.length - 1 ) !== "\\" ) {
1864
                        if ( value === undefined ) {        // Query it on first element
1903
                                match[1] = (match[1] || "").replace(/\\/g, "");
1865
                                return this.length ?
-
 
1866
                                        jQuery.attr( this[0], name ) :
1904
                                set = Expr.find[ type ]( match, context, isXML );
1867
                                        null;
1905
                                if ( set != null ) {
1868
                        } else {                            // Set it on all elements
-
 
1869
                                for ( var i = 0, l = this.length; i < l; i++ ) {
1906
                                        expr = expr.replace( Expr.match[ type ], "" );
1870
                                        elem = this[i];
1907
                                        break;
1871
                                        if ( isFunction )
-
 
1872
                                                value = value.call(elem,i);
-
 
1873
                                        jQuery.attr( elem, name, value );
-
 
1874
                                }
1908
                                }
1875
                        }
1909
                        }
1876
                } else {                              // Multiple attributes to set on all
-
 
1877
                        options = name;
-
 
1878
                        for ( var i = 0, l = this.length; i < l; i++ ) {
-
 
1879
                                elem = this[i];
-
 
1880
                                for ( name in options ) {
-
 
1881
                                        value = options[name];
-
 
1882
                                        if ( jQuery.isFunction(value) )
-
 
1883
                                                value = value.call(elem,i);
-
 
1884
                                        jQuery.attr( elem, name, value );
-
 
1885
                                }
1910
                }
1886
                        }
1911
        }
-
 
1912
-
 
1913
        if ( !set ) {
-
 
1914
                set = context.getElementsByTagName("*");
1887
                }
1915
        }
1888
1916
1889
                return this;
1917
        return {set: set, expr: expr};
1890
        },
1918
};
1891
1919
1892
        hasClass: function( selector ) {
1920
Sizzle.filter = function(expr, set, inplace, not){
1893
                return !!selector && this.is( "." + selector );
1921
        var old = expr, result = [], curLoop = set, match, anyFound,
1894
        },
-
 
1895
-
 
1896
        val: function( value ) {
-
 
1897
                if ( value === undefined ) {
-
 
1898
                        var elem = this[0];
-
 
1899
-
 
1900
                        if ( elem ) {
-
 
1901
                                if( jQuery.nodeName( elem, 'option' ) )
1922
                isXMLFilter = set && set[0] && isXML(set[0]);
1902
                                        return (elem.attributes.value || {}).specified ? elem.value : elem.text;
-
 
1903
1923
1904
                                // We need to handle select boxes special
1924
        while ( expr && set.length ) {
1905
                                if ( jQuery.nodeName( elem, "select" ) ) {
1925
                for ( var type in Expr.filter ) {
1906
                                        var index = elem.selectedIndex,
1926
                        if ( (match = Expr.match[ type ].exec( expr )) != null ) {
1907
                                                values = [],
-
 
1908
                                                options = elem.options,
1927
                                var filter = Expr.filter[ type ], found, item;
1909
                                                one = elem.type == "select-one";
1928
                                anyFound = false;
1910
1929
1911
                                        // Nothing was selected
1930
                                if ( curLoop == result ) {
1912
                                        if ( index < 0 )
1931
                                        result = [];
1913
                                                return null;
1932
                                }
1914
1933
1915
                                        // Loop through all the selected options
1934
                                if ( Expr.preFilter[ type ] ) {
1916
                                        for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
1935
                                        match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
1917
                                                var option = options[ i ];
-
 
1918
1936
1919
                                                if ( option.selected ) {
1937
                                        if ( !match ) {
-
 
1938
                                                anyFound = found = true;
1920
                                                        // Get the specifc value for the option
1939
                                        } else if ( match === true ) {
1921
                                                        value = jQuery(option).val();
1940
                                                continue;
-
 
1941
                                        }
-
 
1942
                                }
1922
1943
-
 
1944
                                if ( match ) {
1923
                                                        // We don't need an array for one selects
1945
                                        for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
1924
                                                        if ( one )
1946
                                                if ( item ) {
-
 
1947
                                                        found = filter( item, match, i, curLoop );
1925
                                                                return value;
1948
                                                        var pass = not ^ !!found;
1926
1949
1927
                                                        // Multi-Selects return an array
1950
                                                        if ( inplace && found != null ) {
-
 
1951
                                                                if ( pass ) {
-
 
1952
                                                                        anyFound = true;
-
 
1953
                                                                } else {
-
 
1954
                                                                        curLoop[i] = false;
-
 
1955
                                                                }
-
 
1956
                                                        } else if ( pass ) {
1928
                                                        values.push( value );
1957
                                                                result.push( item );
-
 
1958
                                                                anyFound = true;
-
 
1959
                                                        }
-
 
1960
                                                }
1929
                                                }
1961
                                        }
1930
                                        }
1962
                                }
1931
1963
-
 
1964
                                if ( found !== undefined ) {
-
 
1965
                                        if ( !inplace ) {
1932
                                        return values;
1966
                                                curLoop = result;
1933
                                }
1967
                                        }
1934
1968
1935
                                // Everything else, we just grab the value
-
 
1936
                                return (elem.value || "").replace(/\r/g, "");
1969
                                        expr = expr.replace( Expr.match[ type ], "" );
1937
1970
-
 
1971
                                        if ( !anyFound ) {
-
 
1972
                                                return [];
1938
                        }
1973
                                        }
1939
1974
1940
                        return undefined;
1975
                                        break;
-
 
1976
                                }
-
 
1977
                        }
1941
                }
1978
                }
1942
1979
1943
                // Typecast once if the value is a number
1980
                // Improper expression
1944
                if ( typeof value === "number" )
1981
                if ( expr == old ) {
1945
                        value += '';
-
 
1946
                       
-
 
1947
                var val = value;
1982
                        if ( anyFound == null ) {
1948
-
 
1949
                return this.each(function(){
1983
                                throw "Syntax error, unrecognized expression: " + expr;
1950
                        if(jQuery.isFunction(value)) {
1984
                        } else {
1951
                                val = value.call(this);
1985
                                break;
1952
                                // Typecast each time if the value is a Function and the appended
-
 
1953
                                // value is therefore different each time.
-
 
1954
                                if( typeof val === "number" ) val += '';
1986
                        }
1955
                        }
1987
                }
1956
                       
1988
1957
                        if ( this.nodeType != 1 )
1989
                old = expr;
1958
                                return;
1990
        }
1959
1991
1960
                        if ( jQuery.isArray(val) && /radio|checkbox/.test( this.type ) )
1992
        return curLoop;
1961
                                this.checked = jQuery.inArray(this.value || this.name, val) >= 0;
-
 
-
 
1993
};
1962
1994
-
 
1995
var Expr = Sizzle.selectors = {
-
 
1996
        order: [ "ID", "NAME", "TAG" ],
-
 
1997
        match: {
-
 
1998
                ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
-
 
1999
                CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
-
 
2000
                NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,
-
 
2001
                ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
-
 
2002
                TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,
-
 
2003
                CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
-
 
2004
                POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
-
 
2005
                PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
-
 
2006
        },
-
 
2007
        attrMap: {
-
 
2008
                "class": "className",
-
 
2009
                "for": "htmlFor"
-
 
2010
        },
-
 
2011
        attrHandle: {
-
 
2012
                href: function(elem){
-
 
2013
                        return elem.getAttribute("href");
-
 
2014
                }
-
 
2015
        },
-
 
2016
        relative: {
-
 
2017
                "+": function(checkSet, part, isXML){
1963
                        else if ( jQuery.nodeName( this, "select" ) ) {
2018
                        var isPartStr = typeof part === "string",
-
 
2019
                                isTag = isPartStr && !/\W/.test(part),
1964
                                var values = jQuery.makeArray(val);
2020
                                isPartStrNotTag = isPartStr && !isTag;
1965
2021
1966
                                jQuery( "option", this ).each(function(){
2022
                        if ( isTag && !isXML ) {
1967
                                        this.selected = jQuery.inArray( this.value || this.text, values ) >= 0;
2023
                                part = part.toUpperCase();
1968
                                });
2024
                        }
1969
2025
-
 
2026
                        for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
1970
                                if ( !values.length )
2027
                                if ( (elem = checkSet[i]) ) {
1971
                                        this.selectedIndex = -1;
2028
                                        while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
1972
2029
-
 
2030
                                        checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?
1973
                        } else
2031
                                                elem || false :
1974
                                this.value = val;
2032
                                                elem === part;
1975
                });
2033
                                }
1976
        }
2034
                        }
1977
});
-
 
1978
-
 
1979
jQuery.each({
-
 
1980
        removeAttr: function( name ) {
-
 
1981
                jQuery.attr( this, name, "" );
-
 
1982
                if (this.nodeType == 1)
-
 
1983
                        this.removeAttribute( name );
-
 
1984
        },
-
 
1985
2035
1986
        addClass: function( classNames ) {
2036
                        if ( isPartStrNotTag ) {
1987
                jQuery.className.add( this, classNames );
2037
                                Sizzle.filter( part, checkSet, true );
-
 
2038
                        }
1988
        },
2039
                },
-
 
2040
                ">": function(checkSet, part, isXML){
-
 
2041
                        var isPartStr = typeof part === "string";
1989
2042
1990
        removeClass: function( classNames ) {
2043
                        if ( isPartStr && !/\W/.test(part) ) {
1991
                jQuery.className.remove( this, classNames );
2044
                                part = isXML ? part : part.toUpperCase();
1992
        },
-
 
1993
2045
1994
        toggleClass: function( classNames, state ) {
2046
                                for ( var i = 0, l = checkSet.length; i < l; i++ ) {
1995
                var type = typeof classNames;
2047
                                        var elem = checkSet[i];
1996
                if ( type === "string" ) {
2048
                                        if ( elem ) {
1997
                        // toggle individual class names
-
 
1998
                        var isBool = typeof state === "boolean", className, i = 0,
-
 
1999
                                classNames = classNames.split( /\s+/ );
2049
                                                var parent = elem.parentNode;
2000
                        while ( (className = classNames[ i++ ]) ) {
-
 
2001
                                // check each className given, space seperated list
2050
                                                checkSet[i] = parent.nodeName === part ? parent : false;
2002
                                state = isBool ? state : !jQuery.className.has( this, className );
-
 
2003
                                jQuery.className[ state ? "add" : "remove" ]( this, className );
-
 
2004
                        }
2051
                                        }
2005
                } else if ( type === "undefined" || type === "boolean" ) {
-
 
2006
                        if ( this.className ) {
-
 
2007
                                // store className if set
-
 
2008
                                jQuery.data( this, "__className__", this.className );
-
 
2009
                        }
2052
                                }
-
 
2053
                        } else {
-
 
2054
                                for ( var i = 0, l = checkSet.length; i < l; i++ ) {
2010
                        // toggle whole className
2055
                                        var elem = checkSet[i];
-
 
2056
                                        if ( elem ) {
-
 
2057
                                                checkSet[i] = isPartStr ?
-
 
2058
                                                        elem.parentNode :
2011
                        this.className = this.className || classNames === false ? "" : jQuery.data( this, "__className__" ) || "";
2059
                                                        elem.parentNode === part;
2012
                }
2060
                                        }
2013
        }
2061
                                }
2014
}, function(name, fn){
-
 
2015
        jQuery.fn[ name ] = function(){
-
 
2016
                return this.each( fn, arguments );
-
 
2017
        };
-
 
2018
});
-
 
2019
2062
2020
jQuery.extend({
-
 
2021
        className: {
2063
                                if ( isPartStr ) {
2022
                // internal only, use addClass("class")
2064
                                        Sizzle.filter( part, checkSet, true );
2023
                add: function( elem, classNames ) {
2065
                                }
2024
                        jQuery.each((classNames || "").split(/\s+/), function(i, className){
-
 
2025
                                if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )
-
 
2026
                                        elem.className += (elem.className ? " " : "") + className;
-
 
2027
                        });
2066
                        }
2028
                },
2067
                },
-
 
2068
                "": function(checkSet, part, isXML){
-
 
2069
                        var doneName = done++, checkFn = dirCheck;
2029
2070
2030
                // internal only, use removeClass("class")
-
 
2031
                remove: function( elem, classNames ) {
-
 
2032
                        if (elem.nodeType == 1)
2071
                        if ( !/\W/.test(part) ) {
2033
                                elem.className = classNames !== undefined ?
-
 
2034
                                        jQuery.grep(elem.className.split(/\s+/), function(className){
-
 
2035
                                                return !jQuery.className.has( classNames, className );
2072
                                var nodeCheck = part = isXML ? part : part.toUpperCase();
2036
                                        }).join(" ") :
2073
                                checkFn = dirNodeCheck;
2037
                                        "";
2074
                        }
-
 
2075
-
 
2076
                        checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
2038
                },
2077
                },
-
 
2078
                "~": function(checkSet, part, isXML){
-
 
2079
                        var doneName = done++, checkFn = dirCheck;
2039
2080
2040
                // internal only, use hasClass("class")
2081
                        if ( typeof part === "string" && !/\W/.test(part) ) {
2041
                has: function( elem, className ) {
2082
                                var nodeCheck = part = isXML ? part : part.toUpperCase();
2042
                        return elem && jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
2083
                                checkFn = dirNodeCheck;
2043
                }
2084
                        }
2044
        },
-
 
2045
2085
-
 
2086
                        checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
-
 
2087
                }
-
 
2088
        },
-
 
2089
        find: {
2046
        attr: function( elem, name, value ) {
2090
                ID: function(match, context, isXML){
2047
                // don't set attributes on text and comment nodes
2091
                        if ( typeof context.getElementById !== "undefined" && !isXML ) {
2048
                if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
2092
                                var m = context.getElementById(match[1]);
2049
                        return undefined;
2093
                                return m ? [m] : [];
-
 
2094
                        }
-
 
2095
                },
-
 
2096
                NAME: function(match, context, isXML){
-
 
2097
                        if ( typeof context.getElementsByName !== "undefined" ) {
-
 
2098
                                var ret = [], results = context.getElementsByName(match[1]);
2050
2099
2051
                var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
2100
                                for ( var i = 0, l = results.length; i < l; i++ ) {
2052
                        // Whether we are setting (or getting)
2101
                                        if ( results[i].getAttribute("name") === match[1] ) {
2053
                        set = value !== undefined;
2102
                                                ret.push( results[i] );
-
 
2103
                                        }
-
 
2104
                                }
2054
2105
-
 
2106
                                return ret.length === 0 ? null : ret;
-
 
2107
                        }
-
 
2108
                },
2055
                // Try to normalize/fix the name
2109
                TAG: function(match, context){
2056
                name = notxml && jQuery.props[ name ] || name;
2110
                        return context.getElementsByTagName(match[1]);
-
 
2111
                }
-
 
2112
        },
-
 
2113
        preFilter: {
-
 
2114
                CLASS: function(match, curLoop, inplace, result, not, isXML){
-
 
2115
                        match = " " + match[1].replace(/\\/g, "") + " ";
2057
2116
2058
                // Only do all the following if this is a node (faster for style)
2117
                        if ( isXML ) {
2059
                if ( elem.nodeType === 1 ) {
2118
                                return match;
2060
2119
                        }
2061
                        // These attributes require special treatment
-
 
2062
                        var special = /href|src|style/.test( name );
-
 
2063
2120
2064
                        // Safari mis-reports the default selected property of a hidden option
2121
                        for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
-
 
2122
                                if ( elem ) {
2065
                        // Accessing the parent's selectedIndex property fixes it
2123
                                        if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {
-
 
2124
                                                if ( !inplace )
2066
                        if ( name == "selected" && elem.parentNode )
2125
                                                        result.push( elem );
2067
                                elem.parentNode.selectedIndex;
2126
                                        } else if ( inplace ) {
-
 
2127
                                                curLoop[i] = false;
-
 
2128
                                        }
-
 
2129
                                }
-
 
2130
                        }
2068
2131
-
 
2132
                        return false;
-
 
2133
                },
-
 
2134
                ID: function(match){
2069
                        // If applicable, access the attribute via the DOM 0 way
2135
                        return match[1].replace(/\\/g, "");
-
 
2136
                },
-
 
2137
                TAG: function(match, curLoop){
2070
                        if ( name in elem && notxml && !special ) {
2138
                        for ( var i = 0; curLoop[i] === false; i++ ){}
-
 
2139
                        return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
-
 
2140
                },
-
 
2141
                CHILD: function(match){
2071
                                if ( set ){
2142
                        if ( match[1] == "nth" ) {
2072
                                        // We can't allow the type property to be changed (since it causes problems in IE)
2143
                                // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
-
 
2144
                                var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
2073
                                        if ( name == "type" && /(button|input)/i.test(elem.nodeName) && elem.parentNode )
2145
                                        match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
2074
                                                throw "type property can't be changed";
2146
                                        !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
2075
2147
-
 
2148
                                // calculate the numbers (first)n+(last) including if they are negative
-
 
2149
                                match[2] = (test[1] + (test[2] || 1)) - 0;
2076
                                        elem[ name ] = value;
2150
                                match[3] = test[3] - 0;
2077
                                }
2151
                        }
2078
2152
2079
                                // browsers index elements by id/name on forms, give priority to attributes.
-
 
2080
                                if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
2153
                        // TODO: Move to normal caching system
2081
                                        return elem.getAttributeNode( name ).nodeValue;
2154
                        match[0] = done++;
2082
2155
2083
                                // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
-
 
2084
                                // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
-
 
2085
                                if ( name == "tabIndex" ) {
2156
                        return match;
2086
                                        var attributeNode = elem.getAttributeNode( "tabIndex" );
-
 
-
 
2157
                },
2087
                                        return attributeNode && attributeNode.specified
2158
                ATTR: function(match, curLoop, inplace, result, not, isXML){
2088
                                                ? attributeNode.value
2159
                        var name = match[1].replace(/\\/g, "");
2089
                                                : /(button|input|object|select|textarea)/i.test(elem.nodeName)
-
 
2090
                                                        ? 0
2160
                       
2091
                                                        : /^(a|area)$/i.test(elem.nodeName) && elem.href
2161
                        if ( !isXML && Expr.attrMap[name] ) {
2092
                                                                ? 0
-
 
2093
                                                                : undefined;
2162
                                match[1] = Expr.attrMap[name];
2094
                                }
2163
                        }
2095
2164
2096
                                return elem[ name ];
2165
                        if ( match[2] === "~=" ) {
-
 
2166
                                match[4] = " " + match[4] + " ";
2097
                        }
2167
                        }
2098
2168
-
 
2169
                        return match;
-
 
2170
                },
-
 
2171
                PSEUDO: function(match, curLoop, inplace, result, not){
-
 
2172
                        if ( match[1] === "not" ) {
-
 
2173
                                // If we're dealing with a complex expression, or a simple one
2099
                        if ( !jQuery.support.style && notxml && name == "style" ) {
2174
                                if ( chunker.exec(match[3]).length > 1 || /^\w/.test(match[3]) ) {
-
 
2175
                                        match[3] = Sizzle(match[3], null, null, curLoop);
2100
                                if ( set )
2176
                                } else {
-
 
2177
                                        var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
-
 
2178
                                        if ( !inplace ) {
2101
                                        elem.style.cssText = "" + value;
2179
                                                result.push.apply( result, ret );
-
 
2180
                                        }
-
 
2181
                                        return false;
-
 
2182
                                }
-
 
2183
                        } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
-
 
2184
                                return true;
-
 
2185
                        }
2102
2186
                       
-
 
2187
                        return match;
-
 
2188
                },
-
 
2189
                POS: function(match){
-
 
2190
                        match.unshift( true );
-
 
2191
                        return match;
-
 
2192
                }
-
 
2193
        },
-
 
2194
        filters: {
-
 
2195
                enabled: function(elem){
-
 
2196
                        return elem.disabled === false && elem.type !== "hidden";
-
 
2197
                },
-
 
2198
                disabled: function(elem){
2103
                                return elem.style.cssText;
2199
                        return elem.disabled === true;
-
 
2200
                },
-
 
2201
                checked: function(elem){
-
 
2202
                        return elem.checked === true;
-
 
2203
                },
-
 
2204
                selected: function(elem){
-
 
2205
                        // Accessing this property makes selected-by-default
-
 
2206
                        // options in Safari work properly
-
 
2207
                        elem.parentNode.selectedIndex;
-
 
2208
                        return elem.selected === true;
-
 
2209
                },
-
 
2210
                parent: function(elem){
-
 
2211
                        return !!elem.firstChild;
-
 
2212
                },
-
 
2213
                empty: function(elem){
-
 
2214
                        return !elem.firstChild;
-
 
2215
                },
-
 
2216
                has: function(elem, i, match){
-
 
2217
                        return !!Sizzle( match[3], elem ).length;
-
 
2218
                },
-
 
2219
                header: function(elem){
-
 
2220
                        return /h\d/i.test( elem.nodeName );
-
 
2221
                },
-
 
2222
                text: function(elem){
-
 
2223
                        return "text" === elem.type;
-
 
2224
                },
-
 
2225
                radio: function(elem){
-
 
2226
                        return "radio" === elem.type;
-
 
2227
                },
-
 
2228
                checkbox: function(elem){
-
 
2229
                        return "checkbox" === elem.type;
-
 
2230
                },
-
 
2231
                file: function(elem){
-
 
2232
                        return "file" === elem.type;
-
 
2233
                },
-
 
2234
                password: function(elem){
-
 
2235
                        return "password" === elem.type;
-
 
2236
                },
-
 
2237
                submit: function(elem){
-
 
2238
                        return "submit" === elem.type;
-
 
2239
                },
-
 
2240
                image: function(elem){
-
 
2241
                        return "image" === elem.type;
-
 
2242
                },
-
 
2243
                reset: function(elem){
-
 
2244
                        return "reset" === elem.type;
-
 
2245
                },
-
 
2246
                button: function(elem){
-
 
2247
                        return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
-
 
2248
                },
-
 
2249
                input: function(elem){
-
 
2250
                        return /input|select|textarea|button/i.test(elem.nodeName);
2104
                        }
2251
                }
-
 
2252
        },
-
 
2253
        setFilters: {
-
 
2254
                first: function(elem, i){
-
 
2255
                        return i === 0;
-
 
2256
                },
-
 
2257
                last: function(elem, i, match, array){
-
 
2258
                        return i === array.length - 1;
-
 
2259
                },
-
 
2260
                even: function(elem, i){
-
 
2261
                        return i % 2 === 0;
-
 
2262
                },
-
 
2263
                odd: function(elem, i){
-
 
2264
                        return i % 2 === 1;
-
 
2265
                },
-
 
2266
                lt: function(elem, i, match){
-
 
2267
                        return i < match[3] - 0;
-
 
2268
                },
-
 
2269
                gt: function(elem, i, match){
-
 
2270
                        return i > match[3] - 0;
-
 
2271
                },
-
 
2272
                nth: function(elem, i, match){
-
 
2273
                        return match[3] - 0 == i;
-
 
2274
                },
-
 
2275
                eq: function(elem, i, match){
-
 
2276
                        return match[3] - 0 == i;
-
 
2277
                }
-
 
2278
        },
-
 
2279
        filter: {
-
 
2280
                PSEUDO: function(elem, match, i, array){
-
 
2281
                        var name = match[1], filter = Expr.filters[ name ];
2105
2282
2106
                        if ( set )
2283
                        if ( filter ) {
-
 
2284
                                return filter( elem, i, match, array );
-
 
2285
                        } else if ( name === "contains" ) {
2107
                                // convert the value to a string (all browsers do this but IE) see #1070
2286
                                return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
2108
                                elem.setAttribute( name, "" + value );
2287
                        } else if ( name === "not" ) {
-
 
2288
                                var not = match[3];
2109
2289
2110
                        var attr = !jQuery.support.hrefNormalized && notxml && special
2290
                                for ( var i = 0, l = not.length; i < l; i++ ) {
2111
                                        // Some attributes require a special call on IE
2291
                                        if ( not[i] === elem ) {
2112
                                        ? elem.getAttribute( name, 2 )
2292
                                                return false;
2113
                                        : elem.getAttribute( name );
2293
                                        }
-
 
2294
                                }
2114
2295
-
 
2296
                                return true;
-
 
2297
                        }
-
 
2298
                },
-
 
2299
                CHILD: function(elem, match){
-
 
2300
                        var type = match[1], node = elem;
-
 
2301
                        switch (type) {
-
 
2302
                                case 'only':
-
 
2303
                                case 'first':
2115
                        // Non-existent attributes return null, we normalize to undefined
2304
                                        while ( (node = node.previousSibling) )  {
2116
                        return attr === null ? undefined : attr;
2305
                                                if ( node.nodeType === 1 ) return false;
2117
                }
2306
                                        }
-
 
2307
                                        if ( type == 'first') return true;
-
 
2308
                                        node = elem;
-
 
2309
                                case 'last':
-
 
2310
                                        while ( (node = node.nextSibling) )  {
-
 
2311
                                                if ( node.nodeType === 1 ) return false;
-
 
2312
                                        }
-
 
2313
                                        return true;
-
 
2314
                                case 'nth':
-
 
2315
                                        var first = match[2], last = match[3];
2118
2316
2119
                // elem is actually elem.style ... set the style
2317
                                        if ( first == 1 && last == 0 ) {
2120
                // Using attr for specific style information is now deprecated. Use style insead.
-
 
2121
                return jQuery.style(elem, name, value);
2318
                                                return true;
2122
        }
2319
                                        }
2123
});
-
 
2124
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
-
 
2125
        rleadingWhitespace = /^\s+/,
-
 
2126
        rsingleTag = /^<(\w+)\s*\/?>$/,
-
 
2127
        rxhtmlTag = /(<(\w+)[^>]*?)\/>/g,
-
 
2128
        rselfClosing = /^(?:abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i,
-
 
2129
        rinsideTable = /^<(thead|tbody|tfoot|colg|cap)/,
-
 
2130
        rtbody = /<tbody/i,
-
 
2131
        fcloseTag = function(all, front, tag){
-
 
2132
                return rselfClosing.test(tag) ?
-
 
2133
                        all :
-
 
2134
                        front + "></" + tag + ">";
-
 
2135
        };
-
 
2136
2320
                                       
2137
jQuery.fn.extend({
-
 
2138
        text: function( text ) {
2321
                                        var doneName = match[0],
2139
                if ( typeof text !== "object" && text !== undefined )
2322
                                                parent = elem.parentNode;
2140
                        return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
-
 
2141
2323
       
-
 
2324
                                        if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
2142
                var ret = "";
2325
                                                var count = 0;
-
 
2326
                                                for ( node = parent.firstChild; node; node = node.nextSibling ) {
-
 
2327
                                                        if ( node.nodeType === 1 ) {
-
 
2328
                                                                node.nodeIndex = ++count;
-
 
2329
                                                        }
-
 
2330
                                                }
-
 
2331
                                                parent.sizcache = doneName;
-
 
2332
                                        }
2143
2333
                                       
2144
                jQuery.each( text || this, function(){
-
 
2145
                        jQuery.each( this.childNodes, function(){
2334
                                        var diff = elem.nodeIndex - last;
2146
                                if ( this.nodeType !== 8 ) {
2335
                                        if ( first == 0 ) {
2147
                                        ret += this.nodeType !== 1 ?
2336
                                                return diff == 0;
2148
                                                this.nodeValue :
2337
                                        } else {
2149
                                                jQuery.fn.text( [ this ] );
2338
                                                return ( diff % first == 0 && diff / first >= 0 );
2150
                                }
2339
                                        }
2151
                        });
2340
                        }
2152
                });
2341
                },
-
 
2342
                ID: function(elem, match){
-
 
2343
                        return elem.nodeType === 1 && elem.getAttribute("id") === match;
-
 
2344
                },
-
 
2345
                TAG: function(elem, match){
-
 
2346
                        return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
-
 
2347
                },
-
 
2348
                CLASS: function(elem, match){
-
 
2349
                        return (" " + (elem.className || elem.getAttribute("class")) + " ")
-
 
2350
                                .indexOf( match ) > -1;
-
 
2351
                },
-
 
2352
                ATTR: function(elem, match){
-
 
2353
                        var name = match[1],
-
 
2354
                                result = Expr.attrHandle[ name ] ?
-
 
2355
                                        Expr.attrHandle[ name ]( elem ) :
-
 
2356
                                        elem[ name ] != null ?
-
 
2357
                                                elem[ name ] :
-
 
2358
                                                elem.getAttribute( name ),
-
 
2359
                                value = result + "",
-
 
2360
                                type = match[2],
-
 
2361
                                check = match[4];
2153
2362
2154
                return ret;
2363
                        return result == null ?
-
 
2364
                                type === "!=" :
-
 
2365
                                type === "=" ?
-
 
2366
                                value === check :
-
 
2367
                                type === "*=" ?
-
 
2368
                                value.indexOf(check) >= 0 :
-
 
2369
                                type === "~=" ?
-
 
2370
                                (" " + value + " ").indexOf(check) >= 0 :
-
 
2371
                                !check ?
-
 
2372
                                value && result !== false :
-
 
2373
                                type === "!=" ?
-
 
2374
                                value != check :
-
 
2375
                                type === "^=" ?
-
 
2376
                                value.indexOf(check) === 0 :
-
 
2377
                                type === "$=" ?
-
 
2378
                                value.substr(value.length - check.length) === check :
-
 
2379
                                type === "|=" ?
-
 
2380
                                value === check || value.substr(0, check.length + 1) === check + "-" :
-
 
2381
                                false;
2155
        },
2382
                },
-
 
2383
                POS: function(elem, match, i, array){
-
 
2384
                        var name = match[2], filter = Expr.setFilters[ name ];
2156
2385
2157
        wrapAll: function( html ) {
2386
                        if ( filter ) {
2158
                if ( jQuery.isFunction( html ) ) {
-
 
2159
                        return this.each(function() {
2387
                                return filter( elem, i, match, array );
2160
                                jQuery(this).wrapAll( html.apply(this, arguments) );
-
 
2161
                        });
2388
                        }
-
 
2389
                }
-
 
2390
        }
-
 
2391
};
-
 
2392
-
 
2393
var origPOS = Expr.match.POS;
-
 
2394
-
 
2395
for ( var type in Expr.match ) {
-
 
2396
        Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
2162
                }
2397
}
2163
2398
2164
                if ( this[0] ) {
-
 
2165
                        // The elements to wrap the target around
2399
var makeArray = function(array, results) {
2166
                        var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone();
2400
        array = Array.prototype.slice.call( array, 0 );
2167
2401
2168
                        if ( this[0].parentNode ) {
2402
        if ( results ) {
2169
                                wrap.insertBefore( this[0] );
2403
                results.push.apply( results, array );
-
 
2404
                return results;
2170
                        }
2405
        }
2171
2406
       
2172
                        wrap.map(function(){
2407
        return array;
2173
                                var elem = this;
2408
};
2174
2409
-
 
2410
// Perform a simple check to determine if the browser is capable of
-
 
2411
// converting a NodeList to an array using builtin methods.
-
 
2412
try {
-
 
2413
        Array.prototype.slice.call( document.documentElement.childNodes, 0 );
-
 
2414
-
 
2415
// Provide a fallback method if it does not work
-
 
2416
} catch(e){
-
 
2417
        makeArray = function(array, results) {
-
 
2418
                var ret = results || [];
-
 
2419
-
 
2420
                if ( toString.call(array) === "[object Array]" ) {
-
 
2421
                        Array.prototype.push.apply( ret, array );
-
 
2422
                } else {
-
 
2423
                        if ( typeof array.length === "number" ) {
2175
                                while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
2424
                                for ( var i = 0, l = array.length; i < l; i++ ) {
-
 
2425
                                        ret.push( array[i] );
-
 
2426
                                }
-
 
2427
                        } else {
-
 
2428
                                for ( var i = 0; array[i]; i++ ) {
2176
                                        elem = elem.firstChild;
2429
                                        ret.push( array[i] );
-
 
2430
                                }
-
 
2431
                        }
2177
                                }
2432
                }
2178
2433
2179
                                return elem;
2434
                return ret;
2180
                        }).append(this);
2435
        };
2181
                }
2436
}
2182
2437
2183
                return this;
2438
var sortOrder;
2184
        },
-
 
2185
2439
-
 
2440
if ( document.documentElement.compareDocumentPosition ) {
2186
        wrapInner: function( html ) {
2441
        sortOrder = function( a, b ) {
-
 
2442
                if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
2187
                return this.each(function(){
2443
                        if ( a == b ) {
2188
                        jQuery( this ).contents().wrapAll( html );
2444
                                hasDuplicate = true;
2189
                });
2445
                        }
-
 
2446
                        return 0;
2190
        },
2447
                }
2191
2448
-
 
2449
                var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
-
 
2450
                if ( ret === 0 ) {
-
 
2451
                        hasDuplicate = true;
-
 
2452
                }
-
 
2453
                return ret;
-
 
2454
        };
-
 
2455
} else if ( "sourceIndex" in document.documentElement ) {
2192
        wrap: function( html ) {
2456
        sortOrder = function( a, b ) {
2193
                return this.each(function(){
2457
                if ( !a.sourceIndex || !b.sourceIndex ) {
-
 
2458
                        if ( a == b ) {
2194
                        jQuery( this ).wrapAll( html );
2459
                                hasDuplicate = true;
2195
                });
2460
                        }
-
 
2461
                        return 0;
2196
        },
2462
                }
2197
2463
-
 
2464
                var ret = a.sourceIndex - b.sourceIndex;
-
 
2465
                if ( ret === 0 ) {
-
 
2466
                        hasDuplicate = true;
-
 
2467
                }
-
 
2468
                return ret;
-
 
2469
        };
-
 
2470
} else if ( document.createRange ) {
2198
        append: function() {
2471
        sortOrder = function( a, b ) {
2199
                return this.domManip(arguments, true, function(elem){
2472
                if ( !a.ownerDocument || !b.ownerDocument ) {
2200
                        if ( this.nodeType === 1 ) {
2473
                        if ( a == b ) {
2201
                                this.appendChild( elem );
2474
                                hasDuplicate = true;
-
 
2475
                        }
-
 
2476
                        return 0;
2202
                        }
2477
                }
2203
                });
-
 
2204
        },
-
 
2205
2478
-
 
2479
                var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
-
 
2480
                aRange.selectNode(a);
-
 
2481
                aRange.collapse(true);
2206
        prepend: function() {
2482
                bRange.selectNode(b);
-
 
2483
                bRange.collapse(true);
2207
                return this.domManip(arguments, true, function(elem){
2484
                var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
2208
                        if ( this.nodeType === 1 ) {
2485
                if ( ret === 0 ) {
2209
                                this.insertBefore( elem, this.firstChild );
2486
                        hasDuplicate = true;
-
 
2487
                }
-
 
2488
                return ret;
-
 
2489
        };
2210
                        }
2490
}
2211
                });
-
 
2212
        },
-
 
2213
2491
-
 
2492
// Check to see if the browser returns elements by name when
-
 
2493
// querying by getElementById (and provide a workaround)
2214
        before: function() {
2494
(function(){
2215
                return this.domManip(arguments, false, function(elem){
2495
        // We're going to inject a fake input element with a specified name
2216
                        this.parentNode.insertBefore( elem, this );
2496
        var form = document.createElement("div"),
2217
                });
2497
                id = "script" + (new Date).getTime();
2218
        },
-
 
-
 
2498
        form.innerHTML = "<a name='" + id + "'/>";
2219
2499
2220
        after: function() {
2500
        // Inject it into the root element, check its status, and remove it quickly
2221
                return this.domManip(arguments, false, function(elem){
2501
        var root = document.documentElement;
2222
                        this.parentNode.insertBefore( elem, this.nextSibling );
2502
        root.insertBefore( form, root.firstChild );
2223
                });
-
 
2224
        },
-
 
2225
2503
2226
        clone: function( events ) {
-
 
2227
                // Do the clone
-
 
2228
                var ret = this.map(function(){
-
 
2229
                        if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
-
 
2230
                                // IE copies events bound via attachEvent when
2504
        // The workaround has to do additional checks after a getElementById
2231
                                // using cloneNode. Calling detachEvent on the
-
 
2232
                                // clone will also remove the events from the orignal
2505
        // Which slows things down for other browsers (hence the branching)
2233
                                // In order to get around this, we use innerHTML.
-
 
2234
                                // Unfortunately, this means some modifications to
-
 
2235
                                // attributes in IE that are actually only stored
-
 
2236
                                // as properties will not be copied (such as the
2506
        if ( !!document.getElementById( id ) ) {
2237
                                // the name attribute on an input).
2507
                Expr.find.ID = function(match, context, isXML){
2238
                                var html = this.outerHTML, ownerDocument = this.ownerDocument;
2508
                        if ( typeof context.getElementById !== "undefined" && !isXML ) {
2239
                                if ( !html ) {
-
 
2240
                                        var div = ownerDocument.createElement("div");
2509
                                var m = context.getElementById(match[1]);
2241
                                        div.appendChild( this.cloneNode(true) );
2510
                                return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
2242
                                        html = div.innerHTML;
-
 
2243
                                }
2511
                        }
-
 
2512
                };
2244
2513
2245
                                return jQuery.clean([html.replace(rinlinejQuery, "")
2514
                Expr.filter.ID = function(elem, match){
-
 
2515
                        var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
2246
                                        .replace(rleadingWhitespace, "")], ownerDocument)[0];
2516
                        return elem.nodeType === 1 && node && node.nodeValue === match;
2247
                        } else {
2517
                };
2248
                                return this.cloneNode(true);
-
 
2249
                        }
2518
        }
2250
                });
-
 
2251
2519
2252
                // Copy the events from the original to the clone
-
 
2253
                if ( events === true ) {
2520
        root.removeChild( form );
2254
                        var orig = this.find("*").andSelf(), i = 0;
2521
        root = form = null; // release memory in IE
-
 
2522
})();
2255
2523
-
 
2524
(function(){
2256
                        ret.find("*").andSelf().each(function(){
2525
        // Check to see if the browser returns only elements
2257
                                if ( this.nodeName !== orig[i].nodeName ) { return; }
2526
        // when doing getElementsByTagName("*")
2258
2527
-
 
2528
        // Create a fake element
2259
                                var events = jQuery.data( orig[i], "events" );
2529
        var div = document.createElement("div");
-
 
2530
        div.appendChild( document.createComment("") );
2260
2531
-
 
2532
        // Make sure no comments are found
-
 
2533
        if ( div.getElementsByTagName("*").length > 0 ) {
-
 
2534
                Expr.find.TAG = function(match, context){
-
 
2535
                        var results = context.getElementsByTagName(match[1]);
-
 
2536
-
 
2537
                        // Filter out possible comments
2261
                                for ( var type in events ) {
2538
                        if ( match[1] === "*" ) {
-
 
2539
                                var tmp = [];
-
 
2540
2262
                                        for ( var handler in events[ type ] ) {
2541
                                for ( var i = 0; results[i]; i++ ) {
2263
                                                jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
2542
                                        if ( results[i].nodeType === 1 ) {
-
 
2543
                                                tmp.push( results[i] );
2264
                                        }
2544
                                        }
2265
                                }
2545
                                }
2266
2546
2267
                                i++;
2547
                                results = tmp;
2268
                        });
-
 
2269
                }
2548
                        }
2270
2549
2271
                // Return the cloned set
-
 
2272
                return ret;
2550
                        return results;
2273
        },
2551
                };
2274
-
 
2275
        html: function( value ) {
-
 
2276
                return value === undefined ?
-
 
2277
                        (this[0] ?
-
 
2278
                                this[0].innerHTML.replace(rinlinejQuery, "") :
-
 
2279
                                null) :
-
 
2280
                        this.empty().append( value );
-
 
2281
        },
2552
        }
2282
2553
-
 
2554
        // Check to see if an attribute returns normalized href attributes
-
 
2555
        div.innerHTML = "<a href='#'></a>";
-
 
2556
        if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
-
 
2557
                        div.firstChild.getAttribute("href") !== "#" ) {
2283
        replaceWith: function( value ) {
2558
                Expr.attrHandle.href = function(elem){
2284
                return this.after( value ).remove();
2559
                        return elem.getAttribute("href", 2);
-
 
2560
                };
2285
        },
2561
        }
2286
2562
2287
        detach: function( selector ) {
-
 
2288
                return this.remove( selector, true );
2563
        div = null; // release memory in IE
2289
        },
2564
})();
2290
2565
2291
        domManip: function( args, table, callback ) {
2566
if ( document.querySelectorAll ) (function(){
2292
                var fragment, scripts, cacheable, cached, cacheresults, first,
2567
        var oldSizzle = Sizzle, div = document.createElement("div");
2293
                        value = args[0];
2568
        div.innerHTML = "<p class='TEST'></p>";
2294
2569
2295
                if ( jQuery.isFunction(value) ) {
2570
        // Safari can't handle uppercase or unicode characters when
2296
                        return this.each(function() {
2571
        // in quirks mode.
2297
                                args[0] = value.call(this);
-
 
2298
                                return jQuery(this).domManip( args, table, callback );
2572
        if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
2299
                        });
2573
                return;
2300
                }
2574
        }
2301
2575
       
2302
                if ( this[0] ) {
2576
        Sizzle = function(query, context, extra, seed){
2303
                        if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 ) {
-
 
2304
                                cacheable = true;
2577
                context = context || document;
-
 
2578
2305
                                cacheresults = jQuery.fragments[ args[0] ];
2579
                // Only use querySelectorAll on non-XML documents
2306
                                if ( cacheresults ) {
2580
                // (ID selectors don't work in non-HTML documents)
2307
                                        if ( cacheresults !== 1 ) {
2581
                if ( !seed && context.nodeType === 9 && !isXML(context) ) {
2308
                                                fragment = cacheresults;
-
 
2309
                                        }
2582
                        try {
2310
                                        cached = true;
2583
                                return makeArray( context.querySelectorAll(query), extra );
2311
                                }
2584
                        } catch(e){}
2312
                        }
2585
                }
2313
2586
               
2314
                        if ( !fragment ) {
2587
                return oldSizzle(query, context, extra, seed);
-
 
2588
        };
-
 
2589
2315
                                fragment = (this[0].ownerDocument || this[0]).createDocumentFragment();
2590
        for ( var prop in oldSizzle ) {
2316
                                scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment );
2591
                Sizzle[ prop ] = oldSizzle[ prop ];
2317
                        }
2592
        }
2318
2593
2319
                        first = fragment.firstChild;
2594
        div = null; // release memory in IE
-
 
2595
})();
2320
2596
-
 
2597
if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
2321
                        if ( first ) {
2598
        var div = document.createElement("div");
2322
                                table = table && jQuery.nodeName( first, "tr" );
2599
        div.innerHTML = "<div class='test e'></div><div class='test'></div>";
2323
2600
2324
                                for ( var i = 0, l = this.length; i < l; i++ ) {
2601
        // Opera can't find a second classname (in 9.6)
2325
                                        callback.call(
2602
        if ( div.getElementsByClassName("e").length === 0 )
2326
                                                table ?
2603
                return;
-
 
2604
-
 
2605
        // Safari caches class attributes, doesn't catch changes (in 3.2)
2327
                                                        root(this[i], first) :
2606
        div.lastChild.className = "e";
-
 
2607
-
 
2608
        if ( div.getElementsByClassName("e").length === 1 )
2328
                                                        this[i],
2609
                return;
-
 
2610
2329
                                                cacheable || this.length > 1 || i > 0 ?
2611
        Expr.order.splice(1, 0, "CLASS");
2330
                                                        fragment.cloneNode(true) :
2612
        Expr.find.CLASS = function(match, context, isXML) {
-
 
2613
                if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
2331
                                                        fragment
2614
                        return context.getElementsByClassName(match[1]);
2332
                                        );
-
 
2333
                                }
2615
                }
-
 
2616
        };
-
 
2617
-
 
2618
        div = null; // release memory in IE
-
 
2619
})();
-
 
2620
-
 
2621
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-
 
2622
        var sibDir = dir == "previousSibling" && !isXML;
-
 
2623
        for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-
 
2624
                var elem = checkSet[i];
-
 
2625
                if ( elem ) {
-
 
2626
                        if ( sibDir && elem.nodeType === 1 ){
-
 
2627
                                elem.sizcache = doneName;
-
 
2628
                                elem.sizset = i;
2334
                        }
2629
                        }
-
 
2630
                        elem = elem[dir];
-
 
2631
                        var match = false;
2335
2632
2336
                        if ( scripts ) {
2633
                        while ( elem ) {
-
 
2634
                                if ( elem.sizcache === doneName ) {
2337
                                jQuery.each( scripts, evalScript );
2635
                                        match = checkSet[elem.sizset];
-
 
2636
                                        break;
2338
                        }
2637
                                }
2339
2638
2340
                        if ( cacheable ) {
2639
                                if ( elem.nodeType === 1 && !isXML ){
2341
                                jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
2640
                                        elem.sizcache = doneName;
-
 
2641
                                        elem.sizset = i;
2342
                        }
2642
                                }
-
 
2643
-
 
2644
                                if ( elem.nodeName === cur ) {
-
 
2645
                                        match = elem;
-
 
2646
                                        break;
2343
                }
2647
                                }
2344
2648
2345
                return this;
2649
                                elem = elem[dir];
-
 
2650
                        }
2346
2651
2347
                function root( elem, cur ) {
2652
                        checkSet[i] = match;
2348
                        return jQuery.nodeName(elem, "table") ?
-
 
2349
                                (elem.getElementsByTagName("tbody")[0] ||
-
 
2350
                                elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
-
 
2351
                                elem;
2653
                }
2352
                }
2654
        }
2353
        }
2655
}
2354
});
-
 
2355
-
 
2356
jQuery.fragments = {};
-
 
2357
-
 
2358
jQuery.each({
-
 
2359
        appendTo: "append",
-
 
2360
        prependTo: "prepend",
-
 
2361
        insertBefore: "before",
-
 
2362
        insertAfter: "after",
-
 
2363
        replaceAll: "replaceWith"
-
 
2364
}, function(name, original){
-
 
2365
        jQuery.fn[ name ] = function( selector ) {
-
 
2366
                var ret = [], insert = jQuery( selector );
-
 
2367
2656
-
 
2657
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-
 
2658
        var sibDir = dir == "previousSibling" && !isXML;
2368
                for ( var i = 0, l = insert.length; i < l; i++ ) {
2659
        for ( var i = 0, l = checkSet.length; i < l; i++ ) {
2369
                        var elems = (i > 0 ? this.clone(true) : this).get();
2660
                var elem = checkSet[i];
-
 
2661
                if ( elem ) {
2370
                        jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
2662
                        if ( sibDir && elem.nodeType === 1 ) {
2371
                        ret = ret.concat( elems );
2663
                                elem.sizcache = doneName;
-
 
2664
                                elem.sizset = i;
2372
                }
2665
                        }
-
 
2666
                        elem = elem[dir];
-
 
2667
                        var match = false;
2373
2668
-
 
2669
                        while ( elem ) {
2374
                return this.pushStack( ret, name, selector );
2670
                                if ( elem.sizcache === doneName ) {
-
 
2671
                                        match = checkSet[elem.sizset];
2375
        };
2672
                                        break;
2376
});
2673
                                }
2377
2674
-
 
2675
                                if ( elem.nodeType === 1 ) {
2378
jQuery.each({
2676
                                        if ( !isXML ) {
2379
        // keepData is for internal use only--do not document
2677
                                                elem.sizcache = doneName;
2380
        remove: function( selector, keepData ) {
2678
                                                elem.sizset = i;
-
 
2679
                                        }
2381
                if ( !selector || jQuery.multiFilter( selector, [ this ] ).length ) {
2680
                                        if ( typeof cur !== "string" ) {
2382
                        if ( !keepData && this.nodeType === 1 ) {
2681
                                                if ( elem === cur ) {
2383
                                cleanData( jQuery("*", this).add(this) );
2682
                                                        match = true;
-
 
2683
                                                        break;
2384
                        }
2684
                                                }
2385
2685
2386
                        if ( this.parentNode ) {
2686
                                        } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
2387
                                 this.parentNode.removeChild( this );
2687
                                                match = elem;
-
 
2688
                                                break;
2388
                        }
2689
                                        }
2389
                }
2690
                                }
2390
        },
-
 
2391
2691
2392
        empty: function() {
2692
                                elem = elem[dir];
2393
                // Remove element nodes and prevent memory leaks
-
 
2394
                if ( this.nodeType === 1 ) {
-
 
2395
                        cleanData( jQuery("*", this) );
-
 
2396
                }
2693
                        }
2397
2694
2398
                // Remove any remaining nodes
-
 
2399
                while ( this.firstChild ) {
2695
                        checkSet[i] = match;
2400
                        this.removeChild( this.firstChild );
-
 
2401
                }
2696
                }
2402
        }
2697
        }
-
 
2698
}
-
 
2699
-
 
2700
var contains = document.compareDocumentPosition ?  function(a, b){
2403
}, function(name, fn){
2701
        return a.compareDocumentPosition(b) & 16;
2404
        jQuery.fn[ name ] = function(){
2702
} : function(a, b){
2405
                return this.each( fn, arguments );
2703
        return a !== b && (a.contains ? a.contains(b) : true);
2406
        };
2704
};
2407
});
-
 
2408
2705
2409
jQuery.extend({
2706
var isXML = function(elem){
2410
        clean: function( elems, context, fragment ) {
2707
        return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
2411
                context = context || document;
2708
                !!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";
-
 
2709
};
2412
2710
2413
                // !context.createElement fails in IE with an error but returns typeof 'object'
2711
var posProcess = function(selector, context){
2414
                if ( typeof context.createElement === "undefined" ) {
2712
        var tmpSet = [], later = "", match,
2415
                        context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
2713
                root = context.nodeType ? [context] : context;
2416
                }
-
 
2417
2714
2418
                // If a single string is passed in and it's a single tag
-
 
2419
                // just do a createElement and skip the rest
2715
        // Position selectors must be done after the filter
2420
                if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) {
2716
        // And so must :not(positional) so we move all PSEUDOs to the end
2421
                        var match = rsingleTag.exec(elems[0]);
2717
        while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
2422
                        if ( match ) {
2718
                later += match[0];
2423
                                return [ context.createElement( match[1] ) ];
2719
                selector = selector.replace( Expr.match.PSEUDO, "" );
2424
                        }
-
 
2425
                }
2720
        }
2426
2721
2427
                var ret = [], scripts = [], div = context.createElement("div");
2722
        selector = Expr.relative[selector] ? selector + "*" : selector;
2428
2723
2429
                jQuery.each(elems, function(i, elem){
2724
        for ( var i = 0, l = root.length; i < l; i++ ) {
2430
                        if ( typeof elem === "number" ) {
2725
                Sizzle( selector, root[i], tmpSet );
2431
                                elem += '';
-
 
2432
                        }
2726
        }
2433
2727
2434
                        if ( !elem ) { return; }
2728
        return Sizzle.filter( later, tmpSet );
-
 
2729
};
2435
2730
2436
                        // Convert html string into DOM nodes
2731
// EXPOSE
2437
                        if ( typeof elem === "string" ) {
2732
jQuery.find = Sizzle;
2438
                                // Fix "XHTML"-style tags in all browsers
2733
jQuery.expr = Sizzle.selectors;
2439
                                elem = elem.replace(rxhtmlTag, fcloseTag);
2734
jQuery.expr[":"] = jQuery.expr.filters;
2440
2735
2441
                                // Trim whitespace, otherwise indexOf won't work as expected
2736
Sizzle.selectors.filters.hidden = function(elem){
2442
                                var tags = elem.replace(rleadingWhitespace, "")
2737
        var width = elem.offsetWidth, height = elem.offsetHeight,
-
 
2738
                 force = /^tr$/i.test( elem.nodeName ); // ticket #4512
-
 
2739
        return ( width === 0 && height === 0 && !force ) ?
-
 
2740
                true :
-
 
2741
                        ( width !== 0 && height !== 0 && !force ) ?
-
 
2742
                                false :
2443
                                        .substring(0, 10).toLowerCase();
2743
                                        !!( jQuery.curCSS(elem, "display") === "none" );
-
 
2744
};
2444
2745
2445
                                var wrap =
-
 
2446
                                        // option or optgroup
-
 
2447
                                        !tags.indexOf("<opt") &&
2746
Sizzle.selectors.filters.visible = function(elem){
2448
                                        [ 1, "<select multiple='multiple'>", "</select>" ] ||
2747
        return !Sizzle.selectors.filters.hidden(elem);
-
 
2748
};
2449
2749
2450
                                        !tags.indexOf("<leg") &&
2750
Sizzle.selectors.filters.animated = function(elem){
2451
                                        [ 1, "<fieldset>", "</fieldset>" ] ||
2751
        return jQuery.grep(jQuery.timers, function(fn){
-
 
2752
                return elem === fn.elem;
-
 
2753
        }).length;
-
 
2754
};
2452
2755
-
 
2756
jQuery.filter = jQuery.multiFilter = function( expr, elems, not ) {
2453
                                        rinsideTable.test(tags) &&
2757
        if ( not ) {
2454
                                        [ 1, "<table>", "</table>" ] ||
2758
                expr = ":not(" + expr + ")";
-
 
2759
        }
2455
2760
2456
                                        !tags.indexOf("<tr") &&
2761
        return Sizzle.matches(expr, elems);
2457
                                        [ 2, "<table><tbody>", "</tbody></table>" ] ||
-
 
-
 
2762
};
2458
2763
-
 
2764
jQuery.dir = function( elem, dir ){
2459
                                        // <thead> matched above
2765
        var matched = [], cur = elem[dir];
2460
                                        (!tags.indexOf("<td") || !tags.indexOf("<th")) &&
2766
        while ( cur && cur != document ) {
2461
                                        [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||
2767
                if ( cur.nodeType == 1 )
-
 
2768
                        matched.push( cur );
-
 
2769
                cur = cur[dir];
-
 
2770
        }
-
 
2771
        return matched;
-
 
2772
};
2462
2773
2463
                                        !tags.indexOf("<col") &&
2774
jQuery.nth = function(cur, result, dir, elem){
2464
                                        [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||
2775
        result = result || 1;
-
 
2776
        var num = 0;
2465
2777
2466
                                        // IE can't serialize <link> and <script> tags normally
2778
        for ( ; cur; cur = cur[dir] )
2467
                                        !jQuery.support.htmlSerialize &&
2779
                if ( cur.nodeType == 1 && ++num == result )
2468
                                        [ 1, "div<div>", "</div>" ] ||
2780
                        break;
2469
2781
2470
                                        [ 0, "", "" ];
2782
        return cur;
-
 
2783
};
2471
2784
2472
                                // Go to html and back, then peel off extra wrappers
2785
jQuery.sibling = function(n, elem){
2473
                                div.innerHTML = wrap[1] + elem + wrap[2];
2786
        var r = [];
2474
2787
2475
                                // Move to the right depth
2788
        for ( ; n; n = n.nextSibling ) {
2476
                                while ( wrap[0]-- ) {
2789
                if ( n.nodeType == 1 && n != elem )
2477
                                        div = div.lastChild;
2790
                        r.push( n );
2478
                                }
2791
        }
2479
2792
2480
                                // Remove IE's autoinserted <tbody> from table fragments
-
 
2481
                                if ( !jQuery.support.tbody ) {
2793
        return r;
-
 
2794
};
2482
2795
2483
                                        // String was a <table>, *may* have spurious <tbody>
-
 
2484
                                        var hasBody = rtbody.test(elem),
2796
jQuery.unique = Sizzle.uniqueSort;
2485
                                                tbody = !tags.indexOf("<table") && !hasBody ?
-
 
2486
                                                        div.firstChild && div.firstChild.childNodes :
-
 
2487
2797
-
 
2798
return;
-
 
2799
-
 
2800
window.Sizzle = Sizzle;
-
 
2801
-
 
2802
})();
2488
                                                        // String was a bare <thead> or <tfoot>
2803
var winnow = function( elements, qualifier, keep ) {
2489
                                                        wrap[1] == "<table>" && !hasBody ?
2804
        if(jQuery.isFunction( qualifier )) {
-
 
2805
                return jQuery.grep(elements, function(elem, i) {
2490
                                                                div.childNodes :
2806
                        return !!qualifier.call( elem, i ) === keep;
2491
                                                                [];
2807
                });
-
 
2808
        } else if( qualifier.nodeType ) {
-
 
2809
                return jQuery.grep(elements, function(elem, i) {
-
 
2810
                        return (elem === qualifier) === keep;
-
 
2811
                })
-
 
2812
        } else if( typeof qualifier === "string" ) {
-
 
2813
                var filtered = jQuery.grep(elements, function(elem) { return elem.nodeType === 1 });
2492
2814
2493
                                        for ( var j = tbody.length - 1; j >= 0 ; --j ) {
-
 
2494
                                                if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
2815
                if(isSimple.test( qualifier )) return jQuery.multiFilter(qualifier, filtered, !keep);
2495
                                                        tbody[ j ].parentNode.removeChild( tbody[ j ] );
2816
                else qualifier = jQuery.multiFilter( qualifier, elements );
2496
                                                }
-
 
2497
                                        }
2817
        }
2498
2818
-
 
2819
        return jQuery.grep(elements, function(elem, i) {
-
 
2820
                return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
-
 
2821
        });
2499
                                }
2822
}
2500
2823
2501
                                // IE completely kills leading whitespace when innerHTML is used
2824
jQuery.fn.extend({
2502
                                if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
2825
        find: function( selector ) {
2503
                                        div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
2826
                var ret = this.pushStack( "", "find", selector ), length = 0;
2504
                                }
-
 
2505
2827
2506
                                elem = jQuery.makeArray( div.childNodes );
2828
                for ( var i = 0, l = this.length; i < l; i++ ) {
2507
                        }
2829
                        length = ret.length;
-
 
2830
                        jQuery.find( selector, this[i], ret );
2508
2831
2509
                        if ( elem.nodeType ) {
2832
                        if ( i > 0 ) {
2510
                                ret.push( elem );
2833
                                // Make sure that the results are unique
-
 
2834
                                for ( var n = length; n < ret.length; n++ ) {
-
 
2835
                                        for ( var r = 0; r < length; r++ ) {
2511
                        } else {
2836
                                                if ( ret[r] === ret[n] ) {
2512
                                ret = jQuery.merge( ret, elem );
2837
                                                        ret.splice(n--, 1);
-
 
2838
                                                        break;
2513
                        }
2839
                                                }
2514
-
 
2515
                });
-
 
2516
-
 
2517
                if ( fragment ) {
-
 
2518
                        for ( var i = 0; ret[i]; i++ ) {
-
 
2519
                                if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
-
 
2520
                                        scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
-
 
2521
                                } else {
-
 
2522
                                        if ( ret[i].nodeType === 1 ) {
-
 
2523
                                                ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
-
 
2524
                                        }
2840
                                        }
2525
                                        fragment.appendChild( ret[i] );
-
 
2526
                                }
2841
                                }
2527
                        }
2842
                        }
2528
-
 
2529
                        return scripts;
-
 
2530
                }
2843
                }
2531
2844
2532
                return ret;
2845
                return ret;
2533
        }
2846
        },
2534
});
-
 
2535
2847
2536
function cleanData( elems ) {
2848
        not: function( selector ) {
2537
        for ( var i = 0, l = elems.length; i < l; i++ ) {
2849
                return this.pushStack( winnow(this, selector, false), "not", selector);
2538
                var id = elems[i][expando];
-
 
2539
                if ( id ) {
-
 
2540
                        delete jQuery.cache[ id ];
-
 
2541
                }
-
 
2542
        }
2850
        },
2543
}
-
 
2544
/*
-
 
2545
 * A number of helper functions used for managing events.
-
 
2546
 * Many of the ideas behind this code originated from
-
 
2547
 * Dean Edwards' addEvent library.
-
 
2548
 */
-
 
2549
jQuery.event = {
-
 
2550
2851
2551
        // Bind an event to an element
-
 
2552
        // Original by Dean Edwards
-
 
2553
        add: function( elem, types, handler, data ) {
2852
        filter: function( selector ) {
2554
                if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
2853
                return this.pushStack( winnow(this, selector, true), "filter", selector );
2555
                        return;
-
 
2556
                }
2854
        },
2557
2855
2558
                // For whatever reason, IE has trouble passing the window object
-
 
2559
                // around, causing it to be cloned in the process
2856
        closest: function( selector, context ) {
2560
                if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
2857
                var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null,
2561
                        elem = window;
2858
                        closer = 0;
2562
                }
-
 
2563
2859
-
 
2860
                return this.map(function(){
-
 
2861
                        var cur = this;
2564
                // Make sure that the function being executed has a unique ID
2862
                        while ( cur && cur.ownerDocument && cur !== context ) {
2565
                if ( !handler.guid ) {
2863
                                if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) {
2566
                        handler.guid = this.guid++;
2864
                                        jQuery.data(cur, "closest", closer);
-
 
2865
                                        return cur;
2567
                }
2866
                                }
2568
-
 
2569
                // if data is passed, bind to handler
-
 
2570
                if ( data !== undefined ) {
-
 
2571
                        // Create temporary function pointer to original handler
-
 
2572
                        var fn = handler;
-
 
2573
-
 
2574
                        // Create unique handler function, wrapped around original handler
-
 
2575
                        handler = this.proxy( fn );
2867
                                cur = cur.parentNode;
2576
-
 
2577
                        // Store data in unique handler
-
 
2578
                        handler.data = data;
2868
                                closer++;
2579
                }
2869
                        }
2580
-
 
2581
                // Init the element's event structure
-
 
2582
                var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ),
-
 
2583
                        handle = jQuery.data( elem, "handle" ) || jQuery.data( elem, "handle", function() {
-
 
2584
                                // Handle the second event of a trigger and when
-
 
2585
                                // an event is called after a page has unloaded
-
 
2586
                                return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
-
 
2587
                                        jQuery.event.handle.apply( arguments.callee.elem, arguments ) :
-
 
2588
                                        undefined;
-
 
2589
                        });
2870
                });
2590
                // Add elem as a property of the handle function
-
 
2591
                // This is to prevent a memory leak with non-native
-
 
2592
                // event in IE.
-
 
2593
                handle.elem = elem;
-
 
2594
2871
        },
2595
                // Handle multiple events separated by a space
-
 
2596
                // jQuery(...).bind("mouseover mouseout", fn);
-
 
2597
                types = types.split( /\s+/ );
-
 
2598
                var type, i=0;
-
 
2599
                while ( (type = types[ i++ ]) ) {
-
 
2600
                        // Namespaced event handlers
-
 
2601
                        var namespaces = type.split(".");
-
 
2602
                        type = namespaces.shift();
-
 
2603
                        handler.type = namespaces.slice(0).sort().join(".");
-
 
2604
2872
-
 
2873
        add: function( selector ) {
2605
                        // Get the current list of functions bound to this event
2874
                var set = typeof selector === "string" ?
-
 
2875
                                jQuery( selector ) :
2606
                        var handlers = events[ type ],
2876
                                jQuery.makeArray( selector ),
2607
                                special = this.special[ type ] || {};
2877
                        all = jQuery.merge( this.get(), set );
2608
2878
2609
                        if ( special.add ) {
-
 
2610
                                var modifiedHandler = special.add.call( elem, handler, data, namespaces );
2879
                return this.pushStack( set[0] && (set[0].setInterval || set[0].nodeType === 9 || (set[0].parentNode && set[0].parentNode.nodeType !== 11)) ?
2611
                                if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) {
-
 
2612
                                        modifiedHandler.guid = modifiedHandler.guid || handler.guid;
-
 
2613
                                        handler = modifiedHandler;
2880
                        jQuery.unique( all ) :
2614
                                }
2881
                        all );
2615
                        }
2882
        },
2616
2883
-
 
2884
        eq: function( i ) {
2617
                        // Init the event handler queue
2885
                return i === -1 ?
2618
                        if ( !handlers ) {
2886
                        this.slice( i ) :
2619
                                handlers = events[ type ] = {};
2887
                        this.slice( i, +i + 1 );
-
 
2888
        },
2620
2889
2621
                                // Check for a special event handler
-
 
2622
                                // Only use addEventListener/attachEvent if the special
-
 
2623
                                // events handler returns false
-
 
2624
                                if ( !special.setup || special.setup.call( elem, data, namespaces ) === false ) {
-
 
2625
                                        // Bind the global event handler to the element
-
 
2626
                                        if ( elem.addEventListener ) {
2890
        first: function() {
2627
                                                elem.addEventListener( type, handle, false );
-
 
2628
                                        } else if ( elem.attachEvent ) {
2891
                return this.eq( 0 );
2629
                                                elem.attachEvent( "on" + type, handle );
-
 
2630
                                        }
-
 
2631
                                }
-
 
2632
                        }
2892
        },
2633
2893
2634
                        // Add the function to the element's handler list
2894
        last: function() {
2635
                        handlers[ handler.guid ] = handler;
2895
                return this.eq( -1 );
-
 
2896
        },
2636
2897
-
 
2898
        slice: function() {
2637
                        // Keep track of which events have been used, for global triggering
2899
                return this.pushStack( Array.prototype.slice.apply( this, arguments ),
2638
                        this.global[ type ] = true;
2900
                        "slice", Array.prototype.slice.call(arguments).join(",") );
2639
                }
2901
        },
2640
2902
-
 
2903
        map: function( callback ) {
-
 
2904
                return this.pushStack( jQuery.map(this, function(elem, i){
2641
                // Nullify elem to prevent memory leaks in IE
2905
                        return callback.call( elem, i, elem );
2642
                elem = null;
2906
                }));
2643
        },
2907
        },
2644
2908
2645
        guid: 1,
2909
        andSelf: function() {
-
 
2910
                return this.add( this.prevObject );
2646
        global: {},
2911
        },
2647
2912
2648
        // Detach an event or set of events from an element
-
 
2649
        remove: function( elem, types, handler ) {
2913
        end: function() {
2650
                // don't do events on text and comment nodes
2914
                return this.prevObject || jQuery(null);
2651
                if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
-
 
2652
                        return;
-
 
2653
                }
2915
        }
-
 
2916
});
2654
2917
-
 
2918
jQuery.each({
-
 
2919
        parent: function(elem){return elem.parentNode;},
-
 
2920
        parents: function(elem){return jQuery.dir(elem,"parentNode");},
-
 
2921
        next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
-
 
2922
        prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
-
 
2923
        nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
-
 
2924
        prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
-
 
2925
        siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
-
 
2926
        children: function(elem){return jQuery.sibling(elem.firstChild);},
-
 
2927
        contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
-
 
2928
}, function(name, fn){
-
 
2929
        jQuery.fn[ name ] = function( selector ) {
2655
                var events = jQuery.data( elem, "events" ), ret, type;
2930
                var ret = jQuery.map( this, fn );
2656
2931
2657
                if ( events ) {
-
 
2658
                        // Unbind all events for the element
-
 
2659
                        if ( types === undefined || (typeof types === "string" && types.charAt(0) === ".") ) {
-
 
2660
                                for ( type in events ) {
-
 
2661
                                        this.remove( elem, type + (types || "") );
2932
                if ( selector && typeof selector === "string" ) {
2662
                                }
-
 
2663
                        } else {
-
 
2664
                                // types is actually an event object here
2933
                        ret = jQuery.multiFilter( selector, ret );
2665
                                if ( types.type ) {
-
 
2666
                                        handler = types.handler;
-
 
2667
                                        types = types.type;
-
 
2668
                                }
2934
                }
2669
2935
2670
                                // Handle multiple events seperated by a space
-
 
2671
                                // jQuery(...).unbind("mouseover mouseout", fn);
-
 
2672
                                types = types.split(/\s+/);
-
 
2673
                                var i = 0;
-
 
2674
                                while ( (type = types[ i++ ]) ) {
-
 
2675
                                        // Namespaced event handlers
-
 
2676
                                        var namespaces = type.split(".");
-
 
2677
                                        type = namespaces.shift();
-
 
2678
                                        var all = !namespaces.length,
-
 
2679
                                                namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join(".*\\.") + "(\\.|$)"),
-
 
2680
                                                special = this.special[ type ] || {};
-
 
2681
-
 
2682
                                        if ( events[ type ] ) {
-
 
2683
                                                // remove the given handler for the given type
2936
                ret = this.length > 1 ? jQuery.unique( ret ) : ret;
2684
                                                if ( handler ) {
-
 
2685
                                                        delete events[ type ][ handler.guid ];
-
 
2686
2937
2687
                                                // remove all handlers for the given type
2938
                if ( name === "parents" && this.length > 1 ) {
2688
                                                } else {
2939
                        ret = ret.reverse();
2689
                                                        for ( var handle in events[ type ] ) {
-
 
2690
                                                                // Handle the removal of namespaced events
-
 
2691
                                                                if ( all || namespace.test( events[ type ][ handle ].type ) ) {
-
 
2692
                                                                        delete events[ type ][ handle ];
-
 
2693
                                                                }
-
 
2694
                                                        }
-
 
2695
                                                }
2940
                }
2696
2941
-
 
2942
                return this.pushStack( ret, name, selector );
-
 
2943
        };
-
 
2944
});
-
 
2945
jQuery.fn.extend({
2697
                                                if ( special.remove ) {
2946
        attr: function( name, value ) {
2698
                                                        special.remove.call( elem, namespaces );
2947
                return access(this, name, value, true, jQuery.attr);
2699
                                                }
2948
        },
2700
2949
-
 
2950
        addClass: function( value ) {
2701
                                                // remove generic event handler if no more handlers exist
2951
                if ( value && typeof value === "string" ) {
-
 
2952
                        var classNames = (value || "").split(/\s+/);
-
 
2953
2702
                                                for ( ret in events[ type ] ) {
2954
                        for ( var i = 0, l = this.length; i < l; i++ ) {
2703
                                                        break;
2955
                                var elem = this[i];
2704
                                                }
2956
-
 
2957
                                if ( elem.nodeType === 1 ) {
2705
                                                if ( !ret ) {
2958
                                        if ( !elem.className ) {
2706
                                                        if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
2959
                                                elem.className = value;
-
 
2960
                                        } else {
2707
                                                                if ( elem.removeEventListener ) {
2961
                                                var className = " " + elem.className + " ";
2708
                                                                        elem.removeEventListener( type, jQuery.data( elem, "handle" ), false );
2962
                                                for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
2709
                                                                } else if ( elem.detachEvent ) {
2963
                                                        if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
2710
                                                                        elem.detachEvent( "on" + type, jQuery.data( elem, "handle" ) );
2964
                                                                elem.className += " " + classNames[c];
2711
                                                                }
2965
                                                        }
2712
                                                        }
2966
                                                }
2713
                                                        ret = null;
-
 
2714
                                                        delete events[ type ];
-
 
2715
                                                }
2967
                                        }
2716
                                        }
2968
                                }
2717
                                }
2969
                        }
2718
                        }
2970
                }
2719
2971
2720
                        // Remove the expando if it's no longer used
-
 
2721
                        for ( ret in events ) {
-
 
2722
                                break;
2972
                return this;
2723
                        }
-
 
2724
                        if ( !ret ) {
-
 
2725
                                var handle = jQuery.data( elem, "handle" );
-
 
2726
                                if ( handle ) {
-
 
2727
                                        handle.elem = null;
-
 
2728
                                }
-
 
2729
                                jQuery.removeData( elem, "events" );
-
 
2730
                                jQuery.removeData( elem, "handle" );
-
 
2731
                        }
-
 
2732
                }
-
 
2733
        },
2973
        },
2734
2974
2735
        // bubbling is internal
2975
        removeClass: function( value ) {
2736
        trigger: function( event, data, elem /*, bubbling */ ) {
2976
                if ( (value && typeof value === "string") || value === undefined ) {
2737
                // Event object or event type
-
 
2738
                var type = event.type || event,
2977
                        var classNames = (value || "").split(/\s+/);
2739
                        bubbling = arguments[3];
-
 
2740
2978
2741
                if ( !bubbling ) {
-
 
2742
                        event = typeof event === "object" ?
-
 
2743
                                // jQuery.Event object
-
 
2744
                                event[expando] ? event :
-
 
2745
                                // Object literal
-
 
2746
                                jQuery.extend( jQuery.Event(type), event ) :
2979
                        for ( var i = 0, l = this.length; i < l; i++ ) {
2747
                                // Just the event type (string)
-
 
2748
                                jQuery.Event(type);
2980
                                var elem = this[i];
2749
2981
2750
                        if ( type.indexOf("!") >= 0 ) {
2982
                                if ( elem.nodeType === 1 && elem.className ) {
-
 
2983
                                        if ( value ) {
2751
                                event.type = type = type.slice(0, -1);
2984
                                        var className = " " + elem.className + " ";
-
 
2985
                                                for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
-
 
2986
                                                        className = className.replace(" " + classNames[c] + " ", " ");
-
 
2987
                                                }
-
 
2988
                                                elem.className = className.substring(1, className.length - 1);
-
 
2989
                                        } else {
2752
                                event.exclusive = true;
2990
                                                elem.className = "";
2753
                        }
2991
                                        }
2754
-
 
2755
                        // Handle a global trigger
-
 
2756
                        if ( !elem ) {
-
 
2757
                                // Don't bubble custom events when global (to avoid too much overhead)
-
 
2758
                                event.stopPropagation();
-
 
2759
                                // Only trigger if we've ever bound an event for it
-
 
2760
                                if ( this.global[ type ] ) {
-
 
2761
                                        jQuery.each( jQuery.cache, function() {
-
 
2762
                                                if ( this.events && this.events[type] ) {
-
 
2763
                                                        jQuery.event.trigger( event, data, this.handle.elem );
-
 
2764
                                                }
2992
                                }
2765
                                        });
-
 
2766
                                }
2993
                        }
2767
                        }
2994
                }
2768
2995
2769
                        // Handle triggering a single element
2996
                return this;
-
 
2997
        },
2770
2998
-
 
2999
        hasClass: function( selector ) {
-
 
3000
                var className = " " + selector + " ";
2771
                        // don't do events on text and comment nodes
3001
                for ( var i = 0, l = this.length; i < l; i++ ) {
2772
                        if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
3002
                        if ( (" " + this[i].className + " ").indexOf( className ) > -1 ) {
2773
                                return undefined;
3003
                                return true;
-
 
3004
                        }
2774
                        }
3005
                }
2775
3006
2776
                        // Clean up in case it is reused
-
 
2777
                        event.result = undefined;
-
 
2778
                        event.target = elem;
3007
                return false;
-
 
3008
        },
2779
3009
2780
                        // Clone the incoming data, if any
3010
        val: function( value ) {
2781
                        data = jQuery.makeArray( data );
3011
                if ( value === undefined ) {
2782
                        data.unshift( event );
3012
                        var elem = this[0];
2783
                }
-
 
2784
3013
-
 
3014
                        if ( elem ) {
2785
                event.currentTarget = elem;
3015
                                if( jQuery.nodeName( elem, 'option' ) )
-
 
3016
                                        return (elem.attributes.value || {}).specified ? elem.value : elem.text;
2786
3017
2787
                // Trigger the event, it is assumed that "handle" is a function
3018
                                // We need to handle select boxes special
2788
                var handle = jQuery.data( elem, "handle" );
3019
                                if ( jQuery.nodeName( elem, "select" ) ) {
-
 
3020
                                        var index = elem.selectedIndex,
2789
                if ( handle ) {
3021
                                                values = [],
2790
                        handle.apply( elem, data );
3022
                                                options = elem.options,
2791
                }
-
 
-
 
3023
                                                one = elem.type == "select-one";
2792
3024
2793
                var nativeFn, nativeHandler;
3025
                                        // Nothing was selected
-
 
3026
                                        if ( index < 0 )
2794
                try {
3027
                                                return null;
-
 
3028
-
 
3029
                                        // Loop through all the selected options
-
 
3030
                                        for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
2795
                        nativeFn = elem[ type ];
3031
                                                var option = options[ i ];
-
 
3032
-
 
3033
                                                if ( option.selected ) {
-
 
3034
                                                        // Get the specifc value for the option
2796
                        nativeHandler = elem[ "on" + type ];
3035
                                                        value = jQuery(option).val();
-
 
3036
2797
                // prevent IE from throwing an error for some elements with some event types, see #3533
3037
                                                        // We don't need an array for one selects
2798
                } catch (e) {}
3038
                                                        if ( one )
2799
                // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
3039
                                                                return value;
-
 
3040
2800
                if ( (!nativeFn || (jQuery.nodeName(elem, 'a') && type === "click")) && nativeHandler && nativeHandler.apply( elem, data ) === false ) {
3041
                                                        // Multi-Selects return an array
2801
                        event.result = false;
3042
                                                        values.push( value );
-
 
3043
                                                }
2802
                }
3044
                                        }
2803
3045
2804
                // Trigger the native events (except for clicks on links)
-
 
2805
                if ( !bubbling && nativeFn && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type === "click") ) {
-
 
2806
                        this.triggered = true;
-
 
2807
                        try {
-
 
2808
                                nativeFn();
3046
                                        return values;
2809
                        // prevent IE from throwing an error for some hidden elements
-
 
2810
                        } catch (e) {}
-
 
2811
                }
3047
                                }
2812
3048
2813
                this.triggered = false;
3049
                                // Everything else, we just grab the value
-
 
3050
                                return (elem.value || "").replace(/\r/g, "");
2814
3051
2815
                if ( !event.isPropagationStopped() ) {
-
 
2816
                        var parent = elem.parentNode || elem.ownerDocument;
-
 
2817
                        if ( parent ) {
-
 
2818
                                jQuery.event.trigger( event, data, parent, true );
-
 
2819
                        }
-
 
2820
                }
3052
                        }
2821
        },
-
 
2822
3053
2823
        handle: function( event ) {
-
 
2824
                // returned undefined or false
3054
                        return undefined;
2825
                var all, handlers;
3055
                }
2826
3056
2827
                event = arguments[0] = jQuery.event.fix( event || window.event );
3057
                // Typecast once if the value is a number
2828
                event.currentTarget = this;
3058
                if ( typeof value === "number" )
-
 
3059
                        value += '';
2829
3060
                       
2830
                // Namespaced event handlers
3061
                var val = value;
2831
                var namespaces = event.type.split(".");
-
 
2832
                event.type = namespaces.shift();
-
 
2833
3062
-
 
3063
                return this.each(function(){
-
 
3064
                        if(jQuery.isFunction(value)) {
-
 
3065
                                val = value.call(this);
2834
                // Cache this now, all = true means, any handler
3066
                                // Typecast each time if the value is a Function and the appended
2835
                all = !namespaces.length && !event.exclusive;
3067
                                // value is therefore different each time.
-
 
3068
                                if( typeof val === "number" ) val += '';
-
 
3069
                        }
2836
3070
                       
2837
                var namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join(".*\\.") + "(\\.|$)");
3071
                        if ( this.nodeType != 1 )
-
 
3072
                                return;
2838
3073
-
 
3074
                        if ( jQuery.isArray(val) && /radio|checkbox/.test( this.type ) )
2839
                handlers = ( jQuery.data(this, "events") || {} )[ event.type ];
3075
                                this.checked = jQuery.inArray(this.value || this.name, val) >= 0;
2840
3076
2841
                for ( var j in handlers ) {
3077
                        else if ( jQuery.nodeName( this, "select" ) ) {
2842
                        var handler = handlers[ j ];
3078
                                var values = jQuery.makeArray(val);
2843
3079
2844
                        // Filter the functions by class
-
 
2845
                        if ( all || namespace.test(handler.type) ) {
3080
                                jQuery( "option", this ).each(function(){
2846
                                // Pass in a reference to the handler function itself
3081
                                        this.selected = jQuery.inArray( this.value || this.text, values ) >= 0;
2847
                                // So that we can later remove it
-
 
2848
                                event.handler = handler;
3082
                                });
2849
                                event.data = handler.data;
-
 
2850
3083
2851
                                var ret = handler.apply( this, arguments );
3084
                                if ( !values.length )
-
 
3085
                                        this.selectedIndex = -1;
2852
3086
2853
                                if ( ret !== undefined ) {
-
 
2854
                                        event.result = ret;
3087
                        } else
2855
                                        if ( ret === false ) {
3088
                                this.value = val;
2856
                                                event.preventDefault();
-
 
2857
                                                event.stopPropagation();
-
 
2858
                                        }
3089
                });
2859
                                }
3090
        }
-
 
3091
});
2860
3092
-
 
3093
jQuery.each({
2861
                                if ( event.isImmediatePropagationStopped() ) {
3094
        removeAttr: function( name ) {
-
 
3095
                jQuery.attr( this, name, "" );
-
 
3096
                if (this.nodeType == 1)
2862
                                        break;
3097
                        this.removeAttribute( name );
2863
                                }
3098
        },
2864
3099
-
 
3100
        toggleClass: function( classNames, state ) {
-
 
3101
                var type = typeof classNames;
-
 
3102
                if ( type === "string" ) {
-
 
3103
                        // toggle individual class names
-
 
3104
                        var isBool = typeof state === "boolean", className, i = 0,
-
 
3105
                                classNames = classNames.split( /\s+/ );
-
 
3106
                        while ( (className = classNames[ i++ ]) ) {
-
 
3107
                                // check each className given, space seperated list
-
 
3108
                                state = isBool ? state : !jQuery(this).hasClass( className );
-
 
3109
                                jQuery(this)[ state ? "addClass" : "removeClass" ]( className );
2865
                        }
3110
                        }
-
 
3111
                } else if ( type === "undefined" || type === "boolean" ) {
-
 
3112
                        if ( this.className ) {
-
 
3113
                                // store className if set
-
 
3114
                                jQuery.data( this, "__className__", this.className );
2866
                }
3115
                        }
-
 
3116
                        // toggle whole className
-
 
3117
                        this.className = this.className || classNames === false ? "" : jQuery.data( this, "__className__" ) || "";
-
 
3118
                }
-
 
3119
        }
-
 
3120
}, function(name, fn){
-
 
3121
        jQuery.fn[ name ] = function(){
-
 
3122
                return this.each( fn, arguments );
2867
        },
3123
        };
-
 
3124
});
2868
3125
-
 
3126
jQuery.extend({
-
 
3127
        attr: function( elem, name, value ) {
-
 
3128
                // don't set attributes on text and comment nodes
2869
        props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
3129
                if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
-
 
3130
                        return undefined;
2870
3131
2871
        fix: function( event ) {
-
 
2872
                if ( event[ expando ] ) {
3132
                if ( name in jQuery.fn && name !== "attr" ) {
2873
                        return event;
3133
                        return jQuery(elem)[name](value);
2874
                }
3134
                }
2875
3135
               
2876
                // store a copy of the original event object
3136
                var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
2877
                // and "clone" to set read-only properties
3137
                        // Whether we are setting (or getting)
2878
                var originalEvent = event;
3138
                        set = value !== undefined;
2879
                event = jQuery.Event( originalEvent );
-
 
2880
3139
2881
                for ( var i = this.props.length, prop; i; ) {
-
 
2882
                        prop = this.props[ --i ];
3140
                // Try to normalize/fix the name
2883
                        event[ prop ] = originalEvent[ prop ];
3141
                name = notxml && jQuery.props[ name ] || name;
2884
                }
-
 
2885
3142
2886
                // Fix target property, if necessary
3143
                // Only do all the following if this is a node (faster for style)
2887
                if ( !event.target ) {
3144
                if ( elem.nodeType === 1 ) {
2888
                        event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
-
 
2889
                }
-
 
2890
3145
2891
                // check if target is a textnode (safari)
3146
                        // These attributes require special treatment
2892
                if ( event.target.nodeType === 3 ) {
-
 
2893
                        event.target = event.target.parentNode;
3147
                        var special = /href|src|style/.test( name );
2894
                }
-
 
2895
3148
-
 
3149
                        // Safari mis-reports the default selected property of a hidden option
2896
                // Add relatedTarget, if necessary
3150
                        // Accessing the parent's selectedIndex property fixes it
2897
                if ( !event.relatedTarget && event.fromElement ) {
3151
                        if ( name == "selected" && elem.parentNode )
2898
                        event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
3152
                                elem.parentNode.selectedIndex;
2899
                }
-
 
2900
3153
2901
                // Calculate pageX/Y if missing and clientX/Y available
3154
                        // If applicable, access the attribute via the DOM 0 way
2902
                if ( event.pageX == null && event.clientX != null ) {
3155
                        if ( name in elem && notxml && !special ) {
-
 
3156
                                if ( set ){
2903
                        var doc = document.documentElement, body = document.body;
3157
                                        // We can't allow the type property to be changed (since it causes problems in IE)
2904
                        event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
3158
                                        if ( name == "type" && /(button|input)/i.test(elem.nodeName) && elem.parentNode )
2905
                        event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
3159
                                                throw "type property can't be changed";
2906
                }
-
 
2907
3160
2908
                // Add which for key events
3161
                                        elem[ name ] = value;
2909
                if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
-
 
2910
                        event.which = event.charCode || event.keyCode;
-
 
2911
                }
3162
                                }
2912
3163
2913
                // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
3164
                                // browsers index elements by id/name on forms, give priority to attributes.
-
 
3165
                                if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
-
 
3166
                                        return elem.getAttributeNode( name ).nodeValue;
-
 
3167
-
 
3168
                                // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
-
 
3169
                                // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
2914
                if ( !event.metaKey && event.ctrlKey ) {
3170
                                if ( name == "tabIndex" ) {
-
 
3171
                                        var attributeNode = elem.getAttributeNode( "tabIndex" );
-
 
3172
                                        return attributeNode && attributeNode.specified
2915
                        event.metaKey = event.ctrlKey;
3173
                                                ? attributeNode.value
-
 
3174
                                                : /(button|input|object|select|textarea)/i.test(elem.nodeName)
-
 
3175
                                                        ? 0
-
 
3176
                                                        : /^(a|area)$/i.test(elem.nodeName) && elem.href
-
 
3177
                                                                ? 0
-
 
3178
                                                                : undefined;
2916
                }
3179
                                }
2917
3180
2918
                // Add which for click: 1 == left; 2 == middle; 3 == right
-
 
2919
                // Note: button is not normalized, so don't use it
3181
                                return elem[ name ];
2920
                if ( !event.which && event.button !== undefined ) {
-
 
2921
                        event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
-
 
2922
                }
3182
                        }
2923
3183
-
 
3184
                        if ( !jQuery.support.style && notxml && name == "style" ) {
2924
                return event;
3185
                                if ( set )
2925
        },
-
 
-
 
3186
                                        elem.style.cssText = "" + value;
2926
3187
2927
        proxy: function( fn, proxy, thisObject ) {
-
 
2928
                if ( proxy !== undefined && !jQuery.isFunction( proxy ) ) {
-
 
2929
                        thisObject = proxy;
3188
                                return elem.style.cssText;
2930
                        proxy = undefined;
-
 
2931
                }
3189
                        }
2932
                // FIXME: Should proxy be redefined to be applied with thisObject if defined?
-
 
2933
                proxy = proxy || function() { return fn.apply( thisObject !== undefined ? thisObject : this, arguments ); };
-
 
2934
                // Set the guid of unique handler to the same of original handler, so it can be removed
-
 
2935
                proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
-
 
2936
                // So proxy can be declared as an argument
-
 
2937
                return proxy;
-
 
2938
        },
-
 
2939
-
 
2940
        special: {
-
 
2941
                ready: {
-
 
2942
                        // Make sure the ready event is setup
-
 
2943
                        setup: bindReady,
-
 
2944
                        teardown: function() {}
-
 
2945
                },
-
 
2946
3190
2947
                live: {
3191
                        if ( set )
2948
                        add: function( proxy, data, namespaces ) {
3192
                                // convert the value to a string (all browsers do this but IE) see #1070
2949
                                jQuery.extend( proxy, data || {} );
3193
                                elem.setAttribute( name, "" + value );
2950
                                proxy.guid += data.selector + data.live;
-
 
2951
                                jQuery.event.add( this, data.live, liveHandler );
-
 
2952
                        },
-
 
2953
3194
-
 
3195
                        var attr = !jQuery.support.hrefNormalized && notxml && special
2954
                        remove: function( namespaces ) {
3196
                                        // Some attributes require a special call on IE
2955
                                if ( namespaces.length ) {
3197
                                        ? elem.getAttribute( name, 2 )
2956
                                        var remove = 0, name = new RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
3198
                                        : elem.getAttribute( name );
2957
3199
2958
                                        jQuery.each( (jQuery.data(this, "events").live || {}), function() {
3200
                        // Non-existent attributes return null, we normalize to undefined
2959
                                                if ( name.test(this.type) ) {
3201
                        return attr === null ? undefined : attr;
2960
                                                        remove++;
-
 
2961
                                                }
3202
                }
2962
                                        });
-
 
2963
3203
2964
                                        if ( remove < 1 ) {
3204
                // elem is actually elem.style ... set the style
-
 
3205
                // Using attr for specific style information is now deprecated. Use style insead.
2965
                                                jQuery.event.remove( this, namespaces[0], liveHandler );
3206
                return jQuery.style(elem, name, value);
2966
                                        }
-
 
2967
                                }
-
 
2968
                        }
-
 
2969
                }
-
 
2970
        }
3207
        }
-
 
3208
});
-
 
3209
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
-
 
3210
        rleadingWhitespace = /^\s+/,
-
 
3211
        rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
-
 
3212
        rselfClosing = /^(?:abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i,
-
 
3213
        rtagName = /<([\w:]+)/,
-
 
3214
        rtbody = /<tbody/i,
-
 
3215
        rhtml = /</,
-
 
3216
        fcloseTag = function(all, front, tag){
-
 
3217
                return rselfClosing.test(tag) ?
-
 
3218
                        all :
-
 
3219
                        front + "></" + tag + ">";
-
 
3220
        },
-
 
3221
        wrapMap = {
-
 
3222
                option: [ 1, "<select multiple='multiple'>", "</select>" ],
-
 
3223
                legend: [ 1, "<fieldset>", "</fieldset>" ],
-
 
3224
                thead: [ 1, "<table>", "</table>" ],
-
 
3225
                tr: [ 2, "<table><tbody>", "</tbody></table>" ],
-
 
3226
                td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
-
 
3227
                col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
-
 
3228
                _default: [ 0, "", "" ]
2971
};
3229
        };
2972
3230
2973
jQuery.Event = function( src ){
3231
wrapMap.optgroup = wrapMap.option;
2974
        // Allow instantiation without the 'new' keyword
3232
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
2975
        if ( !this.preventDefault ) {
3233
wrapMap.th = wrapMap.td;
2976
                return new jQuery.Event( src );
-
 
2977
        }
-
 
2978
3234
2979
        // Event object
3235
// IE can't serialize <link> and <script> tags normally
2980
        if ( src && src.type ) {
3236
if ( !jQuery.support.htmlSerialize ) {
2981
                this.originalEvent = src;
3237
        wrapMap._default = [ 1, "div<div>", "</div>" ];
2982
                this.type = src.type;
-
 
2983
        // Event type
-
 
2984
        } else {
-
 
2985
                this.type = src;
-
 
2986
        }
3238
}
2987
3239
-
 
3240
jQuery.fn.extend({
2988
        // timeStamp is buggy for some events on Firefox(#3843)
3241
        text: function( text ) {
2989
        // So we won't rely on the native value
3242
                if ( typeof text !== "object" && text !== undefined )
2990
        this.timeStamp = now();
3243
                        return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
2991
3244
2992
        // Mark it as fixed
3245
                var ret = "";
2993
        this[ expando ] = true;
-
 
2994
};
-
 
2995
3246
-
 
3247
                jQuery.each( text || this, function(){
-
 
3248
                        jQuery.each( this.childNodes, function(){
2996
function returnFalse() {
3249
                                if ( this.nodeType !== 8 ) {
2997
        return false;
3250
                                        ret += this.nodeType !== 1 ?
2998
}
-
 
2999
function returnTrue() {
3251
                                                this.nodeValue :
3000
        return true;
3252
                                                jQuery.fn.text( [ this ] );
3001
}
3253
                                }
-
 
3254
                        });
-
 
3255
                });
3002
3256
3003
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-
 
3004
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-
 
3005
jQuery.Event.prototype = {
-
 
3006
        preventDefault: function() {
-
 
3007
                this.isDefaultPrevented = returnTrue;
-
 
3008
-
 
3009
                var e = this.originalEvent;
-
 
3010
                if ( !e ) {
-
 
3011
                        return;
3257
                return ret;
3012
                }
-
 
3013
                // if preventDefault exists run it on the original event
-
 
3014
                if ( e.preventDefault ) {
-
 
3015
                        e.preventDefault();
-
 
3016
                }
-
 
3017
                // otherwise set the returnValue property of the original event to false (IE)
-
 
3018
                e.returnValue = false;
-
 
3019
        },
3258
        },
3020
        stopPropagation: function() {
-
 
3021
                this.isPropagationStopped = returnTrue;
-
 
3022
3259
3023
                var e = this.originalEvent;
3260
        wrapAll: function( html ) {
3024
                if ( !e ) {
3261
                if ( jQuery.isFunction( html ) ) {
-
 
3262
                        return this.each(function() {
-
 
3263
                                jQuery(this).wrapAll( html.apply(this, arguments) );
3025
                        return;
3264
                        });
3026
                }
3265
                }
-
 
3266
-
 
3267
                if ( this[0] ) {
3027
                // if stopPropagation exists run it on the original event
3268
                        // The elements to wrap the target around
-
 
3269
                        var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone();
-
 
3270
3028
                if ( e.stopPropagation ) {
3271
                        if ( this[0].parentNode ) {
3029
                        e.stopPropagation();
3272
                                wrap.insertBefore( this[0] );
3030
                }
3273
                        }
3031
                // otherwise set the cancelBubble property of the original event to true (IE)
-
 
3032
                e.cancelBubble = true;
-
 
3033
        },
3274
3034
        stopImmediatePropagation: function(){
-
 
3035
                this.isImmediatePropagationStopped = returnTrue;
-
 
3036
                this.stopPropagation();
3275
                        wrap.map(function(){
3037
        },
-
 
3038
        isDefaultPrevented: returnFalse,
3276
                                var elem = this;
3039
        isPropagationStopped: returnFalse,
-
 
3040
        isImmediatePropagationStopped: returnFalse
-
 
3041
};
3277
3042
// Checks if an event happened on an element within another element
3278
                                while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
3043
// Used in jQuery.event.special.mouseenter and mouseleave handlers
-
 
3044
var withinElement = function( event ) {
-
 
3045
        // Check if mouse(over|out) are still within the same parent element
-
 
3046
        var parent = event.relatedTarget;
3279
                                        elem = elem.firstChild;
3047
        // Traverse up the tree
-
 
3048
        while ( parent && parent != this ) {
-
 
3049
                // Firefox sometimes assigns relatedTarget a XUL element
-
 
3050
                // which we cannot access the parentNode property of
-
 
3051
                try { parent = parent.parentNode; }
-
 
3052
                // assuming we've left the element since we most likely mousedover a xul element
-
 
3053
                catch(e) { break; }
-
 
3054
        }
3280
                                }
3055
3281
3056
        if ( parent != this ) {
3282
                                return elem;
3057
                // set the correct event type
-
 
3058
                event.type = event.data;
3283
                        }).append(this);
3059
                // handle event if we actually just moused on to a non sub-element
-
 
3060
                jQuery.event.handle.apply( this, arguments );
-
 
3061
        }
3284
                }
3062
};
-
 
3063
3285
3064
jQuery.each({
-
 
3065
        mouseover: 'mouseenter',
-
 
3066
        mouseout: 'mouseleave'
-
 
3067
}, function( orig, fix ) {
-
 
3068
        jQuery.event.special[ fix ] = {
-
 
3069
                setup: function(){
3286
                return this;
3070
                        jQuery.event.add( this, orig, withinElement, fix );
-
 
3071
                },
3287
        },
-
 
3288
-
 
3289
        wrapInner: function( html ) {
3072
                teardown: function(){
3290
                return this.each(function(){
3073
                        jQuery.event.remove( this, orig, withinElement );
3291
                        jQuery( this ).contents().wrapAll( html );
3074
                }
-
 
3075
        };
-
 
3076
});
3292
                });
-
 
3293
        },
3077
3294
3078
jQuery.fn.extend({
-
 
3079
        bind: function( type, data, fn, thisObject ) {
-
 
3080
                if ( jQuery.isFunction( data ) ) {
3295
        wrap: function( html ) {
3081
                        if ( fn !== undefined ) {
3296
                return this.each(function(){
3082
                                thisObject = fn;
-
 
3083
                        }
-
 
3084
                        fn = data;
-
 
3085
                        data = undefined;
-
 
3086
                }
-
 
3087
                fn = thisObject === undefined ? fn : jQuery.event.proxy( fn, thisObject );
-
 
3088
                return type === "unload" ? this.one(type, data, fn, thisObject) : this.each(function() {
-
 
3089
                        jQuery.event.add( this, type, fn, data );
3297
                        jQuery( this ).wrapAll( html );
3090
                });
3298
                });
3091
        },
3299
        },
3092
3300
3093
        one: function( type, data, fn, thisObject ) {
3301
        unwrap: function() {
3094
                if ( jQuery.isFunction( data ) ) {
3302
                return this.parent().each(function(){
3095
                        if ( fn !== undefined ) {
3303
                        if ( !jQuery.nodeName( this, "body" ) ) {
3096
                                thisObject = fn;
3304
                                jQuery( this ).replaceWith( this.childNodes );
3097
                        }
3305
                        }
3098
                        fn = data;
3306
                }).end();
-
 
3307
        },
-
 
3308
       
3099
                        data = undefined;
3309
        append: function() {
-
 
3310
                return this.domManip(arguments, true, function(elem){
-
 
3311
                        if ( this.nodeType === 1 ) {
-
 
3312
                                this.appendChild( elem );
3100
                }
3313
                        }
3101
                fn = thisObject === undefined ? fn : jQuery.event.proxy( fn, thisObject );
-
 
3102
                var one = jQuery.event.proxy( fn, function( event ) {
-
 
3103
                        jQuery( this ).unbind( event, one );
-
 
3104
                        return fn.apply( this, arguments );
-
 
3105
                });
-
 
3106
                return this.each(function() {
-
 
3107
                        jQuery.event.add( this, type, one, data );
-
 
3108
                });
3314
                });
3109
        },
3315
        },
3110
3316
3111
        unbind: function( type, fn ) {
3317
        prepend: function() {
-
 
3318
                return this.domManip(arguments, true, function(elem){
3112
                return this.each(function() {
3319
                        if ( this.nodeType === 1 ) {
3113
                        jQuery.event.remove( this, type, fn );
3320
                                this.insertBefore( elem, this.firstChild );
-
 
3321
                        }
3114
                });
3322
                });
3115
        },
3323
        },
3116
3324
3117
        trigger: function( type, data ) {
3325
        before: function() {
-
 
3326
                if ( this[0] && this[0].parentNode ) {
3118
                return this.each(function() {
3327
                        return this.domManip(arguments, false, function(elem){
3119
                        jQuery.event.trigger( type, data, this );
3328
                                this.parentNode.insertBefore( elem, this );
3120
                });
3329
                        });
-
 
3330
                } else if ( arguments.length ) {
-
 
3331
                        var set = jQuery(arguments[0]);
-
 
3332
                        set.push.apply( set, this.toArray() );
-
 
3333
                        return this.pushStack( set, "before", arguments );
-
 
3334
                }
3121
        },
3335
        },
3122
3336
3123
        triggerHandler: function( type, data ) {
3337
        after: function() {
3124
                if ( this[0] ) {
3338
                if ( this[0] && this[0].parentNode ) {
-
 
3339
                        return this.domManip(arguments, false, function(elem){
3125
                        var event = jQuery.Event( type );
3340
                                this.parentNode.insertBefore( elem, this.nextSibling );
-
 
3341
                        });
3126
                        event.preventDefault();
3342
                } else if ( arguments.length ) {
3127
                        event.stopPropagation();
3343
                        var set = this.pushStack( this, "after", arguments );
3128
                        jQuery.event.trigger( event, data, this[0] );
3344
                        set.push.apply( set, jQuery(arguments[0]).toArray() );
3129
                        return event.result;
3345
                        return set;
3130
                }
3346
                }
3131
        },
3347
        },
3132
3348
3133
        toggle: function( fn ) {
3349
        clone: function( events ) {
-
 
3350
                // Do the clone
-
 
3351
                var ret = this.map(function(){
-
 
3352
                        if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
-
 
3353
                                // IE copies events bound via attachEvent when
-
 
3354
                                // using cloneNode. Calling detachEvent on the
-
 
3355
                                // clone will also remove the events from the orignal
3134
                // Save reference to arguments for access in closure
3356
                                // In order to get around this, we use innerHTML.
-
 
3357
                                // Unfortunately, this means some modifications to
-
 
3358
                                // attributes in IE that are actually only stored
-
 
3359
                                // as properties will not be copied (such as the
-
 
3360
                                // the name attribute on an input).
-
 
3361
                                var html = this.outerHTML, ownerDocument = this.ownerDocument;
-
 
3362
                                if ( !html ) {
-
 
3363
                                        var div = ownerDocument.createElement("div");
-
 
3364
                                        div.appendChild( this.cloneNode(true) );
3135
                var args = arguments, i = 1;
3365
                                        html = div.innerHTML;
-
 
3366
                                }
3136
3367
-
 
3368
                                return jQuery.clean([html.replace(rinlinejQuery, "")
3137
                // link all the functions, so any of them can unbind this click handler
3369
                                        .replace(rleadingWhitespace, "")], ownerDocument)[0];
3138
                while( i < args.length ) {
3370
                        } else {
3139
                        jQuery.event.proxy( fn, args[ i++ ] );
3371
                                return this.cloneNode(true);
3140
                }
3372
                        }
-
 
3373
                });
3141
3374
3142
                return this.click( jQuery.event.proxy( fn, function( event ) {
3375
                // Copy the events from the original to the clone
3143
                        // Figure out which function to execute
3376
                if ( events === true ) {
3144
                        this.lastToggle = ( this.lastToggle || 0 ) % i;
3377
                        var orig = this.find("*").andSelf(), i = 0;
3145
3378
3146
                        // Make sure that clicks stop
3379
                        ret.find("*").andSelf().each(function(){
3147
                        event.preventDefault();
3380
                                if ( this.nodeName !== orig[i].nodeName ) { return; }
3148
3381
3149
                        // and execute the function
-
 
3150
                        return args[ this.lastToggle++ ].apply( this, arguments ) || false;
3382
                                var events = jQuery.data( orig[i], "events" );
3151
                }));
-
 
3152
        },
-
 
3153
3383
3154
        hover: function( fnOver, fnOut ) {
3384
                                for ( var type in events ) {
-
 
3385
                                        for ( var handler in events[ type ] ) {
3155
                return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
3386
                                                jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
-
 
3387
                                        }
-
 
3388
                                }
-
 
3389
-
 
3390
                                i++;
-
 
3391
                        });
-
 
3392
                }
-
 
3393
-
 
3394
                // Return the cloned set
-
 
3395
                return ret;
3156
        },
3396
        },
3157
3397
3158
        ready: function( fn ) {
3398
        html: function( value ) {
-
 
3399
                if ( value === undefined ) {
3159
                // Attach the listeners
3400
                        return this[0] ?
-
 
3401
                                this[0].innerHTML.replace(rinlinejQuery, "") :
3160
                bindReady();
3402
                                null;
3161
3403
-
 
3404
                // See if we can take a shortcut and just use innerHTML
-
 
3405
                } else if ( typeof value === "string" && !/<script/i.test( value ) &&
-
 
3406
                        (!jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
-
 
3407
                        !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
-
 
3408
-
 
3409
                        try {
-
 
3410
                                for ( var i = 0, l = this.length; i < l; i++ ) {
3162
                // If the DOM is already ready
3411
                                        // Remove element nodes and prevent memory leaks
3163
                if ( jQuery.isReady ) {
3412
                                        if ( this[i].nodeType === 1 ) {
3164
                        // Execute the function immediately
3413
                                                cleanData( this[i].getElementsByTagName("*") );
-
 
3414
                                                this[i].innerHTML = value;
-
 
3415
                                        }
-
 
3416
                                }
-
 
3417
-
 
3418
                        // If using innerHTML throws an exception, use the fallback method
-
 
3419
                        } catch(e) {
3165
                        fn.call( document, jQuery );
3420
                                this.empty().append( value );
-
 
3421
                        }
3166
3422
3167
                // Otherwise, remember the function for later
-
 
3168
                } else {
3423
                } else {
3169
                        // Add the function to the wait list
-
 
3170
                        jQuery.readyList.push( fn );
3424
                        this.empty().append( value );
3171
                }
3425
                }
3172
3426
3173
                return this;
3427
                return this;
3174
        },
3428
        },
3175
3429
3176
        live: function( type, data, fn, thisObject ) {
-
 
3177
                if ( jQuery.isFunction( data ) ) {
3430
        replaceWith: function( value ) {
3178
                        if ( fn !== undefined ) {
3431
                if ( this[0] && this[0].parentNode ) {
3179
                                thisObject = fn;
3432
                        return this.after( value ).remove();
3180
                        }
-
 
3181
                        fn = data;
3433
                } else {
3182
                        data = undefined;
3434
                        return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
3183
                }
3435
                }
3184
                jQuery( this.context ).bind( liveConvert( type, this.selector ), {
-
 
3185
                        data: data, selector: this.selector, live: type
-
 
3186
                }, fn, thisObject );
-
 
3187
                return this;
-
 
3188
        },
3436
        },
3189
3437
3190
        die: function( type, fn ) {
3438
        detach: function( selector ) {
3191
                jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null );
-
 
3192
                return this;
3439
                return this.remove( selector, true );
3193
        }
3440
        },
3194
});
-
 
3195
3441
3196
function liveHandler( event ) {
3442
        domManip: function( args, table, callback ) {
3197
        var stop = true, elems = [], args = arguments;
3443
                var results, first, value = args[0], scripts = [];
3198
3444
3199
        jQuery.each( jQuery.data( this, "events" ).live || [], function( i, fn ) {
3445
                if ( jQuery.isFunction(value) ) {
3200
                if ( fn.live === event.type ) {
3446
                        return this.each(function() {
-
 
3447
                                args[0] = value.call(this);
3201
                        var elem = jQuery( event.target ).closest( fn.selector )[0];
3448
                                return jQuery(this).domManip( args, table, callback );
3202
                        if ( elem ) {
3449
                        });
3203
                                elems.push({ elem: elem, fn: fn });
-
 
3204
                        }
3450
                }
-
 
3451
-
 
3452
                if ( this[0] ) {
-
 
3453
                        // If we're in a fragment, just use that instead of building a new one
-
 
3454
                        if ( args[0] && args[0].parentNode && args[0].parentNode.nodeType === 11 ) {
-
 
3455
                                results = { fragment: args[0].parentNode };
-
 
3456
                        } else {
-
 
3457
                                results = buildFragment( args, this, scripts );
3205
                }
3458
                        }
3206
        });
-
 
3207
3459
3208
        elems.sort(function( a, b ) {
3460
                        first = results.fragment.firstChild;
3209
                return jQuery.data( a.elem, "closest" ) - jQuery.data( b.elem, "closest" );
-
 
3210
        });
-
 
3211
3461
3212
        jQuery.each(elems, function() {
3462
                        if ( first ) {
3213
                event.currentTarget = this.elem;
-
 
3214
                event.data = this.fn.data;
-
 
3215
                if ( this.fn.apply( this.elem, args ) === false ) {
3463
                                table = table && jQuery.nodeName( first, "tr" );
3216
                        return (stop = false);
-
 
3217
                }
-
 
3218
        });
-
 
3219
3464
-
 
3465
                                for ( var i = 0, l = this.length; i < l; i++ ) {
-
 
3466
                                        callback.call(
3220
        return stop;
3467
                                                table ?
-
 
3468
                                                        root(this[i], first) :
-
 
3469
                                                        this[i],
-
 
3470
                                                results.cacheable || this.length > 1 || i > 0 ?
-
 
3471
                                                        results.fragment.cloneNode(true) :
-
 
3472
                                                        results.fragment
-
 
3473
                                        );
-
 
3474
                                }
3221
}
3475
                        }
3222
3476
3223
function liveConvert( type, selector ) {
3477
                        if ( scripts ) {
3224
        return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join(".");
3478
                                jQuery.each( scripts, evalScript );
-
 
3479
                        }
3225
}
3480
                }
3226
3481
3227
jQuery.extend({
-
 
3228
        isReady: false,
3482
                return this;
3229
        readyList: [],
-
 
3230
        // Handle when the DOM is ready
-
 
3231
        ready: function() {
-
 
3232
                // Make sure that the DOM is not already loaded
-
 
3233
                if ( !jQuery.isReady ) {
-
 
3234
                        // Remember that the DOM is ready
-
 
3235
                        jQuery.isReady = true;
-
 
3236
3483
3237
                        // If there are functions bound, to execute
3484
                function root( elem, cur ) {
3238
                        if ( jQuery.readyList ) {
3485
                        return jQuery.nodeName(elem, "table") ?
3239
                                // Execute all of them
3486
                                (elem.getElementsByTagName("tbody")[0] ||
3240
                                var fn, i = 0;
-
 
3241
                                while ( (fn = jQuery.readyList[ i++ ]) ) {
3487
                                elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
3242
                                        fn.call( document, jQuery );
3488
                                elem;
3243
                                }
3489
                }
3244
-
 
3245
                                // Reset the list of functions
-
 
3246
                                jQuery.readyList = null;
-
 
3247
                        }
3490
        }
-
 
3491
});
3248
3492
-
 
3493
function buildFragment(args, nodes, scripts){
3249
                        // Trigger any bound ready events
3494
        var fragment, cacheable, cached, cacheresults, doc;
-
 
3495
-
 
3496
        if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 ) {
-
 
3497
                cacheable = true;
3250
                        jQuery( document ).triggerHandler( "ready" );
3498
                cacheresults = jQuery.fragments[ args[0] ];
-
 
3499
                if ( cacheresults ) {
-
 
3500
                        if ( cacheresults !== 1 ) {
-
 
3501
                                fragment = cacheresults;
-
 
3502
                        }
-
 
3503
                        cached = true;
3251
                }
3504
                }
3252
        }
3505
        }
3253
});
-
 
3254
3506
3255
var readyBound = false;
3507
        if ( !fragment ) {
-
 
3508
                doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
-
 
3509
                fragment = doc.createDocumentFragment();
-
 
3510
                jQuery.clean( args, doc, fragment, scripts );
-
 
3511
        }
3256
3512
3257
function bindReady() {
3513
        if ( cacheable ) {
3258
        if ( readyBound ) return;
3514
                jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
3259
        readyBound = true;
3515
        }
3260
3516
3261
        // Catch cases where $(document).ready() is called after the
-
 
3262
        // browser event has already occurred.
3517
        return { fragment: fragment, cacheable: cacheable };
3263
        if ( document.readyState === "complete" ) {
-
 
3264
                return jQuery.ready();
-
 
3265
        }
3518
}
3266
3519
3267
        // Mozilla, Opera and webkit nightlies currently support this event
-
 
3268
        if ( document.addEventListener ) {
-
 
3269
                // Use the handy event callback
-
 
3270
                document.addEventListener( "DOMContentLoaded", function() {
-
 
3271
                        document.removeEventListener( "DOMContentLoaded", arguments.callee, false );
-
 
3272
                        jQuery.ready();
3520
jQuery.fragments = {};
3273
                }, false );
-
 
3274
3521
-
 
3522
jQuery.each({
3275
        // If IE event model is used
3523
        appendTo: "append",
3276
        } else if ( document.attachEvent ) {
3524
        prependTo: "prepend",
3277
                // ensure firing before onload,
3525
        insertBefore: "before",
-
 
3526
        insertAfter: "after",
-
 
3527
        replaceAll: "replaceWith"
-
 
3528
}, function(name, original){
3278
                // maybe late but safe also for iframes
3529
        jQuery.fn[ name ] = function( selector ) {
3279
                document.attachEvent("onreadystatechange", function() {
3530
                var ret = [], insert = jQuery( selector );
-
 
3531
3280
                        if ( document.readyState === "complete" ) {
3532
                for ( var i = 0, l = insert.length; i < l; i++ ) {
-
 
3533
                        var elems = (i > 0 ? this.clone(true) : this).get();
3281
                                document.detachEvent( "onreadystatechange", arguments.callee );
3534
                        jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
3282
                                jQuery.ready();
3535
                        ret = ret.concat( elems );
3283
                        }
3536
                }
-
 
3537
                return this.pushStack( ret, name, insert.selector );
-
 
3538
        };
3284
                });
3539
});
3285
3540
-
 
3541
jQuery.each({
3286
                // If IE and not an iframe
3542
        // keepData is for internal use only--do not document
3287
                // continually check to see if the document is ready
3543
        remove: function( selector, keepData ) {
3288
                if ( document.documentElement.doScroll && window === window.top ) (function() {
3544
                if ( !selector || jQuery.multiFilter( selector, [ this ] ).length ) {
3289
                        if ( jQuery.isReady ) {
3545
                        if ( !keepData && this.nodeType === 1 ) {
-
 
3546
                                cleanData( this.getElementsByTagName("*") );
3290
                                return;
3547
                                cleanData( [ this ] );
3291
                        }
3548
                        }
3292
3549
3293
                        try {
-
 
3294
                                // If IE is used, use the trick by Diego Perini
-
 
3295
                                // http://javascript.nwbox.com/IEContentLoaded/
-
 
3296
                                document.documentElement.doScroll("left");
-
 
3297
                        } catch( error ) {
3550
                        if ( this.parentNode ) {
3298
                                setTimeout( arguments.callee, 0 );
3551
                                 this.parentNode.removeChild( this );
3299
                                return;
-
 
3300
                        }
3552
                        }
3301
-
 
3302
                        // and execute any waiting functions
-
 
3303
                        jQuery.ready();
-
 
3304
                })();
-
 
3305
        }
3553
                }
-
 
3554
        },
3306
3555
-
 
3556
        empty: function() {
3307
        // A fallback to window.onload, that will always work
3557
                // Remove element nodes and prevent memory leaks
-
 
3558
                if ( this.nodeType === 1 ) {
3308
        jQuery.event.add( window, "load", jQuery.ready );
3559
                        cleanData( this.getElementsByTagName("*") );
3309
}
3560
                }
3310
3561
3311
jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
-
 
3312
        "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," +
-
 
3313
        "change,select,submit,keydown,keypress,keyup,error").split(","), function( i, name ) {
-
 
3314
-
 
3315
        // Handle event binding
3562
                // Remove any remaining nodes
3316
        jQuery.fn[ name ] = function( fn ) {
-
 
3317
                return fn ? this.bind( name, fn ) : this.trigger( name );
-
 
3318
        };
-
 
3319
});
-
 
3320
-
 
3321
// Prevent memory leaks in IE
-
 
3322
// And prevent errors on refresh with events like mouseover in other browsers
-
 
3323
// Window isn't included so as not to unbind existing unload events
-
 
3324
// More info:
-
 
3325
//  - http://isaacschlueter.com/2006/10/msie-memory-leaks/
-
 
3326
//  - https://bugzilla.mozilla.org/show_bug.cgi?id=252542
-
 
3327
jQuery( window ).bind( 'unload', function() {
-
 
3328
        for ( var id in jQuery.cache ) {
3563
                while ( this.firstChild ) {
3329
                // Skip the window
-
 
3330
                if ( id != 1 && jQuery.cache[ id ].handle ) {
-
 
3331
                        jQuery.event.remove( jQuery.cache[ id ].handle.elem );
3564
                        this.removeChild( this.firstChild );
3332
                }
3565
                }
3333
        }
3566
        }
-
 
3567
}, function(name, fn){
-
 
3568
        jQuery.fn[ name ] = function(){
-
 
3569
                return this.each( fn, arguments );
-
 
3570
        };
3334
});
3571
});
3335
(function(){
-
 
3336
-
 
3337
        jQuery.support = {};
-
 
3338
3572
3339
        var root = document.documentElement,
3573
jQuery.extend({
3340
                script = document.createElement("script"),
3574
        clean: function( elems, context, fragment, scripts ) {
3341
                div = document.createElement("div"),
-
 
3342
                id = "script" + (new Date).getTime();
3575
                context = context || document;
3343
3576
-
 
3577
                // !context.createElement fails in IE with an error but returns typeof 'object'
3344
        div.style.display = "none";
3578
                if ( typeof context.createElement === "undefined" ) {
3345
        div.innerHTML = '   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select>';
3579
                        context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
-
 
3580
                }
3346
3581
3347
        var all = div.getElementsByTagName("*"),
3582
                var ret = [], div = context.createElement("div");
3348
                a = div.getElementsByTagName("a")[0];
-
 
3349
3583
3350
        // Can't get basic test support
3584
                jQuery.each(elems, function(i, elem){
3351
        if ( !all || !all.length || !a ) {
3585
                        if ( typeof elem === "number" ) {
3352
                return;
3586
                                elem += '';
3353
        }
3587
                        }
3354
3588
3355
        jQuery.support = {
3589
                        if ( !elem ) { return; }
3356
                // IE strips leading whitespace when .innerHTML is used
-
 
3357
                leadingWhitespace: div.firstChild.nodeType == 3,
-
 
3358
3590
3359
                // Make sure that tbody elements aren't automatically inserted
3591
                        // Convert html string into DOM nodes
3360
                // IE will insert them into empty tables
3592
                        if ( typeof elem === "string" && !rhtml.test( elem ) ) {
3361
                tbody: !div.getElementsByTagName("tbody").length,
3593
                                elem = context.createTextNode( elem );
3362
3594
3363
                // Make sure that link elements get serialized correctly by innerHTML
3595
                        } else if ( typeof elem === "string" ) {
3364
                // This requires a wrapper element in IE
3596
                                // Fix "XHTML"-style tags in all browsers
3365
                htmlSerialize: !!div.getElementsByTagName("link").length,
3597
                                elem = elem.replace(rxhtmlTag, fcloseTag);
3366
3598
3367
                // Get the style information from getAttribute
3599
                                // Trim whitespace, otherwise indexOf won't work as expected
3368
                // (IE uses .cssText insted)
3600
                                var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
3369
                style: /red/.test( a.getAttribute("style") ),
3601
                                        wrap = wrapMap[ tag ] || wrapMap._default,
-
 
3602
                                        depth = wrap[0];
3370
3603
3371
                // Make sure that URLs aren't manipulated
3604
                                // Go to html and back, then peel off extra wrappers
3372
                // (IE normalizes it by default)
-
 
3373
                hrefNormalized: a.getAttribute("href") === "/a",
3605
                                div.innerHTML = wrap[1] + elem + wrap[2];
3374
3606
3375
                // Make sure that element opacity exists
3607
                                // Move to the right depth
3376
                // (IE uses filter instead)
3608
                                while ( depth-- ) {
3377
                opacity: a.style.opacity === "0.5",
3609
                                        div = div.lastChild;
-
 
3610
                                }
3378
3611
3379
                // Verify style float existence
-
 
3380
                // (IE uses styleFloat instead of cssFloat)
3612
                                // Remove IE's autoinserted <tbody> from table fragments
3381
                cssFloat: !!a.style.cssFloat,
3613
                                if ( !jQuery.support.tbody ) {
3382
3614
3383
                // Will be defined later
3615
                                        // String was a <table>, *may* have spurious <tbody>
3384
                scriptEval: false,
3616
                                        var hasBody = rtbody.test(elem),
3385
                noCloneEvent: true,
3617
                                                tbody = tag === "table" && !hasBody ?
3386
                boxModel: null
3618
                                                        div.firstChild && div.firstChild.childNodes :
3387
        };
-
 
3388
3619
3389
        script.type = "text/javascript";
3620
                                                        // String was a bare <thead> or <tfoot>
3390
        try {
-
 
3391
                script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
3621
                                                        wrap[1] == "<table>" && !hasBody ?
-
 
3622
                                                                div.childNodes :
3392
        } catch(e){}
3623
                                                                [];
3393
3624
-
 
3625
                                        for ( var j = tbody.length - 1; j >= 0 ; --j ) {
-
 
3626
                                                if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
3394
        root.insertBefore( script, root.firstChild );
3627
                                                        tbody[ j ].parentNode.removeChild( tbody[ j ] );
-
 
3628
                                                }
-
 
3629
                                        }
3395
3630
3396
        // Make sure that the execution of code works by injecting a script
-
 
3397
        // tag with appendChild/createTextNode
-
 
3398
        // (IE doesn't support this, fails, and uses .text instead)
-
 
3399
        if ( window[ id ] ) {
-
 
3400
                jQuery.support.scriptEval = true;
-
 
3401
                delete window[ id ];
-
 
3402
        }
3631
                                }
3403
3632
3404
        root.removeChild( script );
3633
                                // IE completely kills leading whitespace when innerHTML is used
-
 
3634
                                if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
-
 
3635
                                        div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
-
 
3636
                                }
3405
3637
3406
        if ( div.attachEvent && div.fireEvent ) {
3638
                                elem = jQuery.makeArray( div.childNodes );
3407
                div.attachEvent("onclick", function click(){
-
 
3408
                        // Cloning a node shouldn't copy over any
-
 
3409
                        // bound event handlers (IE does this)
-
 
3410
                        jQuery.support.noCloneEvent = false;
-
 
3411
                        div.detachEvent("onclick", click);
-
 
3412
                });
-
 
3413
                div.cloneNode(true).fireEvent("onclick");
-
 
3414
        }
3639
                        }
3415
3640
3416
        // Figure out if the W3C box model works as expected
3641
                        if ( elem.nodeType ) {
3417
        // document.body must exist before we can do this
3642
                                ret.push( elem );
3418
        jQuery(function(){
3643
                        } else {
3419
                var div = document.createElement("div");
3644
                                ret = jQuery.merge( ret, elem );
3420
                div.style.width = div.style.paddingLeft = "1px";
-
 
-
 
3645
                        }
3421
3646
3422
                document.body.appendChild( div );
-
 
3423
                jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
-
 
3424
                document.body.removeChild( div ).style.display = 'none';
-
 
3425
                div = null;
-
 
3426
        });
3647
                });
3427
3648
3428
        // release memory in IE
3649
                if ( fragment ) {
3429
        root = script = div = all = a = null;
3650
                        for ( var i = 0; ret[i]; i++ ) {
-
 
3651
                                if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
-
 
3652
                                        scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
-
 
3653
                                } else {
-
 
3654
                                        if ( ret[i].nodeType === 1 ) {
-
 
3655
                                                ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
-
 
3656
                                        }
-
 
3657
                                        fragment.appendChild( ret[i] );
3430
})();
3658
                                }
-
 
3659
                        }
-
 
3660
                }
3431
3661
3432
jQuery.props = {
3662
                return ret;
3433
        "for": "htmlFor",
3663
        }
-
 
3664
});
-
 
3665
3434
        "class": "className",
3666
function cleanData( elems ) {
3435
        readonly: "readOnly",
3667
        for ( var i = 0, elem, id; (elem = elems[i]) != null; i++ ) {
3436
        maxlength: "maxLength",
3668
                if ( (id = elem[expando]) ) {
3437
        cellspacing: "cellSpacing",
3669
                        delete jQuery.cache[ id ];
3438
        rowspan: "rowSpan",
3670
                }
3439
        colspan: "colSpan",
3671
        }
3440
        tabindex: "tabIndex"
-
 
3441
};
3672
}
3442
// exclude the following css properties to add px
3673
// exclude the following css properties to add px
3443
var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
3674
var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
3444
        ralpha = /alpha\([^)]*\)/,
3675
        ralpha = /alpha\([^)]*\)/,
3445
        ropacity = /opacity=([^)]*)/,
3676
        ropacity = /opacity=([^)]*)/,
3446
        rfloat = /float/i,
3677
        rfloat = /float/i,
3447
        rdashAlpha = /-([a-z])/ig,
3678
        rdashAlpha = /-([a-z])/ig,
3448
        rupper = /([A-Z])/g,
3679
        rupper = /([A-Z])/g,
3449
        rnumpx = /^\d+(?:px)?$/i,
3680
        rnumpx = /^\d+(?:px)?$/i,
3450
        rnum = /^\d/,
3681
        rnum = /^\d/,
3451
3682
3452
        // cache check for defaultView.getComputedStyle
3683
        // cache check for defaultView.getComputedStyle
3453
        getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
3684
        getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
3454
        // normalize float css property
3685
        // normalize float css property
3455
        styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
3686
        styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
3456
        fcamelCase = function(all, letter){
3687
        fcamelCase = function(all, letter){
3457
                return letter.toUpperCase();
3688
                return letter.toUpperCase();
3458
        };
3689
        };
3459
3690
3460
jQuery.fn.css = function( name, value ) {
3691
jQuery.fn.css = function( name, value ) {
3461
        var options = name, isFunction = jQuery.isFunction( value );
3692
        return access( this, name, value, true, function( elem, name, value ) {
3462
-
 
3463
        if ( typeof name === "string" ) {
-
 
3464
                // Are we setting the style?
-
 
3465
                if ( value === undefined ) {
3693
                if (value === undefined) {
3466
                        return this.length ?
-
 
3467
                                jQuery.css( this[0], name ) :
3694
                        return jQuery.css( elem, name );
3468
                                null;
-
 
3469
-
 
3470
                // Convert name, value params to options hash format
-
 
3471
                } else {
-
 
3472
                        options = {};
-
 
3473
                        options[ name ] = value;
-
 
3474
                }
-
 
3475
        }
-
 
3476
       
-
 
3477
        var isFunction = {};
-
 
3478
       
-
 
3479
        // For each value, determine whether it's a Function so we don't
-
 
3480
        // need to determine it again for each element
-
 
3481
        for ( var prop in options ) {
-
 
3482
                isFunction[prop] = jQuery.isFunction( options[prop] );
-
 
3483
        }
-
 
3484
-
 
3485
        // For each element...
-
 
3486
        for ( var i = 0, l = this.length; i < l; i++ ) {
-
 
3487
                var elem = this[i];
-
 
3488
-
 
3489
                // Set all the styles
-
 
3490
                for ( var prop in options ) {
-
 
3491
                        value = options[prop];
-
 
3492
-
 
3493
                        if ( isFunction[prop] ) {
-
 
3494
                                value = value.call( elem, i );
-
 
3495
                        }
3695
                }
3496
3696
               
3497
                        if ( typeof value === "number" && !rexclude.test(prop) ) {
3697
                if ( typeof value === "number" && !rexclude.test(name) ) {
3498
                                value = value + "px";
3698
                        value += "px";
3499
                        }
3699
                }
3500
3700
3501
                        jQuery.style( elem, prop, value );
3701
                jQuery.style( elem, name, value );
3502
                }
-
 
3503
        }
3702
        });
3504
-
 
3505
        return this;
-
 
3506
};
3703
};
3507
3704
3508
jQuery.extend({
3705
jQuery.extend({
3509
        style: function( elem, name, value ) {
3706
        style: function( elem, name, value ) {
3510
                // don't set styles on text and comment nodes
3707
                // don't set styles on text and comment nodes
3511
                if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
3708
                if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
3512
                        return undefined;
3709
                        return undefined;
3513
                }
3710
                }
3514
3711
3515
                // ignore negative width and height values #1599
3712
                // ignore negative width and height values #1599
3516
                if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
3713
                if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
3517
                        value = undefined;
3714
                        value = undefined;
3518
                }
3715
                }
3519
3716
3520
                var style = elem.style || elem, set = value !== undefined;
3717
                var style = elem.style || elem, set = value !== undefined;
3521
3718
3522
                // IE uses filters for opacity
3719
                // IE uses filters for opacity
3523
                if ( !jQuery.support.opacity && name === "opacity" ) {
3720
                if ( !jQuery.support.opacity && name === "opacity" ) {
3524
                        if ( set ) {
3721
                        if ( set ) {
3525
                                // IE has trouble with opacity if it does not have layout
3722
                                // IE has trouble with opacity if it does not have layout
3526
                                // Force it by setting the zoom level
3723
                                // Force it by setting the zoom level
3527
                                style.zoom = 1;
3724
                                style.zoom = 1;
3528
3725
3529
                                // Set the alpha filter to set the opacity
3726
                                // Set the alpha filter to set the opacity
3530
                                style.filter = (style.filter || "").replace( ralpha, "" ) +
3727
                                style.filter = (style.filter || "").replace( ralpha, "" ) +
3531
                                        (parseInt( value ) + '' === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
3728
                                        (parseInt( value ) + '' === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
3532
                        }
3729
                        }
3533
3730
3534
                        return style.filter && style.filter.indexOf("opacity=") >= 0 ?
3731
                        return style.filter && style.filter.indexOf("opacity=") >= 0 ?
3535
                                (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + '':
3732
                                (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + '':
3536
                                "";
3733
                                "";
3537
                }
3734
                }
3538
3735
3539
                // Make sure we're using the right name for getting the float value
3736
                // Make sure we're using the right name for getting the float value
3540
                if ( rfloat.test( name ) ) {
3737
                if ( rfloat.test( name ) ) {
3541
                        name = styleFloat;
3738
                        name = styleFloat;
3542
                }
3739
                }
3543
3740
3544
                name = name.replace(rdashAlpha, fcamelCase);
3741
                name = name.replace(rdashAlpha, fcamelCase);
3545
3742
3546
                if ( set ) {
3743
                if ( set ) {
3547
                        style[ name ] = value;
3744
                        style[ name ] = value;
3548
                }
3745
                }
3549
3746
3550
                return style[ name ];
3747
                return style[ name ];
3551
        },
3748
        },
3552
3749
3553
        css: function( elem, name, force, extra ) {
3750
        css: function( elem, name, force, extra ) {
3554
                if ( name === "width" || name === "height" ) {
3751
                if ( name === "width" || name === "height" ) {
3555
                        var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name === "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];
3752
                        var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name === "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];
3556
3753
3557
                        function getWH() {
3754
                        function getWH() {
3558
                                val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
3755
                                val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
3559
3756
3560
                                if ( extra === "border" ) { return; }
3757
                                if ( extra === "border" ) { return; }
3561
3758
3562
                                jQuery.each( which, function() {
3759
                                jQuery.each( which, function() {
3563
                                        if ( !extra ) {
3760
                                        if ( !extra ) {
3564
                                                val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
3761
                                                val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
3565
                                        }
3762
                                        }
3566
3763
3567
                                        if ( extra === "margin" ) {
3764
                                        if ( extra === "margin" ) {
3568
                                                val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
3765
                                                val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
3569
                                        } else {
3766
                                        } else {
3570
                                                val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
3767
                                                val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
3571
                                        }
3768
                                        }
3572
                                });
3769
                                });
3573
                        }
3770
                        }
3574
3771
3575
                        if ( elem.offsetWidth !== 0 ) {
3772
                        if ( elem.offsetWidth !== 0 ) {
3576
                                getWH();
3773
                                getWH();
3577
                        } else {
3774
                        } else {
3578
                                jQuery.swap( elem, props, getWH );
3775
                                jQuery.swap( elem, props, getWH );
3579
                        }
3776
                        }
3580
3777
3581
                        return Math.max(0, Math.round(val));
3778
                        return Math.max(0, Math.round(val));
3582
                }
3779
                }
3583
3780
3584
                return jQuery.curCSS( elem, name, force );
3781
                return jQuery.curCSS( elem, name, force );
3585
        },
3782
        },
3586
3783
3587
        curCSS: function( elem, name, force ) {
3784
        curCSS: function( elem, name, force ) {
3588
                var ret, style = elem.style, filter;
3785
                var ret, style = elem.style, filter;
3589
3786
3590
                // IE uses filters for opacity
3787
                // IE uses filters for opacity
3591
                if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
3788
                if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
3592
                        ret = ropacity.test(elem.currentStyle.filter || "") ?
3789
                        ret = ropacity.test(elem.currentStyle.filter || "") ?
3593
                                (parseFloat(RegExp.$1) / 100) + "" :
3790
                                (parseFloat(RegExp.$1) / 100) + "" :
3594
                                "";
3791
                                "";
3595
3792
3596
                        return ret === "" ?
3793
                        return ret === "" ?
3597
                                "1" :
3794
                                "1" :
3598
                                ret;
3795
                                ret;
3599
                }
3796
                }
3600
3797
3601
                // Make sure we're using the right name for getting the float value
3798
                // Make sure we're using the right name for getting the float value
3602
                if ( rfloat.test( name ) ) {
3799
                if ( rfloat.test( name ) ) {
3603
                        name = styleFloat;
3800
                        name = styleFloat;
3604
                }
3801
                }
3605
3802
3606
                if ( !force && style && style[ name ] ) {
3803
                if ( !force && style && style[ name ] ) {
3607
                        ret = style[ name ];
3804
                        ret = style[ name ];
3608
3805
3609
                } else if ( getComputedStyle ) {
3806
                } else if ( getComputedStyle ) {
3610
3807
3611
                        // Only "float" is needed here
3808
                        // Only "float" is needed here
3612
                        if ( rfloat.test( name ) ) {
3809
                        if ( rfloat.test( name ) ) {
3613
                                name = "float";
3810
                                name = "float";
3614
                        }
3811
                        }
3615
3812
3616
                        name = name.replace( rupper, "-$1" ).toLowerCase();
3813
                        name = name.replace( rupper, "-$1" ).toLowerCase();
3617
3814
3618
                        var computedStyle = elem.ownerDocument.defaultView.getComputedStyle( elem, null );
3815
                        var computedStyle = elem.ownerDocument.defaultView.getComputedStyle( elem, null );
3619
3816
3620
                        if ( computedStyle ) {
3817
                        if ( computedStyle ) {
3621
                                ret = computedStyle.getPropertyValue( name );
3818
                                ret = computedStyle.getPropertyValue( name );
3622
                        }
3819
                        }
3623
3820
3624
                        // We should always get a number back from opacity
3821
                        // We should always get a number back from opacity
3625
                        if ( name === "opacity" && ret === "" ) {
3822
                        if ( name === "opacity" && ret === "" ) {
3626
                                ret = "1";
3823
                                ret = "1";
3627
                        }
3824
                        }
3628
3825
3629
                } else if ( elem.currentStyle ) {
3826
                } else if ( elem.currentStyle ) {
3630
                        var camelCase = name.replace(rdashAlpha, fcamelCase);
3827
                        var camelCase = name.replace(rdashAlpha, fcamelCase);
3631
3828
3632
                        ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
3829
                        ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
3633
3830
3634
                        // From the awesome hack by Dean Edwards
3831
                        // From the awesome hack by Dean Edwards
3635
                        // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
3832
                        // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
3636
3833
3637
                        // If we're not dealing with a regular pixel number
3834
                        // If we're not dealing with a regular pixel number
3638
                        // but a number that has a weird ending, we need to convert it to pixels
3835
                        // but a number that has a weird ending, we need to convert it to pixels
3639
                        if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
3836
                        if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
3640
                                // Remember the original values
3837
                                // Remember the original values
3641
                                var left = style.left, rsLeft = elem.runtimeStyle.left;
3838
                                var left = style.left, rsLeft = elem.runtimeStyle.left;
3642
3839
3643
                                // Put in the new values to get a computed value out
3840
                                // Put in the new values to get a computed value out
3644
                                elem.runtimeStyle.left = elem.currentStyle.left;
3841
                                elem.runtimeStyle.left = elem.currentStyle.left;
3645
                                style.left = ret || 0;
3842
                                style.left = ret || 0;
3646
                                ret = style.pixelLeft + "px";
3843
                                ret = style.pixelLeft + "px";
3647
3844
3648
                                // Revert the changed values
3845
                                // Revert the changed values
3649
                                style.left = left;
3846
                                style.left = left;
3650
                                elem.runtimeStyle.left = rsLeft;
3847
                                elem.runtimeStyle.left = rsLeft;
3651
                        }
3848
                        }
3652
                }
3849
                }
3653
3850
3654
                return ret;
3851
                return ret;
3655
        },
3852
        },
3656
3853
3657
        // A method for quickly swapping in/out CSS properties to get correct calculations
3854
        // A method for quickly swapping in/out CSS properties to get correct calculations
3658
        swap: function( elem, options, callback ) {
3855
        swap: function( elem, options, callback ) {
3659
                var old = {};
3856
                var old = {};
3660
3857
3661
                // Remember the old values, and insert the new ones
3858
                // Remember the old values, and insert the new ones
3662
                for ( var name in options ) {
3859
                for ( var name in options ) {
3663
                        old[ name ] = elem.style[ name ];
3860
                        old[ name ] = elem.style[ name ];
3664
                        elem.style[ name ] = options[ name ];
3861
                        elem.style[ name ] = options[ name ];
3665
                }
3862
                }
3666
3863
3667
                callback.call( elem );
3864
                callback.call( elem );
3668
3865
3669
                // Revert the old values
3866
                // Revert the old values
3670
                for ( var name in options ) {
3867
                for ( var name in options ) {
3671
                        elem.style[ name ] = old[ name ];
3868
                        elem.style[ name ] = old[ name ];
3672
                }
3869
                }
3673
        }
3870
        }
3674
});
3871
});
3675
var jsc = now(),
3872
var jsc = now(),
3676
        rscript = /<script(.|\s)*?\/script>/g,
3873
        rscript = /<script(.|\s)*?\/script>/g,
3677
        rselectTextarea = /select|textarea/i,
3874
        rselectTextarea = /select|textarea/i,
3678
        rinput = /text|hidden|password|search/i,
3875
        rinput = /text|hidden|password|search/i,
3679
        jsre = /=\?(&|$)/,
3876
        jsre = /=\?(&|$)/,
3680
        rquery = /\?/,
3877
        rquery = /\?/,
3681
        rts = /(\?|&)_=.*?(&|$)/,
3878
        rts = /(\?|&)_=.*?(&|$)/,
3682
        rurl = /^(\w+:)?\/\/([^\/?#]+)/,
3879
        rurl = /^(\w+:)?\/\/([^\/?#]+)/,
3683
        r20 = /%20/g;
3880
        r20 = /%20/g;
3684
3881
3685
jQuery.fn.extend({
3882
jQuery.fn.extend({
3686
        // Keep a copy of the old load
3883
        // Keep a copy of the old load
3687
        _load: jQuery.fn.load,
3884
        _load: jQuery.fn.load,
3688
3885
3689
        load: function( url, params, callback ) {
3886
        load: function( url, params, callback ) {
3690
                if ( typeof url !== "string" ) {
3887
                if ( typeof url !== "string" ) {
3691
                        return this._load( url );
3888
                        return this._load( url );
3692
                }
3889
                }
3693
3890
3694
                var off = url.indexOf(" ");
3891
                var off = url.indexOf(" ");
3695
                if ( off >= 0 ) {
3892
                if ( off >= 0 ) {
3696
                        var selector = url.slice(off, url.length);
3893
                        var selector = url.slice(off, url.length);
3697
                        url = url.slice(0, off);
3894
                        url = url.slice(0, off);
3698
                }
3895
                }
3699
3896
3700
                // Default to a GET request
3897
                // Default to a GET request
3701
                var type = "GET";
3898
                var type = "GET";
3702
3899
3703
                // If the second parameter was provided
3900
                // If the second parameter was provided
3704
                if ( params ) {
3901
                if ( params ) {
3705
                        // If it's a function
3902
                        // If it's a function
3706
                        if ( jQuery.isFunction( params ) ) {
3903
                        if ( jQuery.isFunction( params ) ) {
3707
                                // We assume that it's the callback
3904
                                // We assume that it's the callback
3708
                                callback = params;
3905
                                callback = params;
3709
                                params = null;
3906
                                params = null;
3710
3907
3711
                        // Otherwise, build a param string
3908
                        // Otherwise, build a param string
3712
                        } else if ( typeof params === "object" ) {
3909
                        } else if ( typeof params === "object" ) {
3713
                                params = jQuery.param( params );
3910
                                params = jQuery.param( params );
3714
                                type = "POST";
3911
                                type = "POST";
3715
                        }
3912
                        }
3716
                }
3913
                }
3717
3914
3718
                var self = this;
-
 
3719
-
 
3720
                // Request the remote document
3915
                // Request the remote document
3721
                jQuery.ajax({
3916
                jQuery.ajax({
3722
                        url: url,
3917
                        url: url,
3723
                        type: type,
3918
                        type: type,
3724
                        dataType: "html",
3919
                        dataType: "html",
3725
                        data: params,
3920
                        data: params,
-
 
3921
                        context:this,
3726
                        complete: function(res, status){
3922
                        complete: function(res, status){
3727
                                // If successful, inject the HTML into all the matched elements
3923
                                // If successful, inject the HTML into all the matched elements
3728
                                if ( status === "success" || status === "notmodified" ) {
3924
                                if ( status === "success" || status === "notmodified" ) {
3729
                                        // See if a selector was specified
3925
                                        // See if a selector was specified
3730
                                        self.html( selector ?
3926
                                        this.html( selector ?
3731
                                                // Create a dummy div to hold the results
3927
                                                // Create a dummy div to hold the results
3732
                                                jQuery("<div/>")
3928
                                                jQuery("<div />")
3733
                                                        // inject the contents of the document in, removing the scripts
3929
                                                        // inject the contents of the document in, removing the scripts
3734
                                                        // to avoid any 'Permission Denied' errors in IE
3930
                                                        // to avoid any 'Permission Denied' errors in IE
3735
                                                        .append(res.responseText.replace(rscript, ""))
3931
                                                        .append(res.responseText.replace(rscript, ""))
3736
3932
3737
                                                        // Locate the specified elements
3933
                                                        // Locate the specified elements
3738
                                                        .find(selector) :
3934
                                                        .find(selector) :
3739
3935
3740
                                                // If not, just inject the full result
3936
                                                // If not, just inject the full result
3741
                                                res.responseText );
3937
                                                res.responseText );
3742
                                }
3938
                                }
3743
3939
3744
                                if ( callback ) {
3940
                                if ( callback ) {
3745
                                        self.each( callback, [res.responseText, status, res] );
3941
                                        this.each( callback, [res.responseText, status, res] );
3746
                                }
3942
                                }
3747
                        }
3943
                        }
3748
                });
3944
                });
3749
3945
3750
                return this;
3946
                return this;
3751
        },
3947
        },
3752
3948
3753
        serialize: function() {
3949
        serialize: function() {
3754
                return jQuery.param(this.serializeArray());
3950
                return jQuery.param(this.serializeArray());
3755
        },
3951
        },
3756
        serializeArray: function() {
3952
        serializeArray: function() {
3757
                return this.map(function(){
3953
                return this.map(function(){
3758
                        return this.elements ? jQuery.makeArray(this.elements) : this;
3954
                        return this.elements ? jQuery.makeArray(this.elements) : this;
3759
                })
3955
                })
3760
                .filter(function(){
3956
                .filter(function(){
3761
                        return this.name && !this.disabled &&
3957
                        return this.name && !this.disabled &&
3762
                                (this.checked || rselectTextarea.test(this.nodeName) ||
3958
                                (this.checked || rselectTextarea.test(this.nodeName) ||
3763
                                        rinput.test(this.type));
3959
                                        rinput.test(this.type));
3764
                })
3960
                })
3765
                .map(function(i, elem){
3961
                .map(function(i, elem){
3766
                        var val = jQuery(this).val();
3962
                        var val = jQuery(this).val();
3767
3963
3768
                        return val == null ?
3964
                        return val == null ?
3769
                                null :
3965
                                null :
3770
                                jQuery.isArray(val) ?
3966
                                jQuery.isArray(val) ?
3771
                                        jQuery.map( val, function(val, i){
3967
                                        jQuery.map( val, function(val, i){
3772
                                                return {name: elem.name, value: val};
3968
                                                return {name: elem.name, value: val};
3773
                                        }) :
3969
                                        }) :
3774
                                        {name: elem.name, value: val};
3970
                                        {name: elem.name, value: val};
3775
                }).get();
3971
                }).get();
3776
        }
3972
        }
3777
});
3973
});
3778
3974
3779
// Attach a bunch of functions for handling common AJAX events
3975
// Attach a bunch of functions for handling common AJAX events
3780
jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
3976
jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
3781
        jQuery.fn[o] = function(f){
3977
        jQuery.fn[o] = function(f){
3782
                return this.bind(o, f);
3978
                return this.bind(o, f);
3783
        };
3979
        };
3784
});
3980
});
3785
3981
3786
jQuery.extend({
3982
jQuery.extend({
3787
3983
3788
        get: function( url, data, callback, type ) {
3984
        get: function( url, data, callback, type ) {
3789
                // shift arguments if data argument was ommited
3985
                // shift arguments if data argument was omited
3790
                if ( jQuery.isFunction( data ) ) {
3986
                if ( jQuery.isFunction( data ) ) {
-
 
3987
                        type = type || callback;
3791
                        callback = data;
3988
                        callback = data;
3792
                        data = null;
3989
                        data = null;
3793
                }
3990
                }
3794
3991
3795
                return jQuery.ajax({
3992
                return jQuery.ajax({
3796
                        type: "GET",
3993
                        type: "GET",
3797
                        url: url,
3994
                        url: url,
3798
                        data: data,
3995
                        data: data,
3799
                        success: callback,
3996
                        success: callback,
3800
                        dataType: type
3997
                        dataType: type
3801
                });
3998
                });
3802
        },
3999
        },
3803
4000
3804
        getScript: function( url, callback ) {
4001
        getScript: function( url, callback ) {
3805
                return jQuery.get(url, null, callback, "script");
4002
                return jQuery.get(url, null, callback, "script");
3806
        },
4003
        },
3807
4004
3808
        getJSON: function( url, data, callback ) {
4005
        getJSON: function( url, data, callback ) {
3809
                return jQuery.get(url, data, callback, "json");
4006
                return jQuery.get(url, data, callback, "json");
3810
        },
4007
        },
3811
4008
3812
        post: function( url, data, callback, type ) {
4009
        post: function( url, data, callback, type ) {
-
 
4010
                // shift arguments if data argument was omited
3813
                if ( jQuery.isFunction( data ) ) {
4011
                if ( jQuery.isFunction( data ) ) {
-
 
4012
                        type = type || callback;
3814
                        callback = data;
4013
                        callback = data;
3815
                        data = {};
4014
                        data = {};
3816
                }
4015
                }
3817
4016
3818
                return jQuery.ajax({
4017
                return jQuery.ajax({
3819
                        type: "POST",
4018
                        type: "POST",
3820
                        url: url,
4019
                        url: url,
3821
                        data: data,
4020
                        data: data,
3822
                        success: callback,
4021
                        success: callback,
3823
                        dataType: type
4022
                        dataType: type
3824
                });
4023
                });
3825
        },
4024
        },
3826
4025
3827
        ajaxSetup: function( settings ) {
4026
        ajaxSetup: function( settings ) {
3828
                jQuery.extend( jQuery.ajaxSettings, settings );
4027
                jQuery.extend( jQuery.ajaxSettings, settings );
3829
        },
4028
        },
3830
4029
3831
        ajaxSettings: {
4030
        ajaxSettings: {
3832
                url: location.href,
4031
                url: location.href,
3833
                global: true,
4032
                global: true,
3834
                type: "GET",
4033
                type: "GET",
3835
                contentType: "application/x-www-form-urlencoded",
4034
                contentType: "application/x-www-form-urlencoded",
3836
                processData: true,
4035
                processData: true,
3837
                async: true,
4036
                async: true,
3838
                /*
4037
                /*
3839
                timeout: 0,
4038
                timeout: 0,
3840
                data: null,
4039
                data: null,
3841
                username: null,
4040
                username: null,
3842
                password: null,
4041
                password: null,
3843
                */
4042
                */
3844
                // Create the request object; Microsoft failed to properly
4043
                // Create the request object; Microsoft failed to properly
3845
                // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
4044
                // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
3846
                // This function can be overriden by calling jQuery.ajaxSetup
4045
                // This function can be overriden by calling jQuery.ajaxSetup
3847
                xhr: function(){
4046
                xhr: function(){
3848
                        return window.ActiveXObject ?
4047
                        return window.ActiveXObject ?
3849
                                new ActiveXObject("Microsoft.XMLHTTP") :
4048
                                new ActiveXObject("Microsoft.XMLHTTP") :
3850
                                new XMLHttpRequest();
4049
                                new XMLHttpRequest();
3851
                },
4050
                },
3852
                accepts: {
4051
                accepts: {
3853
                        xml: "application/xml, text/xml",
4052
                        xml: "application/xml, text/xml",
3854
                        html: "text/html",
4053
                        html: "text/html",
3855
                        script: "text/javascript, application/javascript",
4054
                        script: "text/javascript, application/javascript",
3856
                        json: "application/json, text/javascript",
4055
                        json: "application/json, text/javascript",
3857
                        text: "text/plain",
4056
                        text: "text/plain",
3858
                        _default: "*/*"
4057
                        _default: "*/*"
3859
                }
4058
                }
3860
        },
4059
        },
3861
4060
3862
        // Last-Modified header cache for next request
4061
        // Last-Modified header cache for next request
3863
        lastModified: {},
4062
        lastModified: {},
3864
        etag: {},
4063
        etag: {},
3865
4064
3866
        ajax: function( s ) {
4065
        ajax: function( s ) {
3867
                // Extend the settings, but re-extend 's' so that it can be
4066
                // Extend the settings, but re-extend 's' so that it can be
3868
                // checked again later (in the test suite, specifically)
4067
                // checked again later (in the test suite, specifically)
3869
                s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
4068
                s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
3870
4069
               
3871
                var jsonp, status, data,
4070
                var jsonp, status, data,
-
 
4071
                        callbackContext = s.context || window,
3872
                        type = s.type.toUpperCase();
4072
                        type = s.type.toUpperCase();
3873
4073
3874
                // convert data if not already a string
4074
                // convert data if not already a string
3875
                if ( s.data && s.processData && typeof s.data !== "string" ) {
4075
                if ( s.data && s.processData && typeof s.data !== "string" ) {
3876
                        s.data = jQuery.param(s.data);
4076
                        s.data = jQuery.param(s.data);
3877
                }
4077
                }
3878
4078
3879
                // Handle JSONP Parameter Callbacks
4079
                // Handle JSONP Parameter Callbacks
3880
                if ( s.dataType === "jsonp" ) {
4080
                if ( s.dataType === "jsonp" ) {
3881
                        if ( type === "GET" ) {
4081
                        if ( type === "GET" ) {
3882
                                if ( !jsre.test( s.url ) ) {
4082
                                if ( !jsre.test( s.url ) ) {
3883
                                        s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
4083
                                        s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
3884
                                }
4084
                                }
3885
                        } else if ( !s.data || !jsre.test(s.data) ) {
4085
                        } else if ( !s.data || !jsre.test(s.data) ) {
3886
                                s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
4086
                                s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
3887
                        }
4087
                        }
3888
                        s.dataType = "json";
4088
                        s.dataType = "json";
3889
                }
4089
                }
3890
4090
3891
                // Build temporary JSONP function
4091
                // Build temporary JSONP function
3892
                if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
4092
                if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
3893
                        jsonp = "jsonp" + jsc++;
4093
                        jsonp = "jsonp" + jsc++;
3894
4094
3895
                        // Replace the =? sequence both in the query string and the data
4095
                        // Replace the =? sequence both in the query string and the data
3896
                        if ( s.data ) {
4096
                        if ( s.data ) {
3897
                                s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
4097
                                s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
3898
                        }
4098
                        }
3899
4099
3900
                        s.url = s.url.replace(jsre, "=" + jsonp + "$1");
4100
                        s.url = s.url.replace(jsre, "=" + jsonp + "$1");
3901
4101
3902
                        // We need to make sure
4102
                        // We need to make sure
3903
                        // that a JSONP style response is executed properly
4103
                        // that a JSONP style response is executed properly
3904
                        s.dataType = "script";
4104
                        s.dataType = "script";
3905
4105
3906
                        // Handle JSONP-style loading
4106
                        // Handle JSONP-style loading
3907
                        window[ jsonp ] = function(tmp){
4107
                        window[ jsonp ] = function(tmp){
3908
                                data = tmp;
4108
                                data = tmp;
3909
                                success();
4109
                                success();
3910
                                complete();
4110
                                complete();
3911
                                // Garbage collect
4111
                                // Garbage collect
3912
                                window[ jsonp ] = undefined;
4112
                                window[ jsonp ] = undefined;
3913
                                try{ delete window[ jsonp ]; } catch(e){}
4113
                                try{ delete window[ jsonp ]; } catch(e){}
3914
                                if ( head ) {
4114
                                if ( head ) {
3915
                                        head.removeChild( script );
4115
                                        head.removeChild( script );
3916
                                }
4116
                                }
3917
                        };
4117
                        };
3918
                }
4118
                }
3919
4119
3920
                if ( s.dataType === "script" && s.cache === null ) {
4120
                if ( s.dataType === "script" && s.cache === null ) {
3921
                        s.cache = false;
4121
                        s.cache = false;
3922
                }
4122
                }
3923
4123
3924
                if ( s.cache === false && type === "GET" ) {
4124
                if ( s.cache === false && type === "GET" ) {
3925
                        var ts = now();
4125
                        var ts = now();
3926
4126
3927
                        // try replacing _= if it is there
4127
                        // try replacing _= if it is there
3928
                        var ret = s.url.replace(rts, "$1_=" + ts + "$2");
4128
                        var ret = s.url.replace(rts, "$1_=" + ts + "$2");
3929
4129
3930
                        // if nothing was replaced, add timestamp to the end
4130
                        // if nothing was replaced, add timestamp to the end
3931
                        s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
4131
                        s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
3932
                }
4132
                }
3933
4133
3934
                // If data is available, append data to url for get requests
4134
                // If data is available, append data to url for get requests
3935
                if ( s.data && type === "GET" ) {
4135
                if ( s.data && type === "GET" ) {
3936
                        s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
4136
                        s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
3937
                }
4137
                }
3938
4138
3939
                // Watch for a new set of requests
4139
                // Watch for a new set of requests
3940
                if ( s.global && ! jQuery.active++ ) {
4140
                if ( s.global && ! jQuery.active++ ) {
3941
                        jQuery.event.trigger( "ajaxStart" );
4141
                        jQuery.event.trigger( "ajaxStart" );
3942
                }
4142
                }
3943
4143
3944
                // Matches an absolute URL, and saves the domain
4144
                // Matches an absolute URL, and saves the domain
3945
                var parts = rurl.exec( s.url );
4145
                var parts = rurl.exec( s.url );
3946
4146
3947
                // If we're requesting a remote document
4147
                // If we're requesting a remote document
3948
                // and trying to load JSON or Script with a GET
4148
                // and trying to load JSON or Script with a GET
3949
                if ( s.dataType === "script" && type === "GET" && parts
4149
                if ( s.dataType === "script" && type === "GET" && parts
3950
                        && ( parts[1] && parts[1] !== location.protocol || parts[2] !== location.host )) {
4150
                        && ( parts[1] && parts[1] !== location.protocol || parts[2] !== location.host )) {
3951
4151
3952
                        var head = document.getElementsByTagName("head")[0];
4152
                        var head = document.getElementsByTagName("head")[0] || document.documentElement;
3953
                        var script = document.createElement("script");
4153
                        var script = document.createElement("script");
3954
                        script.src = s.url;
4154
                        script.src = s.url;
3955
                        if ( s.scriptCharset ) {
4155
                        if ( s.scriptCharset ) {
3956
                                script.charset = s.scriptCharset;
4156
                                script.charset = s.scriptCharset;
3957
                        }
4157
                        }
3958
4158
3959
                        // Handle Script loading
4159
                        // Handle Script loading
3960
                        if ( !jsonp ) {
4160
                        if ( !jsonp ) {
3961
                                var done = false;
4161
                                var done = false;
3962
4162
3963
                                // Attach handlers for all browsers
4163
                                // Attach handlers for all browsers
3964
                                script.onload = script.onreadystatechange = function(){
4164
                                script.onload = script.onreadystatechange = function(){
3965
                                        if ( !done && (!this.readyState ||
4165
                                        if ( !done && (!this.readyState ||
3966
                                                        this.readyState === "loaded" || this.readyState === "complete") ) {
4166
                                                        this.readyState === "loaded" || this.readyState === "complete") ) {
3967
                                                done = true;
4167
                                                done = true;
3968
                                                success();
4168
                                                success();
3969
                                                complete();
4169
                                                complete();
3970
4170
3971
                                                // Handle memory leak in IE
4171
                                                // Handle memory leak in IE
3972
                                                script.onload = script.onreadystatechange = null;
4172
                                                script.onload = script.onreadystatechange = null;
3973
                                                if ( head && script.parentNode ) {
4173
                                                if ( head && script.parentNode ) {
3974
                                                        head.removeChild( script );
4174
                                                        head.removeChild( script );
3975
                                                }
4175
                                                }
3976
                                        }
4176
                                        }
3977
                                };
4177
                                };
3978
                        }
4178
                        }
3979
4179
3980
                        // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
4180
                        // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
3981
                        // This arises when a base node is used (#2709 and #4378).
4181
                        // This arises when a base node is used (#2709 and #4378).
3982
                        head.insertBefore( script, head.firstChild );
4182
                        head.insertBefore( script, head.firstChild );
3983
4183
3984
                        // We handle everything using the script element injection
4184
                        // We handle everything using the script element injection
3985
                        return undefined;
4185
                        return undefined;
3986
                }
4186
                }
3987
4187
3988
                var requestDone = false;
4188
                var requestDone = false;
3989
4189
3990
                // Create the request object
4190
                // Create the request object
3991
                var xhr = s.xhr();
4191
                var xhr = s.xhr();
3992
4192
3993
                // Open the socket
4193
                // Open the socket
3994
                // Passing null username, generates a login popup on Opera (#2865)
4194
                // Passing null username, generates a login popup on Opera (#2865)
3995
                if ( s.username ) {
4195
                if ( s.username ) {
3996
                        xhr.open(type, s.url, s.async, s.username, s.password);
4196
                        xhr.open(type, s.url, s.async, s.username, s.password);
3997
                } else {
4197
                } else {
3998
                        xhr.open(type, s.url, s.async);
4198
                        xhr.open(type, s.url, s.async);
3999
                }
4199
                }
4000
4200
4001
                // Need an extra try/catch for cross domain requests in Firefox 3
4201
                // Need an extra try/catch for cross domain requests in Firefox 3
4002
                try {
4202
                try {
4003
                        // Set the correct header, if data is being sent
4203
                        // Set the correct header, if data is being sent
4004
                        if ( s.data ) {
4204
                        if ( s.data ) {
4005
                                xhr.setRequestHeader("Content-Type", s.contentType);
4205
                                xhr.setRequestHeader("Content-Type", s.contentType);
4006
                        }
4206
                        }
4007
4207
4008
                                // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
4208
                                // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
4009
                                if ( s.ifModified ) {
4209
                                if ( s.ifModified ) {
4010
                                        if ( jQuery.lastModified[s.url] ) {
4210
                                        if ( jQuery.lastModified[s.url] ) {
4011
                                                xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
4211
                                                xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
4012
                                        }
4212
                                        }
4013
4213
4014
                                        if ( jQuery.etag[s.url] ) {
4214
                                        if ( jQuery.etag[s.url] ) {
4015
                                                xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
4215
                                                xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
4016
                                        }
4216
                                        }
4017
                                }
4217
                                }
4018
4218
4019
                        // Set header so the called script knows that it's an XMLHttpRequest
4219
                        // Set header so the called script knows that it's an XMLHttpRequest
4020
                        xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
4220
                        xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
4021
4221
4022
                        // Set the Accepts header for the server, depending on the dataType
4222
                        // Set the Accepts header for the server, depending on the dataType
4023
                        xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
4223
                        xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
4024
                                s.accepts[ s.dataType ] + ", */*" :
4224
                                s.accepts[ s.dataType ] + ", */*" :
4025
                                s.accepts._default );
4225
                                s.accepts._default );
4026
                } catch(e){}
4226
                } catch(e){}
4027
4227
4028
                // Allow custom headers/mimetypes and early abort
4228
                // Allow custom headers/mimetypes and early abort
4029
                if ( s.beforeSend && s.beforeSend(xhr, s) === false ) {
4229
                if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
4030
                        // Handle the global AJAX counter
4230
                        // Handle the global AJAX counter
4031
                        if ( s.global && ! --jQuery.active ) {
4231
                        if ( s.global && ! --jQuery.active ) {
4032
                                jQuery.event.trigger( "ajaxStop" );
4232
                                jQuery.event.trigger( "ajaxStop" );
4033
                        }
4233
                        }
4034
4234
4035
                        // close opended socket
4235
                        // close opended socket
4036
                        xhr.abort();
4236
                        xhr.abort();
4037
                        return false;
4237
                        return false;
4038
                }
4238
                }
4039
4239
4040
                if ( s.global ) {
4240
                if ( s.global ) {
4041
                        jQuery.event.trigger("ajaxSend", [xhr, s]);
4241
                        trigger("ajaxSend", [xhr, s]);
4042
                }
4242
                }
4043
4243
4044
                // Wait for a response to come back
4244
                // Wait for a response to come back
4045
                var onreadystatechange = function(isTimeout){
4245
                var onreadystatechange = function(isTimeout){
4046
                        // The request was aborted, clear the interval and decrement jQuery.active
4246
                        // The request was aborted, clear the interval and decrement jQuery.active
4047
                        if ( xhr.readyState === 0 ) {
4247
                        if ( !xhr || xhr.readyState === 0 ) {
4048
                                if ( ival ) {
4248
                                if ( ival ) {
4049
                                        // clear poll interval
4249
                                        // clear poll interval
4050
                                        clearInterval( ival );
4250
                                        clearInterval( ival );
4051
                                        ival = null;
4251
                                        ival = null;
4052
4252
4053
                                        // Handle the global AJAX counter
4253
                                        // Handle the global AJAX counter
4054
                                        if ( s.global && ! --jQuery.active ) {
4254
                                        if ( s.global && ! --jQuery.active ) {
4055
                                                jQuery.event.trigger( "ajaxStop" );
4255
                                                jQuery.event.trigger( "ajaxStop" );
4056
                                        }
4256
                                        }
4057
                                }
4257
                                }
4058
4258
4059
                        // The transfer is complete and the data is available, or the request timed out
4259
                        // The transfer is complete and the data is available, or the request timed out
4060
                        } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
4260
                        } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
4061
                                requestDone = true;
4261
                                requestDone = true;
4062
4262
4063
                                // clear poll interval
4263
                                // clear poll interval
4064
                                if (ival) {
4264
                                if (ival) {
4065
                                        clearInterval(ival);
4265
                                        clearInterval(ival);
4066
                                        ival = null;
4266
                                        ival = null;
4067
                                }
4267
                                }
4068
4268
4069
                                status = isTimeout === "timeout" ?
4269
                                status = isTimeout === "timeout" ?
4070
                                        "timeout" :
4270
                                        "timeout" :
4071
                                        !jQuery.httpSuccess( xhr ) ?
4271
                                        !jQuery.httpSuccess( xhr ) ?
4072
                                                "error" :
4272
                                                "error" :
4073
                                                s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
4273
                                                s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
4074
                                                        "notmodified" :
4274
                                                        "notmodified" :
4075
                                                        "success";
4275
                                                        "success";
4076
4276
4077
                                if ( status === "success" ) {
4277
                                if ( status === "success" ) {
4078
                                        // Watch for, and catch, XML document parse errors
4278
                                        // Watch for, and catch, XML document parse errors
4079
                                        try {
4279
                                        try {
4080
                                                // process the data (runs the xml through httpData regardless of callback)
4280
                                                // process the data (runs the xml through httpData regardless of callback)
4081
                                                data = jQuery.httpData( xhr, s.dataType, s );
4281
                                                data = jQuery.httpData( xhr, s.dataType, s );
4082
                                        } catch(e) {
4282
                                        } catch(e) {
4083
                                                status = "parsererror";
4283
                                                status = "parsererror";
4084
                                        }
4284
                                        }
4085
                                }
4285
                                }
4086
4286
4087
                                // Make sure that the request was successful or notmodified
4287
                                // Make sure that the request was successful or notmodified
4088
                                if ( status === "success" || status === "notmodified" ) {
4288
                                if ( status === "success" || status === "notmodified" ) {
4089
                                        // JSONP handles its own success callback
4289
                                        // JSONP handles its own success callback
4090
                                        if ( !jsonp ) {
4290
                                        if ( !jsonp ) {
4091
                                                success();
4291
                                                success();
4092
                                        }
4292
                                        }
4093
                                } else {
4293
                                } else {
4094
                                        jQuery.handleError(s, xhr, status);
4294
                                        jQuery.handleError(s, xhr, status);
4095
                                }
4295
                                }
4096
4296
4097
                                // Fire the complete handlers
4297
                                // Fire the complete handlers
4098
                                complete();
4298
                                complete();
4099
4299
4100
                                if ( isTimeout ) {
4300
                                if ( isTimeout ) {
4101
                                        xhr.abort();
4301
                                        xhr.abort();
4102
                                }
4302
                                }
4103
4303
4104
                                // Stop memory leaks
4304
                                // Stop memory leaks
4105
                                if ( s.async ) {
4305
                                if ( s.async ) {
4106
                                        xhr = null;
4306
                                        xhr = null;
4107
                                }
4307
                                }
4108
                        }
4308
                        }
4109
                };
4309
                };
4110
4310
4111
                if ( s.async ) {
4311
                if ( s.async ) {
4112
                        // don't attach the handler to the request, just poll it instead
4312
                        // don't attach the handler to the request, just poll it instead
4113
                        var ival = setInterval(onreadystatechange, 13);
4313
                        var ival = setInterval(onreadystatechange, 13);
4114
4314
4115
                        // Timeout checker
4315
                        // Timeout checker
4116
                        if ( s.timeout > 0 ) {
4316
                        if ( s.timeout > 0 ) {
4117
                                setTimeout(function(){
4317
                                setTimeout(function(){
4118
                                        // Check to see if the request is still happening
4318
                                        // Check to see if the request is still happening
4119
                                        if ( xhr && !requestDone ) {
4319
                                        if ( xhr && !requestDone ) {
4120
                                                onreadystatechange( "timeout" );
4320
                                                onreadystatechange( "timeout" );
4121
                                        }
4321
                                        }
4122
                                }, s.timeout);
4322
                                }, s.timeout);
4123
                        }
4323
                        }
4124
                }
4324
                }
4125
4325
4126
                // Send the data
4326
                // Send the data
4127
                try {
4327
                try {
4128
                        xhr.send( type === "POST" || type === "PUT" ? s.data : null );
4328
                        xhr.send( type === "POST" || type === "PUT" ? s.data : null );
4129
                } catch(e) {
4329
                } catch(e) {
4130
                        jQuery.handleError(s, xhr, null, e);
4330
                        jQuery.handleError(s, xhr, null, e);
4131
                }
4331
                }
4132
4332
4133
                // firefox 1.5 doesn't fire statechange for sync requests
4333
                // firefox 1.5 doesn't fire statechange for sync requests
4134
                if ( !s.async ) {
4334
                if ( !s.async ) {
4135
                        onreadystatechange();
4335
                        onreadystatechange();
4136
                }
4336
                }
4137
4337
4138
                function success(){
4338
                function success(){
4139
                        // If a local callback was specified, fire it and pass it the data
4339
                        // If a local callback was specified, fire it and pass it the data
4140
                        if ( s.success ) {
4340
                        if ( s.success ) {
4141
                                s.success( data, status );
4341
                                s.success.call( callbackContext, data, status );
4142
                        }
4342
                        }
4143
4343
4144
                        // Fire the global callback
4344
                        // Fire the global callback
4145
                        if ( s.global ) {
4345
                        if ( s.global ) {
4146
                                jQuery.event.trigger( "ajaxSuccess", [xhr, s] );
4346
                                trigger( "ajaxSuccess", [xhr, s] );
4147
                        }
4347
                        }
4148
                }
4348
                }
4149
4349
4150
                function complete(){
4350
                function complete(){
4151
                        // Process result
4351
                        // Process result
4152
                        if ( s.complete ) {
4352
                        if ( s.complete ) {
4153
                                s.complete(xhr, status);
4353
                                s.complete.call( callbackContext, xhr, status);
4154
                        }
4354
                        }
4155
4355
4156
                        // The request was completed
4356
                        // The request was completed
4157
                        if ( s.global ) {
4357
                        if ( s.global ) {
4158
                                jQuery.event.trigger( "ajaxComplete", [xhr, s] );
4358
                                trigger( "ajaxComplete", [xhr, s] );
4159
                        }
4359
                        }
4160
4360
4161
                        // Handle the global AJAX counter
4361
                        // Handle the global AJAX counter
4162
                        if ( s.global && ! --jQuery.active ) {
4362
                        if ( s.global && ! --jQuery.active ) {
4163
                                jQuery.event.trigger( "ajaxStop" );
4363
                                jQuery.event.trigger( "ajaxStop" );
4164
                        }
4364
                        }
4165
                }
4365
                }
4166
4366
               
-
 
4367
                function trigger(type, args){
-
 
4368
                        (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
-
 
4369
                }
-
 
4370
4167
                // return XMLHttpRequest to allow aborting the request etc.
4371
                // return XMLHttpRequest to allow aborting the request etc.
4168
                return xhr;
4372
                return xhr;
4169
        },
4373
        },
4170
4374
4171
        handleError: function( s, xhr, status, e ) {
4375
        handleError: function( s, xhr, status, e ) {
4172
                // If a local callback was specified, fire it
4376
                // If a local callback was specified, fire it
4173
                if ( s.error ) {
4377
                if ( s.error ) {
4174
                        s.error( xhr, status, e );
4378
                        s.error.call( s.context || window, xhr, status, e );
4175
                }
4379
                }
4176
4380
4177
                // Fire the global callback
4381
                // Fire the global callback
4178
                if ( s.global ) {
4382
                if ( s.global ) {
4179
                        jQuery.event.trigger( "ajaxError", [xhr, s, e] );
4383
                        (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
4180
                }
4384
                }
4181
        },
4385
        },
4182
4386
4183
        // Counter for holding the number of active queries
4387
        // Counter for holding the number of active queries
4184
        active: 0,
4388
        active: 0,
4185
4389
4186
        // Determines if an XMLHttpRequest was successful or not
4390
        // Determines if an XMLHttpRequest was successful or not
4187
        httpSuccess: function( xhr ) {
4391
        httpSuccess: function( xhr ) {
4188
                try {
4392
                try {
4189
                        // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
4393
                        // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
4190
                        return !xhr.status && location.protocol === "file:" ||
4394
                        return !xhr.status && location.protocol === "file:" ||
4191
                                // Opera returns 0 when status is 304
4395
                                // Opera returns 0 when status is 304
4192
                                ( xhr.status >= 200 && xhr.status < 300 ) ||
4396
                                ( xhr.status >= 200 && xhr.status < 300 ) ||
4193
                                xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
4397
                                xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
4194
                } catch(e){}
4398
                } catch(e){}
4195
4399
4196
                return false;
4400
                return false;
4197
        },
4401
        },
4198
4402
4199
        // Determines if an XMLHttpRequest returns NotModified
4403
        // Determines if an XMLHttpRequest returns NotModified
4200
        httpNotModified: function( xhr, url ) {
4404
        httpNotModified: function( xhr, url ) {
4201
                var last_modified = xhr.getResponseHeader("Last-Modified"),
4405
                var lastModified = xhr.getResponseHeader("Last-Modified"),
4202
                        etag = xhr.getResponseHeader("Etag");
4406
                        etag = xhr.getResponseHeader("Etag");
4203
4407
4204
                if ( last_modified ) {
4408
                if ( lastModified ) {
4205
                        jQuery.lastModified[url] = last_modified;
4409
                        jQuery.lastModified[url] = lastModified;
4206
                }
4410
                }
4207
4411
4208
                if ( etag ) {
4412
                if ( etag ) {
4209
                        jQuery.etag[url] = etag;
4413
                        jQuery.etag[url] = etag;
4210
                }
4414
                }
4211
4415
4212
                // Opera returns 0 when status is 304
4416
                // Opera returns 0 when status is 304
4213
                return xhr.status === 304 || xhr.status === 0;
4417
                return xhr.status === 304 || xhr.status === 0;
4214
        },
4418
        },
4215
4419
4216
        httpData: function( xhr, type, s ) {
4420
        httpData: function( xhr, type, s ) {
4217
                var ct = xhr.getResponseHeader("content-type"),
4421
                var ct = xhr.getResponseHeader("content-type"),
4218
                        xml = type === "xml" || !type && ct && ct.indexOf("xml") >= 0,
4422
                        xml = type === "xml" || !type && ct && ct.indexOf("xml") >= 0,
4219
                        data = xml ? xhr.responseXML : xhr.responseText;
4423
                        data = xml ? xhr.responseXML : xhr.responseText;
4220
4424
4221
                if ( xml && data.documentElement.nodeName === "parsererror" ) {
4425
                if ( xml && data.documentElement.nodeName === "parsererror" ) {
4222
                        throw "parsererror";
4426
                        throw "parsererror";
4223
                }
4427
                }
4224
4428
4225
                // Allow a pre-filtering function to sanitize the response
4429
                // Allow a pre-filtering function to sanitize the response
4226
                // s is checked to keep backwards compatibility
4430
                // s is checked to keep backwards compatibility
4227
                if ( s && s.dataFilter ) {
4431
                if ( s && s.dataFilter ) {
4228
                        data = s.dataFilter( data, type );
4432
                        data = s.dataFilter( data, type );
4229
                }
4433
                }
4230
4434
4231
                // The filter can actually parse the response
4435
                // The filter can actually parse the response
4232
                if ( typeof data === "string" ) {
4436
                if ( typeof data === "string" ) {
4233
4437
4234
                        // If the type is "script", eval it in global context
4438
                        // If the type is "script", eval it in global context
4235
                        if ( type === "script" ) {
4439
                        if ( type === "script" ) {
4236
                                jQuery.globalEval( data );
4440
                                jQuery.globalEval( data );
4237
                        }
4441
                        }
4238
4442
4239
                        // Get the JavaScript object, if JSON is used.
4443
                        // Get the JavaScript object, if JSON is used.
4240
                        if ( type === "json" ) {
4444
                        if ( type === "json" ) {
4241
                                if ( typeof JSON === "object" && JSON.parse ) {
4445
                                if ( typeof JSON === "object" && JSON.parse ) {
4242
                                        data = JSON.parse( data );
4446
                                        data = JSON.parse( data );
4243
                                } else {
4447
                                } else {
4244
                                        data = (new Function("return " + data))();
4448
                                        data = (new Function("return " + data))();
4245
                                }
4449
                                }
4246
                        }
4450
                        }
4247
                }
4451
                }
4248
4452
4249
                return data;
4453
                return data;
4250
        },
4454
        },
4251
4455
4252
        // Serialize an array of form elements or a set of
4456
        // Serialize an array of form elements or a set of
4253
        // key/values into a query string
4457
        // key/values into a query string
4254
        param: function( a ) {
4458
        param: function( a ) {
4255
                var s = [];
4459
                var s = [],
-
 
4460
                        param_traditional = jQuery.param.traditional;
4256
4461
               
4257
                function add( key, value ){
4462
                function add( key, value ){
-
 
4463
                        // If value is a function, invoke it and return its value
-
 
4464
                        value = jQuery.isFunction(value) ? value() : value;
4258
                        s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value);
4465
                        s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value);
4259
                }
4466
                }
4260
4467
               
4261
                // If an array was passed in, assume that it is an array
4468
                // If an array was passed in, assume that it is an array
4262
                // of form elements
4469
                // of form elements
4263
                if ( jQuery.isArray(a) || a.jquery ) {
4470
                if ( jQuery.isArray(a) || a.jquery )
4264
                        // Serialize the form elements
4471
                        // Serialize the form elements
4265
                        jQuery.each( a, function(){
4472
                        jQuery.each( a, function() {
4266
                                add( this.name, this.value );
4473
                                add( this.name, this.value );
4267
                        });
4474
                        });
4268
4475
                       
4269
                // Otherwise, assume that it's an object of key/value pairs
-
 
4270
                } else {
4476
                else
4271
                        // Serialize the key/values
4477
                        // Encode parameters from object, recursively. If
-
 
4478
                        // jQuery.param.traditional is set, encode the "old" way
4272
                        for ( var j in a ) {
4479
                        // (the way 1.3.2 or older did it)
4273
                                // If the value is an array then the key names need to be repeated
4480
                        jQuery.each( a, function buildParams( prefix, obj ) {
-
 
4481
                               
4274
                                if ( jQuery.isArray(a[j]) ) {
4482
                                if ( jQuery.isArray(obj) )
4275
                                        jQuery.each( a[j], function(){
4483
                                        jQuery.each( obj, function(i,v){
-
 
4484
                                                // Due to rails' limited request param syntax, numeric array
-
 
4485
                                                // indices are not supported. To avoid serialization ambiguity
-
 
4486
                                                // issues, serialized arrays can only contain scalar values. php
-
 
4487
                                                // does not have this issue, but we should go with the lowest
-
 
4488
                                                // common denominator
-
 
4489
                                                add( prefix + ( param_traditional ? "" : "[]" ), v );
-
 
4490
                                        });
-
 
4491
                                       
-
 
4492
                                else if ( typeof obj == "object" )
-
 
4493
                                        if ( param_traditional )
4276
                                                add( j, this );
4494
                                                add( prefix, obj );
-
 
4495
                                               
-
 
4496
                                        else
-
 
4497
                                                jQuery.each( obj, function(k,v){
-
 
4498
                                                        buildParams( prefix ? prefix + "[" + k + "]" : k, v );
-
 
4499
                                                });
-
 
4500
                                       
-
 
4501
                                else
-
 
4502
                                        add( prefix, obj );
-
 
4503
                               
4277
                                        });
4504
                        });
4278
                                } else {
-
 
4279
                                        add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] );
-
 
4280
                                }
-
 
4281
                        }
-
 
4282
                }
-
 
4283
4505
4284
                // Return the resulting serialization
4506
                // Return the resulting serialization
4285
                return s.join("&").replace(r20, "+");
4507
                return s.join("&").replace(r20, "+");
4286
        }
4508
        }
4287
4509
4288
});
4510
});
4289
var elemdisplay = {},
4511
var elemdisplay = {},
4290
        timerId,
4512
        timerId,
4291
        fxAttrs = [
4513
        fxAttrs = [
4292
                // height animations
4514
                // height animations
4293
                [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
4515
                [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
4294
                // width animations
4516
                // width animations
4295
                [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
4517
                [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
4296
                // opacity animations
4518
                // opacity animations
4297
                [ "opacity" ]
4519
                [ "opacity" ]
4298
        ];
4520
        ];
4299
4521
4300
function genFx( type, num ){
4522
function genFx( type, num ){
4301
        var obj = {};
4523
        var obj = {};
4302
        jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){
4524
        jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){
4303
                obj[ this ] = type;
4525
                obj[ this ] = type;
4304
        });
4526
        });
4305
        return obj;
4527
        return obj;
4306
}
4528
}
4307
4529
4308
jQuery.fn.extend({
4530
jQuery.fn.extend({
4309
        show: function(speed,callback){
4531
        show: function(speed,callback){
4310
                if ( speed ) {
4532
                if ( speed !== undefined ) {
4311
                        return this.animate( genFx("show", 3), speed, callback);
4533
                        return this.animate( genFx("show", 3), speed, callback);
4312
                } else {
4534
                } else {
4313
                        for ( var i = 0, l = this.length; i < l; i++ ){
4535
                        for ( var i = 0, l = this.length; i < l; i++ ){
4314
                                var old = jQuery.data(this[i], "olddisplay");
4536
                                var old = jQuery.data(this[i], "olddisplay");
4315
4537
4316
                                this[i].style.display = old || "";
4538
                                this[i].style.display = old || "";
4317
4539
4318
                                if ( jQuery.css(this[i], "display") === "none" ) {
4540
                                if ( jQuery.css(this[i], "display") === "none" ) {
4319
                                        var nodeName = this[i].nodeName, display;
4541
                                        var nodeName = this[i].nodeName, display;
4320
4542
4321
                                        if ( elemdisplay[ nodeName ] ) {
4543
                                        if ( elemdisplay[ nodeName ] ) {
4322
                                                display = elemdisplay[ nodeName ];
4544
                                                display = elemdisplay[ nodeName ];
4323
                                        } else {
4545
                                        } else {
4324
                                                var elem = jQuery("<" + nodeName + " />").appendTo("body");
4546
                                                var elem = jQuery("<" + nodeName + " />").appendTo("body");
4325
4547
4326
                                                display = elem.css("display");
4548
                                                display = elem.css("display");
4327
                                                if ( display === "none" )
4549
                                                if ( display === "none" )
4328
                                                        display = "block";
4550
                                                        display = "block";
4329
4551
4330
                                                elem.remove();
4552
                                                elem.remove();
4331
4553
4332
                                                elemdisplay[ nodeName ] = display;
4554
                                                elemdisplay[ nodeName ] = display;
4333
                                        }
4555
                                        }
4334
4556
4335
                                        jQuery.data(this[i], "olddisplay", display);
4557
                                        jQuery.data(this[i], "olddisplay", display);
4336
                                }
4558
                                }
4337
                        }
4559
                        }
4338
4560
4339
                        // Set the display of the elements in a second loop
4561
                        // Set the display of the elements in a second loop
4340
                        // to avoid the constant reflow
4562
                        // to avoid the constant reflow
4341
                        for ( var i = 0, l = this.length; i < l; i++ ){
4563
                        for ( var i = 0, l = this.length; i < l; i++ ){
4342
                                this[i].style.display = jQuery.data(this[i], "olddisplay") || "";
4564
                                this[i].style.display = jQuery.data(this[i], "olddisplay") || "";
4343
                        }
4565
                        }
4344
4566
4345
                        return this;
4567
                        return this;
4346
                }
4568
                }
4347
        },
4569
        },
4348
4570
4349
        hide: function(speed,callback){
4571
        hide: function(speed,callback){
4350
                if ( speed ) {
4572
                if ( speed !== undefined ) {
4351
                        return this.animate( genFx("hide", 3), speed, callback);
4573
                        return this.animate( genFx("hide", 3), speed, callback);
4352
                } else {
4574
                } else {
4353
                        for ( var i = 0, l = this.length; i < l; i++ ){
4575
                        for ( var i = 0, l = this.length; i < l; i++ ){
4354
                                var old = jQuery.data(this[i], "olddisplay");
4576
                                var old = jQuery.data(this[i], "olddisplay");
4355
                                if ( !old && old !== "none" )
4577
                                if ( !old && old !== "none" )
4356
                                        jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
4578
                                        jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
4357
                        }
4579
                        }
4358
4580
4359
                        // Set the display of the elements in a second loop
4581
                        // Set the display of the elements in a second loop
4360
                        // to avoid the constant reflow
4582
                        // to avoid the constant reflow
4361
                        for ( var i = 0, l = this.length; i < l; i++ ){
4583
                        for ( var i = 0, l = this.length; i < l; i++ ){
4362
                                this[i].style.display = "none";
4584
                                this[i].style.display = "none";
4363
                        }
4585
                        }
4364
4586
4365
                        return this;
4587
                        return this;
4366
                }
4588
                }
4367
        },
4589
        },
4368
4590
4369
        // Save the old toggle function
4591
        // Save the old toggle function
4370
        _toggle: jQuery.fn.toggle,
4592
        _toggle: jQuery.fn.toggle,
4371
4593
4372
        toggle: function( fn, fn2 ){
4594
        toggle: function( fn, fn2 ){
4373
                var bool = typeof fn === "boolean";
4595
                var bool = typeof fn === "boolean";
4374
4596
4375
                return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
4597
                return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
4376
                        this._toggle.apply( this, arguments ) :
4598
                        this._toggle.apply( this, arguments ) :
4377
                        fn == null || bool ?
4599
                        fn == null || bool ?
4378
                                this.each(function(){
4600
                                this.each(function(){
4379
                                        var state = bool ? fn : jQuery(this).is(":hidden");
4601
                                        var state = bool ? fn : jQuery(this).is(":hidden");
4380
                                        jQuery(this)[ state ? "show" : "hide" ]();
4602
                                        jQuery(this)[ state ? "show" : "hide" ]();
4381
                                }) :
4603
                                }) :
4382
                                this.animate(genFx("toggle", 3), fn, fn2);
4604
                                this.animate(genFx("toggle", 3), fn, fn2);
4383
        },
4605
        },
4384
4606
4385
        fadeTo: function(speed,to,callback){
4607
        fadeTo: function(speed,to,callback){
4386
                return this.filter(":hidden").css('opacity', 0).show().end()
4608
                return this.filter(":hidden").css('opacity', 0).show().end()
4387
                                        .animate({opacity: to}, speed, callback);
4609
                                        .animate({opacity: to}, speed, callback);
4388
        },
4610
        },
4389
4611
4390
        animate: function( prop, speed, easing, callback ) {
4612
        animate: function( prop, speed, easing, callback ) {
4391
                var optall = jQuery.speed(speed, easing, callback);
4613
                var optall = jQuery.speed(speed, easing, callback);
4392
4614
4393
                return this[ optall.queue === false ? "each" : "queue" ](function(){
4615
                return this[ optall.queue === false ? "each" : "queue" ](function(){
4394
4616
4395
                        var opt = jQuery.extend({}, optall), p,
4617
                        var opt = jQuery.extend({}, optall), p,
4396
                                hidden = this.nodeType == 1 && jQuery(this).is(":hidden"),
4618
                                hidden = this.nodeType == 1 && jQuery(this).is(":hidden"),
4397
                                self = this;
4619
                                self = this;
4398
4620
4399
                        for ( p in prop ) {
4621
                        for ( p in prop ) {
4400
                                var name = p.replace(rdashAlpha, fcamelCase);
4622
                                var name = p.replace(rdashAlpha, fcamelCase);
4401
4623
4402
                                if ( p !== name ) {
4624
                                if ( p !== name ) {
4403
                                        prop[ name ] = prop[ p ];
4625
                                        prop[ name ] = prop[ p ];
4404
                                        delete prop[ p ];
4626
                                        delete prop[ p ];
4405
                                        p = name;
4627
                                        p = name;
4406
                                }
4628
                                }
4407
4629
4408
                                if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
4630
                                if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
4409
                                        return opt.complete.call(this);
4631
                                        return opt.complete.call(this);
4410
4632
4411
                                if ( ( p == "height" || p == "width" ) && this.style ) {
4633
                                if ( ( p == "height" || p == "width" ) && this.style ) {
4412
                                        // Store display property
4634
                                        // Store display property
4413
                                        opt.display = jQuery.css(this, "display");
4635
                                        opt.display = jQuery.css(this, "display");
4414
4636
4415
                                        // Make sure that nothing sneaks out
4637
                                        // Make sure that nothing sneaks out
4416
                                        opt.overflow = this.style.overflow;
4638
                                        opt.overflow = this.style.overflow;
4417
                                }
4639
                                }
4418
                        }
4640
                        }
4419
4641
4420
                        if ( opt.overflow != null )
4642
                        if ( opt.overflow != null )
4421
                                this.style.overflow = "hidden";
4643
                                this.style.overflow = "hidden";
4422
4644
4423
                        opt.curAnim = jQuery.extend({}, prop);
4645
                        opt.curAnim = jQuery.extend({}, prop);
4424
4646
4425
                        jQuery.each( prop, function(name, val){
4647
                        jQuery.each( prop, function(name, val){
4426
                                var e = new jQuery.fx( self, opt, name );
4648
                                var e = new jQuery.fx( self, opt, name );
4427
4649
4428
                                if ( /toggle|show|hide/.test(val) )
4650
                                if ( /toggle|show|hide/.test(val) )
4429
                                        e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
4651
                                        e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
4430
                                else {
4652
                                else {
4431
                                        var parts = /^([+-]=)?([\d+-.]+)(.*)$/.exec(val),
4653
                                        var parts = /^([+-]=)?([\d+-.]+)(.*)$/.exec(val),
4432
                                                start = e.cur(true) || 0;
4654
                                                start = e.cur(true) || 0;
4433
4655
4434
                                        if ( parts ) {
4656
                                        if ( parts ) {
4435
                                                var end = parseFloat(parts[2]),
4657
                                                var end = parseFloat(parts[2]),
4436
                                                        unit = parts[3] || "px";
4658
                                                        unit = parts[3] || "px";
4437
4659
4438
                                                // We need to compute starting value
4660
                                                // We need to compute starting value
4439
                                                if ( unit != "px" ) {
4661
                                                if ( unit != "px" ) {
4440
                                                        self.style[ name ] = (end || 1) + unit;
4662
                                                        self.style[ name ] = (end || 1) + unit;
4441
                                                        start = ((end || 1) / e.cur(true)) * start;
4663
                                                        start = ((end || 1) / e.cur(true)) * start;
4442
                                                        self.style[ name ] = start + unit;
4664
                                                        self.style[ name ] = start + unit;
4443
                                                }
4665
                                                }
4444
4666
4445
                                                // If a +=/-= token was provided, we're doing a relative animation
4667
                                                // If a +=/-= token was provided, we're doing a relative animation
4446
                                                if ( parts[1] )
4668
                                                if ( parts[1] )
4447
                                                        end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
4669
                                                        end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
4448
4670
4449
                                                e.custom( start, end, unit );
4671
                                                e.custom( start, end, unit );
4450
                                        } else
4672
                                        } else
4451
                                                e.custom( start, val, "" );
4673
                                                e.custom( start, val, "" );
4452
                                }
4674
                                }
4453
                        });
4675
                        });
4454
4676
4455
                        // For JS strict compliance
4677
                        // For JS strict compliance
4456
                        return true;
4678
                        return true;
4457
                });
4679
                });
4458
        },
4680
        },
4459
4681
4460
        stop: function(clearQueue, gotoEnd){
4682
        stop: function(clearQueue, gotoEnd){
4461
                var timers = jQuery.timers;
4683
                var timers = jQuery.timers;
4462
4684
4463
                if (clearQueue)
4685
                if (clearQueue)
4464
                        this.queue([]);
4686
                        this.queue([]);
4465
4687
4466
                this.each(function(){
4688
                this.each(function(){
4467
                        // go in reverse order so anything added to the queue during the loop is ignored
4689
                        // go in reverse order so anything added to the queue during the loop is ignored
4468
                        for ( var i = timers.length - 1; i >= 0; i-- )
4690
                        for ( var i = timers.length - 1; i >= 0; i-- )
4469
                                if ( timers[i].elem == this ) {
4691
                                if ( timers[i].elem == this ) {
4470
                                        if (gotoEnd)
4692
                                        if (gotoEnd)
4471
                                                // force the next step to be the last
4693
                                                // force the next step to be the last
4472
                                                timers[i](true);
4694
                                                timers[i](true);
4473
                                        timers.splice(i, 1);
4695
                                        timers.splice(i, 1);
4474
                                }
4696
                                }
4475
                });
4697
                });
4476
4698
4477
                // start the next in the queue if the last step wasn't forced
4699
                // start the next in the queue if the last step wasn't forced
4478
                if (!gotoEnd)
4700
                if (!gotoEnd)
4479
                        this.dequeue();
4701
                        this.dequeue();
4480
4702
4481
                return this;
4703
                return this;
4482
        }
4704
        }
4483
4705
4484
});
4706
});
4485
4707
4486
// Generate shortcuts for custom animations
4708
// Generate shortcuts for custom animations
4487
jQuery.each({
4709
jQuery.each({
4488
        slideDown: genFx("show", 1),
4710
        slideDown: genFx("show", 1),
4489
        slideUp: genFx("hide", 1),
4711
        slideUp: genFx("hide", 1),
4490
        slideToggle: genFx("toggle", 1),
4712
        slideToggle: genFx("toggle", 1),
4491
        fadeIn: { opacity: "show" },
4713
        fadeIn: { opacity: "show" },
4492
        fadeOut: { opacity: "hide" }
4714
        fadeOut: { opacity: "hide" }
4493
}, function( name, props ){
4715
}, function( name, props ){
4494
        jQuery.fn[ name ] = function( speed, callback ){
4716
        jQuery.fn[ name ] = function( speed, callback ){
4495
                return this.animate( props, speed, callback );
4717
                return this.animate( props, speed, callback );
4496
        };
4718
        };
4497
});
4719
});
4498
4720
4499
jQuery.extend({
4721
jQuery.extend({
4500
4722
4501
        speed: function(speed, easing, fn) {
4723
        speed: function(speed, easing, fn) {
4502
                var opt = typeof speed === "object" ? speed : {
4724
                var opt = typeof speed === "object" ? speed : {
4503
                        complete: fn || !fn && easing ||
4725
                        complete: fn || !fn && easing ||
4504
                                jQuery.isFunction( speed ) && speed,
4726
                                jQuery.isFunction( speed ) && speed,
4505
                        duration: speed,
4727
                        duration: speed,
4506
                        easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
4728
                        easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
4507
                };
4729
                };
4508
4730
4509
                opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
4731
                opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
4510
                        jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
4732
                        jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
4511
4733
4512
                // Queueing
4734
                // Queueing
4513
                opt.old = opt.complete;
4735
                opt.old = opt.complete;
4514
                opt.complete = function(){
4736
                opt.complete = function(){
4515
                        if ( opt.queue !== false )
4737
                        if ( opt.queue !== false )
4516
                                jQuery(this).dequeue();
4738
                                jQuery(this).dequeue();
4517
                        if ( jQuery.isFunction( opt.old ) )
4739
                        if ( jQuery.isFunction( opt.old ) )
4518
                                opt.old.call( this );
4740
                                opt.old.call( this );
4519
                };
4741
                };
4520
4742
4521
                return opt;
4743
                return opt;
4522
        },
4744
        },
4523
4745
4524
        easing: {
4746
        easing: {
4525
                linear: function( p, n, firstNum, diff ) {
4747
                linear: function( p, n, firstNum, diff ) {
4526
                        return firstNum + diff * p;
4748
                        return firstNum + diff * p;
4527
                },
4749
                },
4528
                swing: function( p, n, firstNum, diff ) {
4750
                swing: function( p, n, firstNum, diff ) {
4529
                        return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
4751
                        return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
4530
                }
4752
                }
4531
        },
4753
        },
4532
4754
4533
        timers: [],
4755
        timers: [],
4534
4756
4535
        fx: function( elem, options, prop ){
4757
        fx: function( elem, options, prop ){
4536
                this.options = options;
4758
                this.options = options;
4537
                this.elem = elem;
4759
                this.elem = elem;
4538
                this.prop = prop;
4760
                this.prop = prop;
4539
4761
4540
                if ( !options.orig )
4762
                if ( !options.orig )
4541
                        options.orig = {};
4763
                        options.orig = {};
4542
        }
4764
        }
4543
4765
4544
});
4766
});
4545
4767
4546
jQuery.fx.prototype = {
4768
jQuery.fx.prototype = {
4547
4769
4548
        // Simple function for setting a style value
4770
        // Simple function for setting a style value
4549
        update: function(){
4771
        update: function(){
4550
                if ( this.options.step )
4772
                if ( this.options.step )
4551
                        this.options.step.call( this.elem, this.now, this );
4773
                        this.options.step.call( this.elem, this.now, this );
4552
4774
4553
                (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
4775
                (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
4554
4776
4555
                // Set display property to block for height/width animations
4777
                // Set display property to block for height/width animations
4556
                if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style )
4778
                if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style )
4557
                        this.elem.style.display = "block";
4779
                        this.elem.style.display = "block";
4558
        },
4780
        },
4559
4781
4560
        // Get the current size
4782
        // Get the current size
4561
        cur: function(force){
4783
        cur: function(force){
4562
                if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) )
4784
                if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) )
4563
                        return this.elem[ this.prop ];
4785
                        return this.elem[ this.prop ];
4564
4786
4565
                var r = parseFloat(jQuery.css(this.elem, this.prop, force));
4787
                var r = parseFloat(jQuery.css(this.elem, this.prop, force));
4566
                return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
4788
                return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
4567
        },
4789
        },
4568
4790
4569
        // Start an animation from one number to another
4791
        // Start an animation from one number to another
4570
        custom: function(from, to, unit){
4792
        custom: function(from, to, unit){
4571
                this.startTime = now();
4793
                this.startTime = now();
4572
                this.start = from;
4794
                this.start = from;
4573
                this.end = to;
4795
                this.end = to;
4574
                this.unit = unit || this.unit || "px";
4796
                this.unit = unit || this.unit || "px";
4575
                this.now = this.start;
4797
                this.now = this.start;
4576
                this.pos = this.state = 0;
4798
                this.pos = this.state = 0;
4577
4799
4578
                var self = this;
4800
                var self = this;
4579
                function t(gotoEnd){
4801
                function t(gotoEnd){
4580
                        return self.step(gotoEnd);
4802
                        return self.step(gotoEnd);
4581
                }
4803
                }
4582
4804
4583
                t.elem = this.elem;
4805
                t.elem = this.elem;
4584
4806
4585
                if ( t() && jQuery.timers.push(t) && !timerId )
4807
                if ( t() && jQuery.timers.push(t) && !timerId )
4586
                        timerId = setInterval(jQuery.fx.tick, 13);
4808
                        timerId = setInterval(jQuery.fx.tick, 13);
4587
        },
4809
        },
4588
4810
4589
        // Simple 'show' function
4811
        // Simple 'show' function
4590
        show: function(){
4812
        show: function(){
4591
                // Remember where we started, so that we can go back to it later
4813
                // Remember where we started, so that we can go back to it later
4592
                this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
4814
                this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
4593
                this.options.show = true;
4815
                this.options.show = true;
4594
4816
4595
                // Begin the animation
4817
                // Begin the animation
4596
                // Make sure that we start at a small width/height to avoid any
4818
                // Make sure that we start at a small width/height to avoid any
4597
                // flash of content
4819
                // flash of content
4598
                this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur());
4820
                this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur());
4599
4821
4600
                // Start by showing the element
4822
                // Start by showing the element
4601
                jQuery(this.elem).show();
4823
                jQuery(this.elem).show();
4602
        },
4824
        },
4603
4825
4604
        // Simple 'hide' function
4826
        // Simple 'hide' function
4605
        hide: function(){
4827
        hide: function(){
4606
                // Remember where we started, so that we can go back to it later
4828
                // Remember where we started, so that we can go back to it later
4607
                this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
4829
                this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
4608
                this.options.hide = true;
4830
                this.options.hide = true;
4609
4831
4610
                // Begin the animation
4832
                // Begin the animation
4611
                this.custom(this.cur(), 0);
4833
                this.custom(this.cur(), 0);
4612
        },
4834
        },
4613
4835
4614
        // Each step of an animation
4836
        // Each step of an animation
4615
        step: function(gotoEnd){
4837
        step: function(gotoEnd){
4616
                var t = now();
4838
                var t = now();
4617
4839
4618
                if ( gotoEnd || t >= this.options.duration + this.startTime ) {
4840
                if ( gotoEnd || t >= this.options.duration + this.startTime ) {
4619
                        this.now = this.end;
4841
                        this.now = this.end;
4620
                        this.pos = this.state = 1;
4842
                        this.pos = this.state = 1;
4621
                        this.update();
4843
                        this.update();
4622
4844
4623
                        this.options.curAnim[ this.prop ] = true;
4845
                        this.options.curAnim[ this.prop ] = true;
4624
4846
4625
                        var done = true;
4847
                        var done = true;
4626
                        for ( var i in this.options.curAnim )
4848
                        for ( var i in this.options.curAnim )
4627
                                if ( this.options.curAnim[i] !== true )
4849
                                if ( this.options.curAnim[i] !== true )
4628
                                        done = false;
4850
                                        done = false;
4629
4851
4630
                        if ( done ) {
4852
                        if ( done ) {
4631
                                if ( this.options.display != null ) {
4853
                                if ( this.options.display != null ) {
4632
                                        // Reset the overflow
4854
                                        // Reset the overflow
4633
                                        this.elem.style.overflow = this.options.overflow;
4855
                                        this.elem.style.overflow = this.options.overflow;
4634
4856
4635
                                        // Reset the display
4857
                                        // Reset the display
4636
                                        this.elem.style.display = this.options.display;
4858
                                        this.elem.style.display = this.options.display;
4637
                                        if ( jQuery.css(this.elem, "display") == "none" )
4859
                                        if ( jQuery.css(this.elem, "display") == "none" )
4638
                                                this.elem.style.display = "block";
4860
                                                this.elem.style.display = "block";
4639
                                }
4861
                                }
4640
4862
4641
                                // Hide the element if the "hide" operation was done
4863
                                // Hide the element if the "hide" operation was done
4642
                                if ( this.options.hide )
4864
                                if ( this.options.hide )
4643
                                        jQuery(this.elem).hide();
4865
                                        jQuery(this.elem).hide();
4644
4866
4645
                                // Reset the properties, if the item has been hidden or shown
4867
                                // Reset the properties, if the item has been hidden or shown
4646
                                if ( this.options.hide || this.options.show )
4868
                                if ( this.options.hide || this.options.show )
4647
                                        for ( var p in this.options.curAnim )
4869
                                        for ( var p in this.options.curAnim )
4648
                                                jQuery.style(this.elem, p, this.options.orig[p]);
4870
                                                jQuery.style(this.elem, p, this.options.orig[p]);
4649
4871
4650
                                // Execute the complete function
4872
                                // Execute the complete function
4651
                                this.options.complete.call( this.elem );
4873
                                this.options.complete.call( this.elem );
4652
                        }
4874
                        }
4653
4875
4654
                        return false;
4876
                        return false;
4655
                } else {
4877
                } else {
4656
                        var n = t - this.startTime;
4878
                        var n = t - this.startTime;
4657
                        this.state = n / this.options.duration;
4879
                        this.state = n / this.options.duration;
4658
4880
4659
                        // Perform the easing function, defaults to swing
4881
                        // Perform the easing function, defaults to swing
4660
                        this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
4882
                        this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
4661
                        this.now = this.start + ((this.end - this.start) * this.pos);
4883
                        this.now = this.start + ((this.end - this.start) * this.pos);
4662
4884
4663
                        // Perform the next step of the animation
4885
                        // Perform the next step of the animation
4664
                        this.update();
4886
                        this.update();
4665
                }
4887
                }
4666
4888
4667
                return true;
4889
                return true;
4668
        }
4890
        }
4669
4891
4670
};
4892
};
4671
4893
4672
jQuery.extend( jQuery.fx, {
4894
jQuery.extend( jQuery.fx, {
4673
4895
4674
        tick:function(){
4896
        tick:function(){
4675
                var timers = jQuery.timers;
4897
                var timers = jQuery.timers;
4676
4898
4677
                for ( var i = 0; i < timers.length; i++ )
4899
                for ( var i = 0; i < timers.length; i++ )
4678
                        if ( !timers[i]() )
4900
                        if ( !timers[i]() )
4679
                                timers.splice(i--, 1);
4901
                                timers.splice(i--, 1);
4680
4902
4681
                if ( !timers.length )
4903
                if ( !timers.length )
4682
                        jQuery.fx.stop();
4904
                        jQuery.fx.stop();
4683
        },
4905
        },
4684
               
4906
               
4685
        stop:function(){
4907
        stop:function(){
4686
                clearInterval( timerId );
4908
                clearInterval( timerId );
4687
                timerId = null;
4909
                timerId = null;
4688
        },
4910
        },
4689
       
4911
       
4690
        speeds:{
4912
        speeds:{
4691
                slow: 600,
4913
                slow: 600,
4692
                fast: 200,
4914
                fast: 200,
4693
                // Default speed
4915
                // Default speed
4694
                _default: 400
4916
                _default: 400
4695
        },
4917
        },
4696
4918
4697
        step: {
4919
        step: {
4698
4920
4699
                opacity: function(fx){
4921
                opacity: function(fx){
4700
                        jQuery.style(fx.elem, "opacity", fx.now);
4922
                        jQuery.style(fx.elem, "opacity", fx.now);
4701
                },
4923
                },
4702
4924
4703
                _default: function(fx){
4925
                _default: function(fx){
4704
                        if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
4926
                        if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
4705
                                fx.elem.style[ fx.prop ] = fx.now + fx.unit;
4927
                                fx.elem.style[ fx.prop ] = fx.now + fx.unit;
4706
                        else
4928
                        else
4707
                                fx.elem[ fx.prop ] = fx.now;
4929
                                fx.elem[ fx.prop ] = fx.now;
4708
                }
4930
                }
4709
        }
4931
        }
4710
});
4932
});
4711
if ( "getBoundingClientRect" in document.documentElement ) {
4933
if ( "getBoundingClientRect" in document.documentElement ) {
4712
        jQuery.fn.offset = function() {
4934
        jQuery.fn.offset = function( options ) {
4713
                var elem = this[0];
4935
                var elem = this[0];
4714
                if ( !elem || !elem.ownerDocument ) { return null; }
4936
                if ( !elem || !elem.ownerDocument ) { return null; }
-
 
4937
                if ( options ) {
-
 
4938
                        return this.each(function() {
-
 
4939
                                jQuery.offset.setOffset( this, options );
-
 
4940
                        });
-
 
4941
                }
4715
                if ( elem === elem.ownerDocument.body ) {
4942
                if ( elem === elem.ownerDocument.body ) {
4716
                        return jQuery.offset.bodyOffset( elem );
4943
                        return jQuery.offset.bodyOffset( elem );
4717
                }
4944
                }
4718
4945
4719
                var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
4946
                var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
4720
                        clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
4947
                        clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
4721
                        top  = box.top  + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop ) - clientTop,
4948
                        top  = box.top  + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop ) - clientTop,
4722
                        left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
4949
                        left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
4723
                return { top: top, left: left };
4950
                return { top: top, left: left };
4724
        };
4951
        };
4725
} else {
4952
} else {
4726
        jQuery.fn.offset = function() {
4953
        jQuery.fn.offset = function( options ) {
4727
                var elem = this[0];
4954
                var elem = this[0];
4728
                if ( !elem || !elem.ownerDocument ) { return null; }
4955
                if ( !elem || !elem.ownerDocument ) { return null; }
-
 
4956
                if ( options ) {
-
 
4957
                        return this.each(function() {
-
 
4958
                                jQuery.offset.setOffset( this, options );
-
 
4959
                        });
-
 
4960
                }
4729
                if ( elem === elem.ownerDocument.body ) {
4961
                if ( elem === elem.ownerDocument.body ) {
4730
                        return jQuery.offset.bodyOffset( elem );
4962
                        return jQuery.offset.bodyOffset( elem );
4731
                }
4963
                }
4732
4964
4733
                jQuery.offset.initialize();
4965
                jQuery.offset.initialize();
4734
4966
4735
                var offsetParent = elem.offsetParent, prevOffsetParent = elem,
4967
                var offsetParent = elem.offsetParent, prevOffsetParent = elem,
4736
                        doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
4968
                        doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
4737
                        body = doc.body, defaultView = doc.defaultView,
4969
                        body = doc.body, defaultView = doc.defaultView,
4738
                        prevComputedStyle = defaultView.getComputedStyle(elem, null),
4970
                        prevComputedStyle = defaultView.getComputedStyle( elem, null ),
4739
                        top = elem.offsetTop, left = elem.offsetLeft;
4971
                        top = elem.offsetTop, left = elem.offsetLeft;
4740
4972
4741
                while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
4973
                while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
4742
                        if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { break; }
4974
                        if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { break; }
4743
4975
4744
                        computedStyle = defaultView.getComputedStyle(elem, null);
4976
                        computedStyle = defaultView.getComputedStyle(elem, null);
4745
                        top -= elem.scrollTop;
4977
                        top  -= elem.scrollTop;
4746
                        left -= elem.scrollLeft;
4978
                        left -= elem.scrollLeft;
4747
4979
4748
                        if ( elem === offsetParent ) {
4980
                        if ( elem === offsetParent ) {
4749
                                top += elem.offsetTop;
4981
                                top  += elem.offsetTop;
4750
                                left += elem.offsetLeft;
4982
                                left += elem.offsetLeft;
4751
4983
4752
                                if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
4984
                                if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
4753
                                        top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
4985
                                        top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
4754
                                        left += parseFloat( computedStyle.borderLeftWidth ) || 0;
4986
                                        left += parseFloat( computedStyle.borderLeftWidth ) || 0;
4755
                                }
4987
                                }
4756
4988
4757
                                prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
4989
                                prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
4758
                        }
4990
                        }
4759
4991
4760
                        if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
4992
                        if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
4761
                                top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
4993
                                top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
4762
                                left += parseFloat( computedStyle.borderLeftWidth ) || 0;
4994
                                left += parseFloat( computedStyle.borderLeftWidth ) || 0;
4763
                        }
4995
                        }
4764
4996
4765
                        prevComputedStyle = computedStyle;
4997
                        prevComputedStyle = computedStyle;
4766
                }
4998
                }
4767
4999
4768
                if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
5000
                if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
4769
                        top  += body.offsetTop;
5001
                        top  += body.offsetTop;
4770
                        left += body.offsetLeft;
5002
                        left += body.offsetLeft;
4771
                }
5003
                }
4772
5004
4773
                if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
5005
                if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
4774
                        top  += Math.max( docElem.scrollTop, body.scrollTop );
5006
                        top  += Math.max( docElem.scrollTop, body.scrollTop );
4775
                        left += Math.max( docElem.scrollLeft, body.scrollLeft );
5007
                        left += Math.max( docElem.scrollLeft, body.scrollLeft );
4776
                }
5008
                }
4777
5009
4778
                return { top: top, left: left };
5010
                return { top: top, left: left };
4779
        };
5011
        };
4780
}
5012
}
4781
5013
4782
jQuery.offset = {
5014
jQuery.offset = {
4783
        initialize: function() {
5015
        initialize: function() {
4784
                var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, 'marginTop', true) ) || 0,
5016
                var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, 'marginTop', true) ) || 0,
4785
                        html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';
5017
                        html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';
4786
5018
4787
                jQuery.extend( container.style, { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' } );
5019
                jQuery.extend( container.style, { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' } );
4788
5020
4789
                container.innerHTML = html;
5021
                container.innerHTML = html;
4790
                body.insertBefore( container, body.firstChild );
5022
                body.insertBefore( container, body.firstChild );
4791
                innerDiv = container.firstChild;
5023
                innerDiv = container.firstChild;
4792
                checkDiv = innerDiv.firstChild;
5024
                checkDiv = innerDiv.firstChild;
4793
                td = innerDiv.nextSibling.firstChild.firstChild;
5025
                td = innerDiv.nextSibling.firstChild.firstChild;
4794
5026
4795
                this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
5027
                this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
4796
                this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
5028
                this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
4797
5029
4798
                checkDiv.style.position = 'fixed', checkDiv.style.top = '20px';
5030
                checkDiv.style.position = 'fixed', checkDiv.style.top = '20px';
4799
                // safari subtracts parent border width here which is 5px
5031
                // safari subtracts parent border width here which is 5px
4800
                this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
5032
                this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
4801
                checkDiv.style.position = checkDiv.style.top = '';
5033
                checkDiv.style.position = checkDiv.style.top = '';
4802
5034
4803
                innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative';
5035
                innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative';
4804
                this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
5036
                this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
4805
5037
4806
                this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
5038
                this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
4807
5039
4808
                body.removeChild( container );
5040
                body.removeChild( container );
4809
                body = container = innerDiv = checkDiv = table = td = null;
5041
                body = container = innerDiv = checkDiv = table = td = null;
4810
                jQuery.offset.initialize = function(){};
5042
                jQuery.offset.initialize = function(){};
4811
        },
5043
        },
4812
5044
4813
        bodyOffset: function(body) {
5045
        bodyOffset: function( body ) {
4814
                var top = body.offsetTop, left = body.offsetLeft;
5046
                var top = body.offsetTop, left = body.offsetLeft;
4815
5047
4816
                jQuery.offset.initialize();
5048
                jQuery.offset.initialize();
4817
5049
4818
                if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
5050
                if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
4819
                        top  += parseFloat( jQuery.curCSS(body, 'marginTop',  true) ) || 0;
5051
                        top  += parseFloat( jQuery.curCSS(body, 'marginTop',  true) ) || 0;
4820
                        left += parseFloat( jQuery.curCSS(body, 'marginLeft', true) ) || 0;
5052
                        left += parseFloat( jQuery.curCSS(body, 'marginLeft', true) ) || 0;
4821
                }
5053
                }
4822
5054
4823
                return { top: top, left: left };
5055
                return { top: top, left: left };
-
 
5056
        },
-
 
5057
       
-
 
5058
        setOffset: function( elem, options ) {
-
 
5059
                // set position first, in-case top/left are set even on static elem
-
 
5060
                if ( /static/.test( jQuery.curCSS( elem, 'position' ) ) ) {
-
 
5061
                        elem.style.position = 'relative';
-
 
5062
                }
-
 
5063
                var curElem   = jQuery( elem ),
-
 
5064
                        curOffset = curElem.offset(),
-
 
5065
                        curTop    = parseInt( jQuery.curCSS( elem, 'top',  true ), 10 ) || 0,
-
 
5066
                        curLeft   = parseInt( jQuery.curCSS( elem, 'left', true ), 10)  || 0,
-
 
5067
                        props     = {
-
 
5068
                                top:  (options.top  - curOffset.top)  + curTop,
-
 
5069
                                left: (options.left - curOffset.left) + curLeft
-
 
5070
                        };
-
 
5071
               
-
 
5072
                if ( 'using' in options ) {
-
 
5073
                        options.using.call( elem, props );
-
 
5074
                } else {
-
 
5075
                        curElem.css( props );
-
 
5076
                }
4824
        }
5077
        }
4825
};
5078
};
4826
5079
4827
5080
4828
jQuery.fn.extend({
5081
jQuery.fn.extend({
4829
        position: function() {
5082
        position: function() {
4830
                if ( !this[0] ) { return null; }
5083
                if ( !this[0] ) { return null; }
4831
5084
4832
                var elem = this[0],
5085
                var elem = this[0],
4833
5086
4834
                // Get *real* offsetParent
5087
                // Get *real* offsetParent
4835
                offsetParent = this.offsetParent(),
5088
                offsetParent = this.offsetParent(),
4836
5089
4837
                // Get correct offsets
5090
                // Get correct offsets
4838
                offset       = this.offset(),
5091
                offset       = this.offset(),
4839
                parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
5092
                parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
4840
5093
4841
                // Subtract element margins
5094
                // Subtract element margins
4842
                // note: when an element has margin: auto the offsetLeft and marginLeft
5095
                // note: when an element has margin: auto the offsetLeft and marginLeft
4843
                // are the same in Safari causing offset.left to incorrectly be 0
5096
                // are the same in Safari causing offset.left to incorrectly be 0
4844
                offset.top  -= parseFloat( jQuery.curCSS(elem, 'marginTop',  true) ) || 0;
5097
                offset.top  -= parseFloat( jQuery.curCSS(elem, 'marginTop',  true) ) || 0;
4845
                offset.left -= parseFloat( jQuery.curCSS(elem, 'marginLeft', true) ) || 0;
5098
                offset.left -= parseFloat( jQuery.curCSS(elem, 'marginLeft', true) ) || 0;
4846
5099
4847
                // Add offsetParent borders
5100
                // Add offsetParent borders
4848
                parentOffset.top  += parseFloat( jQuery.curCSS(offsetParent[0], 'borderTopWidth',  true) ) || 0;
5101
                parentOffset.top  += parseFloat( jQuery.curCSS(offsetParent[0], 'borderTopWidth',  true) ) || 0;
4849
                parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], 'borderLeftWidth', true) ) || 0;
5102
                parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], 'borderLeftWidth', true) ) || 0;
4850
5103
4851
                // Subtract the two offsets
5104
                // Subtract the two offsets
4852
                return {
5105
                return {
4853
                        top:  offset.top  - parentOffset.top,
5106
                        top:  offset.top  - parentOffset.top,
4854
                        left: offset.left - parentOffset.left
5107
                        left: offset.left - parentOffset.left
4855
                };
5108
                };
4856
        },
5109
        },
4857
5110
4858
        offsetParent: function() {
5111
        offsetParent: function() {
4859
                return this.map(function(){
5112
                return this.map(function(){
4860
                        var offsetParent = this.offsetParent || document.body;
5113
                        var offsetParent = this.offsetParent || document.body;
4861
                        while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, 'position') === 'static') ) {
5114
                        while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, 'position') === 'static') ) {
4862
                                offsetParent = offsetParent.offsetParent;
5115
                                offsetParent = offsetParent.offsetParent;
4863
                        }
5116
                        }
4864
                        return offsetParent;
5117
                        return offsetParent;
4865
                });
5118
                });
4866
        }
5119
        }
4867
});
5120
});
4868
5121
4869
5122
4870
// Create scrollLeft and scrollTop methods
5123
// Create scrollLeft and scrollTop methods
4871
jQuery.each( ['Left', 'Top'], function(i, name) {
5124
jQuery.each( ['Left', 'Top'], function(i, name) {
4872
        var method = 'scroll' + name;
5125
        var method = 'scroll' + name;
4873
5126
4874
        jQuery.fn[ method ] = function(val) {
5127
        jQuery.fn[ method ] = function(val) {
4875
                var elem = this[0], win;
5128
                var elem = this[0], win;
4876
               
5129
               
4877
                if ( !elem ) { return null; }
5130
                if ( !elem ) { return null; }
4878
5131
4879
                if ( val !== undefined ) {
5132
                if ( val !== undefined ) {
4880
                        // Set the scroll offset
5133
                        // Set the scroll offset
4881
                        return this.each(function() {
5134
                        return this.each(function() {
4882
                                win = getWindow( this );
5135
                                win = getWindow( this );
4883
5136
4884
                                win ?
5137
                                win ?
4885
                                        win.scrollTo(
5138
                                        win.scrollTo(
4886
                                                !i ? val : jQuery(win).scrollLeft(),
5139
                                                !i ? val : jQuery(win).scrollLeft(),
4887
                                                 i ? val : jQuery(win).scrollTop()
5140
                                                 i ? val : jQuery(win).scrollTop()
4888
                                        ) :
5141
                                        ) :
4889
                                        this[ method ] = val;
5142
                                        this[ method ] = val;
4890
                        });
5143
                        });
4891
                } else {
5144
                } else {
4892
                        win = getWindow( elem );
5145
                        win = getWindow( elem );
4893
5146
4894
                        // Return the scroll offset
5147
                        // Return the scroll offset
4895
                        return win ? ('pageXOffset' in win) ? win[ i ? 'pageYOffset' : 'pageXOffset' ] :
5148
                        return win ? ('pageXOffset' in win) ? win[ i ? 'pageYOffset' : 'pageXOffset' ] :
4896
                                jQuery.support.boxModel && win.document.documentElement[ method ] ||
5149
                                jQuery.support.boxModel && win.document.documentElement[ method ] ||
4897
                                        win.document.body[ method ] :
5150
                                        win.document.body[ method ] :
4898
                                elem[ method ];
5151
                                elem[ method ];
4899
                }
5152
                }
4900
        };
5153
        };
4901
});
5154
});
4902
5155
4903
function getWindow( elem ) {
5156
function getWindow( elem ) {
4904
        return ("scrollTo" in elem && elem.document) ?
5157
        return ("scrollTo" in elem && elem.document) ?
4905
                elem :
5158
                elem :
4906
                elem.nodeType === 9 ?
5159
                elem.nodeType === 9 ?
4907
                        elem.defaultView || elem.parentWindow :
5160
                        elem.defaultView || elem.parentWindow :
4908
                        false;
5161
                        false;
4909
}
5162
}
4910
// Create innerHeight, innerWidth, outerHeight and outerWidth methods
5163
// Create innerHeight, innerWidth, outerHeight and outerWidth methods
4911
jQuery.each([ "Height", "Width" ], function(i, name){
5164
jQuery.each([ "Height", "Width" ], function(i, name){
4912
5165
4913
        var type = name.toLowerCase();
5166
        var type = name.toLowerCase();
4914
5167
4915
        // innerHeight and innerWidth
5168
        // innerHeight and innerWidth
4916
        jQuery.fn["inner" + name] = function(){
5169
        jQuery.fn["inner" + name] = function(){
4917
                return this[0] ?
5170
                return this[0] ?
4918
                        jQuery.css( this[0], type, false, "padding" ) :
5171
                        jQuery.css( this[0], type, false, "padding" ) :
4919
                        null;
5172
                        null;
4920
        };
5173
        };
4921
5174
4922
        // outerHeight and outerWidth
5175
        // outerHeight and outerWidth
4923
        jQuery.fn["outer" + name] = function(margin) {
5176
        jQuery.fn["outer" + name] = function(margin) {
4924
                return this[0] ?
5177
                return this[0] ?
4925
                        jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
5178
                        jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
4926
                        null;
5179
                        null;
4927
        };
5180
        };
4928
5181
4929
        jQuery.fn[ type ] = function( size ) {
5182
        jQuery.fn[ type ] = function( size ) {
4930
                // Get window width or height
5183
                // Get window width or height
4931
                var elem = this[0];
5184
                var elem = this[0];
4932
                if ( !elem ) return null;
5185
                if ( !elem ) return null;
4933
                return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
5186
                return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
4934
                        // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
5187
                        // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
4935
                        elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
5188
                        elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
4936
                        elem.document.body[ "client" + name ] :
5189
                        elem.document.body[ "client" + name ] :
4937
5190
4938
                        // Get document width or height
5191
                        // Get document width or height
4939
                        (elem.nodeType === 9) ? // is it a document
5192
                        (elem.nodeType === 9) ? // is it a document
4940
                                // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
5193
                                // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
4941
                                Math.max(
5194
                                Math.max(
4942
                                        elem.documentElement["client" + name],
5195
                                        elem.documentElement["client" + name],
4943
                                        elem.body["scroll" + name], elem.documentElement["scroll" + name],
5196
                                        elem.body["scroll" + name], elem.documentElement["scroll" + name],
4944
                                        elem.body["offset" + name], elem.documentElement["offset" + name]
5197
                                        elem.body["offset" + name], elem.documentElement["offset" + name]
4945
                                ) :
5198
                                ) :
4946
5199
4947
                                // Get or set width or height on the element
5200
                                // Get or set width or height on the element
4948
                                size === undefined ?
5201
                                size === undefined ?
4949
                                        // Get width or height on the element
5202
                                        // Get width or height on the element
4950
                                        jQuery.css( elem, type ) :
5203
                                        jQuery.css( elem, type ) :
4951
5204
4952
                                        // Set the width or height on the element (default to pixels if value is unitless)
5205
                                        // Set the width or height on the element (default to pixels if value is unitless)
4953
                                        this.css( type, typeof size === "string" ? size : size + "px" );
5206
                                        this.css( type, typeof size === "string" ? size : size + "px" );
4954
        };
5207
        };
4955
5208
4956
});
5209
});
-
 
5210
// Expose jQuery to the global object
-
 
5211
window.jQuery = window.$ = jQuery;
-
 
5212
4957
})(window);
5213
})(window);
4958
 
5214