PageRenderTime 112ms CodeModel.GetById 6ms app.highlight 79ms RepoModel.GetById 1ms app.codeStats 2ms

/BlogEngine/BlogEngine.NET/Scripts/jQuery/jquery-1.5.2.js

#
JavaScript | 8374 lines | 5817 code | 1520 blank | 1037 comment | 1685 complexity | 45b0758e69da8012e629070d62b6fa7d MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1/*!
   2 * jQuery JavaScript Library v1.5.2
   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: Thu Mar 31 15:28:23 2011 -0400
  15 */
  16(function( window, undefined ) {
  17
  18// Use the correct document accordingly with window argument (sandbox)
  19var document = window.document;
  20var jQuery = (function() {
  21
  22// Define a local copy of jQuery
  23var 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	// The deferred used on DOM ready
  73	readyList,
  74
  75	// The ready event handler
  76	DOMContentLoaded,
  77
  78	// Save a reference to some core methods
  79	toString = Object.prototype.toString,
  80	hasOwn = Object.prototype.hasOwnProperty,
  81	push = Array.prototype.push,
  82	slice = Array.prototype.slice,
  83	trim = String.prototype.trim,
  84	indexOf = Array.prototype.indexOf,
  85
  86	// [[Class]] -> type pairs
  87	class2type = {};
  88
  89jQuery.fn = jQuery.prototype = {
  90	constructor: jQuery,
  91	init: function( selector, context, rootjQuery ) {
  92		var match, elem, ret, doc;
  93
  94		// Handle $(""), $(null), or $(undefined)
  95		if ( !selector ) {
  96			return this;
  97		}
  98
  99		// Handle $(DOMElement)
 100		if ( selector.nodeType ) {
 101			this.context = this[0] = selector;
 102			this.length = 1;
 103			return this;
 104		}
 105
 106		// The body element only exists once, optimize finding it
 107		if ( selector === "body" && !context && document.body ) {
 108			this.context = document;
 109			this[0] = document.body;
 110			this.selector = "body";
 111			this.length = 1;
 112			return this;
 113		}
 114
 115		// Handle HTML strings
 116		if ( typeof selector === "string" ) {
 117			// Are we dealing with HTML string or an ID?
 118			match = quickExpr.exec( selector );
 119
 120			// Verify a match, and that no context was specified for #id
 121			if ( match && (match[1] || !context) ) {
 122
 123				// HANDLE: $(html) -> $(array)
 124				if ( match[1] ) {
 125					context = context instanceof jQuery ? context[0] : context;
 126					doc = (context ? context.ownerDocument || context : document);
 127
 128					// If a single string is passed in and it's a single tag
 129					// just do a createElement and skip the rest
 130					ret = rsingleTag.exec( selector );
 131
 132					if ( ret ) {
 133						if ( jQuery.isPlainObject( context ) ) {
 134							selector = [ document.createElement( ret[1] ) ];
 135							jQuery.fn.attr.call( selector, context, true );
 136
 137						} else {
 138							selector = [ doc.createElement( ret[1] ) ];
 139						}
 140
 141					} else {
 142						ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
 143						selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
 144					}
 145
 146					return jQuery.merge( this, selector );
 147
 148				// HANDLE: $("#id")
 149				} else {
 150					elem = document.getElementById( match[2] );
 151
 152					// Check parentNode to catch when Blackberry 4.6 returns
 153					// nodes that are no longer in the document #6963
 154					if ( elem && elem.parentNode ) {
 155						// Handle the case where IE and Opera return items
 156						// by name instead of ID
 157						if ( elem.id !== match[2] ) {
 158							return rootjQuery.find( selector );
 159						}
 160
 161						// Otherwise, we inject the element directly into the jQuery object
 162						this.length = 1;
 163						this[0] = elem;
 164					}
 165
 166					this.context = document;
 167					this.selector = selector;
 168					return this;
 169				}
 170
 171			// HANDLE: $(expr, $(...))
 172			} else if ( !context || context.jquery ) {
 173				return (context || rootjQuery).find( selector );
 174
 175			// HANDLE: $(expr, context)
 176			// (which is just equivalent to: $(context).find(expr)
 177			} else {
 178				return this.constructor( context ).find( selector );
 179			}
 180
 181		// HANDLE: $(function)
 182		// Shortcut for document ready
 183		} else if ( jQuery.isFunction( selector ) ) {
 184			return rootjQuery.ready( selector );
 185		}
 186
 187		if (selector.selector !== undefined) {
 188			this.selector = selector.selector;
 189			this.context = selector.context;
 190		}
 191
 192		return jQuery.makeArray( selector, this );
 193	},
 194
 195	// Start with an empty selector
 196	selector: "",
 197
 198	// The current version of jQuery being used
 199	jquery: "1.5.2",
 200
 201	// The default length of a jQuery object is 0
 202	length: 0,
 203
 204	// The number of elements contained in the matched element set
 205	size: function() {
 206		return this.length;
 207	},
 208
 209	toArray: function() {
 210		return slice.call( this, 0 );
 211	},
 212
 213	// Get the Nth element in the matched element set OR
 214	// Get the whole matched element set as a clean array
 215	get: function( num ) {
 216		return num == null ?
 217
 218			// Return a 'clean' array
 219			this.toArray() :
 220
 221			// Return just the object
 222			( num < 0 ? this[ this.length + num ] : this[ num ] );
 223	},
 224
 225	// Take an array of elements and push it onto the stack
 226	// (returning the new matched element set)
 227	pushStack: function( elems, name, selector ) {
 228		// Build a new jQuery matched element set
 229		var ret = this.constructor();
 230
 231		if ( jQuery.isArray( elems ) ) {
 232			push.apply( ret, elems );
 233
 234		} else {
 235			jQuery.merge( ret, elems );
 236		}
 237
 238		// Add the old object onto the stack (as a reference)
 239		ret.prevObject = this;
 240
 241		ret.context = this.context;
 242
 243		if ( name === "find" ) {
 244			ret.selector = this.selector + (this.selector ? " " : "") + selector;
 245		} else if ( name ) {
 246			ret.selector = this.selector + "." + name + "(" + selector + ")";
 247		}
 248
 249		// Return the newly-formed element set
 250		return ret;
 251	},
 252
 253	// Execute a callback for every element in the matched set.
 254	// (You can seed the arguments with an array of args, but this is
 255	// only used internally.)
 256	each: function( callback, args ) {
 257		return jQuery.each( this, callback, args );
 258	},
 259
 260	ready: function( fn ) {
 261		// Attach the listeners
 262		jQuery.bindReady();
 263
 264		// Add the callback
 265		readyList.done( fn );
 266
 267		return this;
 268	},
 269
 270	eq: function( i ) {
 271		return i === -1 ?
 272			this.slice( i ) :
 273			this.slice( i, +i + 1 );
 274	},
 275
 276	first: function() {
 277		return this.eq( 0 );
 278	},
 279
 280	last: function() {
 281		return this.eq( -1 );
 282	},
 283
 284	slice: function() {
 285		return this.pushStack( slice.apply( this, arguments ),
 286			"slice", slice.call(arguments).join(",") );
 287	},
 288
 289	map: function( callback ) {
 290		return this.pushStack( jQuery.map(this, function( elem, i ) {
 291			return callback.call( elem, i, elem );
 292		}));
 293	},
 294
 295	end: function() {
 296		return this.prevObject || this.constructor(null);
 297	},
 298
 299	// For internal use only.
 300	// Behaves like an Array's method, not like a jQuery method.
 301	push: push,
 302	sort: [].sort,
 303	splice: [].splice
 304};
 305
 306// Give the init function the jQuery prototype for later instantiation
 307jQuery.fn.init.prototype = jQuery.fn;
 308
 309jQuery.extend = jQuery.fn.extend = function() {
 310	var options, name, src, copy, copyIsArray, clone,
 311		target = arguments[0] || {},
 312		i = 1,
 313		length = arguments.length,
 314		deep = false;
 315
 316	// Handle a deep copy situation
 317	if ( typeof target === "boolean" ) {
 318		deep = target;
 319		target = arguments[1] || {};
 320		// skip the boolean and the target
 321		i = 2;
 322	}
 323
 324	// Handle case when target is a string or something (possible in deep copy)
 325	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
 326		target = {};
 327	}
 328
 329	// extend jQuery itself if only one argument is passed
 330	if ( length === i ) {
 331		target = this;
 332		--i;
 333	}
 334
 335	for ( ; i < length; i++ ) {
 336		// Only deal with non-null/undefined values
 337		if ( (options = arguments[ i ]) != null ) {
 338			// Extend the base object
 339			for ( name in options ) {
 340				src = target[ name ];
 341				copy = options[ name ];
 342
 343				// Prevent never-ending loop
 344				if ( target === copy ) {
 345					continue;
 346				}
 347
 348				// Recurse if we're merging plain objects or arrays
 349				if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
 350					if ( copyIsArray ) {
 351						copyIsArray = false;
 352						clone = src && jQuery.isArray(src) ? src : [];
 353
 354					} else {
 355						clone = src && jQuery.isPlainObject(src) ? src : {};
 356					}
 357
 358					// Never move original objects, clone them
 359					target[ name ] = jQuery.extend( deep, clone, copy );
 360
 361				// Don't bring in undefined values
 362				} else if ( copy !== undefined ) {
 363					target[ name ] = copy;
 364				}
 365			}
 366		}
 367	}
 368
 369	// Return the modified object
 370	return target;
 371};
 372
 373jQuery.extend({
 374	noConflict: function( deep ) {
 375		window.$ = _$;
 376
 377		if ( deep ) {
 378			window.jQuery = _jQuery;
 379		}
 380
 381		return jQuery;
 382	},
 383
 384	// Is the DOM ready to be used? Set to true once it occurs.
 385	isReady: false,
 386
 387	// A counter to track how many items to wait for before
 388	// the ready event fires. See #6781
 389	readyWait: 1,
 390
 391	// Handle when the DOM is ready
 392	ready: function( wait ) {
 393		// A third-party is pushing the ready event forwards
 394		if ( wait === true ) {
 395			jQuery.readyWait--;
 396		}
 397
 398		// Make sure that the DOM is not already loaded
 399		if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
 400			// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
 401			if ( !document.body ) {
 402				return setTimeout( jQuery.ready, 1 );
 403			}
 404
 405			// Remember that the DOM is ready
 406			jQuery.isReady = true;
 407
 408			// If a normal DOM Ready event fired, decrement, and wait if need be
 409			if ( wait !== true && --jQuery.readyWait > 0 ) {
 410				return;
 411			}
 412
 413			// If there are functions bound, to execute
 414			readyList.resolveWith( document, [ jQuery ] );
 415
 416			// Trigger any bound ready events
 417			if ( jQuery.fn.trigger ) {
 418				jQuery( document ).trigger( "ready" ).unbind( "ready" );
 419			}
 420		}
 421	},
 422
 423	bindReady: function() {
 424		if ( readyList ) {
 425			return;
 426		}
 427
 428		readyList = jQuery._Deferred();
 429
 430		// Catch cases where $(document).ready() is called after the
 431		// browser event has already occurred.
 432		if ( document.readyState === "complete" ) {
 433			// Handle it asynchronously to allow scripts the opportunity to delay ready
 434			return setTimeout( jQuery.ready, 1 );
 435		}
 436
 437		// Mozilla, Opera and webkit nightlies currently support this event
 438		if ( document.addEventListener ) {
 439			// Use the handy event callback
 440			document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
 441
 442			// A fallback to window.onload, that will always work
 443			window.addEventListener( "load", jQuery.ready, false );
 444
 445		// If IE event model is used
 446		} else if ( document.attachEvent ) {
 447			// ensure firing before onload,
 448			// maybe late but safe also for iframes
 449			document.attachEvent("onreadystatechange", DOMContentLoaded);
 450
 451			// A fallback to window.onload, that will always work
 452			window.attachEvent( "onload", jQuery.ready );
 453
 454			// If IE and not a frame
 455			// continually check to see if the document is ready
 456			var toplevel = false;
 457
 458			try {
 459				toplevel = window.frameElement == null;
 460			} catch(e) {}
 461
 462			if ( document.documentElement.doScroll && toplevel ) {
 463				doScrollCheck();
 464			}
 465		}
 466	},
 467
 468	// See test/unit/core.js for details concerning isFunction.
 469	// Since version 1.3, DOM methods and functions like alert
 470	// aren't supported. They return false on IE (#2968).
 471	isFunction: function( obj ) {
 472		return jQuery.type(obj) === "function";
 473	},
 474
 475	isArray: Array.isArray || function( obj ) {
 476		return jQuery.type(obj) === "array";
 477	},
 478
 479	// A crude way of determining if an object is a window
 480	isWindow: function( obj ) {
 481		return obj && typeof obj === "object" && "setInterval" in obj;
 482	},
 483
 484	isNaN: function( obj ) {
 485		return obj == null || !rdigit.test( obj ) || isNaN( obj );
 486	},
 487
 488	type: function( obj ) {
 489		return obj == null ?
 490			String( obj ) :
 491			class2type[ toString.call(obj) ] || "object";
 492	},
 493
 494	isPlainObject: function( obj ) {
 495		// Must be an Object.
 496		// Because of IE, we also have to check the presence of the constructor property.
 497		// Make sure that DOM nodes and window objects don't pass through, as well
 498		if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
 499			return false;
 500		}
 501
 502		// Not own constructor property must be Object
 503		if ( obj.constructor &&
 504			!hasOwn.call(obj, "constructor") &&
 505			!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
 506			return false;
 507		}
 508
 509		// Own properties are enumerated firstly, so to speed up,
 510		// if last one is own, then all properties are own.
 511
 512		var key;
 513		for ( key in obj ) {}
 514
 515		return key === undefined || hasOwn.call( obj, key );
 516	},
 517
 518	isEmptyObject: function( obj ) {
 519		for ( var name in obj ) {
 520			return false;
 521		}
 522		return true;
 523	},
 524
 525	error: function( msg ) {
 526		throw msg;
 527	},
 528
 529	parseJSON: function( data ) {
 530		if ( typeof data !== "string" || !data ) {
 531			return null;
 532		}
 533
 534		// Make sure leading/trailing whitespace is removed (IE can't handle it)
 535		data = jQuery.trim( data );
 536
 537		// Make sure the incoming data is actual JSON
 538		// Logic borrowed from http://json.org/json2.js
 539		if ( rvalidchars.test(data.replace(rvalidescape, "@")
 540			.replace(rvalidtokens, "]")
 541			.replace(rvalidbraces, "")) ) {
 542
 543			// Try to use the native JSON parser first
 544			return window.JSON && window.JSON.parse ?
 545				window.JSON.parse( data ) :
 546				(new Function("return " + data))();
 547
 548		} else {
 549			jQuery.error( "Invalid JSON: " + data );
 550		}
 551	},
 552
 553	// Cross-browser xml parsing
 554	// (xml & tmp used internally)
 555	parseXML: function( data , xml , tmp ) {
 556
 557		if ( window.DOMParser ) { // Standard
 558			tmp = new DOMParser();
 559			xml = tmp.parseFromString( data , "text/xml" );
 560		} else { // IE
 561			xml = new ActiveXObject( "Microsoft.XMLDOM" );
 562			xml.async = "false";
 563			xml.loadXML( data );
 564		}
 565
 566		tmp = xml.documentElement;
 567
 568		if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
 569			jQuery.error( "Invalid XML: " + data );
 570		}
 571
 572		return xml;
 573	},
 574
 575	noop: function() {},
 576
 577	// Evalulates a script in a global context
 578	globalEval: function( data ) {
 579		if ( data && rnotwhite.test(data) ) {
 580			// Inspired by code by Andrea Giammarchi
 581			// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
 582			var head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement,
 583				script = document.createElement( "script" );
 584
 585			if ( jQuery.support.scriptEval() ) {
 586				script.appendChild( document.createTextNode( data ) );
 587			} else {
 588				script.text = data;
 589			}
 590
 591			// Use insertBefore instead of appendChild to circumvent an IE6 bug.
 592			// This arises when a base node is used (#2709).
 593			head.insertBefore( script, head.firstChild );
 594			head.removeChild( script );
 595		}
 596	},
 597
 598	nodeName: function( elem, name ) {
 599		return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
 600	},
 601
 602	// args is for internal usage only
 603	each: function( object, callback, args ) {
 604		var name, i = 0,
 605			length = object.length,
 606			isObj = length === undefined || jQuery.isFunction(object);
 607
 608		if ( args ) {
 609			if ( isObj ) {
 610				for ( name in object ) {
 611					if ( callback.apply( object[ name ], args ) === false ) {
 612						break;
 613					}
 614				}
 615			} else {
 616				for ( ; i < length; ) {
 617					if ( callback.apply( object[ i++ ], args ) === false ) {
 618						break;
 619					}
 620				}
 621			}
 622
 623		// A special, fast, case for the most common use of each
 624		} else {
 625			if ( isObj ) {
 626				for ( name in object ) {
 627					if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
 628						break;
 629					}
 630				}
 631			} else {
 632				for ( var value = object[0];
 633					i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
 634			}
 635		}
 636
 637		return object;
 638	},
 639
 640	// Use native String.trim function wherever possible
 641	trim: trim ?
 642		function( text ) {
 643			return text == null ?
 644				"" :
 645				trim.call( text );
 646		} :
 647
 648		// Otherwise use our own trimming functionality
 649		function( text ) {
 650			return text == null ?
 651				"" :
 652				text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
 653		},
 654
 655	// results is for internal usage only
 656	makeArray: function( array, results ) {
 657		var ret = results || [];
 658
 659		if ( array != null ) {
 660			// The window, strings (and functions) also have 'length'
 661			// The extra typeof function check is to prevent crashes
 662			// in Safari 2 (See: #3039)
 663			// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
 664			var type = jQuery.type(array);
 665
 666			if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
 667				push.call( ret, array );
 668			} else {
 669				jQuery.merge( ret, array );
 670			}
 671		}
 672
 673		return ret;
 674	},
 675
 676	inArray: function( elem, array ) {
 677		if ( array.indexOf ) {
 678			return array.indexOf( elem );
 679		}
 680
 681		for ( var i = 0, length = array.length; i < length; i++ ) {
 682			if ( array[ i ] === elem ) {
 683				return i;
 684			}
 685		}
 686
 687		return -1;
 688	},
 689
 690	merge: function( first, second ) {
 691		var i = first.length,
 692			j = 0;
 693
 694		if ( typeof second.length === "number" ) {
 695			for ( var l = second.length; j < l; j++ ) {
 696				first[ i++ ] = second[ j ];
 697			}
 698
 699		} else {
 700			while ( second[j] !== undefined ) {
 701				first[ i++ ] = second[ j++ ];
 702			}
 703		}
 704
 705		first.length = i;
 706
 707		return first;
 708	},
 709
 710	grep: function( elems, callback, inv ) {
 711		var ret = [], retVal;
 712		inv = !!inv;
 713
 714		// Go through the array, only saving the items
 715		// that pass the validator function
 716		for ( var i = 0, length = elems.length; i < length; i++ ) {
 717			retVal = !!callback( elems[ i ], i );
 718			if ( inv !== retVal ) {
 719				ret.push( elems[ i ] );
 720			}
 721		}
 722
 723		return ret;
 724	},
 725
 726	// arg is for internal usage only
 727	map: function( elems, callback, arg ) {
 728		var ret = [], value;
 729
 730		// Go through the array, translating each of the items to their
 731		// new value (or values).
 732		for ( var i = 0, length = elems.length; i < length; i++ ) {
 733			value = callback( elems[ i ], i, arg );
 734
 735			if ( value != null ) {
 736				ret[ ret.length ] = value;
 737			}
 738		}
 739
 740		// Flatten any nested arrays
 741		return ret.concat.apply( [], ret );
 742	},
 743
 744	// A global GUID counter for objects
 745	guid: 1,
 746
 747	proxy: function( fn, proxy, thisObject ) {
 748		if ( arguments.length === 2 ) {
 749			if ( typeof proxy === "string" ) {
 750				thisObject = fn;
 751				fn = thisObject[ proxy ];
 752				proxy = undefined;
 753
 754			} else if ( proxy && !jQuery.isFunction( proxy ) ) {
 755				thisObject = proxy;
 756				proxy = undefined;
 757			}
 758		}
 759
 760		if ( !proxy && fn ) {
 761			proxy = function() {
 762				return fn.apply( thisObject || this, arguments );
 763			};
 764		}
 765
 766		// Set the guid of unique handler to the same of original handler, so it can be removed
 767		if ( fn ) {
 768			proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
 769		}
 770
 771		// So proxy can be declared as an argument
 772		return proxy;
 773	},
 774
 775	// Mutifunctional method to get and set values to a collection
 776	// The value/s can be optionally by executed if its a function
 777	access: function( elems, key, value, exec, fn, pass ) {
 778		var length = elems.length;
 779
 780		// Setting many attributes
 781		if ( typeof key === "object" ) {
 782			for ( var k in key ) {
 783				jQuery.access( elems, k, key[k], exec, fn, value );
 784			}
 785			return elems;
 786		}
 787
 788		// Setting one attribute
 789		if ( value !== undefined ) {
 790			// Optionally, function values get executed if exec is true
 791			exec = !pass && exec && jQuery.isFunction(value);
 792
 793			for ( var i = 0; i < length; i++ ) {
 794				fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
 795			}
 796
 797			return elems;
 798		}
 799
 800		// Getting an attribute
 801		return length ? fn( elems[0], key ) : undefined;
 802	},
 803
 804	now: function() {
 805		return (new Date()).getTime();
 806	},
 807
 808	// Use of jQuery.browser is frowned upon.
 809	// More details: http://docs.jquery.com/Utilities/jQuery.browser
 810	uaMatch: function( ua ) {
 811		ua = ua.toLowerCase();
 812
 813		var match = rwebkit.exec( ua ) ||
 814			ropera.exec( ua ) ||
 815			rmsie.exec( ua ) ||
 816			ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
 817			[];
 818
 819		return { browser: match[1] || "", version: match[2] || "0" };
 820	},
 821
 822	sub: function() {
 823		function jQuerySubclass( selector, context ) {
 824			return new jQuerySubclass.fn.init( selector, context );
 825		}
 826		jQuery.extend( true, jQuerySubclass, this );
 827		jQuerySubclass.superclass = this;
 828		jQuerySubclass.fn = jQuerySubclass.prototype = this();
 829		jQuerySubclass.fn.constructor = jQuerySubclass;
 830		jQuerySubclass.subclass = this.subclass;
 831		jQuerySubclass.fn.init = function init( selector, context ) {
 832			if ( context && context instanceof jQuery && !(context instanceof jQuerySubclass) ) {
 833				context = jQuerySubclass(context);
 834			}
 835
 836			return jQuery.fn.init.call( this, selector, context, rootjQuerySubclass );
 837		};
 838		jQuerySubclass.fn.init.prototype = jQuerySubclass.fn;
 839		var rootjQuerySubclass = jQuerySubclass(document);
 840		return jQuerySubclass;
 841	},
 842
 843	browser: {}
 844});
 845
 846// Populate the class2type map
 847jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
 848	class2type[ "[object " + name + "]" ] = name.toLowerCase();
 849});
 850
 851browserMatch = jQuery.uaMatch( userAgent );
 852if ( browserMatch.browser ) {
 853	jQuery.browser[ browserMatch.browser ] = true;
 854	jQuery.browser.version = browserMatch.version;
 855}
 856
 857// Deprecated, use jQuery.browser.webkit instead
 858if ( jQuery.browser.webkit ) {
 859	jQuery.browser.safari = true;
 860}
 861
 862if ( indexOf ) {
 863	jQuery.inArray = function( elem, array ) {
 864		return indexOf.call( array, elem );
 865	};
 866}
 867
 868// IE doesn't match non-breaking spaces with \s
 869if ( rnotwhite.test( "\xA0" ) ) {
 870	trimLeft = /^[\s\xA0]+/;
 871	trimRight = /[\s\xA0]+$/;
 872}
 873
 874// All jQuery objects should point back to these
 875rootjQuery = jQuery(document);
 876
 877// Cleanup functions for the document ready method
 878if ( document.addEventListener ) {
 879	DOMContentLoaded = function() {
 880		document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
 881		jQuery.ready();
 882	};
 883
 884} else if ( document.attachEvent ) {
 885	DOMContentLoaded = function() {
 886		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
 887		if ( document.readyState === "complete" ) {
 888			document.detachEvent( "onreadystatechange", DOMContentLoaded );
 889			jQuery.ready();
 890		}
 891	};
 892}
 893
 894// The DOM ready check for Internet Explorer
 895function doScrollCheck() {
 896	if ( jQuery.isReady ) {
 897		return;
 898	}
 899
 900	try {
 901		// If IE is used, use the trick by Diego Perini
 902		// http://javascript.nwbox.com/IEContentLoaded/
 903		document.documentElement.doScroll("left");
 904	} catch(e) {
 905		setTimeout( doScrollCheck, 1 );
 906		return;
 907	}
 908
 909	// and execute any waiting functions
 910	jQuery.ready();
 911}
 912
 913// Expose jQuery to the global object
 914return jQuery;
 915
 916})();
 917
 918
 919var // Promise methods
 920	promiseMethods = "then done fail isResolved isRejected promise".split( " " ),
 921	// Static reference to slice
 922	sliceDeferred = [].slice;
 923
 924jQuery.extend({
 925	// Create a simple deferred (one callbacks list)
 926	_Deferred: function() {
 927		var // callbacks list
 928			callbacks = [],
 929			// stored [ context , args ]
 930			fired,
 931			// to avoid firing when already doing so
 932			firing,
 933			// flag to know if the deferred has been cancelled
 934			cancelled,
 935			// the deferred itself
 936			deferred  = {
 937
 938				// done( f1, f2, ...)
 939				done: function() {
 940					if ( !cancelled ) {
 941						var args = arguments,
 942							i,
 943							length,
 944							elem,
 945							type,
 946							_fired;
 947						if ( fired ) {
 948							_fired = fired;
 949							fired = 0;
 950						}
 951						for ( i = 0, length = args.length; i < length; i++ ) {
 952							elem = args[ i ];
 953							type = jQuery.type( elem );
 954							if ( type === "array" ) {
 955								deferred.done.apply( deferred, elem );
 956							} else if ( type === "function" ) {
 957								callbacks.push( elem );
 958							}
 959						}
 960						if ( _fired ) {
 961							deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
 962						}
 963					}
 964					return this;
 965				},
 966
 967				// resolve with given context and args
 968				resolveWith: function( context, args ) {
 969					if ( !cancelled && !fired && !firing ) {
 970						// make sure args are available (#8421)
 971						args = args || [];
 972						firing = 1;
 973						try {
 974							while( callbacks[ 0 ] ) {
 975								callbacks.shift().apply( context, args );
 976							}
 977						}
 978						finally {
 979							fired = [ context, args ];
 980							firing = 0;
 981						}
 982					}
 983					return this;
 984				},
 985
 986				// resolve with this as context and given arguments
 987				resolve: function() {
 988					deferred.resolveWith( this, arguments );
 989					return this;
 990				},
 991
 992				// Has this deferred been resolved?
 993				isResolved: function() {
 994					return !!( firing || fired );
 995				},
 996
 997				// Cancel
 998				cancel: function() {
 999					cancelled = 1;
1000					callbacks = [];
1001					return this;
1002				}
1003			};
1004
1005		return deferred;
1006	},
1007
1008	// Full fledged deferred (two callbacks list)
1009	Deferred: function( func ) {
1010		var deferred = jQuery._Deferred(),
1011			failDeferred = jQuery._Deferred(),
1012			promise;
1013		// Add errorDeferred methods, then and promise
1014		jQuery.extend( deferred, {
1015			then: function( doneCallbacks, failCallbacks ) {
1016				deferred.done( doneCallbacks ).fail( failCallbacks );
1017				return this;
1018			},
1019			fail: failDeferred.done,
1020			rejectWith: failDeferred.resolveWith,
1021			reject: failDeferred.resolve,
1022			isRejected: failDeferred.isResolved,
1023			// Get a promise for this deferred
1024			// If obj is provided, the promise aspect is added to the object
1025			promise: function( obj ) {
1026				if ( obj == null ) {
1027					if ( promise ) {
1028						return promise;
1029					}
1030					promise = obj = {};
1031				}
1032				var i = promiseMethods.length;
1033				while( i-- ) {
1034					obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
1035				}
1036				return obj;
1037			}
1038		} );
1039		// Make sure only one callback list will be used
1040		deferred.done( failDeferred.cancel ).fail( deferred.cancel );
1041		// Unexpose cancel
1042		delete deferred.cancel;
1043		// Call given func if any
1044		if ( func ) {
1045			func.call( deferred, deferred );
1046		}
1047		return deferred;
1048	},
1049
1050	// Deferred helper
1051	when: function( firstParam ) {
1052		var args = arguments,
1053			i = 0,
1054			length = args.length,
1055			count = length,
1056			deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
1057				firstParam :
1058				jQuery.Deferred();
1059		function resolveFunc( i ) {
1060			return function( value ) {
1061				args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
1062				if ( !( --count ) ) {
1063					// Strange bug in FF4:
1064					// Values changed onto the arguments object sometimes end up as undefined values
1065					// outside the $.when method. Cloning the object into a fresh array solves the issue
1066					deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
1067				}
1068			};
1069		}
1070		if ( length > 1 ) {
1071			for( ; i < length; i++ ) {
1072				if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
1073					args[ i ].promise().then( resolveFunc(i), deferred.reject );
1074				} else {
1075					--count;
1076				}
1077			}
1078			if ( !count ) {
1079				deferred.resolveWith( deferred, args );
1080			}
1081		} else if ( deferred !== firstParam ) {
1082			deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
1083		}
1084		return deferred.promise();
1085	}
1086});
1087
1088
1089
1090
1091(function() {
1092
1093	jQuery.support = {};
1094
1095	var div = document.createElement("div");
1096
1097	div.style.display = "none";
1098	div.innerHTML = "   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
1099
1100	var all = div.getElementsByTagName("*"),
1101		a = div.getElementsByTagName("a")[0],
1102		select = document.createElement("select"),
1103		opt = select.appendChild( document.createElement("option") ),
1104		input = div.getElementsByTagName("input")[0];
1105
1106	// Can't get basic test support
1107	if ( !all || !all.length || !a ) {
1108		return;
1109	}
1110
1111	jQuery.support = {
1112		// IE strips leading whitespace when .innerHTML is used
1113		leadingWhitespace: div.firstChild.nodeType === 3,
1114
1115		// Make sure that tbody elements aren't automatically inserted
1116		// IE will insert them into empty tables
1117		tbody: !div.getElementsByTagName("tbody").length,
1118
1119		// Make sure that link elements get serialized correctly by innerHTML
1120		// This requires a wrapper element in IE
1121		htmlSerialize: !!div.getElementsByTagName("link").length,
1122
1123		// Get the style information from getAttribute
1124		// (IE uses .cssText insted)
1125		style: /red/.test( a.getAttribute("style") ),
1126
1127		// Make sure that URLs aren't manipulated
1128		// (IE normalizes it by default)
1129		hrefNormalized: a.getAttribute("href") === "/a",
1130
1131		// Make sure that element opacity exists
1132		// (IE uses filter instead)
1133		// Use a regex to work around a WebKit issue. See #5145
1134		opacity: /^0.55$/.test( a.style.opacity ),
1135
1136		// Verify style float existence
1137		// (IE uses styleFloat instead of cssFloat)
1138		cssFloat: !!a.style.cssFloat,
1139
1140		// Make sure that if no value is specified for a checkbox
1141		// that it defaults to "on".
1142		// (WebKit defaults to "" instead)
1143		checkOn: input.value === "on",
1144
1145		// Make sure that a selected-by-default option has a working selected property.
1146		// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
1147		optSelected: opt.selected,
1148
1149		// Will be defined later
1150		deleteExpando: true,
1151		optDisabled: false,
1152		checkClone: false,
1153		noCloneEvent: true,
1154		noCloneChecked: true,
1155		boxModel: null,
1156		inlineBlockNeedsLayout: false,
1157		shrinkWrapBlocks: false,
1158		reliableHiddenOffsets: true,
1159		reliableMarginRight: true
1160	};
1161
1162	input.checked = true;
1163	jQuery.support.noCloneChecked = input.cloneNode( true ).checked;
1164
1165	// Make sure that the options inside disabled selects aren't marked as disabled
1166	// (WebKit marks them as diabled)
1167	select.disabled = true;
1168	jQuery.support.optDisabled = !opt.disabled;
1169
1170	var _scriptEval = null;
1171	jQuery.support.scriptEval = function() {
1172		if ( _scriptEval === null ) {
1173			var root = document.documentElement,
1174				script = document.createElement("script"),
1175				id = "script" + jQuery.now();
1176
1177			// Make sure that the execution of code works by injecting a script
1178			// tag with appendChild/createTextNode
1179			// (IE doesn't support this, fails, and uses .text instead)
1180			try {
1181				script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
1182			} catch(e) {}
1183
1184			root.insertBefore( script, root.firstChild );
1185
1186			if ( window[ id ] ) {
1187				_scriptEval = true;
1188				delete window[ id ];
1189			} else {
1190				_scriptEval = false;
1191			}
1192
1193			root.removeChild( script );
1194		}
1195
1196		return _scriptEval;
1197	};
1198
1199	// Test to see if it's possible to delete an expando from an element
1200	// Fails in Internet Explorer
1201	try {
1202		delete div.test;
1203
1204	} catch(e) {
1205		jQuery.support.deleteExpando = false;
1206	}
1207
1208	if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
1209		div.attachEvent("onclick", function click() {
1210			// Cloning a node shouldn't copy over any
1211			// bound event handlers (IE does this)
1212			jQuery.support.noCloneEvent = false;
1213			div.detachEvent("onclick", click);
1214		});
1215		div.cloneNode(true).fireEvent("onclick");
1216	}
1217
1218	div = document.createElement("div");
1219	div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
1220
1221	var fragment = document.createDocumentFragment();
1222	fragment.appendChild( div.firstChild );
1223
1224	// WebKit doesn't clone checked state correctly in fragments
1225	jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
1226
1227	// Figure out if the W3C box model works as expected
1228	// document.body must exist before we can do this
1229	jQuery(function() {
1230		var div = document.createElement("div"),
1231			body = document.getElementsByTagName("body")[0];
1232
1233		// Frameset documents with no body should not run this code
1234		if ( !body ) {
1235			return;
1236		}
1237
1238		div.style.width = div.style.paddingLeft = "1px";
1239		body.appendChild( div );
1240		jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
1241
1242		if ( "zoom" in div.style ) {
1243			// Check if natively block-level elements act like inline-block
1244			// elements when setting their display to 'inline' and giving
1245			// them layout
1246			// (IE < 8 does this)
1247			div.style.display = "inline";
1248			div.style.zoom = 1;
1249			jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;
1250
1251			// Check if elements with layout shrink-wrap their children
1252			// (IE 6 does this)
1253			div.style.display = "";
1254			div.innerHTML = "<div style='width:4px;'></div>";
1255			jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;
1256		}
1257
1258		div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
1259		var tds = div.getElementsByTagName("td");
1260
1261		// Check if table cells still have offsetWidth/Height when they are set
1262		// to display:none and there are still other visible table cells in a
1263		// table row; if so, offsetWidth/Height are not reliable for use when
1264		// determining if an element has been hidden directly using
1265		// display:none (it is still safe to use offsets if a parent element is
1266		// hidden; don safety goggles and see bug #4512 for more information).
1267		// (only IE 8 fails this test)
1268		jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;
1269
1270		tds[0].style.display = "";
1271		tds[1].style.display = "none";
1272
1273		// Check if empty table cells still have offsetWidth/Height
1274		// (IE < 8 fail this test)
1275		jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
1276		div.innerHTML = "";
1277
1278		// Check if div with explicit width and no margin-right incorrectly
1279		// gets computed margin-right based on width of container. For more
1280		// info see bug #3333
1281		// Fails in WebKit before Feb 2011 nightlies
1282		// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
1283		if ( document.defaultView && document.defaultView.getComputedStyle ) {
1284			div.style.width = "1px";
1285			div.style.marginRight = "0";
1286			jQuery.support.reliableMarginRight = ( parseInt(document.defaultView.getComputedStyle(div, null).marginRight, 10) || 0 ) === 0;
1287		}
1288
1289		body.removeChild( div ).style.display = "none";
1290		div = tds = null;
1291	});
1292
1293	// Technique from Juriy Zaytsev
1294	// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
1295	var eventSupported = function( eventName ) {
1296		var el = document.createElement("div");
1297		eventName = "on" + eventName;
1298
1299		// We only care about the case where non-standard event systems
1300		// are used, namely in IE. Short-circuiting here helps us to
1301		// avoid an eval call (in setAttribute) which can cause CSP
1302		// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
1303		if ( !el.attachEvent ) {
1304			return true;
1305		}
1306
1307		var isSupported = (eventName in el);
1308		if ( !isSupported ) {
1309			el.setAttribute(eventName, "return;");
1310			isSupported = typeof el[eventName] === "function";
1311		}
1312		return isSupported;
1313	};
1314
1315	jQuery.support.submitBubbles = eventSupported("submit");
1316	jQuery.support.changeBubbles = eventSupported("change");
1317
1318	// release memory in IE
1319	div = all = a = null;
1320})();
1321
1322
1323
1324var rbrace = /^(?:\{.*\}|\[.*\])$/;
1325
1326jQuery.extend({
1327	cache: {},
1328
1329	// Please use with caution
1330	uuid: 0,
1331
1332	// Unique for each copy of jQuery on the page
1333	// Non-digits removed to match rinlinejQuery
1334	expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
1335
1336	// The following elements throw uncatchable exceptions if you
1337	// attempt to add expando properties to them.
1338	noData: {
1339		"embed": true,
1340		// Ban all objects except for Flash (which handle expandos)
1341		"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
1342		"applet": true
1343	},
1344
1345	hasData: function( elem ) {
1346		elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
1347
1348		return !!elem && !isEmptyDataObject( elem );
1349	},
1350
1351	data: function( elem, name, data, pvt /* Internal Use Only */ ) {
1352		if ( !jQuery.acceptData( elem ) ) {
1353			return;
1354		}
1355
1356		var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,
1357
1358			// We have to handle DOM nodes and JS objects differently because IE6-7
1359			// can't GC object references properly across the DOM-JS boundary
1360			isNode = elem.nodeType,
1361
1362			// Only DOM nodes need the global jQuery cache; JS object data is
1363			// attached directly to the object so GC can occur automatically
1364			cache = isNode ? jQuery.cache : elem,
1365
1366			// Only defining an ID for JS objects if its cache already exists allows
1367			// the code to shortcut on the same path as a DOM node with no cache
1368			id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
1369
1370		// Avoid doing any more work than we need to when trying to get data on an
1371		// object that has no data at all
1372		if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
1373			return;
1374		}
1375
1376		if ( !id ) {
1377			// Only DOM nodes need a new unique ID for each element since their data
1378			// ends up in the global cache
1379			if ( isNode ) {
1380				elem[ jQuery.expando ] = id = ++jQuery.uuid;
1381			} else {
1382				id = jQuery.expando;
1383			}
1384		}
1385
1386		if ( !cache[ id ] ) {
1387			cache[ id ] = {};
1388
1389			// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
1390			// metadata on plain JS objects when the object is serialized using
1391			// JSON.stringify
1392			if ( !isNode ) {
1393				cache[ id ].toJSON = jQuery.noop;
1394			}
1395		}
1396
1397		// An object can be passed to jQuery.data instead of a key/value pair; this gets
1398		// shallow copied over onto the existing cache
1399		if ( typeof name === "object" || typeof name === "function" ) {
1400			if ( pvt ) {
1401				cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
1402			} else {
1403				cache[ id ] = jQuery.extend(cache[ id ], name);
1404			}
1405		}
1406
1407		thisCache = cache[ id ];
1408
1409		// Internal jQuery data is stored in a separate object inside the object's data
1410		// cache in order to avoid key collisions between internal data and user-defined
1411		// data
1412		if ( pvt ) {
1413			if ( !thisCache[ internalKey ] ) {
1414				thisCache[ internalKey ] = {};
1415			}
1416
1417			thisCache = thisCache[ internalKey ];
1418		}
1419
1420		if ( data !== undefined ) {
1421			thisCache[ name ] = data;
1422		}
1423
1424		// TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
1425		// not attempt to inspect the internal events object using jQuery.data, as this
1426		// internal data object is undocumented and subject to change.
1427		if ( name === "events" && !thisCache[name] ) {
1428			return thisCache[ internalKey ] && thisCache[ internalKey ].events;
1429		}
1430
1431		return getByName ? thisCache[ name ] : thisCache;
1432	},
1433
1434	removeData: function( elem, name, pvt /* Internal Use Only */ ) {
1435		if ( !jQuery.acceptData( elem ) ) {
1436			return;
1437		}
1438
1439		var internalKey = jQuery.expando, isNode = elem.nodeType,
1440
1441			// See jQuery.data for more information
1442			cache = isNode ? jQuery.cache : elem,
1443
1444			// See jQuery.data for more information
1445			id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
1446
1447		// If there is already no cache entry for this object, there is no
1448		// purpose in continuing
1449		if ( !cache[ id ] ) {
1450			return;
1451		}
1452
1453		if ( name ) {
1454			var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
1455
1456			if ( thisCache ) {
1457				delete thisCache[ name ];
1458
1459				// If there is no data left in the cache, we want to continue
1460				// and let the cache object itself get destroyed
1461				if ( !isEmptyDataObject(thisCache) ) {
1462					return;
1463				}
1464			}
1465		}
1466
1467		// See jQuery.data for more information
1468		if ( pvt ) {
1469			delete cache[ id ][ internalKey ];
1470
1471			// Don't destroy the parent cache unless the internal data object
1472			// had been the only thing left in it
1473			if ( !isEmptyDataObject(cache[ id ]) ) {
1474				return;
1475			}
1476		}
1477
1478		var internalCache = cache[ id ][ internalKey ];
1479
1480		// Browsers that fail expando deletion also refuse to delete expandos on
1481		// the window, but it will allow it on all other JS objects; other browsers
1482		// don't care
1483		if ( jQuery.support.deleteExpando || cache != window ) {
1484			delete cache[ id ];
1485		} else {
1486			cache[ id ] = null;
1487		}
1488
1489		// We destroyed the entire user cache at once because it's faster than
1490		// iterating through each key, but we need to continue to persist internal
1491		// data if it existed
1492		if ( internalCache ) {
1493			cache[ id ] = {};
1494			// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
1495			// metadata on plain JS objects when the object is serialized using
1496			// JSON.stringify
1497			if ( !isNode ) {
1498				cache[ id ].toJSON = jQuery.noop;
1499			}
1500
1501			cache[ id ][ internalKey ] = internalCache;
1502
1503		// Otherwise, we need to eliminate the expando on the node to avoid
1504		// false lookups in the cache for entries that no longer exist
1505		} else if ( isNode ) {
1506			// IE does not allow us to delete expando properties from nodes,
1507			// nor does it have a removeAttribute function on Document nodes;
1508			// we must handle all of these cases
1509			if ( jQuery.support.deleteExpando ) {
1510				delete elem[ jQuery.expando ];
1511			} else if ( elem.removeAttribute ) {
1512				elem.removeAttribute( jQuery.expando );
1513			} else {
1514				elem[ jQuery.expando ] = null;
1515			}
1516		}
1517	},
1518
1519	// For internal use only.
1520	_data: function( elem, name, data ) {
1521		return jQuery.data( elem, name, data, true );
1522	},
1523
1524	// A method for determining if a DOM node can handle the data expando
1525	acceptData: function( elem ) {
1526		if ( elem.nodeName ) {
1527			var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
1528
1529			if ( match ) {
1530				return !(match === true || elem.getAttribute("classid") !== match);
1531			}
1532		}
1533
1534		return true;
1535	}
1536});
1537
1538jQuery.fn.extend({
1539	data: function( key, value ) {
1540		var data = null;
1541
1542		if ( typeof key === "undefined" ) {
1543			if ( this.length ) {
1544				data = jQuery.data( this[0] );
1545
1546				if ( this[0].nodeType === 1 ) {
1547					var attr = this[0].attributes, name;
1548					for ( var i = 0, l = attr.length; i < l; i++ ) {
1549						name = attr[i].name;
1550
1551						if ( name.indexOf( "data-" ) === 0 ) {
1552							name = name.substr( 5 );
1553							dataAttr( this[0], name, data[ name ] );
1554						}
1555					}
1556				}
1557			}
1558
1559			return data;
1560
1561		} else if ( typeof key === "object" ) {
1562			return this.each(function() {
1563				jQuery.data( this, key );
1564			});
1565		}
1566
1567		var parts = key.split(".");
1568		parts[1] = parts[1] ? "." + parts[1] : "";
1569
1570		if ( value === undefined ) {
1571			data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
1572
1573			// Try to fetch any internally stored data first
1574			if ( data === undefined && this.length ) {
1575				data = jQuery.data( this[0], key );
1576				data = dataAttr( this[0], key, data );
1577			}
1578
1579			return data === undefined && parts[1] ?
1580				this.data( parts[0] ) :
1581				data;
1582
1583		} else {
1584			return this.each(function() {
1585				var $this = jQuery( this ),
1586					args = [ parts[0], value ];
1587
1588				$this.triggerHandler( "setData" + parts[1] + "!", args );
1589				jQuery.data( this, key, value );
1590				$this.triggerHandler( "changeData" + parts[1] + "!", args );
1591			});
1592		}
1593	},
1594
1595	removeData: function( key ) {
1596		return this.each(function() {
1597			jQuery.removeData( this, key );
1598		});
1599	}
1600});
1601
1602function dataAttr( elem, key, data ) {
1603	// If nothing was found internally, try to fetch any
1604	// data from the HTML5 data-* attribute
1605	if ( data === undefined && elem.nodeType === 1 ) {
1606		data = elem.getAttribute( "data-" + key );
1607
1608		if ( typeof data === "string" ) {
1609			try {
1610				data = data === "true" ? true :
1611				data === "false" ? false :
1612				data === "null" ? null :
1613				!jQuery.isNaN( data ) ? parseFloat( data ) :
1614					rbrace.test( data ) ? jQuery.parseJSON( data ) :
1615					data;
1616			} catch( e ) {}
1617
1618			// Make sure we set the data so it isn't changed later
1619			jQuery.data( elem, key, data );
1620
1621		} else {
1622			data = undefined;
1623		}
1624	}
1625
1626	return data;
1627}
1628
1629// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
1630// property to be considered empty objects; this property always exists in
1631// order to make sure JSON.stringify does not expose internal metadata
1632function isEmptyDataObject( obj ) {
1633	for ( var name in obj ) {
1634		if ( name !== "toJSON" ) {
1635			return false;
1636		}
1637	}
1638
1639	return true;
1640}
1641
1642
1643
1644
1645jQuery.extend({
1646	queue: function( elem, type, data ) {
1647		if ( !elem ) {
1648			return;
1649		}
1650
1651		type = (type || "fx") + "queue";
1652		var q = jQuery._data( elem, type );
1653
1654		// Speed up dequeue by getting out quickly if this is just a lookup
1655		if ( !data ) {
1656			return q || [];
1657		}
1658
1659		if ( !q || jQuery.isArray(data) ) {
1660			q = jQuery._data( elem, type, jQuery.makeArray(data) );
1661
1662		} else {
1663			q.push( data );
1664		}
1665
1666		return q;
1667	},
1668
1669	dequeue: function( elem, type ) {
1670		type = type || "fx";
1671
1672		var queue = jQuery.queue( elem, type ),
1673			fn = queue.shift();
1674
1675		// If the fx queue is dequeued, always remove the progress sentinel
1676		if ( fn === "inprogress" ) {
1677			fn = queue.shift();
1678		}
1679
1680		if ( fn ) {
1681			// Add a progress sentinel to prevent the fx queue from being
1682			// automatically dequeued
1683			if ( type === "fx" ) {
1684				queue.unshift("inprogress");
1685			}
1686
1687			fn.call(elem, function() {
1688				jQuery.dequeue(elem, type);
1689			});
1690		}
1691
1692		if ( !queue.length ) {
1693			jQuery.removeData( elem, type + "queue", true );
1694		}
1695	}
1696});
1697
1698jQuery.fn.extend({
1699	queue: function( type, data ) {
1700		if ( typeof type !== "string" ) {
1701			data = type;
1702			type = "fx";
1703		}
1704
1705		if ( data === undefined ) {
1706			return jQuery.queue( this[0], type );
1707		}
1708		return this.each(function( i ) {
1709			var queue = jQuery.queue( this, type, data );
1710
1711			if ( type === "fx" && queue[0] !== "inprogress" ) {
1712				jQuery.dequeue( this, type );
1713			}
1714		});
1715	},
1716	dequeue: function( type ) {
1717		return this.each(function() {
1718			jQuery.dequeue( this, type );
1719		});
1720	},
1721
1722	// Based off of the plugin by Clint Helfers, with permission.
1723	// http://blindsignals.com/index.php/2009/07/jquery-delay/
1724	delay: function( time, type ) {
1725		time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
1726		type = type || "fx";
1727
1728		return this.queue( type, function() {
1729			var elem = this;
1730			setTimeout(function() {
1731				jQuery.dequeue( elem, type );
1732			}, time );
1733		});
1734	},
1735
1736	clearQueue: function( type ) {
1737		return this.queue( type || "fx", [] );
1738	}
1739});
1740
1741
1742
1743
1744var rclass = /[\n\t\r]/g,
1745	rspaces = /\s+/,
1746	rreturn = /\r/g,
1747	rspecialurl = /^(?:href|src|style)$/,
1748	rtype = /^(?:button|input)$/i,
1749	rfocusable = /^(?:button|input|object|select|textarea)$/i,
1750	rclickable = /^a(?:rea)?$/i,
1751	rradiocheck = /^(?:radio|checkbox)$/i;
1752
1753jQuery.props = {
1754	"for": "htmlFor",
1755	"class": "className",
1756	readonly: "readOnly",
1757	maxlength: "maxLength",
1758	cellspacing: "cellSpacing",
1759	rowspan: "rowSpan",
1760	colspan: "colSpan",
1761	tabindex: "tabIndex",
1762	usemap: "useMap",
1763	frameborder: "frameBorder"
1764};
1765
1766jQuery.fn.extend({
1767	attr: function( name, value ) {
1768		return jQuery.access( this, name, value, true, jQuery.attr );
1769	},
1770
1771	removeAttr: function( name, fn ) {
1772		return this.each(function(){
1773			jQuery.attr( this, name, "" );
1774			if ( this.nodeType === 1 ) {
1775				this.removeAttribute( name );
1776			}
1777		});
1778	},
1779
1780	addClass: function( value ) {
1781		if ( jQuery.isFunction(value) ) {
1782			return this.each(function(i) {
1783				var self = jQuery(this);
1784				self.addClass( value.call(this, i, self.attr("class")) );
1785			});
1786		}
1787
1788		if ( value && typeof value === "string" ) {
1789			var classNames = (value || "").split( rspaces );
1790
1791			for ( var i = 0, l = this.length; i < l; i++ ) {
1792				var elem = this[i];
1793
1794				if ( elem.nodeType === 1 ) {
1795					if ( !elem.className ) {
1796						elem.className = value;
1797
1798					} else {
1799						var className = " " + elem.className + " ",
1800							setClass = elem.className;
1801
1802						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
1803							if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
1804								setClass += " " + classNames[c];
1805							}
1806						}
1807						elem.className = jQuery.trim( setClass );
1808					}
1809				}
1810			}
1811		}
1812
1813		return this;
1814	},
1815
1816	removeClass: function( value ) {
1817		if ( jQuery.isFunction(value) ) {
1818			return this.each(function(i) {
1819				var self = jQuery(this);
1820				self.removeClass( value.call(this, i, self.attr("class")) );
1821			});
1822		}
1823
1824		if ( (value && typeof value === "string") || value === undefined ) {
1825			var classNames = (value || "").split( rspaces );
1826
1827			for ( var i = 0, l = this.length; i < l; i++ ) {
1828				var elem = this[i];
1829
1830				if ( elem.nodeType === 1 && elem.className ) {
1831					if ( value ) {
1832						var className = (" " + elem.className + " ").replace(rclass, " ");
1833						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
1834							className = className.replace(" " + classNames[c] + " ", " ");
1835						}
1836						elem.className = jQuery.trim( className );
1837
1838					} else {
1839						elem.className = "";
1840					}
1841				}
1842			}
1843		}
1844
1845		return this;
1846	},
1847
1848	toggleClass: function( value, stateVal ) {
1849		var type = typeof value,
1850			isBool = typeof stateVal === "boolean";
1851
1852		if ( jQuery.isFunction( value ) ) {
1853			return this.each(function(i) {
1854				var self = jQuery(this);
1855				self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
1856			});
1857		}
1858
1859		return this.each(function() {
1860			if ( type === "string" ) {
1861				// toggle individual class names
1862				var className,
1863					i = 0,
1864					self = jQuery( this ),
1865					state = stateVal,
1866					classNames = value.split( rspaces );
1867
1868				while ( (className = classNames[ i++ ]) ) {
1869					// check each className given, space seperated list
1870					state = isBool ? state : !self.hasClass( className );
1871					self[ state ? "addClass" : "removeClass" ]( className );
1872				}
1873
1874			} else if ( type === "undefined" || type === "boolean" ) {
1875				if ( this.className ) {
1876					// store className if set
1877					jQuery._data( this, "__className__", this.className );
1878				}
1879
1880				// toggle whole className
1881				this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
1882			}
1883		});
1884	},
1885
1886	hasClass: function( selector ) {
1887		var className = " " + selector + " ";
1888		for ( var i = 0, l = this.length; i < l; i++ ) {
1889			if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
1890				return true;
1891			}
1892		}
1893
1894		return false;
1895	},
1896
1897	val: function( value ) {
1898		if ( !arguments.length ) {
1899			var elem

Large files files are truncated, but you can click here to view the full file