@@ -0,0 +1,8316 @@
1+/*!
2+ * jQuery JavaScript Library v1.5.1
3+ * http://jquery.com/
4+ *
5+ * Copyright 2011, John Resig
6+ * Dual licensed under the MIT or GPL Version 2 licenses.
7+ * http://jquery.org/license
8+ *
9+ * Includes Sizzle.js
10+ * http://sizzlejs.com/
11+ * Copyright 2011, The Dojo Foundation
12+ * Released under the MIT, BSD, and GPL Licenses.
13+ *
14+ * Date: Wed Feb 23 13:55:29 2011 -0500
15+ */
16+(function( window, undefined ) {
17+
18+// Use the correct document accordingly with window argument (sandbox)
19+var document = window.document;
20+var jQuery = (function() {
21+
22+// Define a local copy of jQuery
23+var jQuery = function( selector, context ) {
24+ // The jQuery object is actually just the init constructor 'enhanced'
25+ return new jQuery.fn.init( selector, context, rootjQuery );
26+ },
27+
28+ // Map over jQuery in case of overwrite
29+ _jQuery = window.jQuery,
30+
31+ // Map over the $ in case of overwrite
32+ _$ = window.$,
33+
34+ // A central reference to the root jQuery(document)
35+ rootjQuery,
36+
37+ // A simple way to check for HTML strings or ID strings
38+ // (both of which we optimize for)
39+ quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
40+
41+ // Check if a string has a non-whitespace character in it
42+ rnotwhite = /\S/,
43+
44+ // Used for trimming whitespace
45+ trimLeft = /^\s+/,
46+ trimRight = /\s+$/,
47+
48+ // Check for digits
49+ rdigit = /\d/,
50+
51+ // Match a standalone tag
52+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
53+
54+ // JSON RegExp
55+ rvalidchars = /^[\],:{}\s]*$/,
56+ rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
57+ rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
58+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
59+
60+ // Useragent RegExp
61+ rwebkit = /(webkit)[ \/]([\w.]+)/,
62+ ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
63+ rmsie = /(msie) ([\w.]+)/,
64+ rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
65+
66+ // Keep a UserAgent string for use with jQuery.browser
67+ userAgent = navigator.userAgent,
68+
69+ // For matching the engine and version of the browser
70+ browserMatch,
71+
72+ // Has the ready events already been bound?
73+ readyBound = false,
74+
75+ // The deferred used on DOM ready
76+ readyList,
77+
78+ // Promise methods
79+ promiseMethods = "then done fail isResolved isRejected promise".split( " " ),
80+
81+ // The ready event handler
82+ DOMContentLoaded,
83+
84+ // Save a reference to some core methods
85+ toString = Object.prototype.toString,
86+ hasOwn = Object.prototype.hasOwnProperty,
87+ push = Array.prototype.push,
88+ slice = Array.prototype.slice,
89+ trim = String.prototype.trim,
90+ indexOf = Array.prototype.indexOf,
91+
92+ // [[Class]] -> type pairs
93+ class2type = {};
94+
95+jQuery.fn = jQuery.prototype = {
96+ constructor: jQuery,
97+ init: function( selector, context, rootjQuery ) {
98+ var match, elem, ret, doc;
99+
100+ // Handle $(""), $(null), or $(undefined)
101+ if ( !selector ) {
102+ return this;
103+ }
104+
105+ // Handle $(DOMElement)
106+ if ( selector.nodeType ) {
107+ this.context = this[0] = selector;
108+ this.length = 1;
109+ return this;
110+ }
111+
112+ // The body element only exists once, optimize finding it
113+ if ( selector === "body" && !context && document.body ) {
114+ this.context = document;
115+ this[0] = document.body;
116+ this.selector = "body";
117+ this.length = 1;
118+ return this;
119+ }
120+
121+ // Handle HTML strings
122+ if ( typeof selector === "string" ) {
123+ // Are we dealing with HTML string or an ID?
124+ match = quickExpr.exec( selector );
125+
126+ // Verify a match, and that no context was specified for #id
127+ if ( match && (match[1] || !context) ) {
128+
129+ // HANDLE: $(html) -> $(array)
130+ if ( match[1] ) {
131+ context = context instanceof jQuery ? context[0] : context;
132+ doc = (context ? context.ownerDocument || context : document);
133+
134+ // If a single string is passed in and it's a single tag
135+ // just do a createElement and skip the rest
136+ ret = rsingleTag.exec( selector );
137+
138+ if ( ret ) {
139+ if ( jQuery.isPlainObject( context ) ) {
140+ selector = [ document.createElement( ret[1] ) ];
141+ jQuery.fn.attr.call( selector, context, true );
142+
143+ } else {
144+ selector = [ doc.createElement( ret[1] ) ];
145+ }
146+
147+ } else {
148+ ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
149+ selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
150+ }
151+
152+ return jQuery.merge( this, selector );
153+
154+ // HANDLE: $("#id")
155+ } else {
156+ elem = document.getElementById( match[2] );
157+
158+ // Check parentNode to catch when Blackberry 4.6 returns
159+ // nodes that are no longer in the document #6963
160+ if ( elem && elem.parentNode ) {
161+ // Handle the case where IE and Opera return items
162+ // by name instead of ID
163+ if ( elem.id !== match[2] ) {
164+ return rootjQuery.find( selector );
165+ }
166+
167+ // Otherwise, we inject the element directly into the jQuery object
168+ this.length = 1;
169+ this[0] = elem;
170+ }
171+
172+ this.context = document;
173+ this.selector = selector;
174+ return this;
175+ }
176+
177+ // HANDLE: $(expr, $(...))
178+ } else if ( !context || context.jquery ) {
179+ return (context || rootjQuery).find( selector );
180+
181+ // HANDLE: $(expr, context)
182+ // (which is just equivalent to: $(context).find(expr)
183+ } else {
184+ return this.constructor( context ).find( selector );
185+ }
186+
187+ // HANDLE: $(function)
188+ // Shortcut for document ready
189+ } else if ( jQuery.isFunction( selector ) ) {
190+ return rootjQuery.ready( selector );
191+ }
192+
193+ if (selector.selector !== undefined) {
194+ this.selector = selector.selector;
195+ this.context = selector.context;
196+ }
197+
198+ return jQuery.makeArray( selector, this );
199+ },
200+
201+ // Start with an empty selector
202+ selector: "",
203+
204+ // The current version of jQuery being used
205+ jquery: "1.5.1",
206+
207+ // The default length of a jQuery object is 0
208+ length: 0,
209+
210+ // The number of elements contained in the matched element set
211+ size: function() {
212+ return this.length;
213+ },
214+
215+ toArray: function() {
216+ return slice.call( this, 0 );
217+ },
218+
219+ // Get the Nth element in the matched element set OR
220+ // Get the whole matched element set as a clean array
221+ get: function( num ) {
222+ return num == null ?
223+
224+ // Return a 'clean' array
225+ this.toArray() :
226+
227+ // Return just the object
228+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
229+ },
230+
231+ // Take an array of elements and push it onto the stack
232+ // (returning the new matched element set)
233+ pushStack: function( elems, name, selector ) {
234+ // Build a new jQuery matched element set
235+ var ret = this.constructor();
236+
237+ if ( jQuery.isArray( elems ) ) {
238+ push.apply( ret, elems );
239+
240+ } else {
241+ jQuery.merge( ret, elems );
242+ }
243+
244+ // Add the old object onto the stack (as a reference)
245+ ret.prevObject = this;
246+
247+ ret.context = this.context;
248+
249+ if ( name === "find" ) {
250+ ret.selector = this.selector + (this.selector ? " " : "") + selector;
251+ } else if ( name ) {
252+ ret.selector = this.selector + "." + name + "(" + selector + ")";
253+ }
254+
255+ // Return the newly-formed element set
256+ return ret;
257+ },
258+
259+ // Execute a callback for every element in the matched set.
260+ // (You can seed the arguments with an array of args, but this is
261+ // only used internally.)
262+ each: function( callback, args ) {
263+ return jQuery.each( this, callback, args );
264+ },
265+
266+ ready: function( fn ) {
267+ // Attach the listeners
268+ jQuery.bindReady();
269+
270+ // Add the callback
271+ readyList.done( fn );
272+
273+ return this;
274+ },
275+
276+ eq: function( i ) {
277+ return i === -1 ?
278+ this.slice( i ) :
279+ this.slice( i, +i + 1 );
280+ },
281+
282+ first: function() {
283+ return this.eq( 0 );
284+ },
285+
286+ last: function() {
287+ return this.eq( -1 );
288+ },
289+
290+ slice: function() {
291+ return this.pushStack( slice.apply( this, arguments ),
292+ "slice", slice.call(arguments).join(",") );
293+ },
294+
295+ map: function( callback ) {
296+ return this.pushStack( jQuery.map(this, function( elem, i ) {
297+ return callback.call( elem, i, elem );
298+ }));
299+ },
300+
301+ end: function() {
302+ return this.prevObject || this.constructor(null);
303+ },
304+
305+ // For internal use only.
306+ // Behaves like an Array's method, not like a jQuery method.
307+ push: push,
308+ sort: [].sort,
309+ splice: [].splice
310+};
311+
312+// Give the init function the jQuery prototype for later instantiation
313+jQuery.fn.init.prototype = jQuery.fn;
314+
315+jQuery.extend = jQuery.fn.extend = function() {
316+ var options, name, src, copy, copyIsArray, clone,
317+ target = arguments[0] || {},
318+ i = 1,
319+ length = arguments.length,
320+ deep = false;
321+
322+ // Handle a deep copy situation
323+ if ( typeof target === "boolean" ) {
324+ deep = target;
325+ target = arguments[1] || {};
326+ // skip the boolean and the target
327+ i = 2;
328+ }
329+
330+ // Handle case when target is a string or something (possible in deep copy)
331+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
332+ target = {};
333+ }
334+
335+ // extend jQuery itself if only one argument is passed
336+ if ( length === i ) {
337+ target = this;
338+ --i;
339+ }
340+
341+ for ( ; i < length; i++ ) {
342+ // Only deal with non-null/undefined values
343+ if ( (options = arguments[ i ]) != null ) {
344+ // Extend the base object
345+ for ( name in options ) {
346+ src = target[ name ];
347+ copy = options[ name ];
348+
349+ // Prevent never-ending loop
350+ if ( target === copy ) {
351+ continue;
352+ }
353+
354+ // Recurse if we're merging plain objects or arrays
355+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
356+ if ( copyIsArray ) {
357+ copyIsArray = false;
358+ clone = src && jQuery.isArray(src) ? src : [];
359+
360+ } else {
361+ clone = src && jQuery.isPlainObject(src) ? src : {};
362+ }
363+
364+ // Never move original objects, clone them
365+ target[ name ] = jQuery.extend( deep, clone, copy );
366+
367+ // Don't bring in undefined values
368+ } else if ( copy !== undefined ) {
369+ target[ name ] = copy;
370+ }
371+ }
372+ }
373+ }
374+
375+ // Return the modified object
376+ return target;
377+};
378+
379+jQuery.extend({
380+ noConflict: function( deep ) {
381+ window.$ = _$;
382+
383+ if ( deep ) {
384+ window.jQuery = _jQuery;
385+ }
386+
387+ return jQuery;
388+ },
389+
390+ // Is the DOM ready to be used? Set to true once it occurs.
391+ isReady: false,
392+
393+ // A counter to track how many items to wait for before
394+ // the ready event fires. See #6781
395+ readyWait: 1,
396+
397+ // Handle when the DOM is ready
398+ ready: function( wait ) {
399+ // A third-party is pushing the ready event forwards
400+ if ( wait === true ) {
401+ jQuery.readyWait--;
402+ }
403+
404+ // Make sure that the DOM is not already loaded
405+ if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
406+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
407+ if ( !document.body ) {
408+ return setTimeout( jQuery.ready, 1 );
409+ }
410+
411+ // Remember that the DOM is ready
412+ jQuery.isReady = true;
413+
414+ // If a normal DOM Ready event fired, decrement, and wait if need be
415+ if ( wait !== true && --jQuery.readyWait > 0 ) {
416+ return;
417+ }
418+
419+ // If there are functions bound, to execute
420+ readyList.resolveWith( document, [ jQuery ] );
421+
422+ // Trigger any bound ready events
423+ if ( jQuery.fn.trigger ) {
424+ jQuery( document ).trigger( "ready" ).unbind( "ready" );
425+ }
426+ }
427+ },
428+
429+ bindReady: function() {
430+ if ( readyBound ) {
431+ return;
432+ }
433+
434+ readyBound = true;
435+
436+ // Catch cases where $(document).ready() is called after the
437+ // browser event has already occurred.
438+ if ( document.readyState === "complete" ) {
439+ // Handle it asynchronously to allow scripts the opportunity to delay ready
440+ return setTimeout( jQuery.ready, 1 );
441+ }
442+
443+ // Mozilla, Opera and webkit nightlies currently support this event
444+ if ( document.addEventListener ) {
445+ // Use the handy event callback
446+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
447+
448+ // A fallback to window.onload, that will always work
449+ window.addEventListener( "load", jQuery.ready, false );
450+
451+ // If IE event model is used
452+ } else if ( document.attachEvent ) {
453+ // ensure firing before onload,
454+ // maybe late but safe also for iframes
455+ document.attachEvent("onreadystatechange", DOMContentLoaded);
456+
457+ // A fallback to window.onload, that will always work
458+ window.attachEvent( "onload", jQuery.ready );
459+
460+ // If IE and not a frame
461+ // continually check to see if the document is ready
462+ var toplevel = false;
463+
464+ try {
465+ toplevel = window.frameElement == null;
466+ } catch(e) {}
467+
468+ if ( document.documentElement.doScroll && toplevel ) {
469+ doScrollCheck();
470+ }
471+ }
472+ },
473+
474+ // See test/unit/core.js for details concerning isFunction.
475+ // Since version 1.3, DOM methods and functions like alert
476+ // aren't supported. They return false on IE (#2968).
477+ isFunction: function( obj ) {
478+ return jQuery.type(obj) === "function";
479+ },
480+
481+ isArray: Array.isArray || function( obj ) {
482+ return jQuery.type(obj) === "array";
483+ },
484+
485+ // A crude way of determining if an object is a window
486+ isWindow: function( obj ) {
487+ return obj && typeof obj === "object" && "setInterval" in obj;
488+ },
489+
490+ isNaN: function( obj ) {
491+ return obj == null || !rdigit.test( obj ) || isNaN( obj );
492+ },
493+
494+ type: function( obj ) {
495+ return obj == null ?
496+ String( obj ) :
497+ class2type[ toString.call(obj) ] || "object";
498+ },
499+
500+ isPlainObject: function( obj ) {
501+ // Must be an Object.
502+ // Because of IE, we also have to check the presence of the constructor property.
503+ // Make sure that DOM nodes and window objects don't pass through, as well
504+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
505+ return false;
506+ }
507+
508+ // Not own constructor property must be Object
509+ if ( obj.constructor &&
510+ !hasOwn.call(obj, "constructor") &&
511+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
512+ return false;
513+ }
514+
515+ // Own properties are enumerated firstly, so to speed up,
516+ // if last one is own, then all properties are own.
517+
518+ var key;
519+ for ( key in obj ) {}
520+
521+ return key === undefined || hasOwn.call( obj, key );
522+ },
523+
524+ isEmptyObject: function( obj ) {
525+ for ( var name in obj ) {
526+ return false;
527+ }
528+ return true;
529+ },
530+
531+ error: function( msg ) {
532+ throw msg;
533+ },
534+
535+ parseJSON: function( data ) {
536+ if ( typeof data !== "string" || !data ) {
537+ return null;
538+ }
539+
540+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
541+ data = jQuery.trim( data );
542+
543+ // Make sure the incoming data is actual JSON
544+ // Logic borrowed from http://json.org/json2.js
545+ if ( rvalidchars.test(data.replace(rvalidescape, "@")
546+ .replace(rvalidtokens, "]")
547+ .replace(rvalidbraces, "")) ) {
548+
549+ // Try to use the native JSON parser first
550+ return window.JSON && window.JSON.parse ?
551+ window.JSON.parse( data ) :
552+ (new Function("return " + data))();
553+
554+ } else {
555+ jQuery.error( "Invalid JSON: " + data );
556+ }
557+ },
558+
559+ // Cross-browser xml parsing
560+ // (xml & tmp used internally)
561+ parseXML: function( data , xml , tmp ) {
562+
563+ if ( window.DOMParser ) { // Standard
564+ tmp = new DOMParser();
565+ xml = tmp.parseFromString( data , "text/xml" );
566+ } else { // IE
567+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
568+ xml.async = "false";
569+ xml.loadXML( data );
570+ }
571+
572+ tmp = xml.documentElement;
573+
574+ if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
575+ jQuery.error( "Invalid XML: " + data );
576+ }
577+
578+ return xml;
579+ },
580+
581+ noop: function() {},
582+
583+ // Evalulates a script in a global context
Cut short: this commit's diff is over 1000 lines.