PageRenderTime 184ms CodeModel.GetById 97ms app.highlight 64ms RepoModel.GetById 1ms app.codeStats 2ms

/src/MvcCms.Web/Scripts/jquery-1.4.1.js

#
JavaScript | 6111 lines | 4741 code | 828 blank | 542 comment | 975 complexity | e7b3b1cb5cb82f2f4c36c28ddb736f45 MD5 | raw file

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

   1/*!
   2 * jQuery JavaScript Library v1.4.1
   3 * http://jquery.com/
   4 *
   5 * Copyright 2010, John Resig
   6 *
   7 * Includes Sizzle.js
   8 * http://sizzlejs.com/
   9 * Copyright 2010, The Dojo Foundation
  10 *
  11 * Permission is hereby granted, free of charge, to any person obtaining
  12 * a copy of this software and associated documentation files (the
  13 * "Software"), to deal in the Software without restriction, including
  14 * without limitation the rights to use, copy, modify, merge, publish,
  15 * distribute, sublicense, and/or sell copies of the Software, and to
  16 * permit persons to whom the Software is furnished to do so, subject to
  17 * the following conditions:
  18 * 
  19 * The above copyright notice and this permission notice shall be
  20 * included in all copies or substantial portions of the Software.
  21 * 
  22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  25 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  26 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  27 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  28 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  29 * Date: Mon Jan 25 19:43:33 2010 -0500
  30 */
  31(function( window, undefined ) {
  32
  33// Define a local copy of jQuery
  34var jQuery = function( selector, context ) {
  35		// The jQuery object is actually just the init constructor 'enhanced'
  36		return new jQuery.fn.init( selector, context );
  37	},
  38
  39	// Map over jQuery in case of overwrite
  40	_jQuery = window.jQuery,
  41
  42	// Map over the $ in case of overwrite
  43	_$ = window.$,
  44
  45	// Use the correct document accordingly with window argument (sandbox)
  46	document = window.document,
  47
  48	// A central reference to the root jQuery(document)
  49	rootjQuery,
  50
  51	// A simple way to check for HTML strings or ID strings
  52	// (both of which we optimize for)
  53	quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
  54
  55	// Is it a simple selector
  56	isSimple = /^.[^:#\[\.,]*$/,
  57
  58	// Check if a string has a non-whitespace character in it
  59	rnotwhite = /\S/,
  60
  61	// Used for trimming whitespace
  62	rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
  63
  64	// Match a standalone tag
  65	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
  66
  67	// Keep a UserAgent string for use with jQuery.browser
  68	userAgent = navigator.userAgent,
  69
  70	// For matching the engine and version of the browser
  71	browserMatch,
  72	
  73	// Has the ready events already been bound?
  74	readyBound = false,
  75	
  76	// The functions to execute on DOM ready
  77	readyList = [],
  78
  79	// The ready event handler
  80	DOMContentLoaded,
  81
  82	// Save a reference to some core methods
  83	toString = Object.prototype.toString,
  84	hasOwnProperty = Object.prototype.hasOwnProperty,
  85	push = Array.prototype.push,
  86	slice = Array.prototype.slice,
  87	indexOf = Array.prototype.indexOf;
  88
  89jQuery.fn = jQuery.prototype = {
  90	init: function( selector, context ) {
  91		var match, elem, ret, doc;
  92
  93		// Handle $(""), $(null), or $(undefined)
  94		if ( !selector ) {
  95			return this;
  96		}
  97
  98		// Handle $(DOMElement)
  99		if ( selector.nodeType ) {
 100			this.context = this[0] = selector;
 101			this.length = 1;
 102			return this;
 103		}
 104
 105		// Handle HTML strings
 106		if ( typeof selector === "string" ) {
 107			// Are we dealing with HTML string or an ID?
 108			match = quickExpr.exec( selector );
 109
 110			// Verify a match, and that no context was specified for #id
 111			if ( match && (match[1] || !context) ) {
 112
 113				// HANDLE: $(html) -> $(array)
 114				if ( match[1] ) {
 115					doc = (context ? context.ownerDocument || context : document);
 116
 117					// If a single string is passed in and it's a single tag
 118					// just do a createElement and skip the rest
 119					ret = rsingleTag.exec( selector );
 120
 121					if ( ret ) {
 122						if ( jQuery.isPlainObject( context ) ) {
 123							selector = [ document.createElement( ret[1] ) ];
 124							jQuery.fn.attr.call( selector, context, true );
 125
 126						} else {
 127							selector = [ doc.createElement( ret[1] ) ];
 128						}
 129
 130					} else {
 131						ret = buildFragment( [ match[1] ], [ doc ] );
 132						selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
 133					}
 134
 135				// HANDLE: $("#id")
 136				} else {
 137					elem = document.getElementById( match[2] );
 138
 139					if ( elem ) {
 140						// Handle the case where IE and Opera return items
 141						// by name instead of ID
 142						if ( elem.id !== match[2] ) {
 143							return rootjQuery.find( selector );
 144						}
 145
 146						// Otherwise, we inject the element directly into the jQuery object
 147						this.length = 1;
 148						this[0] = elem;
 149					}
 150
 151					this.context = document;
 152					this.selector = selector;
 153					return this;
 154				}
 155
 156			// HANDLE: $("TAG")
 157			} else if ( !context && /^\w+$/.test( selector ) ) {
 158				this.selector = selector;
 159				this.context = document;
 160				selector = document.getElementsByTagName( selector );
 161
 162			// HANDLE: $(expr, $(...))
 163			} else if ( !context || context.jquery ) {
 164				return (context || rootjQuery).find( selector );
 165
 166			// HANDLE: $(expr, context)
 167			// (which is just equivalent to: $(context).find(expr)
 168			} else {
 169				return jQuery( context ).find( selector );
 170			}
 171
 172		// HANDLE: $(function)
 173		// Shortcut for document ready
 174		} else if ( jQuery.isFunction( selector ) ) {
 175			return rootjQuery.ready( selector );
 176		}
 177
 178		if (selector.selector !== undefined) {
 179			this.selector = selector.selector;
 180			this.context = selector.context;
 181		}
 182
 183		return jQuery.isArray( selector ) ?
 184			this.setArray( selector ) :
 185			jQuery.makeArray( selector, this );
 186	},
 187
 188	// Start with an empty selector
 189	selector: "",
 190
 191	// The current version of jQuery being used
 192	jquery: "1.4.1",
 193
 194	// The default length of a jQuery object is 0
 195	length: 0,
 196
 197	// The number of elements contained in the matched element set
 198	size: function() {
 199		return this.length;
 200	},
 201
 202	toArray: function() {
 203		return slice.call( this, 0 );
 204	},
 205
 206	// Get the Nth element in the matched element set OR
 207	// Get the whole matched element set as a clean array
 208	get: function( num ) {
 209		return num == null ?
 210
 211			// Return a 'clean' array
 212			this.toArray() :
 213
 214			// Return just the object
 215			( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
 216	},
 217
 218	// Take an array of elements and push it onto the stack
 219	// (returning the new matched element set)
 220	pushStack: function( elems, name, selector ) {
 221		// Build a new jQuery matched element set
 222		var ret = jQuery( elems || null );
 223
 224		// Add the old object onto the stack (as a reference)
 225		ret.prevObject = this;
 226
 227		ret.context = this.context;
 228
 229		if ( name === "find" ) {
 230			ret.selector = this.selector + (this.selector ? " " : "") + selector;
 231		} else if ( name ) {
 232			ret.selector = this.selector + "." + name + "(" + selector + ")";
 233		}
 234
 235		// Return the newly-formed element set
 236		return ret;
 237	},
 238
 239	// Force the current matched set of elements to become
 240	// the specified array of elements (destroying the stack in the process)
 241	// You should use pushStack() in order to do this, but maintain the stack
 242	setArray: function( elems ) {
 243		// Resetting the length to 0, then using the native Array push
 244		// is a super-fast way to populate an object with array-like properties
 245		this.length = 0;
 246		push.apply( this, elems );
 247
 248		return this;
 249	},
 250
 251	// Execute a callback for every element in the matched set.
 252	// (You can seed the arguments with an array of args, but this is
 253	// only used internally.)
 254	each: function( callback, args ) {
 255		return jQuery.each( this, callback, args );
 256	},
 257	
 258	ready: function( fn ) {
 259		// Attach the listeners
 260		jQuery.bindReady();
 261
 262		// If the DOM is already ready
 263		if ( jQuery.isReady ) {
 264			// Execute the function immediately
 265			fn.call( document, jQuery );
 266
 267		// Otherwise, remember the function for later
 268		} else if ( readyList ) {
 269			// Add the function to the wait list
 270			readyList.push( fn );
 271		}
 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 || jQuery(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
 313jQuery.fn.init.prototype = jQuery.fn;
 314
 315jQuery.extend = jQuery.fn.extend = function() {
 316	// copy reference to target object
 317	var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
 318
 319	// Handle a deep copy situation
 320	if ( typeof target === "boolean" ) {
 321		deep = target;
 322		target = arguments[1] || {};
 323		// skip the boolean and the target
 324		i = 2;
 325	}
 326
 327	// Handle case when target is a string or something (possible in deep copy)
 328	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
 329		target = {};
 330	}
 331
 332	// extend jQuery itself if only one argument is passed
 333	if ( length === i ) {
 334		target = this;
 335		--i;
 336	}
 337
 338	for ( ; i < length; i++ ) {
 339		// Only deal with non-null/undefined values
 340		if ( (options = arguments[ i ]) != null ) {
 341			// Extend the base object
 342			for ( name in options ) {
 343				src = target[ name ];
 344				copy = options[ name ];
 345
 346				// Prevent never-ending loop
 347				if ( target === copy ) {
 348					continue;
 349				}
 350
 351				// Recurse if we're merging object literal values or arrays
 352				if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
 353					var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
 354						: jQuery.isArray(copy) ? [] : {};
 355
 356					// Never move original objects, clone them
 357					target[ name ] = jQuery.extend( deep, clone, copy );
 358
 359				// Don't bring in undefined values
 360				} else if ( copy !== undefined ) {
 361					target[ name ] = copy;
 362				}
 363			}
 364		}
 365	}
 366
 367	// Return the modified object
 368	return target;
 369};
 370
 371jQuery.extend({
 372	noConflict: function( deep ) {
 373		window.$ = _$;
 374
 375		if ( deep ) {
 376			window.jQuery = _jQuery;
 377		}
 378
 379		return jQuery;
 380	},
 381	
 382	// Is the DOM ready to be used? Set to true once it occurs.
 383	isReady: false,
 384	
 385	// Handle when the DOM is ready
 386	ready: function() {
 387		// Make sure that the DOM is not already loaded
 388		if ( !jQuery.isReady ) {
 389			// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
 390			if ( !document.body ) {
 391				return setTimeout( jQuery.ready, 13 );
 392			}
 393
 394			// Remember that the DOM is ready
 395			jQuery.isReady = true;
 396
 397			// If there are functions bound, to execute
 398			if ( readyList ) {
 399				// Execute all of them
 400				var fn, i = 0;
 401				while ( (fn = readyList[ i++ ]) ) {
 402					fn.call( document, jQuery );
 403				}
 404
 405				// Reset the list of functions
 406				readyList = null;
 407			}
 408
 409			// Trigger any bound ready events
 410			if ( jQuery.fn.triggerHandler ) {
 411				jQuery( document ).triggerHandler( "ready" );
 412			}
 413		}
 414	},
 415	
 416	bindReady: function() {
 417		if ( readyBound ) {
 418			return;
 419		}
 420
 421		readyBound = true;
 422
 423		// Catch cases where $(document).ready() is called after the
 424		// browser event has already occurred.
 425		if ( document.readyState === "complete" ) {
 426			return jQuery.ready();
 427		}
 428
 429		// Mozilla, Opera and webkit nightlies currently support this event
 430		if ( document.addEventListener ) {
 431			// Use the handy event callback
 432			document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
 433			
 434			// A fallback to window.onload, that will always work
 435			window.addEventListener( "load", jQuery.ready, false );
 436
 437		// If IE event model is used
 438		} else if ( document.attachEvent ) {
 439			// ensure firing before onload,
 440			// maybe late but safe also for iframes
 441			document.attachEvent("onreadystatechange", DOMContentLoaded);
 442			
 443			// A fallback to window.onload, that will always work
 444			window.attachEvent( "onload", jQuery.ready );
 445
 446			// If IE and not a frame
 447			// continually check to see if the document is ready
 448			var toplevel = false;
 449
 450			try {
 451				toplevel = window.frameElement == null;
 452			} catch(e) {}
 453
 454			if ( document.documentElement.doScroll && toplevel ) {
 455				doScrollCheck();
 456			}
 457		}
 458	},
 459
 460	// See test/unit/core.js for details concerning isFunction.
 461	// Since version 1.3, DOM methods and functions like alert
 462	// aren't supported. They return false on IE (#2968).
 463	isFunction: function( obj ) {
 464		return toString.call(obj) === "[object Function]";
 465	},
 466
 467	isArray: function( obj ) {
 468		return toString.call(obj) === "[object Array]";
 469	},
 470
 471	isPlainObject: function( obj ) {
 472		// Must be an Object.
 473		// Because of IE, we also have to check the presence of the constructor property.
 474		// Make sure that DOM nodes and window objects don't pass through, as well
 475		if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
 476			return false;
 477		}
 478		
 479		// Not own constructor property must be Object
 480		if ( obj.constructor
 481			&& !hasOwnProperty.call(obj, "constructor")
 482			&& !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
 483			return false;
 484		}
 485		
 486		// Own properties are enumerated firstly, so to speed up,
 487		// if last one is own, then all properties are own.
 488	
 489		var key;
 490		for ( key in obj ) {}
 491		
 492		return key === undefined || hasOwnProperty.call( obj, key );
 493	},
 494
 495	isEmptyObject: function( obj ) {
 496		for ( var name in obj ) {
 497			return false;
 498		}
 499		return true;
 500	},
 501	
 502	error: function( msg ) {
 503		throw msg;
 504	},
 505	
 506	parseJSON: function( data ) {
 507		if ( typeof data !== "string" || !data ) {
 508			return null;
 509		}
 510		
 511		// Make sure the incoming data is actual JSON
 512		// Logic borrowed from http://json.org/json2.js
 513		if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
 514			.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
 515			.replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) {
 516
 517			// Try to use the native JSON parser first
 518			return window.JSON && window.JSON.parse ?
 519				window.JSON.parse( data ) :
 520				(new Function("return " + data))();
 521
 522		} else {
 523			jQuery.error( "Invalid JSON: " + data );
 524		}
 525	},
 526
 527	noop: function() {},
 528
 529	// Evalulates a script in a global context
 530	globalEval: function( data ) {
 531		if ( data && rnotwhite.test(data) ) {
 532			// Inspired by code by Andrea Giammarchi
 533			// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
 534			var head = document.getElementsByTagName("head")[0] || document.documentElement,
 535				script = document.createElement("script");
 536
 537			script.type = "text/javascript";
 538
 539			if ( jQuery.support.scriptEval ) {
 540				script.appendChild( document.createTextNode( data ) );
 541			} else {
 542				script.text = data;
 543			}
 544
 545			// Use insertBefore instead of appendChild to circumvent an IE6 bug.
 546			// This arises when a base node is used (#2709).
 547			head.insertBefore( script, head.firstChild );
 548			head.removeChild( script );
 549		}
 550	},
 551
 552	nodeName: function( elem, name ) {
 553		return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
 554	},
 555
 556	// args is for internal usage only
 557	each: function( object, callback, args ) {
 558		var name, i = 0,
 559			length = object.length,
 560			isObj = length === undefined || jQuery.isFunction(object);
 561
 562		if ( args ) {
 563			if ( isObj ) {
 564				for ( name in object ) {
 565					if ( callback.apply( object[ name ], args ) === false ) {
 566						break;
 567					}
 568				}
 569			} else {
 570				for ( ; i < length; ) {
 571					if ( callback.apply( object[ i++ ], args ) === false ) {
 572						break;
 573					}
 574				}
 575			}
 576
 577		// A special, fast, case for the most common use of each
 578		} else {
 579			if ( isObj ) {
 580				for ( name in object ) {
 581					if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
 582						break;
 583					}
 584				}
 585			} else {
 586				for ( var value = object[0];
 587					i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
 588			}
 589		}
 590
 591		return object;
 592	},
 593
 594	trim: function( text ) {
 595		return (text || "").replace( rtrim, "" );
 596	},
 597
 598	// results is for internal usage only
 599	makeArray: function( array, results ) {
 600		var ret = results || [];
 601
 602		if ( array != null ) {
 603			// The window, strings (and functions) also have 'length'
 604			// The extra typeof function check is to prevent crashes
 605			// in Safari 2 (See: #3039)
 606			if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
 607				push.call( ret, array );
 608			} else {
 609				jQuery.merge( ret, array );
 610			}
 611		}
 612
 613		return ret;
 614	},
 615
 616	inArray: function( elem, array ) {
 617		if ( array.indexOf ) {
 618			return array.indexOf( elem );
 619		}
 620
 621		for ( var i = 0, length = array.length; i < length; i++ ) {
 622			if ( array[ i ] === elem ) {
 623				return i;
 624			}
 625		}
 626
 627		return -1;
 628	},
 629
 630	merge: function( first, second ) {
 631		var i = first.length, j = 0;
 632
 633		if ( typeof second.length === "number" ) {
 634			for ( var l = second.length; j < l; j++ ) {
 635				first[ i++ ] = second[ j ];
 636			}
 637		} else {
 638			while ( second[j] !== undefined ) {
 639				first[ i++ ] = second[ j++ ];
 640			}
 641		}
 642
 643		first.length = i;
 644
 645		return first;
 646	},
 647
 648	grep: function( elems, callback, inv ) {
 649		var ret = [];
 650
 651		// Go through the array, only saving the items
 652		// that pass the validator function
 653		for ( var i = 0, length = elems.length; i < length; i++ ) {
 654			if ( !inv !== !callback( elems[ i ], i ) ) {
 655				ret.push( elems[ i ] );
 656			}
 657		}
 658
 659		return ret;
 660	},
 661
 662	// arg is for internal usage only
 663	map: function( elems, callback, arg ) {
 664		var ret = [], value;
 665
 666		// Go through the array, translating each of the items to their
 667		// new value (or values).
 668		for ( var i = 0, length = elems.length; i < length; i++ ) {
 669			value = callback( elems[ i ], i, arg );
 670
 671			if ( value != null ) {
 672				ret[ ret.length ] = value;
 673			}
 674		}
 675
 676		return ret.concat.apply( [], ret );
 677	},
 678
 679	// A global GUID counter for objects
 680	guid: 1,
 681
 682	proxy: function( fn, proxy, thisObject ) {
 683		if ( arguments.length === 2 ) {
 684			if ( typeof proxy === "string" ) {
 685				thisObject = fn;
 686				fn = thisObject[ proxy ];
 687				proxy = undefined;
 688
 689			} else if ( proxy && !jQuery.isFunction( proxy ) ) {
 690				thisObject = proxy;
 691				proxy = undefined;
 692			}
 693		}
 694
 695		if ( !proxy && fn ) {
 696			proxy = function() {
 697				return fn.apply( thisObject || this, arguments );
 698			};
 699		}
 700
 701		// Set the guid of unique handler to the same of original handler, so it can be removed
 702		if ( fn ) {
 703			proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
 704		}
 705
 706		// So proxy can be declared as an argument
 707		return proxy;
 708	},
 709
 710	// Use of jQuery.browser is frowned upon.
 711	// More details: http://docs.jquery.com/Utilities/jQuery.browser
 712	uaMatch: function( ua ) {
 713		ua = ua.toLowerCase();
 714
 715		var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
 716			/(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) ||
 717			/(msie) ([\w.]+)/.exec( ua ) ||
 718			!/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) ||
 719		  	[];
 720
 721		return { browser: match[1] || "", version: match[2] || "0" };
 722	},
 723
 724	browser: {}
 725});
 726
 727browserMatch = jQuery.uaMatch( userAgent );
 728if ( browserMatch.browser ) {
 729	jQuery.browser[ browserMatch.browser ] = true;
 730	jQuery.browser.version = browserMatch.version;
 731}
 732
 733// Deprecated, use jQuery.browser.webkit instead
 734if ( jQuery.browser.webkit ) {
 735	jQuery.browser.safari = true;
 736}
 737
 738if ( indexOf ) {
 739	jQuery.inArray = function( elem, array ) {
 740		return indexOf.call( array, elem );
 741	};
 742}
 743
 744// All jQuery objects should point back to these
 745rootjQuery = jQuery(document);
 746
 747// Cleanup functions for the document ready method
 748if ( document.addEventListener ) {
 749	DOMContentLoaded = function() {
 750		document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
 751		jQuery.ready();
 752	};
 753
 754} else if ( document.attachEvent ) {
 755	DOMContentLoaded = function() {
 756		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
 757		if ( document.readyState === "complete" ) {
 758			document.detachEvent( "onreadystatechange", DOMContentLoaded );
 759			jQuery.ready();
 760		}
 761	};
 762}
 763
 764// The DOM ready check for Internet Explorer
 765function doScrollCheck() {
 766	if ( jQuery.isReady ) {
 767		return;
 768	}
 769
 770	try {
 771		// If IE is used, use the trick by Diego Perini
 772		// http://javascript.nwbox.com/IEContentLoaded/
 773		document.documentElement.doScroll("left");
 774	} catch( error ) {
 775		setTimeout( doScrollCheck, 1 );
 776		return;
 777	}
 778
 779	// and execute any waiting functions
 780	jQuery.ready();
 781}
 782
 783function evalScript( i, elem ) {
 784	if ( elem.src ) {
 785		jQuery.ajax({
 786			url: elem.src,
 787			async: false,
 788			dataType: "script"
 789		});
 790	} else {
 791		jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
 792	}
 793
 794	if ( elem.parentNode ) {
 795		elem.parentNode.removeChild( elem );
 796	}
 797}
 798
 799// Mutifunctional method to get and set values to a collection
 800// The value/s can be optionally by executed if its a function
 801function access( elems, key, value, exec, fn, pass ) {
 802	var length = elems.length;
 803	
 804	// Setting many attributes
 805	if ( typeof key === "object" ) {
 806		for ( var k in key ) {
 807			access( elems, k, key[k], exec, fn, value );
 808		}
 809		return elems;
 810	}
 811	
 812	// Setting one attribute
 813	if ( value !== undefined ) {
 814		// Optionally, function values get executed if exec is true
 815		exec = !pass && exec && jQuery.isFunction(value);
 816		
 817		for ( var i = 0; i < length; i++ ) {
 818			fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
 819		}
 820		
 821		return elems;
 822	}
 823	
 824	// Getting an attribute
 825	return length ? fn( elems[0], key ) : null;
 826}
 827
 828function now() {
 829	return (new Date).getTime();
 830}
 831(function() {
 832
 833	jQuery.support = {};
 834
 835	var root = document.documentElement,
 836		script = document.createElement("script"),
 837		div = document.createElement("div"),
 838		id = "script" + now();
 839
 840	div.style.display = "none";
 841	div.innerHTML = "   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
 842
 843	var all = div.getElementsByTagName("*"),
 844		a = div.getElementsByTagName("a")[0];
 845
 846	// Can't get basic test support
 847	if ( !all || !all.length || !a ) {
 848		return;
 849	}
 850
 851	jQuery.support = {
 852		// IE strips leading whitespace when .innerHTML is used
 853		leadingWhitespace: div.firstChild.nodeType === 3,
 854
 855		// Make sure that tbody elements aren't automatically inserted
 856		// IE will insert them into empty tables
 857		tbody: !div.getElementsByTagName("tbody").length,
 858
 859		// Make sure that link elements get serialized correctly by innerHTML
 860		// This requires a wrapper element in IE
 861		htmlSerialize: !!div.getElementsByTagName("link").length,
 862
 863		// Get the style information from getAttribute
 864		// (IE uses .cssText insted)
 865		style: /red/.test( a.getAttribute("style") ),
 866
 867		// Make sure that URLs aren't manipulated
 868		// (IE normalizes it by default)
 869		hrefNormalized: a.getAttribute("href") === "/a",
 870
 871		// Make sure that element opacity exists
 872		// (IE uses filter instead)
 873		// Use a regex to work around a WebKit issue. See #5145
 874		opacity: /^0.55$/.test( a.style.opacity ),
 875
 876		// Verify style float existence
 877		// (IE uses styleFloat instead of cssFloat)
 878		cssFloat: !!a.style.cssFloat,
 879
 880		// Make sure that if no value is specified for a checkbox
 881		// that it defaults to "on".
 882		// (WebKit defaults to "" instead)
 883		checkOn: div.getElementsByTagName("input")[0].value === "on",
 884
 885		// Make sure that a selected-by-default option has a working selected property.
 886		// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
 887		optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
 888
 889		// Will be defined later
 890		checkClone: false,
 891		scriptEval: false,
 892		noCloneEvent: true,
 893		boxModel: null
 894	};
 895
 896	script.type = "text/javascript";
 897	try {
 898		script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
 899	} catch(e) {}
 900
 901	root.insertBefore( script, root.firstChild );
 902
 903	// Make sure that the execution of code works by injecting a script
 904	// tag with appendChild/createTextNode
 905	// (IE doesn't support this, fails, and uses .text instead)
 906	if ( window[ id ] ) {
 907		jQuery.support.scriptEval = true;
 908		delete window[ id ];
 909	}
 910
 911	root.removeChild( script );
 912
 913	if ( div.attachEvent && div.fireEvent ) {
 914		div.attachEvent("onclick", function click() {
 915			// Cloning a node shouldn't copy over any
 916			// bound event handlers (IE does this)
 917			jQuery.support.noCloneEvent = false;
 918			div.detachEvent("onclick", click);
 919		});
 920		div.cloneNode(true).fireEvent("onclick");
 921	}
 922
 923	div = document.createElement("div");
 924	div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
 925
 926	var fragment = document.createDocumentFragment();
 927	fragment.appendChild( div.firstChild );
 928
 929	// WebKit doesn't clone checked state correctly in fragments
 930	jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
 931
 932	// Figure out if the W3C box model works as expected
 933	// document.body must exist before we can do this
 934	jQuery(function() {
 935		var div = document.createElement("div");
 936		div.style.width = div.style.paddingLeft = "1px";
 937
 938		document.body.appendChild( div );
 939		jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
 940		document.body.removeChild( div ).style.display = 'none';
 941		div = null;
 942	});
 943
 944	// Technique from Juriy Zaytsev
 945	// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
 946	var eventSupported = function( eventName ) { 
 947		var el = document.createElement("div"); 
 948		eventName = "on" + eventName; 
 949
 950		var isSupported = (eventName in el); 
 951		if ( !isSupported ) { 
 952			el.setAttribute(eventName, "return;"); 
 953			isSupported = typeof el[eventName] === "function"; 
 954		} 
 955		el = null; 
 956
 957		return isSupported; 
 958	};
 959	
 960	jQuery.support.submitBubbles = eventSupported("submit");
 961	jQuery.support.changeBubbles = eventSupported("change");
 962
 963	// release memory in IE
 964	root = script = div = all = a = null;
 965})();
 966
 967jQuery.props = {
 968	"for": "htmlFor",
 969	"class": "className",
 970	readonly: "readOnly",
 971	maxlength: "maxLength",
 972	cellspacing: "cellSpacing",
 973	rowspan: "rowSpan",
 974	colspan: "colSpan",
 975	tabindex: "tabIndex",
 976	usemap: "useMap",
 977	frameborder: "frameBorder"
 978};
 979var expando = "jQuery" + now(), uuid = 0, windowData = {};
 980var emptyObject = {};
 981
 982jQuery.extend({
 983	cache: {},
 984	
 985	expando:expando,
 986
 987	// The following elements throw uncatchable exceptions if you
 988	// attempt to add expando properties to them.
 989	noData: {
 990		"embed": true,
 991		"object": true,
 992		"applet": true
 993	},
 994
 995	data: function( elem, name, data ) {
 996		if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
 997			return;
 998		}
 999
1000		elem = elem == window ?
1001			windowData :
1002			elem;
1003
1004		var id = elem[ expando ], cache = jQuery.cache, thisCache;
1005
1006		// Handle the case where there's no name immediately
1007		if ( !name && !id ) {
1008			return null;
1009		}
1010
1011		// Compute a unique ID for the element
1012		if ( !id ) { 
1013			id = ++uuid;
1014		}
1015
1016		// Avoid generating a new cache unless none exists and we
1017		// want to manipulate it.
1018		if ( typeof name === "object" ) {
1019			elem[ expando ] = id;
1020			thisCache = cache[ id ] = jQuery.extend(true, {}, name);
1021		} else if ( cache[ id ] ) {
1022			thisCache = cache[ id ];
1023		} else if ( typeof data === "undefined" ) {
1024			thisCache = emptyObject;
1025		} else {
1026			thisCache = cache[ id ] = {};
1027		}
1028
1029		// Prevent overriding the named cache with undefined values
1030		if ( data !== undefined ) {
1031			elem[ expando ] = id;
1032			thisCache[ name ] = data;
1033		}
1034
1035		return typeof name === "string" ? thisCache[ name ] : thisCache;
1036	},
1037
1038	removeData: function( elem, name ) {
1039		if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
1040			return;
1041		}
1042
1043		elem = elem == window ?
1044			windowData :
1045			elem;
1046
1047		var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
1048
1049		// If we want to remove a specific section of the element's data
1050		if ( name ) {
1051			if ( thisCache ) {
1052				// Remove the section of cache data
1053				delete thisCache[ name ];
1054
1055				// If we've removed all the data, remove the element's cache
1056				if ( jQuery.isEmptyObject(thisCache) ) {
1057					jQuery.removeData( elem );
1058				}
1059			}
1060
1061		// Otherwise, we want to remove all of the element's data
1062		} else {
1063			// Clean up the element expando
1064			try {
1065				delete elem[ expando ];
1066			} catch( e ) {
1067				// IE has trouble directly removing the expando
1068				// but it's ok with using removeAttribute
1069				if ( elem.removeAttribute ) {
1070					elem.removeAttribute( expando );
1071				}
1072			}
1073
1074			// Completely remove the data cache
1075			delete cache[ id ];
1076		}
1077	}
1078});
1079
1080jQuery.fn.extend({
1081	data: function( key, value ) {
1082		if ( typeof key === "undefined" && this.length ) {
1083			return jQuery.data( this[0] );
1084
1085		} else if ( typeof key === "object" ) {
1086			return this.each(function() {
1087				jQuery.data( this, key );
1088			});
1089		}
1090
1091		var parts = key.split(".");
1092		parts[1] = parts[1] ? "." + parts[1] : "";
1093
1094		if ( value === undefined ) {
1095			var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
1096
1097			if ( data === undefined && this.length ) {
1098				data = jQuery.data( this[0], key );
1099			}
1100			return data === undefined && parts[1] ?
1101				this.data( parts[0] ) :
1102				data;
1103		} else {
1104			return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
1105				jQuery.data( this, key, value );
1106			});
1107		}
1108	},
1109
1110	removeData: function( key ) {
1111		return this.each(function() {
1112			jQuery.removeData( this, key );
1113		});
1114	}
1115});
1116jQuery.extend({
1117	queue: function( elem, type, data ) {
1118		if ( !elem ) {
1119			return;
1120		}
1121
1122		type = (type || "fx") + "queue";
1123		var q = jQuery.data( elem, type );
1124
1125		// Speed up dequeue by getting out quickly if this is just a lookup
1126		if ( !data ) {
1127			return q || [];
1128		}
1129
1130		if ( !q || jQuery.isArray(data) ) {
1131			q = jQuery.data( elem, type, jQuery.makeArray(data) );
1132
1133		} else {
1134			q.push( data );
1135		}
1136
1137		return q;
1138	},
1139
1140	dequeue: function( elem, type ) {
1141		type = type || "fx";
1142
1143		var queue = jQuery.queue( elem, type ), fn = queue.shift();
1144
1145		// If the fx queue is dequeued, always remove the progress sentinel
1146		if ( fn === "inprogress" ) {
1147			fn = queue.shift();
1148		}
1149
1150		if ( fn ) {
1151			// Add a progress sentinel to prevent the fx queue from being
1152			// automatically dequeued
1153			if ( type === "fx" ) {
1154				queue.unshift("inprogress");
1155			}
1156
1157			fn.call(elem, function() {
1158				jQuery.dequeue(elem, type);
1159			});
1160		}
1161	}
1162});
1163
1164jQuery.fn.extend({
1165	queue: function( type, data ) {
1166		if ( typeof type !== "string" ) {
1167			data = type;
1168			type = "fx";
1169		}
1170
1171		if ( data === undefined ) {
1172			return jQuery.queue( this[0], type );
1173		}
1174		return this.each(function( i, elem ) {
1175			var queue = jQuery.queue( this, type, data );
1176
1177			if ( type === "fx" && queue[0] !== "inprogress" ) {
1178				jQuery.dequeue( this, type );
1179			}
1180		});
1181	},
1182	dequeue: function( type ) {
1183		return this.each(function() {
1184			jQuery.dequeue( this, type );
1185		});
1186	},
1187
1188	// Based off of the plugin by Clint Helfers, with permission.
1189	// http://blindsignals.com/index.php/2009/07/jquery-delay/
1190	delay: function( time, type ) {
1191		time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
1192		type = type || "fx";
1193
1194		return this.queue( type, function() {
1195			var elem = this;
1196			setTimeout(function() {
1197				jQuery.dequeue( elem, type );
1198			}, time );
1199		});
1200	},
1201
1202	clearQueue: function( type ) {
1203		return this.queue( type || "fx", [] );
1204	}
1205});
1206var rclass = /[\n\t]/g,
1207	rspace = /\s+/,
1208	rreturn = /\r/g,
1209	rspecialurl = /href|src|style/,
1210	rtype = /(button|input)/i,
1211	rfocusable = /(button|input|object|select|textarea)/i,
1212	rclickable = /^(a|area)$/i,
1213	rradiocheck = /radio|checkbox/;
1214
1215jQuery.fn.extend({
1216	attr: function( name, value ) {
1217		return access( this, name, value, true, jQuery.attr );
1218	},
1219
1220	removeAttr: function( name, fn ) {
1221		return this.each(function(){
1222			jQuery.attr( this, name, "" );
1223			if ( this.nodeType === 1 ) {
1224				this.removeAttribute( name );
1225			}
1226		});
1227	},
1228
1229	addClass: function( value ) {
1230		if ( jQuery.isFunction(value) ) {
1231			return this.each(function(i) {
1232				var self = jQuery(this);
1233				self.addClass( value.call(this, i, self.attr("class")) );
1234			});
1235		}
1236
1237		if ( value && typeof value === "string" ) {
1238			var classNames = (value || "").split( rspace );
1239
1240			for ( var i = 0, l = this.length; i < l; i++ ) {
1241				var elem = this[i];
1242
1243				if ( elem.nodeType === 1 ) {
1244					if ( !elem.className ) {
1245						elem.className = value;
1246
1247					} else {
1248						var className = " " + elem.className + " ";
1249						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
1250							if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
1251								elem.className += " " + classNames[c];
1252							}
1253						}
1254					}
1255				}
1256			}
1257		}
1258
1259		return this;
1260	},
1261
1262	removeClass: function( value ) {
1263		if ( jQuery.isFunction(value) ) {
1264			return this.each(function(i) {
1265				var self = jQuery(this);
1266				self.removeClass( value.call(this, i, self.attr("class")) );
1267			});
1268		}
1269
1270		if ( (value && typeof value === "string") || value === undefined ) {
1271			var classNames = (value || "").split(rspace);
1272
1273			for ( var i = 0, l = this.length; i < l; i++ ) {
1274				var elem = this[i];
1275
1276				if ( elem.nodeType === 1 && elem.className ) {
1277					if ( value ) {
1278						var className = (" " + elem.className + " ").replace(rclass, " ");
1279						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
1280							className = className.replace(" " + classNames[c] + " ", " ");
1281						}
1282						elem.className = className.substring(1, className.length - 1);
1283
1284					} else {
1285						elem.className = "";
1286					}
1287				}
1288			}
1289		}
1290
1291		return this;
1292	},
1293
1294	toggleClass: function( value, stateVal ) {
1295		var type = typeof value, isBool = typeof stateVal === "boolean";
1296
1297		if ( jQuery.isFunction( value ) ) {
1298			return this.each(function(i) {
1299				var self = jQuery(this);
1300				self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
1301			});
1302		}
1303
1304		return this.each(function() {
1305			if ( type === "string" ) {
1306				// toggle individual class names
1307				var className, i = 0, self = jQuery(this),
1308					state = stateVal,
1309					classNames = value.split( rspace );
1310
1311				while ( (className = classNames[ i++ ]) ) {
1312					// check each className given, space seperated list
1313					state = isBool ? state : !self.hasClass( className );
1314					self[ state ? "addClass" : "removeClass" ]( className );
1315				}
1316
1317			} else if ( type === "undefined" || type === "boolean" ) {
1318				if ( this.className ) {
1319					// store className if set
1320					jQuery.data( this, "__className__", this.className );
1321				}
1322
1323				// toggle whole className
1324				this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
1325			}
1326		});
1327	},
1328
1329	hasClass: function( selector ) {
1330		var className = " " + selector + " ";
1331		for ( var i = 0, l = this.length; i < l; i++ ) {
1332			if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
1333				return true;
1334			}
1335		}
1336
1337		return false;
1338	},
1339
1340	val: function( value ) {
1341		if ( value === undefined ) {
1342			var elem = this[0];
1343
1344			if ( elem ) {
1345				if ( jQuery.nodeName( elem, "option" ) ) {
1346					return (elem.attributes.value || {}).specified ? elem.value : elem.text;
1347				}
1348
1349				// We need to handle select boxes special
1350				if ( jQuery.nodeName( elem, "select" ) ) {
1351					var index = elem.selectedIndex,
1352						values = [],
1353						options = elem.options,
1354						one = elem.type === "select-one";
1355
1356					// Nothing was selected
1357					if ( index < 0 ) {
1358						return null;
1359					}
1360
1361					// Loop through all the selected options
1362					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
1363						var option = options[ i ];
1364
1365						if ( option.selected ) {
1366							// Get the specifc value for the option
1367							value = jQuery(option).val();
1368
1369							// We don't need an array for one selects
1370							if ( one ) {
1371								return value;
1372							}
1373
1374							// Multi-Selects return an array
1375							values.push( value );
1376						}
1377					}
1378
1379					return values;
1380				}
1381
1382				// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
1383				if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
1384					return elem.getAttribute("value") === null ? "on" : elem.value;
1385				}
1386				
1387
1388				// Everything else, we just grab the value
1389				return (elem.value || "").replace(rreturn, "");
1390
1391			}
1392
1393			return undefined;
1394		}
1395
1396		var isFunction = jQuery.isFunction(value);
1397
1398		return this.each(function(i) {
1399			var self = jQuery(this), val = value;
1400
1401			if ( this.nodeType !== 1 ) {
1402				return;
1403			}
1404
1405			if ( isFunction ) {
1406				val = value.call(this, i, self.val());
1407			}
1408
1409			// Typecast each time if the value is a Function and the appended
1410			// value is therefore different each time.
1411			if ( typeof val === "number" ) {
1412				val += "";
1413			}
1414
1415			if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
1416				this.checked = jQuery.inArray( self.val(), val ) >= 0;
1417
1418			} else if ( jQuery.nodeName( this, "select" ) ) {
1419				var values = jQuery.makeArray(val);
1420
1421				jQuery( "option", this ).each(function() {
1422					this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
1423				});
1424
1425				if ( !values.length ) {
1426					this.selectedIndex = -1;
1427				}
1428
1429			} else {
1430				this.value = val;
1431			}
1432		});
1433	}
1434});
1435
1436jQuery.extend({
1437	attrFn: {
1438		val: true,
1439		css: true,
1440		html: true,
1441		text: true,
1442		data: true,
1443		width: true,
1444		height: true,
1445		offset: true
1446	},
1447		
1448	attr: function( elem, name, value, pass ) {
1449		// don't set attributes on text and comment nodes
1450		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
1451			return undefined;
1452		}
1453
1454		if ( pass && name in jQuery.attrFn ) {
1455			return jQuery(elem)[name](value);
1456		}
1457
1458		var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
1459			// Whether we are setting (or getting)
1460			set = value !== undefined;
1461
1462		// Try to normalize/fix the name
1463		name = notxml && jQuery.props[ name ] || name;
1464
1465		// Only do all the following if this is a node (faster for style)
1466		if ( elem.nodeType === 1 ) {
1467			// These attributes require special treatment
1468			var special = rspecialurl.test( name );
1469
1470			// Safari mis-reports the default selected property of an option
1471			// Accessing the parent's selectedIndex property fixes it
1472			if ( name === "selected" && !jQuery.support.optSelected ) {
1473				var parent = elem.parentNode;
1474				if ( parent ) {
1475					parent.selectedIndex;
1476	
1477					// Make sure that it also works with optgroups, see #5701
1478					if ( parent.parentNode ) {
1479						parent.parentNode.selectedIndex;
1480					}
1481				}
1482			}
1483
1484			// If applicable, access the attribute via the DOM 0 way
1485			if ( name in elem && notxml && !special ) {
1486				if ( set ) {
1487					// We can't allow the type property to be changed (since it causes problems in IE)
1488					if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
1489						jQuery.error( "type property can't be changed" );
1490					}
1491
1492					elem[ name ] = value;
1493				}
1494
1495				// browsers index elements by id/name on forms, give priority to attributes.
1496				if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
1497					return elem.getAttributeNode( name ).nodeValue;
1498				}
1499
1500				// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
1501				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
1502				if ( name === "tabIndex" ) {
1503					var attributeNode = elem.getAttributeNode( "tabIndex" );
1504
1505					return attributeNode && attributeNode.specified ?
1506						attributeNode.value :
1507						rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
1508							0 :
1509							undefined;
1510				}
1511
1512				return elem[ name ];
1513			}
1514
1515			if ( !jQuery.support.style && notxml && name === "style" ) {
1516				if ( set ) {
1517					elem.style.cssText = "" + value;
1518				}
1519
1520				return elem.style.cssText;
1521			}
1522
1523			if ( set ) {
1524				// convert the value to a string (all browsers do this but IE) see #1070
1525				elem.setAttribute( name, "" + value );
1526			}
1527
1528			var attr = !jQuery.support.hrefNormalized && notxml && special ?
1529					// Some attributes require a special call on IE
1530					elem.getAttribute( name, 2 ) :
1531					elem.getAttribute( name );
1532
1533			// Non-existent attributes return null, we normalize to undefined
1534			return attr === null ? undefined : attr;
1535		}
1536
1537		// elem is actually elem.style ... set the style
1538		// Using attr for specific style information is now deprecated. Use style insead.
1539		return jQuery.style( elem, name, value );
1540	}
1541});
1542var fcleanup = function( nm ) {
1543	return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
1544		return "\\" + ch;
1545	});
1546};
1547
1548/*
1549 * A number of helper functions used for managing events.
1550 * Many of the ideas behind this code originated from
1551 * Dean Edwards' addEvent library.
1552 */
1553jQuery.event = {
1554
1555	// Bind an event to an element
1556	// Original by Dean Edwards
1557	add: function( elem, types, handler, data ) {
1558		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
1559			return;
1560		}
1561
1562		// For whatever reason, IE has trouble passing the window object
1563		// around, causing it to be cloned in the process
1564		if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
1565			elem = window;
1566		}
1567
1568		// Make sure that the function being executed has a unique ID
1569		if ( !handler.guid ) {
1570			handler.guid = jQuery.guid++;
1571		}
1572
1573		// if data is passed, bind to handler
1574		if ( data !== undefined ) {
1575			// Create temporary function pointer to original handler
1576			var fn = handler;
1577
1578			// Create unique handler function, wrapped around original handler
1579			handler = jQuery.proxy( fn );
1580
1581			// Store data in unique handler
1582			handler.data = data;
1583		}
1584
1585		// Init the element's event structure
1586		var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ),
1587			handle = jQuery.data( elem, "handle" ), eventHandle;
1588
1589		if ( !handle ) {
1590			eventHandle = function() {
1591				// Handle the second event of a trigger and when
1592				// an event is called after a page has unloaded
1593				return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
1594					jQuery.event.handle.apply( eventHandle.elem, arguments ) :
1595					undefined;
1596			};
1597
1598			handle = jQuery.data( elem, "handle", eventHandle );
1599		}
1600
1601		// If no handle is found then we must be trying to bind to one of the
1602		// banned noData elements
1603		if ( !handle ) {
1604			return;
1605		}
1606
1607		// Add elem as a property of the handle function
1608		// This is to prevent a memory leak with non-native
1609		// event in IE.
1610		handle.elem = elem;
1611
1612		// Handle multiple events separated by a space
1613		// jQuery(...).bind("mouseover mouseout", fn);
1614		types = types.split( /\s+/ );
1615
1616		var type, i = 0;
1617
1618		while ( (type = types[ i++ ]) ) {
1619			// Namespaced event handlers
1620			var namespaces = type.split(".");
1621			type = namespaces.shift();
1622
1623			if ( i > 1 ) {
1624				handler = jQuery.proxy( handler );
1625
1626				if ( data !== undefined ) {
1627					handler.data = data;
1628				}
1629			}
1630
1631			handler.type = namespaces.slice(0).sort().join(".");
1632
1633			// Get the current list of functions bound to this event
1634			var handlers = events[ type ],
1635				special = this.special[ type ] || {};
1636
1637			// Init the event handler queue
1638			if ( !handlers ) {
1639				handlers = events[ type ] = {};
1640
1641				// Check for a special event handler
1642				// Only use addEventListener/attachEvent if the special
1643				// events handler returns false
1644				if ( !special.setup || special.setup.call( elem, data, namespaces, handler) === false ) {
1645					// Bind the global event handler to the element
1646					if ( elem.addEventListener ) {
1647						elem.addEventListener( type, handle, false );
1648					} else if ( elem.attachEvent ) {
1649						elem.attachEvent( "on" + type, handle );
1650					}
1651				}
1652			}
1653			
1654			if ( special.add ) { 
1655				var modifiedHandler = special.add.call( elem, handler, data, namespaces, handlers ); 
1656				if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) { 
1657					modifiedHandler.guid = modifiedHandler.guid || handler.guid; 
1658					modifiedHandler.data = modifiedHandler.data || handler.data; 
1659					modifiedHandler.type = modifiedHandler.type || handler.type; 
1660					handler = modifiedHandler; 
1661				} 
1662			} 
1663			
1664			// Add the function to the element's handler list
1665			handlers[ handler.guid ] = handler;
1666
1667			// Keep track of which events have been used, for global triggering
1668			this.global[ type ] = true;
1669		}
1670
1671		// Nullify elem to prevent memory leaks in IE
1672		elem = null;
1673	},
1674
1675	global: {},
1676
1677	// Detach an event or set of events from an element
1678	remove: function( elem, types, handler ) {
1679		// don't do events on text and comment nodes
1680		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
1681			return;
1682		}
1683
1684		var events = jQuery.data( elem, "events" ), ret, type, fn;
1685
1686		if ( events ) {
1687			// Unbind all events for the element
1688			if ( types === undefined || (typeof types === "string" && types.charAt(0) === ".") ) {
1689				for ( type in events ) {
1690					this.remove( elem, type + (types || "") );
1691				}
1692			} else {
1693				// types is actually an event object here
1694				if ( types.type ) {
1695					handler = types.handler;
1696					types = types.type;
1697				}
1698
1699				// Handle multiple events separated by a space
1700				// jQuery(...).unbind("mouseover mouseout", fn);
1701				types = types.split(/\s+/);
1702				var i = 0;
1703				while ( (type = types[ i++ ]) ) {
1704					// Namespaced event handlers
1705					var namespaces = type.split(".");
1706					type = namespaces.shift();
1707					var all = !namespaces.length,
1708						cleaned = jQuery.map( namespaces.slice(0).sort(), fcleanup ),
1709						namespace = new RegExp("(^|\\.)" + cleaned.join("\\.(?:.*\\.)?") + "(\\.|$)"),
1710						special = this.special[ type ] || {};
1711
1712					if ( events[ type ] ) {
1713						// remove the given handler for the given type
1714						if ( handler ) {
1715							fn = events[ type ][ handler.guid ];
1716							delete events[ type ][ handler.guid ];
1717
1718						// remove all handlers for the given type
1719						} else {
1720							for ( var handle in events[ type ] ) {
1721								// Handle the removal of namespaced events
1722								if ( all || namespace.test( events[ type ][ handle ].type ) ) {
1723									delete events[ type ][ handle ];
1724								}
1725							}
1726						}
1727
1728						if ( special.remove ) {
1729							special.remove.call( elem, namespaces, fn);
1730						}
1731
1732						// remove generic event handler if no more handlers exist
1733						for ( ret in events[ type ] ) {
1734							break;
1735						}
1736						if ( !ret ) {
1737							if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
1738								if ( elem.removeEventListener ) {
1739									elem.removeEventListener( type, jQuery.data( elem, "handle" ), false );
1740								} else if ( elem.detachEvent ) {
1741									elem.detachEvent( "on" + type, jQuery.data( elem, "handle" ) );
1742								}
1743							}
1744							ret = null;
1745							delete events[ type ];
1746						}
1747					}
1748				}
1749			}
1750
1751			// Remove the expando if it's no longer used
1752			for ( ret in events ) {
1753				break;
1754			}
1755			if ( !ret ) {
1756				var handle = jQuery.data( elem, "handle" );
1757				if ( handle ) {
1758					handle.elem = null;
1759				}
1760				jQuery.removeData( elem, "events" );
1761				jQuery.removeData( elem, "handle" );
1762			}
1763		}
1764	},
1765
1766	// bubbling is internal
1767	trigger: function( event, data, elem /*, bubbling */ ) {
1768		// Event object or event type
1769		var type = event.type || event,
1770			bubbling = arguments[3];
1771
1772		if ( !bubbling ) {
1773			event = typeof event === "object" ?
1774				// jQuery.Event object
1775				event[expando] ? event :
1776				// Object literal
1777				jQuery.extend( jQuery.Event(type), event ) :
1778				// Just the event type (string)
1779				jQuery.Event(type);
1780
1781			if ( type.indexOf("!") >= 0 ) {
1782				event.type = type = type.slice(0, -1);
1783				event.exclusive = true;
1784			}
1785
1786			// Handle a global trigger
1787			if ( !elem ) {
1788				// Don't bubble custom events when global (to avoid too much overhead)
1789				event.stopPropagation();
1790
1791				// Only trigger if we've ever bound an event for it
1792				if ( this.global[ type ] ) {
1793					jQuery.each( jQuery.cache, function() {
1794						if ( this.events && this.events[type] ) {
1795							jQuery.event.trigger( event, data, this.handle.elem );
1796						}
1797					});
1798				}
1799			}
1800
1801			// Handle triggering a single element
1802
1803			// don't do events on text and comment nodes
1804			if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
1805				return undefined;
1806			}
1807
1808			// Clean up in case it is reused
1809			event.result = undefined;
1810			event.target = elem;
1811
1812			// Clone the incoming data, if any
1813			data = jQuery.makeArray( data );
1814			data.unshift( event );
1815		}
1816
1817		event.currentTarget = elem;
1818
1819		// Trigger the event, it is assumed that "handle" is a function
1820		var handle = jQuery.data( elem, "handle" );
1821		if ( h

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