web/static/ldt/js/jquery.js
author cavaliet
Wed, 20 Apr 2011 18:45:21 +0200
changeset 66 8a7530e28185
parent 24 57a2650a7f87
child 99 483a30ff6e15
permissions -rw-r--r--
Add token authentification to un/publish request. Update jquery.min.js and twitter auth keys.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
     1
/*!
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
     2
 * jQuery JavaScript Library v1.5
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
 * http://jquery.com/
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
24
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
     5
 * Copyright 2011, John Resig
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
     6
 * Dual licensed under the MIT or GPL Version 2 licenses.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
     7
 * http://jquery.org/license
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
     8
 *
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
     9
 * Includes Sizzle.js
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    10
 * http://sizzlejs.com/
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    11
 * Copyright 2011, The Dojo Foundation
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    12
 * Released under the MIT, BSD, and GPL Licenses.
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
 *
24
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    14
 * Date: Mon Jan 31 08:31:29 2011 -0500
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
 */
24
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    16
(function( window, undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    17
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    18
// Use the correct document accordingly with window argument (sandbox)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    19
var document = window.document;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    20
var jQuery = (function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    21
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    22
// Define a local copy of jQuery
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    23
var jQuery = function( selector, context ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    24
		// The jQuery object is actually just the init constructor 'enhanced'
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    25
		return new jQuery.fn.init( selector, context, rootjQuery );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    26
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    27
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    28
	// Map over jQuery in case of overwrite
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    29
	_jQuery = window.jQuery,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    30
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    31
	// Map over the $ in case of overwrite
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    32
	_$ = window.$,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    33
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    34
	// A central reference to the root jQuery(document)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    35
	rootjQuery,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    36
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    37
	// A simple way to check for HTML strings or ID strings
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    38
	// (both of which we optimize for)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    39
	quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    40
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    41
	// Check if a string has a non-whitespace character in it
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    42
	rnotwhite = /\S/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    43
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    44
	// Used for trimming whitespace
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    45
	trimLeft = /^\s+/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    46
	trimRight = /\s+$/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    47
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    48
	// Check for digits
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    49
	rdigit = /\d/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    50
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    51
	// Match a standalone tag
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    52
	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    53
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    54
	// JSON RegExp
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    55
	rvalidchars = /^[\],:{}\s]*$/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    56
	rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    57
	rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    58
	rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    59
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    60
	// Useragent RegExp
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    61
	rwebkit = /(webkit)[ \/]([\w.]+)/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    62
	ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    63
	rmsie = /(msie) ([\w.]+)/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    64
	rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    65
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    66
	// Keep a UserAgent string for use with jQuery.browser
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    67
	userAgent = navigator.userAgent,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    68
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    69
	// For matching the engine and version of the browser
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    70
	browserMatch,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    71
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    72
	// Has the ready events already been bound?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    73
	readyBound = false,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    74
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    75
	// The deferred used on DOM ready
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    76
	readyList,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    77
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    78
	// Promise methods
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    79
	promiseMethods = "then done fail isResolved isRejected promise".split( " " ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    80
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    81
	// The ready event handler
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    82
	DOMContentLoaded,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    83
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    84
	// Save a reference to some core methods
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    85
	toString = Object.prototype.toString,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    86
	hasOwn = Object.prototype.hasOwnProperty,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    87
	push = Array.prototype.push,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    88
	slice = Array.prototype.slice,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    89
	trim = String.prototype.trim,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    90
	indexOf = Array.prototype.indexOf,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    91
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    92
	// [[Class]] -> type pairs
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    93
	class2type = {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    94
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    95
jQuery.fn = jQuery.prototype = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    96
	constructor: jQuery,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    97
	init: function( selector, context, rootjQuery ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    98
		var match, elem, ret, doc;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    99
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   100
		// Handle $(""), $(null), or $(undefined)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   101
		if ( !selector ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   102
			return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   103
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   104
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   105
		// Handle $(DOMElement)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   106
		if ( selector.nodeType ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   107
			this.context = this[0] = selector;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   108
			this.length = 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   109
			return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   110
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   111
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   112
		// The body element only exists once, optimize finding it
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   113
		if ( selector === "body" && !context && document.body ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   114
			this.context = document;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   115
			this[0] = document.body;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   116
			this.selector = "body";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   117
			this.length = 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   118
			return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   119
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   120
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   121
		// Handle HTML strings
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   122
		if ( typeof selector === "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   123
			// Are we dealing with HTML string or an ID?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   124
			match = quickExpr.exec( selector );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   125
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   126
			// Verify a match, and that no context was specified for #id
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   127
			if ( match && (match[1] || !context) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   128
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   129
				// HANDLE: $(html) -> $(array)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   130
				if ( match[1] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   131
					context = context instanceof jQuery ? context[0] : context;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   132
					doc = (context ? context.ownerDocument || context : document);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   133
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   134
					// If a single string is passed in and it's a single tag
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   135
					// just do a createElement and skip the rest
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   136
					ret = rsingleTag.exec( selector );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   137
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   138
					if ( ret ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   139
						if ( jQuery.isPlainObject( context ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   140
							selector = [ document.createElement( ret[1] ) ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   141
							jQuery.fn.attr.call( selector, context, true );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   142
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   143
						} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   144
							selector = [ doc.createElement( ret[1] ) ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   145
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   146
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   147
					} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   148
						ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   149
						selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   150
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   151
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   152
					return jQuery.merge( this, selector );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   153
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   154
				// HANDLE: $("#id")
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   155
				} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   156
					elem = document.getElementById( match[2] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   157
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   158
					// Check parentNode to catch when Blackberry 4.6 returns
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   159
					// nodes that are no longer in the document #6963
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   160
					if ( elem && elem.parentNode ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   161
						// Handle the case where IE and Opera return items
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   162
						// by name instead of ID
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   163
						if ( elem.id !== match[2] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   164
							return rootjQuery.find( selector );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   165
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   166
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   167
						// Otherwise, we inject the element directly into the jQuery object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   168
						this.length = 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   169
						this[0] = elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   170
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   171
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   172
					this.context = document;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   173
					this.selector = selector;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   174
					return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   175
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   176
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   177
			// HANDLE: $(expr, $(...))
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   178
			} else if ( !context || context.jquery ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   179
				return (context || rootjQuery).find( selector );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   180
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   181
			// HANDLE: $(expr, context)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   182
			// (which is just equivalent to: $(context).find(expr)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   183
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   184
				return this.constructor( context ).find( selector );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   185
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   186
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   187
		// HANDLE: $(function)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   188
		// Shortcut for document ready
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   189
		} else if ( jQuery.isFunction( selector ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   190
			return rootjQuery.ready( selector );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   191
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   192
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   193
		if (selector.selector !== undefined) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   194
			this.selector = selector.selector;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   195
			this.context = selector.context;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   196
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   197
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   198
		return jQuery.makeArray( selector, this );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   199
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   200
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   201
	// Start with an empty selector
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   202
	selector: "",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   203
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   204
	// The current version of jQuery being used
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   205
	jquery: "1.5",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   206
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   207
	// The default length of a jQuery object is 0
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   208
	length: 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   209
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   210
	// The number of elements contained in the matched element set
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   211
	size: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   212
		return this.length;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   213
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   214
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   215
	toArray: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   216
		return slice.call( this, 0 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   217
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   218
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   219
	// Get the Nth element in the matched element set OR
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   220
	// Get the whole matched element set as a clean array
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   221
	get: function( num ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   222
		return num == null ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   223
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   224
			// Return a 'clean' array
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   225
			this.toArray() :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   226
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   227
			// Return just the object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   228
			( num < 0 ? this[ this.length + num ] : this[ num ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   229
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   230
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   231
	// Take an array of elements and push it onto the stack
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   232
	// (returning the new matched element set)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   233
	pushStack: function( elems, name, selector ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   234
		// Build a new jQuery matched element set
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   235
		var ret = this.constructor();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   236
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   237
		if ( jQuery.isArray( elems ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   238
			push.apply( ret, elems );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   239
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   240
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   241
			jQuery.merge( ret, elems );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   242
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   243
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   244
		// Add the old object onto the stack (as a reference)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   245
		ret.prevObject = this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   246
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   247
		ret.context = this.context;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   248
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   249
		if ( name === "find" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   250
			ret.selector = this.selector + (this.selector ? " " : "") + selector;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   251
		} else if ( name ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   252
			ret.selector = this.selector + "." + name + "(" + selector + ")";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   253
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   254
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   255
		// Return the newly-formed element set
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   256
		return ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   257
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   258
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   259
	// Execute a callback for every element in the matched set.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   260
	// (You can seed the arguments with an array of args, but this is
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   261
	// only used internally.)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   262
	each: function( callback, args ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   263
		return jQuery.each( this, callback, args );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   264
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   265
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   266
	ready: function( fn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   267
		// Attach the listeners
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   268
		jQuery.bindReady();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   269
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   270
		// Add the callback
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   271
		readyList.done( fn );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   272
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   273
		return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   274
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   275
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   276
	eq: function( i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   277
		return i === -1 ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   278
			this.slice( i ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   279
			this.slice( i, +i + 1 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   280
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   281
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   282
	first: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   283
		return this.eq( 0 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   284
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   285
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   286
	last: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   287
		return this.eq( -1 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   288
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   289
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   290
	slice: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   291
		return this.pushStack( slice.apply( this, arguments ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   292
			"slice", slice.call(arguments).join(",") );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   293
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   294
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   295
	map: function( callback ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   296
		return this.pushStack( jQuery.map(this, function( elem, i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   297
			return callback.call( elem, i, elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   298
		}));
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   299
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   300
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   301
	end: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   302
		return this.prevObject || this.constructor(null);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   303
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   304
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   305
	// For internal use only.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   306
	// Behaves like an Array's method, not like a jQuery method.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   307
	push: push,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   308
	sort: [].sort,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   309
	splice: [].splice
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   310
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   311
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   312
// Give the init function the jQuery prototype for later instantiation
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   313
jQuery.fn.init.prototype = jQuery.fn;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   314
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   315
jQuery.extend = jQuery.fn.extend = function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   316
	 var options, name, src, copy, copyIsArray, clone,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   317
		target = arguments[0] || {},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   318
		i = 1,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   319
		length = arguments.length,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   320
		deep = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   321
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   322
	// Handle a deep copy situation
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   323
	if ( typeof target === "boolean" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   324
		deep = target;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   325
		target = arguments[1] || {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   326
		// skip the boolean and the target
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   327
		i = 2;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   328
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   329
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   330
	// Handle case when target is a string or something (possible in deep copy)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   331
	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   332
		target = {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   333
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   334
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   335
	// extend jQuery itself if only one argument is passed
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   336
	if ( length === i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   337
		target = this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   338
		--i;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   339
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   340
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   341
	for ( ; i < length; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   342
		// Only deal with non-null/undefined values
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   343
		if ( (options = arguments[ i ]) != null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   344
			// Extend the base object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   345
			for ( name in options ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   346
				src = target[ name ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   347
				copy = options[ name ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   348
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   349
				// Prevent never-ending loop
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   350
				if ( target === copy ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   351
					continue;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   352
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   353
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   354
				// Recurse if we're merging plain objects or arrays
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   355
				if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   356
					if ( copyIsArray ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   357
						copyIsArray = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   358
						clone = src && jQuery.isArray(src) ? src : [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   359
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   360
					} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   361
						clone = src && jQuery.isPlainObject(src) ? src : {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   362
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   363
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   364
					// Never move original objects, clone them
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   365
					target[ name ] = jQuery.extend( deep, clone, copy );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   366
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   367
				// Don't bring in undefined values
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   368
				} else if ( copy !== undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   369
					target[ name ] = copy;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   370
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   371
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   372
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   373
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   374
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   375
	// Return the modified object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   376
	return target;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   377
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   378
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   379
jQuery.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   380
	noConflict: function( deep ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   381
		window.$ = _$;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   382
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   383
		if ( deep ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   384
			window.jQuery = _jQuery;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   385
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   386
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   387
		return jQuery;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   388
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   389
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   390
	// Is the DOM ready to be used? Set to true once it occurs.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   391
	isReady: false,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   392
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   393
	// A counter to track how many items to wait for before
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   394
	// the ready event fires. See #6781
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   395
	readyWait: 1,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   396
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   397
	// Handle when the DOM is ready
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   398
	ready: function( wait ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   399
		// A third-party is pushing the ready event forwards
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   400
		if ( wait === true ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   401
			jQuery.readyWait--;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   402
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   403
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   404
		// Make sure that the DOM is not already loaded
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   405
		if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   406
			// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   407
			if ( !document.body ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   408
				return setTimeout( jQuery.ready, 1 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   409
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   410
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   411
			// Remember that the DOM is ready
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   412
			jQuery.isReady = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   413
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   414
			// If a normal DOM Ready event fired, decrement, and wait if need be
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   415
			if ( wait !== true && --jQuery.readyWait > 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   416
				return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   417
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   418
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   419
			// If there are functions bound, to execute
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   420
			readyList.resolveWith( document, [ jQuery ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   421
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   422
			// Trigger any bound ready events
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   423
			if ( jQuery.fn.trigger ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   424
				jQuery( document ).trigger( "ready" ).unbind( "ready" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   425
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   426
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   427
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   428
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   429
	bindReady: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   430
		if ( readyBound ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   431
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   432
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   433
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   434
		readyBound = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   435
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   436
		// Catch cases where $(document).ready() is called after the
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   437
		// browser event has already occurred.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   438
		if ( document.readyState === "complete" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   439
			// Handle it asynchronously to allow scripts the opportunity to delay ready
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   440
			return setTimeout( jQuery.ready, 1 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   441
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   442
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   443
		// Mozilla, Opera and webkit nightlies currently support this event
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   444
		if ( document.addEventListener ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   445
			// Use the handy event callback
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   446
			document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   447
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   448
			// A fallback to window.onload, that will always work
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   449
			window.addEventListener( "load", jQuery.ready, false );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   450
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   451
		// If IE event model is used
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   452
		} else if ( document.attachEvent ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   453
			// ensure firing before onload,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   454
			// maybe late but safe also for iframes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   455
			document.attachEvent("onreadystatechange", DOMContentLoaded);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   456
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   457
			// A fallback to window.onload, that will always work
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   458
			window.attachEvent( "onload", jQuery.ready );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   459
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   460
			// If IE and not a frame
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   461
			// continually check to see if the document is ready
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   462
			var toplevel = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   463
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   464
			try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   465
				toplevel = window.frameElement == null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   466
			} catch(e) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   467
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   468
			if ( document.documentElement.doScroll && toplevel ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   469
				doScrollCheck();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   470
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   471
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   472
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   473
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   474
	// See test/unit/core.js for details concerning isFunction.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   475
	// Since version 1.3, DOM methods and functions like alert
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   476
	// aren't supported. They return false on IE (#2968).
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   477
	isFunction: function( obj ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   478
		return jQuery.type(obj) === "function";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   479
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   480
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   481
	isArray: Array.isArray || function( obj ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   482
		return jQuery.type(obj) === "array";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   483
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   484
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   485
	// A crude way of determining if an object is a window
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   486
	isWindow: function( obj ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   487
		return obj && typeof obj === "object" && "setInterval" in obj;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   488
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   489
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   490
	isNaN: function( obj ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   491
		return obj == null || !rdigit.test( obj ) || isNaN( obj );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   492
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   493
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   494
	type: function( obj ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   495
		return obj == null ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   496
			String( obj ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   497
			class2type[ toString.call(obj) ] || "object";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   498
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   499
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   500
	isPlainObject: function( obj ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   501
		// Must be an Object.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   502
		// Because of IE, we also have to check the presence of the constructor property.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   503
		// Make sure that DOM nodes and window objects don't pass through, as well
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   504
		if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   505
			return false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   506
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   507
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   508
		// Not own constructor property must be Object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   509
		if ( obj.constructor &&
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   510
			!hasOwn.call(obj, "constructor") &&
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   511
			!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   512
			return false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   513
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   514
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   515
		// Own properties are enumerated firstly, so to speed up,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   516
		// if last one is own, then all properties are own.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   517
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   518
		var key;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   519
		for ( key in obj ) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   520
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   521
		return key === undefined || hasOwn.call( obj, key );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   522
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   523
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   524
	isEmptyObject: function( obj ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   525
		for ( var name in obj ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   526
			return false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   527
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   528
		return true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   529
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   530
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   531
	error: function( msg ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   532
		throw msg;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   533
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   534
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   535
	parseJSON: function( data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   536
		if ( typeof data !== "string" || !data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   537
			return null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   538
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   539
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   540
		// Make sure leading/trailing whitespace is removed (IE can't handle it)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   541
		data = jQuery.trim( data );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   542
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   543
		// Make sure the incoming data is actual JSON
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   544
		// Logic borrowed from http://json.org/json2.js
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   545
		if ( rvalidchars.test(data.replace(rvalidescape, "@")
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   546
			.replace(rvalidtokens, "]")
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   547
			.replace(rvalidbraces, "")) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   548
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   549
			// Try to use the native JSON parser first
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   550
			return window.JSON && window.JSON.parse ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   551
				window.JSON.parse( data ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   552
				(new Function("return " + data))();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   553
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   554
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   555
			jQuery.error( "Invalid JSON: " + data );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   556
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   557
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   558
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   559
	// Cross-browser xml parsing
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   560
	// (xml & tmp used internally)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   561
	parseXML: function( data , xml , tmp ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   562
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   563
		if ( window.DOMParser ) { // Standard
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   564
			tmp = new DOMParser();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   565
			xml = tmp.parseFromString( data , "text/xml" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   566
		} else { // IE
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   567
			xml = new ActiveXObject( "Microsoft.XMLDOM" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   568
			xml.async = "false";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   569
			xml.loadXML( data );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   570
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   571
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   572
		tmp = xml.documentElement;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   573
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   574
		if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   575
			jQuery.error( "Invalid XML: " + data );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   576
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   577
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   578
		return xml;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   579
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   580
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   581
	noop: function() {},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   582
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   583
	// Evalulates a script in a global context
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   584
	globalEval: function( data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   585
		if ( data && rnotwhite.test(data) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   586
			// Inspired by code by Andrea Giammarchi
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   587
			// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   588
			var head = document.getElementsByTagName("head")[0] || document.documentElement,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   589
				script = document.createElement("script");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   590
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   591
			script.type = "text/javascript";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   592
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   593
			if ( jQuery.support.scriptEval() ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   594
				script.appendChild( document.createTextNode( data ) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   595
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   596
				script.text = data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   597
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   598
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   599
			// Use insertBefore instead of appendChild to circumvent an IE6 bug.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   600
			// This arises when a base node is used (#2709).
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   601
			head.insertBefore( script, head.firstChild );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   602
			head.removeChild( script );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   603
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   604
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   605
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   606
	nodeName: function( elem, name ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   607
		return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   608
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   609
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   610
	// args is for internal usage only
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   611
	each: function( object, callback, args ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   612
		var name, i = 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   613
			length = object.length,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   614
			isObj = length === undefined || jQuery.isFunction(object);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   615
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   616
		if ( args ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   617
			if ( isObj ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   618
				for ( name in object ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   619
					if ( callback.apply( object[ name ], args ) === false ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   620
						break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   621
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   622
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   623
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   624
				for ( ; i < length; ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   625
					if ( callback.apply( object[ i++ ], args ) === false ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   626
						break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   627
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   628
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   629
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   630
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   631
		// A special, fast, case for the most common use of each
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   632
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   633
			if ( isObj ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   634
				for ( name in object ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   635
					if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   636
						break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   637
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   638
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   639
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   640
				for ( var value = object[0];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   641
					i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   642
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   643
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   644
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   645
		return object;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   646
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   647
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   648
	// Use native String.trim function wherever possible
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   649
	trim: trim ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   650
		function( text ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   651
			return text == null ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   652
				"" :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   653
				trim.call( text );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   654
		} :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   655
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   656
		// Otherwise use our own trimming functionality
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   657
		function( text ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   658
			return text == null ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   659
				"" :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   660
				text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   661
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   662
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   663
	// results is for internal usage only
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   664
	makeArray: function( array, results ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   665
		var ret = results || [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   666
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   667
		if ( array != null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   668
			// The window, strings (and functions) also have 'length'
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   669
			// The extra typeof function check is to prevent crashes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   670
			// in Safari 2 (See: #3039)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   671
			// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   672
			var type = jQuery.type(array);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   673
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   674
			if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   675
				push.call( ret, array );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   676
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   677
				jQuery.merge( ret, array );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   678
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   679
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   680
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   681
		return ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   682
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   683
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   684
	inArray: function( elem, array ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   685
		if ( array.indexOf ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   686
			return array.indexOf( elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   687
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   688
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   689
		for ( var i = 0, length = array.length; i < length; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   690
			if ( array[ i ] === elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   691
				return i;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   692
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   693
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   694
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   695
		return -1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   696
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   697
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   698
	merge: function( first, second ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   699
		var i = first.length,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   700
			j = 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   701
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   702
		if ( typeof second.length === "number" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   703
			for ( var l = second.length; j < l; j++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   704
				first[ i++ ] = second[ j ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   705
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   706
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   707
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   708
			while ( second[j] !== undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   709
				first[ i++ ] = second[ j++ ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   710
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   711
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   712
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   713
		first.length = i;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   714
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   715
		return first;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   716
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   717
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   718
	grep: function( elems, callback, inv ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   719
		var ret = [], retVal;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   720
		inv = !!inv;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   721
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   722
		// Go through the array, only saving the items
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   723
		// that pass the validator function
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   724
		for ( var i = 0, length = elems.length; i < length; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   725
			retVal = !!callback( elems[ i ], i );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   726
			if ( inv !== retVal ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   727
				ret.push( elems[ i ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   728
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   729
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   730
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   731
		return ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   732
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   733
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   734
	// arg is for internal usage only
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   735
	map: function( elems, callback, arg ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   736
		var ret = [], value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   737
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   738
		// Go through the array, translating each of the items to their
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   739
		// new value (or values).
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   740
		for ( var i = 0, length = elems.length; i < length; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   741
			value = callback( elems[ i ], i, arg );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   742
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   743
			if ( value != null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   744
				ret[ ret.length ] = value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   745
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   746
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   747
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   748
		// Flatten any nested arrays
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   749
		return ret.concat.apply( [], ret );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   750
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   751
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   752
	// A global GUID counter for objects
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   753
	guid: 1,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   754
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   755
	proxy: function( fn, proxy, thisObject ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   756
		if ( arguments.length === 2 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   757
			if ( typeof proxy === "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   758
				thisObject = fn;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   759
				fn = thisObject[ proxy ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   760
				proxy = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   761
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   762
			} else if ( proxy && !jQuery.isFunction( proxy ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   763
				thisObject = proxy;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   764
				proxy = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   765
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   766
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   767
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   768
		if ( !proxy && fn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   769
			proxy = function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   770
				return fn.apply( thisObject || this, arguments );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   771
			};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   772
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   773
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   774
		// Set the guid of unique handler to the same of original handler, so it can be removed
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   775
		if ( fn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   776
			proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   777
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   778
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   779
		// So proxy can be declared as an argument
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   780
		return proxy;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   781
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   782
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   783
	// Mutifunctional method to get and set values to a collection
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   784
	// The value/s can be optionally by executed if its a function
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   785
	access: function( elems, key, value, exec, fn, pass ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   786
		var length = elems.length;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   787
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   788
		// Setting many attributes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   789
		if ( typeof key === "object" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   790
			for ( var k in key ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   791
				jQuery.access( elems, k, key[k], exec, fn, value );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   792
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   793
			return elems;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   794
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   795
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   796
		// Setting one attribute
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   797
		if ( value !== undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   798
			// Optionally, function values get executed if exec is true
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   799
			exec = !pass && exec && jQuery.isFunction(value);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   800
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   801
			for ( var i = 0; i < length; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   802
				fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   803
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   804
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   805
			return elems;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   806
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   807
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   808
		// Getting an attribute
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   809
		return length ? fn( elems[0], key ) : undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   810
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   811
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   812
	now: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   813
		return (new Date()).getTime();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   814
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   815
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   816
	// Create a simple deferred (one callbacks list)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   817
	_Deferred: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   818
		var // callbacks list
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   819
			callbacks = [],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   820
			// stored [ context , args ]
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   821
			fired,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   822
			// to avoid firing when already doing so
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   823
			firing,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   824
			// flag to know if the deferred has been cancelled
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   825
			cancelled,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   826
			// the deferred itself
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   827
			deferred  = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   828
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   829
				// done( f1, f2, ...)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   830
				done: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   831
					if ( !cancelled ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   832
						var args = arguments,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   833
							i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   834
							length,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   835
							elem,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   836
							type,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   837
							_fired;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   838
						if ( fired ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   839
							_fired = fired;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   840
							fired = 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   841
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   842
						for ( i = 0, length = args.length; i < length; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   843
							elem = args[ i ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   844
							type = jQuery.type( elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   845
							if ( type === "array" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   846
								deferred.done.apply( deferred, elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   847
							} else if ( type === "function" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   848
								callbacks.push( elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   849
							}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   850
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   851
						if ( _fired ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   852
							deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   853
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   854
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   855
					return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   856
				},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   857
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   858
				// resolve with given context and args
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   859
				resolveWith: function( context, args ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   860
					if ( !cancelled && !fired && !firing ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   861
						firing = 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   862
						try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   863
							while( callbacks[ 0 ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   864
								callbacks.shift().apply( context, args );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   865
							}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   866
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   867
						finally {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   868
							fired = [ context, args ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   869
							firing = 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   870
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   871
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   872
					return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   873
				},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   874
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   875
				// resolve with this as context and given arguments
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   876
				resolve: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   877
					deferred.resolveWith( jQuery.isFunction( this.promise ) ? this.promise() : this, arguments );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   878
					return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   879
				},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   880
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   881
				// Has this deferred been resolved?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   882
				isResolved: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   883
					return !!( firing || fired );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   884
				},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   885
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   886
				// Cancel
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   887
				cancel: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   888
					cancelled = 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   889
					callbacks = [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   890
					return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   891
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   892
			};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   893
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   894
		return deferred;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   895
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   896
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   897
	// Full fledged deferred (two callbacks list)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   898
	Deferred: function( func ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   899
		var deferred = jQuery._Deferred(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   900
			failDeferred = jQuery._Deferred(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   901
			promise;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   902
		// Add errorDeferred methods, then and promise
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   903
		jQuery.extend( deferred, {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   904
			then: function( doneCallbacks, failCallbacks ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   905
				deferred.done( doneCallbacks ).fail( failCallbacks );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   906
				return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   907
			},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   908
			fail: failDeferred.done,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   909
			rejectWith: failDeferred.resolveWith,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   910
			reject: failDeferred.resolve,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   911
			isRejected: failDeferred.isResolved,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   912
			// Get a promise for this deferred
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   913
			// If obj is provided, the promise aspect is added to the object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   914
			promise: function( obj , i /* internal */ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   915
				if ( obj == null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   916
					if ( promise ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   917
						return promise;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   918
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   919
					promise = obj = {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   920
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   921
				i = promiseMethods.length;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   922
				while( i-- ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   923
					obj[ promiseMethods[ i ] ] = deferred[ promiseMethods[ i ] ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   924
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   925
				return obj;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   926
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   927
		} );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   928
		// Make sure only one callback list will be used
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   929
		deferred.then( failDeferred.cancel, deferred.cancel );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   930
		// Unexpose cancel
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   931
		delete deferred.cancel;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   932
		// Call given func if any
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   933
		if ( func ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   934
			func.call( deferred, deferred );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   935
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   936
		return deferred;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   937
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   938
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   939
	// Deferred helper
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   940
	when: function( object ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   941
		var args = arguments,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   942
			length = args.length,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   943
			deferred = length <= 1 && object && jQuery.isFunction( object.promise ) ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   944
				object :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   945
				jQuery.Deferred(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   946
			promise = deferred.promise(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   947
			resolveArray;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   948
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   949
		if ( length > 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   950
			resolveArray = new Array( length );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   951
			jQuery.each( args, function( index, element ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   952
				jQuery.when( element ).then( function( value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   953
					resolveArray[ index ] = arguments.length > 1 ? slice.call( arguments, 0 ) : value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   954
					if( ! --length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   955
						deferred.resolveWith( promise, resolveArray );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   956
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   957
				}, deferred.reject );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   958
			} );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   959
		} else if ( deferred !== object ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   960
			deferred.resolve( object );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   961
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   962
		return promise;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   963
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   964
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   965
	// Use of jQuery.browser is frowned upon.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   966
	// More details: http://docs.jquery.com/Utilities/jQuery.browser
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   967
	uaMatch: function( ua ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   968
		ua = ua.toLowerCase();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   969
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   970
		var match = rwebkit.exec( ua ) ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   971
			ropera.exec( ua ) ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   972
			rmsie.exec( ua ) ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   973
			ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   974
			[];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   975
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   976
		return { browser: match[1] || "", version: match[2] || "0" };
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   977
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   978
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   979
	sub: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   980
		function jQuerySubclass( selector, context ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   981
			return new jQuerySubclass.fn.init( selector, context );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   982
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   983
		jQuery.extend( true, jQuerySubclass, this );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   984
		jQuerySubclass.superclass = this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   985
		jQuerySubclass.fn = jQuerySubclass.prototype = this();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   986
		jQuerySubclass.fn.constructor = jQuerySubclass;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   987
		jQuerySubclass.subclass = this.subclass;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   988
		jQuerySubclass.fn.init = function init( selector, context ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   989
			if ( context && context instanceof jQuery && !(context instanceof jQuerySubclass) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   990
				context = jQuerySubclass(context);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   991
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   992
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   993
			return jQuery.fn.init.call( this, selector, context, rootjQuerySubclass );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   994
		};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   995
		jQuerySubclass.fn.init.prototype = jQuerySubclass.fn;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   996
		var rootjQuerySubclass = jQuerySubclass(document);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   997
		return jQuerySubclass;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   998
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   999
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1000
	browser: {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1001
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1002
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1003
// Create readyList deferred
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1004
readyList = jQuery._Deferred();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1005
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1006
// Populate the class2type map
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1007
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1008
	class2type[ "[object " + name + "]" ] = name.toLowerCase();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1009
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1010
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1011
browserMatch = jQuery.uaMatch( userAgent );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1012
if ( browserMatch.browser ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1013
	jQuery.browser[ browserMatch.browser ] = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1014
	jQuery.browser.version = browserMatch.version;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1015
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1016
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1017
// Deprecated, use jQuery.browser.webkit instead
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1018
if ( jQuery.browser.webkit ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1019
	jQuery.browser.safari = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1020
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1021
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1022
if ( indexOf ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1023
	jQuery.inArray = function( elem, array ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1024
		return indexOf.call( array, elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1025
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1026
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1027
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1028
// IE doesn't match non-breaking spaces with \s
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1029
if ( rnotwhite.test( "\xA0" ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1030
	trimLeft = /^[\s\xA0]+/;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1031
	trimRight = /[\s\xA0]+$/;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1032
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1033
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1034
// All jQuery objects should point back to these
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1035
rootjQuery = jQuery(document);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1036
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1037
// Cleanup functions for the document ready method
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1038
if ( document.addEventListener ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1039
	DOMContentLoaded = function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1040
		document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1041
		jQuery.ready();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1042
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1043
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1044
} else if ( document.attachEvent ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1045
	DOMContentLoaded = function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1046
		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1047
		if ( document.readyState === "complete" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1048
			document.detachEvent( "onreadystatechange", DOMContentLoaded );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1049
			jQuery.ready();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1050
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1051
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1052
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1053
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1054
// The DOM ready check for Internet Explorer
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1055
function doScrollCheck() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1056
	if ( jQuery.isReady ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1057
		return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1058
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1059
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1060
	try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1061
		// If IE is used, use the trick by Diego Perini
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1062
		// http://javascript.nwbox.com/IEContentLoaded/
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1063
		document.documentElement.doScroll("left");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1064
	} catch(e) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1065
		setTimeout( doScrollCheck, 1 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1066
		return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1067
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1068
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1069
	// and execute any waiting functions
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1070
	jQuery.ready();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1071
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1072
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1073
// Expose jQuery to the global object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1074
return (window.jQuery = window.$ = jQuery);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1075
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1076
})();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1077
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1078
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1079
(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1080
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1081
	jQuery.support = {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1082
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1083
	var div = document.createElement("div");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1084
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1085
	div.style.display = "none";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1086
	div.innerHTML = "   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1087
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1088
	var all = div.getElementsByTagName("*"),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1089
		a = div.getElementsByTagName("a")[0],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1090
		select = document.createElement("select"),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1091
		opt = select.appendChild( document.createElement("option") );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1092
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1093
	// Can't get basic test support
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1094
	if ( !all || !all.length || !a ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1095
		return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1096
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1097
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1098
	jQuery.support = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1099
		// IE strips leading whitespace when .innerHTML is used
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1100
		leadingWhitespace: div.firstChild.nodeType === 3,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1101
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1102
		// Make sure that tbody elements aren't automatically inserted
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1103
		// IE will insert them into empty tables
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1104
		tbody: !div.getElementsByTagName("tbody").length,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1105
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1106
		// Make sure that link elements get serialized correctly by innerHTML
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1107
		// This requires a wrapper element in IE
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1108
		htmlSerialize: !!div.getElementsByTagName("link").length,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1109
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1110
		// Get the style information from getAttribute
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1111
		// (IE uses .cssText insted)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1112
		style: /red/.test( a.getAttribute("style") ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1113
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1114
		// Make sure that URLs aren't manipulated
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1115
		// (IE normalizes it by default)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1116
		hrefNormalized: a.getAttribute("href") === "/a",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1117
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1118
		// Make sure that element opacity exists
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1119
		// (IE uses filter instead)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1120
		// Use a regex to work around a WebKit issue. See #5145
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1121
		opacity: /^0.55$/.test( a.style.opacity ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1122
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1123
		// Verify style float existence
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1124
		// (IE uses styleFloat instead of cssFloat)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1125
		cssFloat: !!a.style.cssFloat,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1126
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1127
		// Make sure that if no value is specified for a checkbox
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1128
		// that it defaults to "on".
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1129
		// (WebKit defaults to "" instead)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1130
		checkOn: div.getElementsByTagName("input")[0].value === "on",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1131
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1132
		// Make sure that a selected-by-default option has a working selected property.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1133
		// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1134
		optSelected: opt.selected,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1135
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1136
		// Will be defined later
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1137
		deleteExpando: true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1138
		optDisabled: false,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1139
		checkClone: false,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1140
		_scriptEval: null,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1141
		noCloneEvent: true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1142
		boxModel: null,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1143
		inlineBlockNeedsLayout: false,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1144
		shrinkWrapBlocks: false,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1145
		reliableHiddenOffsets: true
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1146
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1147
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1148
	// Make sure that the options inside disabled selects aren't marked as disabled
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1149
	// (WebKit marks them as diabled)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1150
	select.disabled = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1151
	jQuery.support.optDisabled = !opt.disabled;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1152
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1153
	jQuery.support.scriptEval = function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1154
		if ( jQuery.support._scriptEval === null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1155
			var root = document.documentElement,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1156
				script = document.createElement("script"),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1157
				id = "script" + jQuery.now();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1158
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1159
			script.type = "text/javascript";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1160
			try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1161
				script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1162
			} catch(e) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1163
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1164
			root.insertBefore( script, root.firstChild );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1165
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1166
			// Make sure that the execution of code works by injecting a script
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1167
			// tag with appendChild/createTextNode
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1168
			// (IE doesn't support this, fails, and uses .text instead)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1169
			if ( window[ id ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1170
				jQuery.support._scriptEval = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1171
				delete window[ id ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1172
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1173
				jQuery.support._scriptEval = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1174
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1175
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1176
			root.removeChild( script );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1177
			// release memory in IE
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1178
			root = script = id  = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1179
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1180
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1181
		return jQuery.support._scriptEval;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1182
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1183
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1184
	// Test to see if it's possible to delete an expando from an element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1185
	// Fails in Internet Explorer
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1186
	try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1187
		delete div.test;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1188
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1189
	} catch(e) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1190
		jQuery.support.deleteExpando = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1191
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1192
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1193
	if ( div.attachEvent && div.fireEvent ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1194
		div.attachEvent("onclick", function click() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1195
			// Cloning a node shouldn't copy over any
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1196
			// bound event handlers (IE does this)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1197
			jQuery.support.noCloneEvent = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1198
			div.detachEvent("onclick", click);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1199
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1200
		div.cloneNode(true).fireEvent("onclick");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1201
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1202
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1203
	div = document.createElement("div");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1204
	div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1205
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1206
	var fragment = document.createDocumentFragment();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1207
	fragment.appendChild( div.firstChild );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1208
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1209
	// WebKit doesn't clone checked state correctly in fragments
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1210
	jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1211
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1212
	// Figure out if the W3C box model works as expected
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1213
	// document.body must exist before we can do this
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1214
	jQuery(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1215
		var div = document.createElement("div"),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1216
			body = document.getElementsByTagName("body")[0];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1217
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1218
		// Frameset documents with no body should not run this code
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1219
		if ( !body ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1220
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1221
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1222
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1223
		div.style.width = div.style.paddingLeft = "1px";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1224
		body.appendChild( div );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1225
		jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1226
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1227
		if ( "zoom" in div.style ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1228
			// Check if natively block-level elements act like inline-block
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1229
			// elements when setting their display to 'inline' and giving
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1230
			// them layout
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1231
			// (IE < 8 does this)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1232
			div.style.display = "inline";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1233
			div.style.zoom = 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1234
			jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1235
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1236
			// Check if elements with layout shrink-wrap their children
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1237
			// (IE 6 does this)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1238
			div.style.display = "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1239
			div.innerHTML = "<div style='width:4px;'></div>";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1240
			jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1241
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1242
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1243
		div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1244
		var tds = div.getElementsByTagName("td");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1245
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1246
		// Check if table cells still have offsetWidth/Height when they are set
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1247
		// to display:none and there are still other visible table cells in a
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1248
		// table row; if so, offsetWidth/Height are not reliable for use when
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1249
		// determining if an element has been hidden directly using
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1250
		// display:none (it is still safe to use offsets if a parent element is
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1251
		// hidden; don safety goggles and see bug #4512 for more information).
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1252
		// (only IE 8 fails this test)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1253
		jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1254
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1255
		tds[0].style.display = "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1256
		tds[1].style.display = "none";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1257
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1258
		// Check if empty table cells still have offsetWidth/Height
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1259
		// (IE < 8 fail this test)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1260
		jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1261
		div.innerHTML = "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1262
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1263
		body.removeChild( div ).style.display = "none";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1264
		div = tds = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1265
	});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1266
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1267
	// Technique from Juriy Zaytsev
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1268
	// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1269
	var eventSupported = function( eventName ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1270
		var el = document.createElement("div");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1271
		eventName = "on" + eventName;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1272
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1273
		// We only care about the case where non-standard event systems
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1274
		// are used, namely in IE. Short-circuiting here helps us to
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1275
		// avoid an eval call (in setAttribute) which can cause CSP
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1276
		// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1277
		if ( !el.attachEvent ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1278
			return true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1279
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1280
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1281
		var isSupported = (eventName in el);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1282
		if ( !isSupported ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1283
			el.setAttribute(eventName, "return;");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1284
			isSupported = typeof el[eventName] === "function";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1285
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1286
		el = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1287
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1288
		return isSupported;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1289
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1290
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1291
	jQuery.support.submitBubbles = eventSupported("submit");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1292
	jQuery.support.changeBubbles = eventSupported("change");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1293
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1294
	// release memory in IE
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1295
	div = all = a = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1296
})();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1297
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1298
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1299
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1300
var rbrace = /^(?:\{.*\}|\[.*\])$/;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1301
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1302
jQuery.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1303
	cache: {},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1304
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1305
	// Please use with caution
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1306
	uuid: 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1307
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1308
	// Unique for each copy of jQuery on the page
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1309
	// Non-digits removed to match rinlinejQuery
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1310
	expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1311
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1312
	// The following elements throw uncatchable exceptions if you
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1313
	// attempt to add expando properties to them.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1314
	noData: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1315
		"embed": true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1316
		// Ban all objects except for Flash (which handle expandos)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1317
		"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1318
		"applet": true
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1319
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1320
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1321
	hasData: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1322
		elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1323
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1324
		return !!elem && !jQuery.isEmptyObject(elem);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1325
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1326
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1327
	data: function( elem, name, data, pvt /* Internal Use Only */ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1328
		if ( !jQuery.acceptData( elem ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1329
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1330
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1331
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1332
		var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1333
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1334
			// We have to handle DOM nodes and JS objects differently because IE6-7
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1335
			// can't GC object references properly across the DOM-JS boundary
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1336
			isNode = elem.nodeType,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1337
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1338
			// Only DOM nodes need the global jQuery cache; JS object data is
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1339
			// attached directly to the object so GC can occur automatically
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1340
			cache = isNode ? jQuery.cache : elem,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1341
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1342
			// Only defining an ID for JS objects if its cache already exists allows
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1343
			// the code to shortcut on the same path as a DOM node with no cache
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1344
			id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1345
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1346
		// Avoid doing any more work than we need to when trying to get data on an
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1347
		// object that has no data at all
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1348
		if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1349
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1350
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1351
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1352
		if ( !id ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1353
			// Only DOM nodes need a new unique ID for each element since their data
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1354
			// ends up in the global cache
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1355
			if ( isNode ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1356
				elem[ jQuery.expando ] = id = ++jQuery.uuid;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1357
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1358
				id = jQuery.expando;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1359
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1360
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1361
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1362
		if ( !cache[ id ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1363
			cache[ id ] = {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1364
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1365
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1366
		// An object can be passed to jQuery.data instead of a key/value pair; this gets
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1367
		// shallow copied over onto the existing cache
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1368
		if ( typeof name === "object" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1369
			if ( pvt ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1370
				cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1371
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1372
				cache[ id ] = jQuery.extend(cache[ id ], name);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1373
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1374
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1375
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1376
		thisCache = cache[ id ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1377
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1378
		// Internal jQuery data is stored in a separate object inside the object's data
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1379
		// cache in order to avoid key collisions between internal data and user-defined
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1380
		// data
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1381
		if ( pvt ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1382
			if ( !thisCache[ internalKey ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1383
				thisCache[ internalKey ] = {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1384
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1385
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1386
			thisCache = thisCache[ internalKey ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1387
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1388
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1389
		if ( data !== undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1390
			thisCache[ name ] = data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1391
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1392
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1393
		// TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1394
		// not attempt to inspect the internal events object using jQuery.data, as this
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1395
		// internal data object is undocumented and subject to change.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1396
		if ( name === "events" && !thisCache[name] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1397
			return thisCache[ internalKey ] && thisCache[ internalKey ].events;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1398
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1399
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1400
		return getByName ? thisCache[ name ] : thisCache;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1401
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1402
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1403
	removeData: function( elem, name, pvt /* Internal Use Only */ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1404
		if ( !jQuery.acceptData( elem ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1405
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1406
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1407
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1408
		var internalKey = jQuery.expando, isNode = elem.nodeType,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1409
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1410
			// See jQuery.data for more information
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1411
			cache = isNode ? jQuery.cache : elem,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1412
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1413
			// See jQuery.data for more information
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1414
			id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1415
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1416
		// If there is already no cache entry for this object, there is no
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1417
		// purpose in continuing
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1418
		if ( !cache[ id ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1419
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1420
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1421
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1422
		if ( name ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1423
			var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1424
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1425
			if ( thisCache ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1426
				delete thisCache[ name ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1427
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1428
				// If there is no data left in the cache, we want to continue
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1429
				// and let the cache object itself get destroyed
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1430
				if ( !jQuery.isEmptyObject(thisCache) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1431
					return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1432
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1433
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1434
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1435
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1436
		// See jQuery.data for more information
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1437
		if ( pvt ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1438
			delete cache[ id ][ internalKey ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1439
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1440
			// Don't destroy the parent cache unless the internal data object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1441
			// had been the only thing left in it
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1442
			if ( !jQuery.isEmptyObject(cache[ id ]) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1443
				return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1444
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1445
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1446
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1447
		var internalCache = cache[ id ][ internalKey ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1448
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1449
		// Browsers that fail expando deletion also refuse to delete expandos on
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1450
		// the window, but it will allow it on all other JS objects; other browsers
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1451
		// don't care
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1452
		if ( jQuery.support.deleteExpando || cache != window ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1453
			delete cache[ id ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1454
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1455
			cache[ id ] = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1456
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1457
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1458
		// We destroyed the entire user cache at once because it's faster than
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1459
		// iterating through each key, but we need to continue to persist internal
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1460
		// data if it existed
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1461
		if ( internalCache ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1462
			cache[ id ] = {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1463
			cache[ id ][ internalKey ] = internalCache;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1464
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1465
		// Otherwise, we need to eliminate the expando on the node to avoid
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1466
		// false lookups in the cache for entries that no longer exist
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1467
		} else if ( isNode ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1468
			// IE does not allow us to delete expando properties from nodes,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1469
			// nor does it have a removeAttribute function on Document nodes;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1470
			// we must handle all of these cases
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1471
			if ( jQuery.support.deleteExpando ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1472
				delete elem[ jQuery.expando ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1473
			} else if ( elem.removeAttribute ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1474
				elem.removeAttribute( jQuery.expando );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1475
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1476
				elem[ jQuery.expando ] = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1477
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1478
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1479
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1480
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1481
	// For internal use only.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1482
	_data: function( elem, name, data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1483
		return jQuery.data( elem, name, data, true );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1484
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1485
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1486
	// A method for determining if a DOM node can handle the data expando
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1487
	acceptData: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1488
		if ( elem.nodeName ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1489
			var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1490
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1491
			if ( match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1492
				return !(match === true || elem.getAttribute("classid") !== match);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1493
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1494
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1495
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1496
		return true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1497
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1498
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1499
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1500
jQuery.fn.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1501
	data: function( key, value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1502
		var data = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1503
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1504
		if ( typeof key === "undefined" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1505
			if ( this.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1506
				data = jQuery.data( this[0] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1507
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1508
				if ( this[0].nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1509
					var attr = this[0].attributes, name;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1510
					for ( var i = 0, l = attr.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1511
						name = attr[i].name;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1512
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1513
						if ( name.indexOf( "data-" ) === 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1514
							name = name.substr( 5 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1515
							dataAttr( this[0], name, data[ name ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1516
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1517
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1518
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1519
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1520
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1521
			return data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1522
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1523
		} else if ( typeof key === "object" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1524
			return this.each(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1525
				jQuery.data( this, key );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1526
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1527
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1528
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1529
		var parts = key.split(".");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1530
		parts[1] = parts[1] ? "." + parts[1] : "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1531
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1532
		if ( value === undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1533
			data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1534
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1535
			// Try to fetch any internally stored data first
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1536
			if ( data === undefined && this.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1537
				data = jQuery.data( this[0], key );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1538
				data = dataAttr( this[0], key, data );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1539
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1540
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1541
			return data === undefined && parts[1] ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1542
				this.data( parts[0] ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1543
				data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1544
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1545
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1546
			return this.each(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1547
				var $this = jQuery( this ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1548
					args = [ parts[0], value ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1549
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1550
				$this.triggerHandler( "setData" + parts[1] + "!", args );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1551
				jQuery.data( this, key, value );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1552
				$this.triggerHandler( "changeData" + parts[1] + "!", args );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1553
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1554
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1555
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1556
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1557
	removeData: function( key ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1558
		return this.each(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1559
			jQuery.removeData( this, key );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1560
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1561
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1562
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1563
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1564
function dataAttr( elem, key, data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1565
	// If nothing was found internally, try to fetch any
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1566
	// data from the HTML5 data-* attribute
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1567
	if ( data === undefined && elem.nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1568
		data = elem.getAttribute( "data-" + key );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1569
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1570
		if ( typeof data === "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1571
			try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1572
				data = data === "true" ? true :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1573
				data === "false" ? false :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1574
				data === "null" ? null :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1575
				!jQuery.isNaN( data ) ? parseFloat( data ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1576
					rbrace.test( data ) ? jQuery.parseJSON( data ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1577
					data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1578
			} catch( e ) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1579
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1580
			// Make sure we set the data so it isn't changed later
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1581
			jQuery.data( elem, key, data );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1582
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1583
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1584
			data = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1585
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1586
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1587
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1588
	return data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1589
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1590
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1591
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1592
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1593
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1594
jQuery.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1595
	queue: function( elem, type, data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1596
		if ( !elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1597
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1598
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1599
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1600
		type = (type || "fx") + "queue";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1601
		var q = jQuery._data( elem, type );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1602
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1603
		// Speed up dequeue by getting out quickly if this is just a lookup
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1604
		if ( !data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1605
			return q || [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1606
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1607
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1608
		if ( !q || jQuery.isArray(data) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1609
			q = jQuery._data( elem, type, jQuery.makeArray(data) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1610
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1611
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1612
			q.push( data );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1613
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1614
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1615
		return q;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1616
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1617
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1618
	dequeue: function( elem, type ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1619
		type = type || "fx";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1620
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1621
		var queue = jQuery.queue( elem, type ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1622
			fn = queue.shift();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1623
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1624
		// If the fx queue is dequeued, always remove the progress sentinel
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1625
		if ( fn === "inprogress" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1626
			fn = queue.shift();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1627
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1628
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1629
		if ( fn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1630
			// Add a progress sentinel to prevent the fx queue from being
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1631
			// automatically dequeued
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1632
			if ( type === "fx" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1633
				queue.unshift("inprogress");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1634
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1635
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1636
			fn.call(elem, function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1637
				jQuery.dequeue(elem, type);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1638
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1639
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1640
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1641
		if ( !queue.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1642
			jQuery.removeData( elem, type + "queue", true );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1643
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1644
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1645
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1646
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1647
jQuery.fn.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1648
	queue: function( type, data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1649
		if ( typeof type !== "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1650
			data = type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1651
			type = "fx";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1652
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1653
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1654
		if ( data === undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1655
			return jQuery.queue( this[0], type );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1656
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1657
		return this.each(function( i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1658
			var queue = jQuery.queue( this, type, data );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1659
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1660
			if ( type === "fx" && queue[0] !== "inprogress" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1661
				jQuery.dequeue( this, type );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1662
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1663
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1664
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1665
	dequeue: function( type ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1666
		return this.each(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1667
			jQuery.dequeue( this, type );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1668
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1669
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1670
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1671
	// Based off of the plugin by Clint Helfers, with permission.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1672
	// http://blindsignals.com/index.php/2009/07/jquery-delay/
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1673
	delay: function( time, type ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1674
		time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1675
		type = type || "fx";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1676
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1677
		return this.queue( type, function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1678
			var elem = this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1679
			setTimeout(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1680
				jQuery.dequeue( elem, type );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1681
			}, time );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1682
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1683
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1684
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1685
	clearQueue: function( type ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1686
		return this.queue( type || "fx", [] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1687
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1688
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1689
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1690
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1691
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1692
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1693
var rclass = /[\n\t\r]/g,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1694
	rspaces = /\s+/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1695
	rreturn = /\r/g,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1696
	rspecialurl = /^(?:href|src|style)$/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1697
	rtype = /^(?:button|input)$/i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1698
	rfocusable = /^(?:button|input|object|select|textarea)$/i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1699
	rclickable = /^a(?:rea)?$/i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1700
	rradiocheck = /^(?:radio|checkbox)$/i;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1701
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1702
jQuery.props = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1703
	"for": "htmlFor",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1704
	"class": "className",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1705
	readonly: "readOnly",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1706
	maxlength: "maxLength",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1707
	cellspacing: "cellSpacing",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1708
	rowspan: "rowSpan",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1709
	colspan: "colSpan",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1710
	tabindex: "tabIndex",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1711
	usemap: "useMap",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1712
	frameborder: "frameBorder"
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1713
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1714
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1715
jQuery.fn.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1716
	attr: function( name, value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1717
		return jQuery.access( this, name, value, true, jQuery.attr );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1718
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1719
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1720
	removeAttr: function( name, fn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1721
		return this.each(function(){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1722
			jQuery.attr( this, name, "" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1723
			if ( this.nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1724
				this.removeAttribute( name );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1725
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1726
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1727
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1728
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1729
	addClass: function( value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1730
		if ( jQuery.isFunction(value) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1731
			return this.each(function(i) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1732
				var self = jQuery(this);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1733
				self.addClass( value.call(this, i, self.attr("class")) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1734
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1735
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1736
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1737
		if ( value && typeof value === "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1738
			var classNames = (value || "").split( rspaces );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1739
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1740
			for ( var i = 0, l = this.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1741
				var elem = this[i];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1742
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1743
				if ( elem.nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1744
					if ( !elem.className ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1745
						elem.className = value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1746
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1747
					} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1748
						var className = " " + elem.className + " ",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1749
							setClass = elem.className;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1750
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1751
						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1752
							if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1753
								setClass += " " + classNames[c];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1754
							}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1755
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1756
						elem.className = jQuery.trim( setClass );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1757
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1758
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1759
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1760
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1761
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1762
		return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1763
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1764
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1765
	removeClass: function( value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1766
		if ( jQuery.isFunction(value) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1767
			return this.each(function(i) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1768
				var self = jQuery(this);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1769
				self.removeClass( value.call(this, i, self.attr("class")) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1770
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1771
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1772
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1773
		if ( (value && typeof value === "string") || value === undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1774
			var classNames = (value || "").split( rspaces );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1775
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1776
			for ( var i = 0, l = this.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1777
				var elem = this[i];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1778
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1779
				if ( elem.nodeType === 1 && elem.className ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1780
					if ( value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1781
						var className = (" " + elem.className + " ").replace(rclass, " ");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1782
						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1783
							className = className.replace(" " + classNames[c] + " ", " ");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1784
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1785
						elem.className = jQuery.trim( className );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1786
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1787
					} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1788
						elem.className = "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1789
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1790
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1791
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1792
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1793
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1794
		return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1795
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1796
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1797
	toggleClass: function( value, stateVal ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1798
		var type = typeof value,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1799
			isBool = typeof stateVal === "boolean";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1800
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1801
		if ( jQuery.isFunction( value ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1802
			return this.each(function(i) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1803
				var self = jQuery(this);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1804
				self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1805
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1806
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1807
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1808
		return this.each(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1809
			if ( type === "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1810
				// toggle individual class names
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1811
				var className,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1812
					i = 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1813
					self = jQuery( this ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1814
					state = stateVal,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1815
					classNames = value.split( rspaces );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1816
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1817
				while ( (className = classNames[ i++ ]) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1818
					// check each className given, space seperated list
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1819
					state = isBool ? state : !self.hasClass( className );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1820
					self[ state ? "addClass" : "removeClass" ]( className );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1821
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1822
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1823
			} else if ( type === "undefined" || type === "boolean" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1824
				if ( this.className ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1825
					// store className if set
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1826
					jQuery._data( this, "__className__", this.className );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1827
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1828
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1829
				// toggle whole className
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1830
				this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1831
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1832
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1833
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1834
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1835
	hasClass: function( selector ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1836
		var className = " " + selector + " ";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1837
		for ( var i = 0, l = this.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1838
			if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1839
				return true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1840
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1841
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1842
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1843
		return false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1844
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1845
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1846
	val: function( value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1847
		if ( !arguments.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1848
			var elem = this[0];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1849
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1850
			if ( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1851
				if ( jQuery.nodeName( elem, "option" ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1852
					// attributes.value is undefined in Blackberry 4.7 but
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1853
					// uses .value. See #6932
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1854
					var val = elem.attributes.value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1855
					return !val || val.specified ? elem.value : elem.text;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1856
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1857
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1858
				// We need to handle select boxes special
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1859
				if ( jQuery.nodeName( elem, "select" ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1860
					var index = elem.selectedIndex,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1861
						values = [],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1862
						options = elem.options,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1863
						one = elem.type === "select-one";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1864
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1865
					// Nothing was selected
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1866
					if ( index < 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1867
						return null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1868
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1869
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1870
					// Loop through all the selected options
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1871
					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1872
						var option = options[ i ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1873
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1874
						// Don't return options that are disabled or in a disabled optgroup
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1875
						if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1876
								(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1877
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1878
							// Get the specific value for the option
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1879
							value = jQuery(option).val();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1880
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1881
							// We don't need an array for one selects
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1882
							if ( one ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1883
								return value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1884
							}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1885
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1886
							// Multi-Selects return an array
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1887
							values.push( value );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1888
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1889
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1890
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1891
					return values;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1892
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1893
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1894
				// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1895
				if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1896
					return elem.getAttribute("value") === null ? "on" : elem.value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1897
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1898
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1899
				// Everything else, we just grab the value
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1900
				return (elem.value || "").replace(rreturn, "");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1901
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1902
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1903
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1904
			return undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1905
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1906
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1907
		var isFunction = jQuery.isFunction(value);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1908
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1909
		return this.each(function(i) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1910
			var self = jQuery(this), val = value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1911
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1912
			if ( this.nodeType !== 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1913
				return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1914
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1915
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1916
			if ( isFunction ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1917
				val = value.call(this, i, self.val());
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1918
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1919
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1920
			// Treat null/undefined as ""; convert numbers to string
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1921
			if ( val == null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1922
				val = "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1923
			} else if ( typeof val === "number" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1924
				val += "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1925
			} else if ( jQuery.isArray(val) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1926
				val = jQuery.map(val, function (value) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1927
					return value == null ? "" : value + "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1928
				});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1929
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1930
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1931
			if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1932
				this.checked = jQuery.inArray( self.val(), val ) >= 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1933
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1934
			} else if ( jQuery.nodeName( this, "select" ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1935
				var values = jQuery.makeArray(val);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1936
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1937
				jQuery( "option", this ).each(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1938
					this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1939
				});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1940
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1941
				if ( !values.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1942
					this.selectedIndex = -1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1943
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1944
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1945
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1946
				this.value = val;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1947
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1948
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1949
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1950
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1951
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1952
jQuery.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1953
	attrFn: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1954
		val: true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1955
		css: true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1956
		html: true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1957
		text: true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1958
		data: true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1959
		width: true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1960
		height: true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1961
		offset: true
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1962
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1963
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1964
	attr: function( elem, name, value, pass ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1965
		// don't get/set attributes on text, comment and attribute nodes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1966
		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || elem.nodeType === 2 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1967
			return undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1968
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1969
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1970
		if ( pass && name in jQuery.attrFn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1971
			return jQuery(elem)[name](value);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1972
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1973
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1974
		var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1975
			// Whether we are setting (or getting)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1976
			set = value !== undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1977
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1978
		// Try to normalize/fix the name
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1979
		name = notxml && jQuery.props[ name ] || name;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1980
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1981
		// Only do all the following if this is a node (faster for style)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1982
		if ( elem.nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1983
			// These attributes require special treatment
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1984
			var special = rspecialurl.test( name );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1985
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1986
			// Safari mis-reports the default selected property of an option
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1987
			// Accessing the parent's selectedIndex property fixes it
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1988
			if ( name === "selected" && !jQuery.support.optSelected ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1989
				var parent = elem.parentNode;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1990
				if ( parent ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1991
					parent.selectedIndex;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1992
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1993
					// Make sure that it also works with optgroups, see #5701
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1994
					if ( parent.parentNode ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1995
						parent.parentNode.selectedIndex;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1996
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1997
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1998
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1999
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2000
			// If applicable, access the attribute via the DOM 0 way
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2001
			// 'in' checks fail in Blackberry 4.7 #6931
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2002
			if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2003
				if ( set ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2004
					// We can't allow the type property to be changed (since it causes problems in IE)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2005
					if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2006
						jQuery.error( "type property can't be changed" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2007
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2008
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2009
					if ( value === null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2010
						if ( elem.nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2011
							elem.removeAttribute( name );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2012
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2013
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2014
					} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2015
						elem[ name ] = value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2016
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2017
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2018
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2019
				// browsers index elements by id/name on forms, give priority to attributes.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2020
				if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2021
					return elem.getAttributeNode( name ).nodeValue;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2022
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2023
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2024
				// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2025
				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2026
				if ( name === "tabIndex" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2027
					var attributeNode = elem.getAttributeNode( "tabIndex" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2028
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2029
					return attributeNode && attributeNode.specified ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2030
						attributeNode.value :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2031
						rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2032
							0 :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2033
							undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2034
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2035
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2036
				return elem[ name ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2037
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2038
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2039
			if ( !jQuery.support.style && notxml && name === "style" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2040
				if ( set ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2041
					elem.style.cssText = "" + value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2042
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2043
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2044
				return elem.style.cssText;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2045
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2046
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2047
			if ( set ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2048
				// convert the value to a string (all browsers do this but IE) see #1070
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2049
				elem.setAttribute( name, "" + value );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2050
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2051
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2052
			// Ensure that missing attributes return undefined
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2053
			// Blackberry 4.7 returns "" from getAttribute #6938
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2054
			if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2055
				return undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2056
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2057
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2058
			var attr = !jQuery.support.hrefNormalized && notxml && special ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2059
					// Some attributes require a special call on IE
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2060
					elem.getAttribute( name, 2 ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2061
					elem.getAttribute( name );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2062
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2063
			// Non-existent attributes return null, we normalize to undefined
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2064
			return attr === null ? undefined : attr;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2065
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2066
		// Handle everything which isn't a DOM element node
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2067
		if ( set ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2068
			elem[ name ] = value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2069
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2070
		return elem[ name ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2071
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2072
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2073
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2074
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2075
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2076
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2077
var rnamespaces = /\.(.*)$/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2078
	rformElems = /^(?:textarea|input|select)$/i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2079
	rperiod = /\./g,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2080
	rspace = / /g,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2081
	rescape = /[^\w\s.|`]/g,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2082
	fcleanup = function( nm ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2083
		return nm.replace(rescape, "\\$&");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2084
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2085
	eventKey = "events";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2086
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  2087
/*
24
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2088
 * A number of helper functions used for managing events.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2089
 * Many of the ideas behind this code originated from
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2090
 * Dean Edwards' addEvent library.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2091
 */
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2092
jQuery.event = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2093
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2094
	// Bind an event to an element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2095
	// Original by Dean Edwards
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2096
	add: function( elem, types, handler, data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2097
		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2098
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2099
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2100
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2101
		// For whatever reason, IE has trouble passing the window object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2102
		// around, causing it to be cloned in the process
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2103
		if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2104
			elem = window;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2105
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2106
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2107
		if ( handler === false ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2108
			handler = returnFalse;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2109
		} else if ( !handler ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2110
			// Fixes bug #7229. Fix recommended by jdalton
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2111
		  return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2112
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2113
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2114
		var handleObjIn, handleObj;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2115
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2116
		if ( handler.handler ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2117
			handleObjIn = handler;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2118
			handler = handleObjIn.handler;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2119
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2120
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2121
		// Make sure that the function being executed has a unique ID
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2122
		if ( !handler.guid ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2123
			handler.guid = jQuery.guid++;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2124
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2125
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2126
		// Init the element's event structure
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2127
		var elemData = jQuery._data( elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2128
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2129
		// If no elemData is found then we must be trying to bind to one of the
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2130
		// banned noData elements
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2131
		if ( !elemData ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2132
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2133
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2134
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2135
		var events = elemData[ eventKey ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2136
			eventHandle = elemData.handle;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2137
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2138
		if ( typeof events === "function" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2139
			// On plain objects events is a fn that holds the the data
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2140
			// which prevents this data from being JSON serialized
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2141
			// the function does not need to be called, it just contains the data
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2142
			eventHandle = events.handle;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2143
			events = events.events;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2144
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2145
		} else if ( !events ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2146
			if ( !elem.nodeType ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2147
				// On plain objects, create a fn that acts as the holder
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2148
				// of the values to avoid JSON serialization of event data
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2149
				elemData[ eventKey ] = elemData = function(){};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2150
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2151
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2152
			elemData.events = events = {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2153
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2154
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2155
		if ( !eventHandle ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2156
			elemData.handle = eventHandle = function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2157
				// Handle the second event of a trigger and when
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2158
				// an event is called after a page has unloaded
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2159
				return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2160
					jQuery.event.handle.apply( eventHandle.elem, arguments ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2161
					undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2162
			};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2163
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2164
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2165
		// Add elem as a property of the handle function
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2166
		// This is to prevent a memory leak with non-native events in IE.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2167
		eventHandle.elem = elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2168
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2169
		// Handle multiple events separated by a space
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2170
		// jQuery(...).bind("mouseover mouseout", fn);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2171
		types = types.split(" ");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2172
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2173
		var type, i = 0, namespaces;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2174
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2175
		while ( (type = types[ i++ ]) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2176
			handleObj = handleObjIn ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2177
				jQuery.extend({}, handleObjIn) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2178
				{ handler: handler, data: data };
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2179
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2180
			// Namespaced event handlers
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2181
			if ( type.indexOf(".") > -1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2182
				namespaces = type.split(".");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2183
				type = namespaces.shift();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2184
				handleObj.namespace = namespaces.slice(0).sort().join(".");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2185
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2186
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2187
				namespaces = [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2188
				handleObj.namespace = "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2189
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2190
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2191
			handleObj.type = type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2192
			if ( !handleObj.guid ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2193
				handleObj.guid = handler.guid;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2194
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2195
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2196
			// Get the current list of functions bound to this event
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2197
			var handlers = events[ type ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2198
				special = jQuery.event.special[ type ] || {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2199
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2200
			// Init the event handler queue
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2201
			if ( !handlers ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2202
				handlers = events[ type ] = [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2203
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2204
				// Check for a special event handler
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2205
				// Only use addEventListener/attachEvent if the special
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2206
				// events handler returns false
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2207
				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2208
					// Bind the global event handler to the element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2209
					if ( elem.addEventListener ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2210
						elem.addEventListener( type, eventHandle, false );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2211
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2212
					} else if ( elem.attachEvent ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2213
						elem.attachEvent( "on" + type, eventHandle );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2214
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2215
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2216
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2217
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2218
			if ( special.add ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2219
				special.add.call( elem, handleObj );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2220
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2221
				if ( !handleObj.handler.guid ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2222
					handleObj.handler.guid = handler.guid;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2223
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2224
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2225
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2226
			// Add the function to the element's handler list
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2227
			handlers.push( handleObj );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2228
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2229
			// Keep track of which events have been used, for global triggering
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2230
			jQuery.event.global[ type ] = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2231
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2232
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2233
		// Nullify elem to prevent memory leaks in IE
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2234
		elem = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2235
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2236
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2237
	global: {},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2238
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2239
	// Detach an event or set of events from an element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2240
	remove: function( elem, types, handler, pos ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2241
		// don't do events on text and comment nodes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2242
		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2243
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2244
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2245
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2246
		if ( handler === false ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2247
			handler = returnFalse;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2248
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2249
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2250
		var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2251
			elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2252
			events = elemData && elemData[ eventKey ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2253
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2254
		if ( !elemData || !events ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2255
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2256
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2257
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2258
		if ( typeof events === "function" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2259
			elemData = events;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2260
			events = events.events;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2261
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2262
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2263
		// types is actually an event object here
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2264
		if ( types && types.type ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2265
			handler = types.handler;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2266
			types = types.type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2267
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2268
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2269
		// Unbind all events for the element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2270
		if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2271
			types = types || "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2272
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2273
			for ( type in events ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2274
				jQuery.event.remove( elem, type + types );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2275
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2276
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2277
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2278
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2279
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2280
		// Handle multiple events separated by a space
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2281
		// jQuery(...).unbind("mouseover mouseout", fn);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2282
		types = types.split(" ");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2283
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2284
		while ( (type = types[ i++ ]) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2285
			origType = type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2286
			handleObj = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2287
			all = type.indexOf(".") < 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2288
			namespaces = [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2289
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2290
			if ( !all ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2291
				// Namespaced event handlers
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2292
				namespaces = type.split(".");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2293
				type = namespaces.shift();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2294
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2295
				namespace = new RegExp("(^|\\.)" +
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2296
					jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2297
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2298
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2299
			eventType = events[ type ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2300
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2301
			if ( !eventType ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2302
				continue;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2303
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2304
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2305
			if ( !handler ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2306
				for ( j = 0; j < eventType.length; j++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2307
					handleObj = eventType[ j ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2308
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2309
					if ( all || namespace.test( handleObj.namespace ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2310
						jQuery.event.remove( elem, origType, handleObj.handler, j );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2311
						eventType.splice( j--, 1 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2312
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2313
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2314
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2315
				continue;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2316
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2317
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2318
			special = jQuery.event.special[ type ] || {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2319
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2320
			for ( j = pos || 0; j < eventType.length; j++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2321
				handleObj = eventType[ j ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2322
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2323
				if ( handler.guid === handleObj.guid ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2324
					// remove the given handler for the given type
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2325
					if ( all || namespace.test( handleObj.namespace ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2326
						if ( pos == null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2327
							eventType.splice( j--, 1 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2328
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2329
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2330
						if ( special.remove ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2331
							special.remove.call( elem, handleObj );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2332
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2333
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2334
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2335
					if ( pos != null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2336
						break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2337
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2338
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2339
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2340
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2341
			// remove generic event handler if no more handlers exist
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2342
			if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2343
				if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2344
					jQuery.removeEvent( elem, type, elemData.handle );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2345
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2346
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2347
				ret = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2348
				delete events[ type ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2349
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2350
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2351
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2352
		// Remove the expando if it's no longer used
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2353
		if ( jQuery.isEmptyObject( events ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2354
			var handle = elemData.handle;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2355
			if ( handle ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2356
				handle.elem = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2357
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2358
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2359
			delete elemData.events;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2360
			delete elemData.handle;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2361
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2362
			if ( typeof elemData === "function" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2363
				jQuery.removeData( elem, eventKey, true );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2364
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2365
			} else if ( jQuery.isEmptyObject( elemData ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2366
				jQuery.removeData( elem, undefined, true );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2367
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2368
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2369
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2370
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2371
	// bubbling is internal
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2372
	trigger: function( event, data, elem /*, bubbling */ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2373
		// Event object or event type
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2374
		var type = event.type || event,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2375
			bubbling = arguments[3];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2376
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2377
		if ( !bubbling ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2378
			event = typeof event === "object" ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2379
				// jQuery.Event object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2380
				event[ jQuery.expando ] ? event :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2381
				// Object literal
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2382
				jQuery.extend( jQuery.Event(type), event ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2383
				// Just the event type (string)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2384
				jQuery.Event(type);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2385
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2386
			if ( type.indexOf("!") >= 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2387
				event.type = type = type.slice(0, -1);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2388
				event.exclusive = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2389
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2390
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2391
			// Handle a global trigger
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2392
			if ( !elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2393
				// Don't bubble custom events when global (to avoid too much overhead)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2394
				event.stopPropagation();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2395
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2396
				// Only trigger if we've ever bound an event for it
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2397
				if ( jQuery.event.global[ type ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2398
					// XXX This code smells terrible. event.js should not be directly
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2399
					// inspecting the data cache
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2400
					jQuery.each( jQuery.cache, function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2401
						// internalKey variable is just used to make it easier to find
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2402
						// and potentially change this stuff later; currently it just
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2403
						// points to jQuery.expando
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2404
						var internalKey = jQuery.expando,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2405
							internalCache = this[ internalKey ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2406
						if ( internalCache && internalCache.events && internalCache.events[type] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2407
							jQuery.event.trigger( event, data, internalCache.handle.elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2408
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2409
					});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2410
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2411
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2412
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2413
			// Handle triggering a single element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2414
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2415
			// don't do events on text and comment nodes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2416
			if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2417
				return undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2418
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2419
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2420
			// Clean up in case it is reused
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2421
			event.result = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2422
			event.target = elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2423
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2424
			// Clone the incoming data, if any
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2425
			data = jQuery.makeArray( data );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2426
			data.unshift( event );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2427
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2428
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2429
		event.currentTarget = elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2430
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2431
		// Trigger the event, it is assumed that "handle" is a function
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2432
		var handle = elem.nodeType ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2433
			jQuery._data( elem, "handle" ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2434
			(jQuery._data( elem, eventKey ) || {}).handle;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2435
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2436
		if ( handle ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2437
			handle.apply( elem, data );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2438
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2439
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2440
		var parent = elem.parentNode || elem.ownerDocument;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2441
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2442
		// Trigger an inline bound script
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2443
		try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2444
			if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2445
				if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2446
					event.result = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2447
					event.preventDefault();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2448
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2449
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2450
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2451
		// prevent IE from throwing an error for some elements with some event types, see #3533
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2452
		} catch (inlineError) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2453
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2454
		if ( !event.isPropagationStopped() && parent ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2455
			jQuery.event.trigger( event, data, parent, true );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2456
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2457
		} else if ( !event.isDefaultPrevented() ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2458
			var old,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2459
				target = event.target,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2460
				targetType = type.replace( rnamespaces, "" ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2461
				isClick = jQuery.nodeName( target, "a" ) && targetType === "click",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2462
				special = jQuery.event.special[ targetType ] || {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2463
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2464
			if ( (!special._default || special._default.call( elem, event ) === false) &&
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2465
				!isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2466
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2467
				try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2468
					if ( target[ targetType ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2469
						// Make sure that we don't accidentally re-trigger the onFOO events
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2470
						old = target[ "on" + targetType ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2471
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2472
						if ( old ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2473
							target[ "on" + targetType ] = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2474
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2475
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2476
						jQuery.event.triggered = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2477
						target[ targetType ]();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2478
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2479
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2480
				// prevent IE from throwing an error for some elements with some event types, see #3533
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2481
				} catch (triggerError) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2482
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2483
				if ( old ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2484
					target[ "on" + targetType ] = old;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2485
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2486
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2487
				jQuery.event.triggered = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2488
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2489
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2490
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2491
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2492
	handle: function( event ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2493
		var all, handlers, namespaces, namespace_re, events,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2494
			namespace_sort = [],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2495
			args = jQuery.makeArray( arguments );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2496
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2497
		event = args[0] = jQuery.event.fix( event || window.event );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2498
		event.currentTarget = this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2499
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2500
		// Namespaced event handlers
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2501
		all = event.type.indexOf(".") < 0 && !event.exclusive;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2502
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2503
		if ( !all ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2504
			namespaces = event.type.split(".");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2505
			event.type = namespaces.shift();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2506
			namespace_sort = namespaces.slice(0).sort();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2507
			namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2508
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2509
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2510
		event.namespace = event.namespace || namespace_sort.join(".");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2511
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2512
		events = jQuery._data(this, eventKey);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2513
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2514
		if ( typeof events === "function" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2515
			events = events.events;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2516
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2517
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2518
		handlers = (events || {})[ event.type ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2519
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2520
		if ( events && handlers ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2521
			// Clone the handlers to prevent manipulation
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2522
			handlers = handlers.slice(0);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2523
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2524
			for ( var j = 0, l = handlers.length; j < l; j++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2525
				var handleObj = handlers[ j ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2526
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2527
				// Filter the functions by class
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2528
				if ( all || namespace_re.test( handleObj.namespace ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2529
					// Pass in a reference to the handler function itself
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2530
					// So that we can later remove it
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2531
					event.handler = handleObj.handler;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2532
					event.data = handleObj.data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2533
					event.handleObj = handleObj;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2534
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2535
					var ret = handleObj.handler.apply( this, args );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2536
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2537
					if ( ret !== undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2538
						event.result = ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2539
						if ( ret === false ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2540
							event.preventDefault();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2541
							event.stopPropagation();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2542
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2543
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2544
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2545
					if ( event.isImmediatePropagationStopped() ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2546
						break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2547
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2548
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2549
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2550
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2551
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2552
		return event.result;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2553
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2554
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2555
	props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2556
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2557
	fix: function( event ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2558
		if ( event[ jQuery.expando ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2559
			return event;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2560
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2561
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2562
		// store a copy of the original event object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2563
		// and "clone" to set read-only properties
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2564
		var originalEvent = event;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2565
		event = jQuery.Event( originalEvent );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2566
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2567
		for ( var i = this.props.length, prop; i; ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2568
			prop = this.props[ --i ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2569
			event[ prop ] = originalEvent[ prop ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2570
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2571
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2572
		// Fix target property, if necessary
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2573
		if ( !event.target ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2574
			// Fixes #1925 where srcElement might not be defined either
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2575
			event.target = event.srcElement || document;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2576
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2577
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2578
		// check if target is a textnode (safari)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2579
		if ( event.target.nodeType === 3 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2580
			event.target = event.target.parentNode;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2581
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2582
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2583
		// Add relatedTarget, if necessary
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2584
		if ( !event.relatedTarget && event.fromElement ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2585
			event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2586
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2587
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2588
		// Calculate pageX/Y if missing and clientX/Y available
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2589
		if ( event.pageX == null && event.clientX != null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2590
			var doc = document.documentElement,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2591
				body = document.body;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2592
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2593
			event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2594
			event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2595
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2596
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2597
		// Add which for key events
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2598
		if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2599
			event.which = event.charCode != null ? event.charCode : event.keyCode;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2600
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2601
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2602
		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2603
		if ( !event.metaKey && event.ctrlKey ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2604
			event.metaKey = event.ctrlKey;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2605
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2606
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2607
		// Add which for click: 1 === left; 2 === middle; 3 === right
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2608
		// Note: button is not normalized, so don't use it
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2609
		if ( !event.which && event.button !== undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2610
			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2611
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2612
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2613
		return event;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2614
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2615
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2616
	// Deprecated, use jQuery.guid instead
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2617
	guid: 1E8,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2618
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2619
	// Deprecated, use jQuery.proxy instead
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2620
	proxy: jQuery.proxy,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2621
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2622
	special: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2623
		ready: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2624
			// Make sure the ready event is setup
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2625
			setup: jQuery.bindReady,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2626
			teardown: jQuery.noop
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2627
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2628
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2629
		live: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2630
			add: function( handleObj ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2631
				jQuery.event.add( this,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2632
					liveConvert( handleObj.origType, handleObj.selector ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2633
					jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2634
			},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2635
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2636
			remove: function( handleObj ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2637
				jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2638
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2639
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2640
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2641
		beforeunload: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2642
			setup: function( data, namespaces, eventHandle ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2643
				// We only want to do this special case on windows
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2644
				if ( jQuery.isWindow( this ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2645
					this.onbeforeunload = eventHandle;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2646
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2647
			},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2648
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2649
			teardown: function( namespaces, eventHandle ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2650
				if ( this.onbeforeunload === eventHandle ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2651
					this.onbeforeunload = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2652
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2653
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2654
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2655
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2656
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2657
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2658
jQuery.removeEvent = document.removeEventListener ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2659
	function( elem, type, handle ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2660
		if ( elem.removeEventListener ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2661
			elem.removeEventListener( type, handle, false );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2662
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2663
	} :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2664
	function( elem, type, handle ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2665
		if ( elem.detachEvent ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2666
			elem.detachEvent( "on" + type, handle );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2667
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2668
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2669
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2670
jQuery.Event = function( src ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2671
	// Allow instantiation without the 'new' keyword
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2672
	if ( !this.preventDefault ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2673
		return new jQuery.Event( src );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2674
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2675
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2676
	// Event object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2677
	if ( src && src.type ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2678
		this.originalEvent = src;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2679
		this.type = src.type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2680
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2681
		// Events bubbling up the document may have been marked as prevented
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2682
		// by a handler lower down the tree; reflect the correct value.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2683
		this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false || 
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2684
			src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2685
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2686
	// Event type
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2687
	} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2688
		this.type = src;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2689
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2690
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2691
	// timeStamp is buggy for some events on Firefox(#3843)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2692
	// So we won't rely on the native value
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2693
	this.timeStamp = jQuery.now();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2694
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2695
	// Mark it as fixed
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2696
	this[ jQuery.expando ] = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2697
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2698
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2699
function returnFalse() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2700
	return false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2701
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2702
function returnTrue() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2703
	return true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2704
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2705
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2706
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2707
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2708
jQuery.Event.prototype = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2709
	preventDefault: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2710
		this.isDefaultPrevented = returnTrue;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2711
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2712
		var e = this.originalEvent;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2713
		if ( !e ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2714
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2715
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2716
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2717
		// if preventDefault exists run it on the original event
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2718
		if ( e.preventDefault ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2719
			e.preventDefault();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2720
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2721
		// otherwise set the returnValue property of the original event to false (IE)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2722
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2723
			e.returnValue = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2724
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2725
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2726
	stopPropagation: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2727
		this.isPropagationStopped = returnTrue;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2728
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2729
		var e = this.originalEvent;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2730
		if ( !e ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2731
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2732
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2733
		// if stopPropagation exists run it on the original event
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2734
		if ( e.stopPropagation ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2735
			e.stopPropagation();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2736
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2737
		// otherwise set the cancelBubble property of the original event to true (IE)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2738
		e.cancelBubble = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2739
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2740
	stopImmediatePropagation: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2741
		this.isImmediatePropagationStopped = returnTrue;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2742
		this.stopPropagation();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2743
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2744
	isDefaultPrevented: returnFalse,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2745
	isPropagationStopped: returnFalse,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2746
	isImmediatePropagationStopped: returnFalse
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2747
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2748
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2749
// Checks if an event happened on an element within another element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2750
// Used in jQuery.event.special.mouseenter and mouseleave handlers
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2751
var withinElement = function( event ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2752
	// Check if mouse(over|out) are still within the same parent element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2753
	var parent = event.relatedTarget;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2754
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2755
	// Firefox sometimes assigns relatedTarget a XUL element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2756
	// which we cannot access the parentNode property of
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2757
	try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2758
		// Traverse up the tree
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2759
		while ( parent && parent !== this ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2760
			parent = parent.parentNode;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2761
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2762
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2763
		if ( parent !== this ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2764
			// set the correct event type
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2765
			event.type = event.data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2766
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2767
			// handle event if we actually just moused on to a non sub-element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2768
			jQuery.event.handle.apply( this, arguments );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2769
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2770
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2771
	// assuming we've left the element since we most likely mousedover a xul element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2772
	} catch(e) { }
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2773
},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2774
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2775
// In case of event delegation, we only need to rename the event.type,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2776
// liveHandler will take care of the rest.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2777
delegate = function( event ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2778
	event.type = event.data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2779
	jQuery.event.handle.apply( this, arguments );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2780
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2781
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2782
// Create mouseenter and mouseleave events
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2783
jQuery.each({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2784
	mouseenter: "mouseover",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2785
	mouseleave: "mouseout"
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2786
}, function( orig, fix ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2787
	jQuery.event.special[ orig ] = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2788
		setup: function( data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2789
			jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2790
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2791
		teardown: function( data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2792
			jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2793
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2794
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2795
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2796
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2797
// submit delegation
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2798
if ( !jQuery.support.submitBubbles ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2799
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2800
	jQuery.event.special.submit = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2801
		setup: function( data, namespaces ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2802
			if ( this.nodeName && this.nodeName.toLowerCase() !== "form" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2803
				jQuery.event.add(this, "click.specialSubmit", function( e ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2804
					var elem = e.target,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2805
						type = elem.type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2806
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2807
					if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2808
						e.liveFired = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2809
						return trigger( "submit", this, arguments );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2810
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2811
				});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2812
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2813
				jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2814
					var elem = e.target,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2815
						type = elem.type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2816
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2817
					if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2818
						e.liveFired = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2819
						return trigger( "submit", this, arguments );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2820
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2821
				});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2822
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2823
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2824
				return false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2825
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2826
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2827
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2828
		teardown: function( namespaces ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2829
			jQuery.event.remove( this, ".specialSubmit" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2830
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2831
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2832
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2833
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2834
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2835
// change delegation, happens here so we have bind.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2836
if ( !jQuery.support.changeBubbles ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2837
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2838
	var changeFilters,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2839
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2840
	getVal = function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2841
		var type = elem.type, val = elem.value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2842
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2843
		if ( type === "radio" || type === "checkbox" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2844
			val = elem.checked;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2845
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2846
		} else if ( type === "select-multiple" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2847
			val = elem.selectedIndex > -1 ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2848
				jQuery.map( elem.options, function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2849
					return elem.selected;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2850
				}).join("-") :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2851
				"";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2852
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2853
		} else if ( elem.nodeName.toLowerCase() === "select" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2854
			val = elem.selectedIndex;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2855
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2856
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2857
		return val;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2858
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2859
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2860
	testChange = function testChange( e ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2861
		var elem = e.target, data, val;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2862
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2863
		if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2864
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2865
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2866
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2867
		data = jQuery._data( elem, "_change_data" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2868
		val = getVal(elem);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2869
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2870
		// the current data will be also retrieved by beforeactivate
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2871
		if ( e.type !== "focusout" || elem.type !== "radio" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2872
			jQuery._data( elem, "_change_data", val );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2873
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2874
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2875
		if ( data === undefined || val === data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2876
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2877
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2878
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2879
		if ( data != null || val ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2880
			e.type = "change";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2881
			e.liveFired = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2882
			return jQuery.event.trigger( e, arguments[1], elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2883
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2884
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2885
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2886
	jQuery.event.special.change = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2887
		filters: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2888
			focusout: testChange,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2889
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2890
			beforedeactivate: testChange,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2891
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2892
			click: function( e ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2893
				var elem = e.target, type = elem.type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2894
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2895
				if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2896
					return testChange.call( this, e );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2897
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2898
			},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2899
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2900
			// Change has to be called before submit
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2901
			// Keydown will be called before keypress, which is used in submit-event delegation
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2902
			keydown: function( e ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2903
				var elem = e.target, type = elem.type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2904
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2905
				if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2906
					(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2907
					type === "select-multiple" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2908
					return testChange.call( this, e );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2909
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2910
			},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2911
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2912
			// Beforeactivate happens also before the previous element is blurred
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2913
			// with this event you can't trigger a change event, but you can store
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2914
			// information
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2915
			beforeactivate: function( e ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2916
				var elem = e.target;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2917
				jQuery._data( elem, "_change_data", getVal(elem) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2918
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2919
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2920
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2921
		setup: function( data, namespaces ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2922
			if ( this.type === "file" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2923
				return false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2924
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2925
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2926
			for ( var type in changeFilters ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2927
				jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2928
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2929
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2930
			return rformElems.test( this.nodeName );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2931
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2932
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2933
		teardown: function( namespaces ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2934
			jQuery.event.remove( this, ".specialChange" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2935
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2936
			return rformElems.test( this.nodeName );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2937
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2938
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2939
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2940
	changeFilters = jQuery.event.special.change.filters;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2941
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2942
	// Handle when the input is .focus()'d
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2943
	changeFilters.focus = changeFilters.beforeactivate;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2944
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2945
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2946
function trigger( type, elem, args ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2947
	args[0].type = type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2948
	return jQuery.event.handle.apply( elem, args );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2949
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2950
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2951
// Create "bubbling" focus and blur events
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2952
if ( document.addEventListener ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2953
	jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2954
		jQuery.event.special[ fix ] = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2955
			setup: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2956
				this.addEventListener( orig, handler, true );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2957
			}, 
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2958
			teardown: function() { 
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2959
				this.removeEventListener( orig, handler, true );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2960
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2961
		};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2962
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2963
		function handler( e ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2964
			e = jQuery.event.fix( e );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2965
			e.type = fix;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2966
			return jQuery.event.handle.call( this, e );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2967
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2968
	});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2969
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2970
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2971
jQuery.each(["bind", "one"], function( i, name ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2972
	jQuery.fn[ name ] = function( type, data, fn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2973
		// Handle object literals
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2974
		if ( typeof type === "object" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2975
			for ( var key in type ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2976
				this[ name ](key, data, type[key], fn);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2977
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2978
			return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2979
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2980
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2981
		if ( jQuery.isFunction( data ) || data === false ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2982
			fn = data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2983
			data = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2984
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2985
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2986
		var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2987
			jQuery( this ).unbind( event, handler );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2988
			return fn.apply( this, arguments );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2989
		}) : fn;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2990
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2991
		if ( type === "unload" && name !== "one" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2992
			this.one( type, data, fn );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2993
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2994
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2995
			for ( var i = 0, l = this.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2996
				jQuery.event.add( this[i], type, handler, data );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2997
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2998
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  2999
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3000
		return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3001
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3002
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3003
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3004
jQuery.fn.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3005
	unbind: function( type, fn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3006
		// Handle object literals
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3007
		if ( typeof type === "object" && !type.preventDefault ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3008
			for ( var key in type ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3009
				this.unbind(key, type[key]);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3010
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3011
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3012
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3013
			for ( var i = 0, l = this.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3014
				jQuery.event.remove( this[i], type, fn );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3015
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3016
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3017
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3018
		return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3019
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3020
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3021
	delegate: function( selector, types, data, fn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3022
		return this.live( types, data, fn, selector );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3023
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3024
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3025
	undelegate: function( selector, types, fn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3026
		if ( arguments.length === 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3027
				return this.unbind( "live" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3028
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3029
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3030
			return this.die( types, null, fn, selector );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3031
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3032
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3033
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3034
	trigger: function( type, data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3035
		return this.each(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3036
			jQuery.event.trigger( type, data, this );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3037
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3038
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3039
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3040
	triggerHandler: function( type, data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3041
		if ( this[0] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3042
			var event = jQuery.Event( type );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3043
			event.preventDefault();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3044
			event.stopPropagation();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3045
			jQuery.event.trigger( event, data, this[0] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3046
			return event.result;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3047
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3048
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3049
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3050
	toggle: function( fn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3051
		// Save reference to arguments for access in closure
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3052
		var args = arguments,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3053
			i = 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3054
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3055
		// link all the functions, so any of them can unbind this click handler
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3056
		while ( i < args.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3057
			jQuery.proxy( fn, args[ i++ ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3058
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3059
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3060
		return this.click( jQuery.proxy( fn, function( event ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3061
			// Figure out which function to execute
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3062
			var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3063
			jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3064
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3065
			// Make sure that clicks stop
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3066
			event.preventDefault();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3067
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3068
			// and execute the function
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3069
			return args[ lastToggle ].apply( this, arguments ) || false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3070
		}));
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3071
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3072
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3073
	hover: function( fnOver, fnOut ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3074
		return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3075
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3076
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3077
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3078
var liveMap = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3079
	focus: "focusin",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3080
	blur: "focusout",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3081
	mouseenter: "mouseover",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3082
	mouseleave: "mouseout"
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3083
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3084
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3085
jQuery.each(["live", "die"], function( i, name ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3086
	jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3087
		var type, i = 0, match, namespaces, preType,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3088
			selector = origSelector || this.selector,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3089
			context = origSelector ? this : jQuery( this.context );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3090
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3091
		if ( typeof types === "object" && !types.preventDefault ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3092
			for ( var key in types ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3093
				context[ name ]( key, data, types[key], selector );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3094
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3095
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3096
			return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3097
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3098
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3099
		if ( jQuery.isFunction( data ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3100
			fn = data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3101
			data = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3102
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3103
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3104
		types = (types || "").split(" ");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3105
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3106
		while ( (type = types[ i++ ]) != null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3107
			match = rnamespaces.exec( type );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3108
			namespaces = "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3109
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3110
			if ( match )  {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3111
				namespaces = match[0];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3112
				type = type.replace( rnamespaces, "" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3113
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3114
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3115
			if ( type === "hover" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3116
				types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3117
				continue;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3118
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3119
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3120
			preType = type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3121
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3122
			if ( type === "focus" || type === "blur" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3123
				types.push( liveMap[ type ] + namespaces );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3124
				type = type + namespaces;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3125
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3126
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3127
				type = (liveMap[ type ] || type) + namespaces;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3128
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3129
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3130
			if ( name === "live" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3131
				// bind live handler
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3132
				for ( var j = 0, l = context.length; j < l; j++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3133
					jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3134
						{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3135
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3136
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3137
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3138
				// unbind live handler
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3139
				context.unbind( "live." + liveConvert( type, selector ), fn );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3140
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3141
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3142
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3143
		return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3144
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3145
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3146
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3147
function liveHandler( event ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3148
	var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3149
		elems = [],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3150
		selectors = [],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3151
		events = jQuery._data( this, eventKey );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3152
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3153
	if ( typeof events === "function" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3154
		events = events.events;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3155
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3156
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3157
	// Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3158
	if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3159
		return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3160
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3161
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3162
	if ( event.namespace ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3163
		namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3164
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3165
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3166
	event.liveFired = this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3167
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3168
	var live = events.live.slice(0);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3169
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3170
	for ( j = 0; j < live.length; j++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3171
		handleObj = live[j];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3172
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3173
		if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3174
			selectors.push( handleObj.selector );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3175
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3176
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3177
			live.splice( j--, 1 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3178
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3179
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3180
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3181
	match = jQuery( event.target ).closest( selectors, event.currentTarget );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3182
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3183
	for ( i = 0, l = match.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3184
		close = match[i];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3185
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3186
		for ( j = 0; j < live.length; j++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3187
			handleObj = live[j];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3188
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3189
			if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3190
				elem = close.elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3191
				related = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3192
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3193
				// Those two events require additional checking
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3194
				if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3195
					event.type = handleObj.preType;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3196
					related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3197
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3198
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3199
				if ( !related || related !== elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3200
					elems.push({ elem: elem, handleObj: handleObj, level: close.level });
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3201
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3202
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3203
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3204
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3205
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3206
	for ( i = 0, l = elems.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3207
		match = elems[i];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3208
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3209
		if ( maxLevel && match.level > maxLevel ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3210
			break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3211
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3212
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3213
		event.currentTarget = match.elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3214
		event.data = match.handleObj.data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3215
		event.handleObj = match.handleObj;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3216
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3217
		ret = match.handleObj.origHandler.apply( match.elem, arguments );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3218
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3219
		if ( ret === false || event.isPropagationStopped() ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3220
			maxLevel = match.level;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3221
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3222
			if ( ret === false ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3223
				stop = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3224
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3225
			if ( event.isImmediatePropagationStopped() ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3226
				break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3227
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3228
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3229
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3230
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3231
	return stop;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3232
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3233
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3234
function liveConvert( type, selector ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3235
	return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3236
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3237
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3238
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3239
	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3240
	"change select submit keydown keypress keyup error").split(" "), function( i, name ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3241
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3242
	// Handle event binding
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3243
	jQuery.fn[ name ] = function( data, fn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3244
		if ( fn == null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3245
			fn = data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3246
			data = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3247
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3248
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3249
		return arguments.length > 0 ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3250
			this.bind( name, data, fn ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3251
			this.trigger( name );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3252
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3253
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3254
	if ( jQuery.attrFn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3255
		jQuery.attrFn[ name ] = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3256
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3257
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3258
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3259
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3260
/*!
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3261
 * Sizzle CSS Selector Engine
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3262
 *  Copyright 2011, The Dojo Foundation
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  3263
 *  Released under the MIT, BSD, and GPL Licenses.
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  3264
 *  More information: http://sizzlejs.com/
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  3265
 */
24
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3266
(function(){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3267
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3268
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3269
	done = 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3270
	toString = Object.prototype.toString,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3271
	hasDuplicate = false,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3272
	baseHasDuplicate = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3273
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3274
// Here we check if the JavaScript engine is using some sort of
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3275
// optimization where it does not always call our comparision
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3276
// function. If that is the case, discard the hasDuplicate value.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3277
//   Thus far that includes Google Chrome.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3278
[0, 0].sort(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3279
	baseHasDuplicate = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3280
	return 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3281
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3282
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3283
var Sizzle = function( selector, context, results, seed ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3284
	results = results || [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3285
	context = context || document;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3286
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3287
	var origContext = context;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3288
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3289
	if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3290
		return [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3291
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3292
	
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3293
	if ( !selector || typeof selector !== "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3294
		return results;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3295
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3296
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3297
	var m, set, checkSet, extra, ret, cur, pop, i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3298
		prune = true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3299
		contextXML = Sizzle.isXML( context ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3300
		parts = [],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3301
		soFar = selector;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3302
	
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3303
	// Reset the position of the chunker regexp (start from head)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3304
	do {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3305
		chunker.exec( "" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3306
		m = chunker.exec( soFar );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3307
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3308
		if ( m ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3309
			soFar = m[3];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3310
		
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3311
			parts.push( m[1] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3312
		
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3313
			if ( m[2] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3314
				extra = m[3];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3315
				break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3316
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3317
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3318
	} while ( m );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3319
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3320
	if ( parts.length > 1 && origPOS.exec( selector ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3321
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3322
		if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3323
			set = posProcess( parts[0] + parts[1], context );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3324
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3325
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3326
			set = Expr.relative[ parts[0] ] ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3327
				[ context ] :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3328
				Sizzle( parts.shift(), context );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3329
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3330
			while ( parts.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3331
				selector = parts.shift();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3332
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3333
				if ( Expr.relative[ selector ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3334
					selector += parts.shift();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3335
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3336
				
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3337
				set = posProcess( selector, set );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3338
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3339
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3340
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3341
	} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3342
		// Take a shortcut and set the context if the root selector is an ID
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3343
		// (but not if it'll be faster if the inner selector is an ID)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3344
		if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3345
				Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3346
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3347
			ret = Sizzle.find( parts.shift(), context, contextXML );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3348
			context = ret.expr ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3349
				Sizzle.filter( ret.expr, ret.set )[0] :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3350
				ret.set[0];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3351
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3352
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3353
		if ( context ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3354
			ret = seed ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3355
				{ expr: parts.pop(), set: makeArray(seed) } :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3356
				Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3357
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3358
			set = ret.expr ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3359
				Sizzle.filter( ret.expr, ret.set ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3360
				ret.set;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3361
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3362
			if ( parts.length > 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3363
				checkSet = makeArray( set );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3364
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3365
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3366
				prune = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3367
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3368
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3369
			while ( parts.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3370
				cur = parts.pop();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3371
				pop = cur;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3372
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3373
				if ( !Expr.relative[ cur ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3374
					cur = "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3375
				} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3376
					pop = parts.pop();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3377
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3378
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3379
				if ( pop == null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3380
					pop = context;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3381
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3382
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3383
				Expr.relative[ cur ]( checkSet, pop, contextXML );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3384
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3385
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3386
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3387
			checkSet = parts = [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3388
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3389
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3390
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3391
	if ( !checkSet ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3392
		checkSet = set;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3393
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3394
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3395
	if ( !checkSet ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3396
		Sizzle.error( cur || selector );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3397
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3398
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3399
	if ( toString.call(checkSet) === "[object Array]" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3400
		if ( !prune ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3401
			results.push.apply( results, checkSet );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3402
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3403
		} else if ( context && context.nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3404
			for ( i = 0; checkSet[i] != null; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3405
				if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3406
					results.push( set[i] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3407
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3408
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3409
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3410
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3411
			for ( i = 0; checkSet[i] != null; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3412
				if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3413
					results.push( set[i] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3414
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3415
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3416
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3417
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3418
	} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3419
		makeArray( checkSet, results );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3420
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3421
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3422
	if ( extra ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3423
		Sizzle( extra, origContext, results, seed );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3424
		Sizzle.uniqueSort( results );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3425
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3426
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3427
	return results;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3428
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3429
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3430
Sizzle.uniqueSort = function( results ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3431
	if ( sortOrder ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3432
		hasDuplicate = baseHasDuplicate;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3433
		results.sort( sortOrder );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3434
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3435
		if ( hasDuplicate ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3436
			for ( var i = 1; i < results.length; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3437
				if ( results[i] === results[ i - 1 ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3438
					results.splice( i--, 1 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3439
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3440
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3441
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3442
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3443
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3444
	return results;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3445
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3446
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3447
Sizzle.matches = function( expr, set ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3448
	return Sizzle( expr, null, null, set );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3449
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3450
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3451
Sizzle.matchesSelector = function( node, expr ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3452
	return Sizzle( expr, null, null, [node] ).length > 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3453
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3454
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3455
Sizzle.find = function( expr, context, isXML ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3456
	var set;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3457
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3458
	if ( !expr ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3459
		return [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3460
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3461
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3462
	for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3463
		var match,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3464
			type = Expr.order[i];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3465
		
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3466
		if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3467
			var left = match[1];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3468
			match.splice( 1, 1 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3469
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3470
			if ( left.substr( left.length - 1 ) !== "\\" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3471
				match[1] = (match[1] || "").replace(/\\/g, "");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3472
				set = Expr.find[ type ]( match, context, isXML );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3473
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3474
				if ( set != null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3475
					expr = expr.replace( Expr.match[ type ], "" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3476
					break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3477
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3478
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3479
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3480
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3481
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3482
	if ( !set ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3483
		set = typeof context.getElementsByTagName !== "undefined" ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3484
			context.getElementsByTagName( "*" ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3485
			[];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3486
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3487
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3488
	return { set: set, expr: expr };
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3489
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3490
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3491
Sizzle.filter = function( expr, set, inplace, not ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3492
	var match, anyFound,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3493
		old = expr,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3494
		result = [],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3495
		curLoop = set,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3496
		isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3497
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3498
	while ( expr && set.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3499
		for ( var type in Expr.filter ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3500
			if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3501
				var found, item,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3502
					filter = Expr.filter[ type ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3503
					left = match[1];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3504
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3505
				anyFound = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3506
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3507
				match.splice(1,1);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3508
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3509
				if ( left.substr( left.length - 1 ) === "\\" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3510
					continue;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3511
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3512
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3513
				if ( curLoop === result ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3514
					result = [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3515
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3516
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3517
				if ( Expr.preFilter[ type ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3518
					match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3519
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3520
					if ( !match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3521
						anyFound = found = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3522
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3523
					} else if ( match === true ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3524
						continue;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3525
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3526
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3527
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3528
				if ( match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3529
					for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3530
						if ( item ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3531
							found = filter( item, match, i, curLoop );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3532
							var pass = not ^ !!found;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3533
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3534
							if ( inplace && found != null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3535
								if ( pass ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3536
									anyFound = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3537
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3538
								} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3539
									curLoop[i] = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3540
								}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3541
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3542
							} else if ( pass ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3543
								result.push( item );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3544
								anyFound = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3545
							}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3546
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3547
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3548
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3549
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3550
				if ( found !== undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3551
					if ( !inplace ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3552
						curLoop = result;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3553
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3554
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3555
					expr = expr.replace( Expr.match[ type ], "" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3556
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3557
					if ( !anyFound ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3558
						return [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3559
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3560
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3561
					break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3562
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3563
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3564
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3565
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3566
		// Improper expression
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3567
		if ( expr === old ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3568
			if ( anyFound == null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3569
				Sizzle.error( expr );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3570
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3571
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3572
				break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3573
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3574
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3575
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3576
		old = expr;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3577
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3578
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3579
	return curLoop;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3580
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3581
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3582
Sizzle.error = function( msg ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3583
	throw "Syntax error, unrecognized expression: " + msg;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3584
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3585
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3586
var Expr = Sizzle.selectors = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3587
	order: [ "ID", "NAME", "TAG" ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3588
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3589
	match: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3590
		ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3591
		CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3592
		NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3593
		ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3594
		TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3595
		CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3596
		POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3597
		PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3598
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3599
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3600
	leftMatch: {},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3601
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3602
	attrMap: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3603
		"class": "className",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3604
		"for": "htmlFor"
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3605
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3606
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3607
	attrHandle: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3608
		href: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3609
			return elem.getAttribute( "href" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3610
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3611
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3612
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3613
	relative: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3614
		"+": function(checkSet, part){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3615
			var isPartStr = typeof part === "string",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3616
				isTag = isPartStr && !/\W/.test( part ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3617
				isPartStrNotTag = isPartStr && !isTag;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3618
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3619
			if ( isTag ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3620
				part = part.toLowerCase();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3621
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3622
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3623
			for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3624
				if ( (elem = checkSet[i]) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3625
					while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3626
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3627
					checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3628
						elem || false :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3629
						elem === part;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3630
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3631
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3632
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3633
			if ( isPartStrNotTag ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3634
				Sizzle.filter( part, checkSet, true );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3635
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3636
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3637
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3638
		">": function( checkSet, part ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3639
			var elem,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3640
				isPartStr = typeof part === "string",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3641
				i = 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3642
				l = checkSet.length;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3643
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3644
			if ( isPartStr && !/\W/.test( part ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3645
				part = part.toLowerCase();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3646
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3647
				for ( ; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3648
					elem = checkSet[i];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3649
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3650
					if ( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3651
						var parent = elem.parentNode;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3652
						checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3653
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3654
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3655
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3656
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3657
				for ( ; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3658
					elem = checkSet[i];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3659
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3660
					if ( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3661
						checkSet[i] = isPartStr ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3662
							elem.parentNode :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3663
							elem.parentNode === part;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3664
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3665
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3666
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3667
				if ( isPartStr ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3668
					Sizzle.filter( part, checkSet, true );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3669
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3670
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3671
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3672
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3673
		"": function(checkSet, part, isXML){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3674
			var nodeCheck,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3675
				doneName = done++,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3676
				checkFn = dirCheck;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3677
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3678
			if ( typeof part === "string" && !/\W/.test(part) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3679
				part = part.toLowerCase();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3680
				nodeCheck = part;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3681
				checkFn = dirNodeCheck;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3682
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3683
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3684
			checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3685
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3686
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3687
		"~": function( checkSet, part, isXML ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3688
			var nodeCheck,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3689
				doneName = done++,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3690
				checkFn = dirCheck;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3691
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3692
			if ( typeof part === "string" && !/\W/.test( part ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3693
				part = part.toLowerCase();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3694
				nodeCheck = part;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3695
				checkFn = dirNodeCheck;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3696
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3697
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3698
			checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3699
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3700
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3701
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3702
	find: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3703
		ID: function( match, context, isXML ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3704
			if ( typeof context.getElementById !== "undefined" && !isXML ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3705
				var m = context.getElementById(match[1]);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3706
				// Check parentNode to catch when Blackberry 4.6 returns
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3707
				// nodes that are no longer in the document #6963
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3708
				return m && m.parentNode ? [m] : [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3709
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3710
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3711
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3712
		NAME: function( match, context ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3713
			if ( typeof context.getElementsByName !== "undefined" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3714
				var ret = [],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3715
					results = context.getElementsByName( match[1] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3716
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3717
				for ( var i = 0, l = results.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3718
					if ( results[i].getAttribute("name") === match[1] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3719
						ret.push( results[i] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3720
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3721
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3722
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3723
				return ret.length === 0 ? null : ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3724
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3725
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3726
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3727
		TAG: function( match, context ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3728
			if ( typeof context.getElementsByTagName !== "undefined" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3729
				return context.getElementsByTagName( match[1] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3730
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3731
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3732
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3733
	preFilter: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3734
		CLASS: function( match, curLoop, inplace, result, not, isXML ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3735
			match = " " + match[1].replace(/\\/g, "") + " ";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3736
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3737
			if ( isXML ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3738
				return match;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3739
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3740
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3741
			for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3742
				if ( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3743
					if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3744
						if ( !inplace ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3745
							result.push( elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3746
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3747
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3748
					} else if ( inplace ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3749
						curLoop[i] = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3750
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3751
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3752
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3753
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3754
			return false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3755
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3756
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3757
		ID: function( match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3758
			return match[1].replace(/\\/g, "");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3759
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3760
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3761
		TAG: function( match, curLoop ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3762
			return match[1].toLowerCase();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3763
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3764
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3765
		CHILD: function( match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3766
			if ( match[1] === "nth" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3767
				if ( !match[2] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3768
					Sizzle.error( match[0] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3769
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3770
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3771
				match[2] = match[2].replace(/^\+|\s*/g, '');
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3772
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3773
				// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3774
				var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3775
					match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3776
					!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3777
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3778
				// calculate the numbers (first)n+(last) including if they are negative
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3779
				match[2] = (test[1] + (test[2] || 1)) - 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3780
				match[3] = test[3] - 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3781
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3782
			else if ( match[2] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3783
				Sizzle.error( match[0] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3784
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3785
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3786
			// TODO: Move to normal caching system
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3787
			match[0] = done++;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3788
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3789
			return match;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3790
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3791
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3792
		ATTR: function( match, curLoop, inplace, result, not, isXML ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3793
			var name = match[1] = match[1].replace(/\\/g, "");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3794
			
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3795
			if ( !isXML && Expr.attrMap[name] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3796
				match[1] = Expr.attrMap[name];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3797
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3798
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3799
			// Handle if an un-quoted value was used
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3800
			match[4] = ( match[4] || match[5] || "" ).replace(/\\/g, "");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3801
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3802
			if ( match[2] === "~=" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3803
				match[4] = " " + match[4] + " ";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3804
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3805
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3806
			return match;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3807
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3808
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3809
		PSEUDO: function( match, curLoop, inplace, result, not ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3810
			if ( match[1] === "not" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3811
				// If we're dealing with a complex expression, or a simple one
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3812
				if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3813
					match[3] = Sizzle(match[3], null, null, curLoop);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3814
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3815
				} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3816
					var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3817
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3818
					if ( !inplace ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3819
						result.push.apply( result, ret );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3820
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3821
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3822
					return false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3823
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3824
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3825
			} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3826
				return true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3827
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3828
			
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3829
			return match;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3830
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3831
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3832
		POS: function( match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3833
			match.unshift( true );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3834
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3835
			return match;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3836
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3837
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3838
	
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3839
	filters: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3840
		enabled: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3841
			return elem.disabled === false && elem.type !== "hidden";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3842
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3843
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3844
		disabled: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3845
			return elem.disabled === true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3846
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3847
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3848
		checked: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3849
			return elem.checked === true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3850
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3851
		
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3852
		selected: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3853
			// Accessing this property makes selected-by-default
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3854
			// options in Safari work properly
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3855
			elem.parentNode.selectedIndex;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3856
			
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3857
			return elem.selected === true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3858
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3859
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3860
		parent: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3861
			return !!elem.firstChild;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3862
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3863
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3864
		empty: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3865
			return !elem.firstChild;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3866
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3867
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3868
		has: function( elem, i, match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3869
			return !!Sizzle( match[3], elem ).length;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3870
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3871
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3872
		header: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3873
			return (/h\d/i).test( elem.nodeName );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3874
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3875
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3876
		text: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3877
			return "text" === elem.type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3878
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3879
		radio: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3880
			return "radio" === elem.type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3881
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3882
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3883
		checkbox: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3884
			return "checkbox" === elem.type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3885
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3886
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3887
		file: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3888
			return "file" === elem.type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3889
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3890
		password: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3891
			return "password" === elem.type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3892
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3893
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3894
		submit: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3895
			return "submit" === elem.type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3896
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3897
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3898
		image: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3899
			return "image" === elem.type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3900
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3901
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3902
		reset: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3903
			return "reset" === elem.type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3904
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3905
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3906
		button: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3907
			return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3908
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3909
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3910
		input: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3911
			return (/input|select|textarea|button/i).test( elem.nodeName );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3912
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3913
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3914
	setFilters: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3915
		first: function( elem, i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3916
			return i === 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3917
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3918
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3919
		last: function( elem, i, match, array ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3920
			return i === array.length - 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3921
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3922
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3923
		even: function( elem, i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3924
			return i % 2 === 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3925
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3926
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3927
		odd: function( elem, i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3928
			return i % 2 === 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3929
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3930
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3931
		lt: function( elem, i, match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3932
			return i < match[3] - 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3933
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3934
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3935
		gt: function( elem, i, match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3936
			return i > match[3] - 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3937
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3938
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3939
		nth: function( elem, i, match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3940
			return match[3] - 0 === i;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3941
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3942
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3943
		eq: function( elem, i, match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3944
			return match[3] - 0 === i;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3945
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3946
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3947
	filter: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3948
		PSEUDO: function( elem, match, i, array ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3949
			var name = match[1],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3950
				filter = Expr.filters[ name ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3951
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3952
			if ( filter ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3953
				return filter( elem, i, match, array );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3954
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3955
			} else if ( name === "contains" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3956
				return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3957
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3958
			} else if ( name === "not" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3959
				var not = match[3];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3960
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3961
				for ( var j = 0, l = not.length; j < l; j++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3962
					if ( not[j] === elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3963
						return false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3964
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3965
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3966
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3967
				return true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3968
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3969
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3970
				Sizzle.error( name );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3971
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3972
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3973
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3974
		CHILD: function( elem, match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3975
			var type = match[1],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3976
				node = elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3977
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3978
			switch ( type ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3979
				case "only":
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3980
				case "first":
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3981
					while ( (node = node.previousSibling) )	 {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3982
						if ( node.nodeType === 1 ) { 
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3983
							return false; 
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3984
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3985
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3986
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3987
					if ( type === "first" ) { 
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3988
						return true; 
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3989
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3990
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3991
					node = elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3992
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3993
				case "last":
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3994
					while ( (node = node.nextSibling) )	 {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3995
						if ( node.nodeType === 1 ) { 
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3996
							return false; 
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3997
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3998
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  3999
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4000
					return true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4001
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4002
				case "nth":
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4003
					var first = match[2],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4004
						last = match[3];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4005
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4006
					if ( first === 1 && last === 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4007
						return true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4008
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4009
					
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4010
					var doneName = match[0],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4011
						parent = elem.parentNode;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4012
	
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4013
					if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4014
						var count = 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4015
						
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4016
						for ( node = parent.firstChild; node; node = node.nextSibling ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4017
							if ( node.nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4018
								node.nodeIndex = ++count;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4019
							}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4020
						} 
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4021
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4022
						parent.sizcache = doneName;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4023
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4024
					
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4025
					var diff = elem.nodeIndex - last;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4026
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4027
					if ( first === 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4028
						return diff === 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4029
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4030
					} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4031
						return ( diff % first === 0 && diff / first >= 0 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4032
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4033
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4034
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4035
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4036
		ID: function( elem, match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4037
			return elem.nodeType === 1 && elem.getAttribute("id") === match;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4038
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4039
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4040
		TAG: function( elem, match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4041
			return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4042
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4043
		
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4044
		CLASS: function( elem, match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4045
			return (" " + (elem.className || elem.getAttribute("class")) + " ")
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4046
				.indexOf( match ) > -1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4047
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4048
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4049
		ATTR: function( elem, match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4050
			var name = match[1],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4051
				result = Expr.attrHandle[ name ] ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4052
					Expr.attrHandle[ name ]( elem ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4053
					elem[ name ] != null ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4054
						elem[ name ] :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4055
						elem.getAttribute( name ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4056
				value = result + "",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4057
				type = match[2],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4058
				check = match[4];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4059
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4060
			return result == null ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4061
				type === "!=" :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4062
				type === "=" ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4063
				value === check :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4064
				type === "*=" ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4065
				value.indexOf(check) >= 0 :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4066
				type === "~=" ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4067
				(" " + value + " ").indexOf(check) >= 0 :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4068
				!check ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4069
				value && result !== false :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4070
				type === "!=" ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4071
				value !== check :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4072
				type === "^=" ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4073
				value.indexOf(check) === 0 :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4074
				type === "$=" ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4075
				value.substr(value.length - check.length) === check :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4076
				type === "|=" ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4077
				value === check || value.substr(0, check.length + 1) === check + "-" :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4078
				false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4079
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4080
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4081
		POS: function( elem, match, i, array ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4082
			var name = match[2],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4083
				filter = Expr.setFilters[ name ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4084
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4085
			if ( filter ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4086
				return filter( elem, i, match, array );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4087
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4088
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4089
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4090
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4091
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4092
var origPOS = Expr.match.POS,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4093
	fescape = function(all, num){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4094
		return "\\" + (num - 0 + 1);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4095
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4096
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4097
for ( var type in Expr.match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4098
	Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4099
	Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4100
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4101
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4102
var makeArray = function( array, results ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4103
	array = Array.prototype.slice.call( array, 0 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4104
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4105
	if ( results ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4106
		results.push.apply( results, array );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4107
		return results;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4108
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4109
	
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4110
	return array;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4111
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4112
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4113
// Perform a simple check to determine if the browser is capable of
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4114
// converting a NodeList to an array using builtin methods.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4115
// Also verifies that the returned array holds DOM nodes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4116
// (which is not the case in the Blackberry browser)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4117
try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4118
	Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4119
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4120
// Provide a fallback method if it does not work
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4121
} catch( e ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4122
	makeArray = function( array, results ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4123
		var i = 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4124
			ret = results || [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4125
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4126
		if ( toString.call(array) === "[object Array]" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4127
			Array.prototype.push.apply( ret, array );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4128
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4129
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4130
			if ( typeof array.length === "number" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4131
				for ( var l = array.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4132
					ret.push( array[i] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4133
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4134
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4135
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4136
				for ( ; array[i]; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4137
					ret.push( array[i] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4138
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4139
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4140
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4141
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4142
		return ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4143
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4144
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4145
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4146
var sortOrder, siblingCheck;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4147
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4148
if ( document.documentElement.compareDocumentPosition ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4149
	sortOrder = function( a, b ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4150
		if ( a === b ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4151
			hasDuplicate = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4152
			return 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4153
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4154
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4155
		if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4156
			return a.compareDocumentPosition ? -1 : 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4157
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4158
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4159
		return a.compareDocumentPosition(b) & 4 ? -1 : 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4160
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4161
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4162
} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4163
	sortOrder = function( a, b ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4164
		var al, bl,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4165
			ap = [],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4166
			bp = [],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4167
			aup = a.parentNode,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4168
			bup = b.parentNode,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4169
			cur = aup;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4170
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4171
		// The nodes are identical, we can exit early
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4172
		if ( a === b ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4173
			hasDuplicate = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4174
			return 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4175
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4176
		// If the nodes are siblings (or identical) we can do a quick check
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4177
		} else if ( aup === bup ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4178
			return siblingCheck( a, b );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4179
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4180
		// If no parents were found then the nodes are disconnected
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4181
		} else if ( !aup ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4182
			return -1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4183
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4184
		} else if ( !bup ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4185
			return 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4186
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4187
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4188
		// Otherwise they're somewhere else in the tree so we need
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4189
		// to build up a full list of the parentNodes for comparison
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4190
		while ( cur ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4191
			ap.unshift( cur );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4192
			cur = cur.parentNode;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4193
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4194
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4195
		cur = bup;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4196
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4197
		while ( cur ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4198
			bp.unshift( cur );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4199
			cur = cur.parentNode;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4200
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4201
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4202
		al = ap.length;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4203
		bl = bp.length;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4204
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4205
		// Start walking down the tree looking for a discrepancy
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4206
		for ( var i = 0; i < al && i < bl; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4207
			if ( ap[i] !== bp[i] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4208
				return siblingCheck( ap[i], bp[i] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4209
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4210
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4211
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4212
		// We ended someplace up the tree so do a sibling check
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4213
		return i === al ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4214
			siblingCheck( a, bp[i], -1 ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4215
			siblingCheck( ap[i], b, 1 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4216
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4217
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4218
	siblingCheck = function( a, b, ret ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4219
		if ( a === b ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4220
			return ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4221
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4222
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4223
		var cur = a.nextSibling;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4224
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4225
		while ( cur ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4226
			if ( cur === b ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4227
				return -1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4228
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4229
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4230
			cur = cur.nextSibling;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4231
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4232
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4233
		return 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4234
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4235
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4236
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4237
// Utility function for retreiving the text value of an array of DOM nodes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4238
Sizzle.getText = function( elems ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4239
	var ret = "", elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4240
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4241
	for ( var i = 0; elems[i]; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4242
		elem = elems[i];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4243
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4244
		// Get the text from text nodes and CDATA nodes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4245
		if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4246
			ret += elem.nodeValue;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4247
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4248
		// Traverse everything else, except comment nodes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4249
		} else if ( elem.nodeType !== 8 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4250
			ret += Sizzle.getText( elem.childNodes );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4251
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4252
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4253
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4254
	return ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4255
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4256
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4257
// Check to see if the browser returns elements by name when
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4258
// querying by getElementById (and provide a workaround)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4259
(function(){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4260
	// We're going to inject a fake input element with a specified name
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4261
	var form = document.createElement("div"),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4262
		id = "script" + (new Date()).getTime(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4263
		root = document.documentElement;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4264
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4265
	form.innerHTML = "<a name='" + id + "'/>";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4266
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4267
	// Inject it into the root element, check its status, and remove it quickly
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4268
	root.insertBefore( form, root.firstChild );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4269
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4270
	// The workaround has to do additional checks after a getElementById
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4271
	// Which slows things down for other browsers (hence the branching)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4272
	if ( document.getElementById( id ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4273
		Expr.find.ID = function( match, context, isXML ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4274
			if ( typeof context.getElementById !== "undefined" && !isXML ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4275
				var m = context.getElementById(match[1]);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4276
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4277
				return m ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4278
					m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4279
						[m] :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4280
						undefined :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4281
					[];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4282
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4283
		};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4284
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4285
		Expr.filter.ID = function( elem, match ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4286
			var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4287
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4288
			return elem.nodeType === 1 && node && node.nodeValue === match;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4289
		};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4290
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4291
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4292
	root.removeChild( form );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4293
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4294
	// release memory in IE
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4295
	root = form = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4296
})();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4297
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4298
(function(){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4299
	// Check to see if the browser returns only elements
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4300
	// when doing getElementsByTagName("*")
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4301
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4302
	// Create a fake element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4303
	var div = document.createElement("div");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4304
	div.appendChild( document.createComment("") );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4305
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4306
	// Make sure no comments are found
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4307
	if ( div.getElementsByTagName("*").length > 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4308
		Expr.find.TAG = function( match, context ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4309
			var results = context.getElementsByTagName( match[1] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4310
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4311
			// Filter out possible comments
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4312
			if ( match[1] === "*" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4313
				var tmp = [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4314
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4315
				for ( var i = 0; results[i]; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4316
					if ( results[i].nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4317
						tmp.push( results[i] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4318
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4319
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4320
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4321
				results = tmp;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4322
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4323
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4324
			return results;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4325
		};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4326
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4327
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4328
	// Check to see if an attribute returns normalized href attributes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4329
	div.innerHTML = "<a href='#'></a>";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4330
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4331
	if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4332
			div.firstChild.getAttribute("href") !== "#" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4333
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4334
		Expr.attrHandle.href = function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4335
			return elem.getAttribute( "href", 2 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4336
		};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4337
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4338
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4339
	// release memory in IE
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4340
	div = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4341
})();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4342
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4343
if ( document.querySelectorAll ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4344
	(function(){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4345
		var oldSizzle = Sizzle,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4346
			div = document.createElement("div"),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4347
			id = "__sizzle__";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4348
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4349
		div.innerHTML = "<p class='TEST'></p>";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4350
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4351
		// Safari can't handle uppercase or unicode characters when
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4352
		// in quirks mode.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4353
		if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4354
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4355
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4356
	
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4357
		Sizzle = function( query, context, extra, seed ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4358
			context = context || document;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4359
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4360
			// Only use querySelectorAll on non-XML documents
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4361
			// (ID selectors don't work in non-HTML documents)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4362
			if ( !seed && !Sizzle.isXML(context) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4363
				// See if we find a selector to speed up
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4364
				var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4365
				
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4366
				if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4367
					// Speed-up: Sizzle("TAG")
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4368
					if ( match[1] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4369
						return makeArray( context.getElementsByTagName( query ), extra );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4370
					
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4371
					// Speed-up: Sizzle(".CLASS")
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4372
					} else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4373
						return makeArray( context.getElementsByClassName( match[2] ), extra );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4374
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4375
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4376
				
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4377
				if ( context.nodeType === 9 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4378
					// Speed-up: Sizzle("body")
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4379
					// The body element only exists once, optimize finding it
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4380
					if ( query === "body" && context.body ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4381
						return makeArray( [ context.body ], extra );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4382
						
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4383
					// Speed-up: Sizzle("#ID")
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4384
					} else if ( match && match[3] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4385
						var elem = context.getElementById( match[3] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4386
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4387
						// Check parentNode to catch when Blackberry 4.6 returns
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4388
						// nodes that are no longer in the document #6963
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4389
						if ( elem && elem.parentNode ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4390
							// Handle the case where IE and Opera return items
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4391
							// by name instead of ID
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4392
							if ( elem.id === match[3] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4393
								return makeArray( [ elem ], extra );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4394
							}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4395
							
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4396
						} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4397
							return makeArray( [], extra );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4398
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4399
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4400
					
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4401
					try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4402
						return makeArray( context.querySelectorAll(query), extra );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4403
					} catch(qsaError) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4404
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4405
				// qSA works strangely on Element-rooted queries
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4406
				// We can work around this by specifying an extra ID on the root
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4407
				// and working up from there (Thanks to Andrew Dupont for the technique)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4408
				// IE 8 doesn't work on object elements
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4409
				} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4410
					var old = context.getAttribute( "id" ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4411
						nid = old || id,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4412
						hasParent = context.parentNode,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4413
						relativeHierarchySelector = /^\s*[+~]/.test( query );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4414
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4415
					if ( !old ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4416
						context.setAttribute( "id", nid );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4417
					} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4418
						nid = nid.replace( /'/g, "\\$&" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4419
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4420
					if ( relativeHierarchySelector && hasParent ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4421
						context = context.parentNode;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4422
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4423
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4424
					try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4425
						if ( !relativeHierarchySelector || hasParent ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4426
							return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4427
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4428
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4429
					} catch(pseudoError) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4430
					} finally {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4431
						if ( !old ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4432
							context.removeAttribute( "id" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4433
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4434
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4435
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4436
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4437
		
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4438
			return oldSizzle(query, context, extra, seed);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4439
		};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4440
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4441
		for ( var prop in oldSizzle ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4442
			Sizzle[ prop ] = oldSizzle[ prop ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4443
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4444
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4445
		// release memory in IE
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4446
		div = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4447
	})();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4448
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4449
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4450
(function(){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4451
	var html = document.documentElement,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4452
		matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4453
		pseudoWorks = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4454
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4455
	try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4456
		// This should fail with an exception
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4457
		// Gecko does not error, returns false instead
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4458
		matches.call( document.documentElement, "[test!='']:sizzle" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4459
	
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4460
	} catch( pseudoError ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4461
		pseudoWorks = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4462
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4463
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4464
	if ( matches ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4465
		Sizzle.matchesSelector = function( node, expr ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4466
			// Make sure that attribute selectors are quoted
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4467
			expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4468
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4469
			if ( !Sizzle.isXML( node ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4470
				try { 
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4471
					if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4472
						return matches.call( node, expr );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4473
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4474
				} catch(e) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4475
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4476
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4477
			return Sizzle(expr, null, null, [node]).length > 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4478
		};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4479
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4480
})();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4481
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4482
(function(){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4483
	var div = document.createElement("div");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4484
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4485
	div.innerHTML = "<div class='test e'></div><div class='test'></div>";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4486
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4487
	// Opera can't find a second classname (in 9.6)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4488
	// Also, make sure that getElementsByClassName actually exists
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4489
	if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4490
		return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4491
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4492
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4493
	// Safari caches class attributes, doesn't catch changes (in 3.2)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4494
	div.lastChild.className = "e";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4495
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4496
	if ( div.getElementsByClassName("e").length === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4497
		return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4498
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4499
	
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4500
	Expr.order.splice(1, 0, "CLASS");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4501
	Expr.find.CLASS = function( match, context, isXML ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4502
		if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4503
			return context.getElementsByClassName(match[1]);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4504
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4505
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4506
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4507
	// release memory in IE
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4508
	div = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4509
})();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4510
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4511
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4512
	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4513
		var elem = checkSet[i];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4514
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4515
		if ( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4516
			var match = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4517
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4518
			elem = elem[dir];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4519
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4520
			while ( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4521
				if ( elem.sizcache === doneName ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4522
					match = checkSet[elem.sizset];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4523
					break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4524
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4525
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4526
				if ( elem.nodeType === 1 && !isXML ){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4527
					elem.sizcache = doneName;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4528
					elem.sizset = i;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4529
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4530
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4531
				if ( elem.nodeName.toLowerCase() === cur ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4532
					match = elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4533
					break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4534
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4535
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4536
				elem = elem[dir];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4537
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4538
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4539
			checkSet[i] = match;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4540
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4541
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4542
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4543
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4544
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4545
	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4546
		var elem = checkSet[i];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4547
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4548
		if ( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4549
			var match = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4550
			
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4551
			elem = elem[dir];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4552
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4553
			while ( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4554
				if ( elem.sizcache === doneName ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4555
					match = checkSet[elem.sizset];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4556
					break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4557
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4558
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4559
				if ( elem.nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4560
					if ( !isXML ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4561
						elem.sizcache = doneName;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4562
						elem.sizset = i;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4563
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4564
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4565
					if ( typeof cur !== "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4566
						if ( elem === cur ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4567
							match = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4568
							break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4569
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4570
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4571
					} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4572
						match = elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4573
						break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4574
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4575
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4576
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4577
				elem = elem[dir];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4578
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4579
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4580
			checkSet[i] = match;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4581
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4582
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4583
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4584
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4585
if ( document.documentElement.contains ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4586
	Sizzle.contains = function( a, b ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4587
		return a !== b && (a.contains ? a.contains(b) : true);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4588
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4589
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4590
} else if ( document.documentElement.compareDocumentPosition ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4591
	Sizzle.contains = function( a, b ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4592
		return !!(a.compareDocumentPosition(b) & 16);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4593
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4594
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4595
} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4596
	Sizzle.contains = function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4597
		return false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4598
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4599
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4600
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4601
Sizzle.isXML = function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4602
	// documentElement is verified for cases where it doesn't yet exist
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4603
	// (such as loading iframes in IE - #4833) 
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4604
	var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4605
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4606
	return documentElement ? documentElement.nodeName !== "HTML" : false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4607
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4608
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4609
var posProcess = function( selector, context ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4610
	var match,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4611
		tmpSet = [],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4612
		later = "",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4613
		root = context.nodeType ? [context] : context;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4614
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4615
	// Position selectors must be done after the filter
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4616
	// And so must :not(positional) so we move all PSEUDOs to the end
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4617
	while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4618
		later += match[0];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4619
		selector = selector.replace( Expr.match.PSEUDO, "" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4620
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4621
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4622
	selector = Expr.relative[selector] ? selector + "*" : selector;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4623
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4624
	for ( var i = 0, l = root.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4625
		Sizzle( selector, root[i], tmpSet );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4626
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4627
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4628
	return Sizzle.filter( later, tmpSet );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4629
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4630
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4631
// EXPOSE
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4632
jQuery.find = Sizzle;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4633
jQuery.expr = Sizzle.selectors;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4634
jQuery.expr[":"] = jQuery.expr.filters;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4635
jQuery.unique = Sizzle.uniqueSort;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4636
jQuery.text = Sizzle.getText;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4637
jQuery.isXMLDoc = Sizzle.isXML;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4638
jQuery.contains = Sizzle.contains;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4639
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4640
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4641
})();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4642
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4643
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4644
var runtil = /Until$/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4645
	rparentsprev = /^(?:parents|prevUntil|prevAll)/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4646
	// Note: This RegExp should be improved, or likely pulled from Sizzle
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4647
	rmultiselector = /,/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4648
	isSimple = /^.[^:#\[\.,]*$/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4649
	slice = Array.prototype.slice,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4650
	POS = jQuery.expr.match.POS,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4651
	// methods guaranteed to produce a unique set when starting from a unique set
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4652
	guaranteedUnique = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4653
		children: true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4654
		contents: true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4655
		next: true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4656
		prev: true
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4657
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4658
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4659
jQuery.fn.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4660
	find: function( selector ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4661
		var ret = this.pushStack( "", "find", selector ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4662
			length = 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4663
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4664
		for ( var i = 0, l = this.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4665
			length = ret.length;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4666
			jQuery.find( selector, this[i], ret );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4667
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4668
			if ( i > 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4669
				// Make sure that the results are unique
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4670
				for ( var n = length; n < ret.length; n++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4671
					for ( var r = 0; r < length; r++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4672
						if ( ret[r] === ret[n] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4673
							ret.splice(n--, 1);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4674
							break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4675
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4676
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4677
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4678
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4679
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4680
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4681
		return ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4682
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4683
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4684
	has: function( target ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4685
		var targets = jQuery( target );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4686
		return this.filter(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4687
			for ( var i = 0, l = targets.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4688
				if ( jQuery.contains( this, targets[i] ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4689
					return true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4690
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4691
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4692
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4693
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4694
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4695
	not: function( selector ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4696
		return this.pushStack( winnow(this, selector, false), "not", selector);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4697
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4698
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4699
	filter: function( selector ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4700
		return this.pushStack( winnow(this, selector, true), "filter", selector );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4701
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4702
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4703
	is: function( selector ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4704
		return !!selector && jQuery.filter( selector, this ).length > 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4705
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4706
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4707
	closest: function( selectors, context ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4708
		var ret = [], i, l, cur = this[0];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4709
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4710
		if ( jQuery.isArray( selectors ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4711
			var match, selector,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4712
				matches = {},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4713
				level = 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4714
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4715
			if ( cur && selectors.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4716
				for ( i = 0, l = selectors.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4717
					selector = selectors[i];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4718
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4719
					if ( !matches[selector] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4720
						matches[selector] = jQuery.expr.match.POS.test( selector ) ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4721
							jQuery( selector, context || this.context ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4722
							selector;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4723
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4724
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4725
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4726
				while ( cur && cur.ownerDocument && cur !== context ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4727
					for ( selector in matches ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4728
						match = matches[selector];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4729
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4730
						if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4731
							ret.push({ selector: selector, elem: cur, level: level });
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4732
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4733
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4734
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4735
					cur = cur.parentNode;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4736
					level++;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4737
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4738
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4739
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4740
			return ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4741
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4742
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4743
		var pos = POS.test( selectors ) ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4744
			jQuery( selectors, context || this.context ) : null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4745
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4746
		for ( i = 0, l = this.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4747
			cur = this[i];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4748
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4749
			while ( cur ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4750
				if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4751
					ret.push( cur );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4752
					break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4753
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4754
				} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4755
					cur = cur.parentNode;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4756
					if ( !cur || !cur.ownerDocument || cur === context ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4757
						break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4758
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4759
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4760
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4761
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4762
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4763
		ret = ret.length > 1 ? jQuery.unique(ret) : ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4764
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4765
		return this.pushStack( ret, "closest", selectors );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4766
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4767
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4768
	// Determine the position of an element within
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4769
	// the matched set of elements
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4770
	index: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4771
		if ( !elem || typeof elem === "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4772
			return jQuery.inArray( this[0],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4773
				// If it receives a string, the selector is used
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4774
				// If it receives nothing, the siblings are used
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4775
				elem ? jQuery( elem ) : this.parent().children() );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4776
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4777
		// Locate the position of the desired element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4778
		return jQuery.inArray(
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4779
			// If it receives a jQuery object, the first element is used
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4780
			elem.jquery ? elem[0] : elem, this );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4781
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4782
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4783
	add: function( selector, context ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4784
		var set = typeof selector === "string" ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4785
				jQuery( selector, context ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4786
				jQuery.makeArray( selector ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4787
			all = jQuery.merge( this.get(), set );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4788
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4789
		return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4790
			all :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4791
			jQuery.unique( all ) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4792
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4793
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4794
	andSelf: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4795
		return this.add( this.prevObject );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4796
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4797
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4798
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4799
// A painfully simple check to see if an element is disconnected
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4800
// from a document (should be improved, where feasible).
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4801
function isDisconnected( node ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4802
	return !node || !node.parentNode || node.parentNode.nodeType === 11;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4803
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4804
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4805
jQuery.each({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4806
	parent: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4807
		var parent = elem.parentNode;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4808
		return parent && parent.nodeType !== 11 ? parent : null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4809
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4810
	parents: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4811
		return jQuery.dir( elem, "parentNode" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4812
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4813
	parentsUntil: function( elem, i, until ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4814
		return jQuery.dir( elem, "parentNode", until );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4815
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4816
	next: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4817
		return jQuery.nth( elem, 2, "nextSibling" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4818
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4819
	prev: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4820
		return jQuery.nth( elem, 2, "previousSibling" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4821
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4822
	nextAll: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4823
		return jQuery.dir( elem, "nextSibling" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4824
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4825
	prevAll: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4826
		return jQuery.dir( elem, "previousSibling" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4827
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4828
	nextUntil: function( elem, i, until ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4829
		return jQuery.dir( elem, "nextSibling", until );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4830
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4831
	prevUntil: function( elem, i, until ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4832
		return jQuery.dir( elem, "previousSibling", until );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4833
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4834
	siblings: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4835
		return jQuery.sibling( elem.parentNode.firstChild, elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4836
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4837
	children: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4838
		return jQuery.sibling( elem.firstChild );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4839
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4840
	contents: function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4841
		return jQuery.nodeName( elem, "iframe" ) ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4842
			elem.contentDocument || elem.contentWindow.document :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4843
			jQuery.makeArray( elem.childNodes );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4844
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4845
}, function( name, fn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4846
	jQuery.fn[ name ] = function( until, selector ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4847
		var ret = jQuery.map( this, fn, until ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4848
                // The variable 'args' was introduced in
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4849
                // https://github.com/jquery/jquery/commit/52a0238
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4850
                // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4851
                // http://code.google.com/p/v8/issues/detail?id=1050
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4852
                    args = slice.call(arguments);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4853
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4854
		if ( !runtil.test( name ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4855
			selector = until;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4856
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4857
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4858
		if ( selector && typeof selector === "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4859
			ret = jQuery.filter( selector, ret );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4860
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4861
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4862
		ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4863
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4864
		if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4865
			ret = ret.reverse();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4866
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4867
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4868
		return this.pushStack( ret, name, args.join(",") );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4869
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4870
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4871
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4872
jQuery.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4873
	filter: function( expr, elems, not ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4874
		if ( not ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4875
			expr = ":not(" + expr + ")";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4876
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4877
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4878
		return elems.length === 1 ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4879
			jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4880
			jQuery.find.matches(expr, elems);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4881
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4882
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4883
	dir: function( elem, dir, until ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4884
		var matched = [],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4885
			cur = elem[ dir ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4886
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4887
		while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4888
			if ( cur.nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4889
				matched.push( cur );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4890
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4891
			cur = cur[dir];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4892
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4893
		return matched;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4894
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4895
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4896
	nth: function( cur, result, dir, elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4897
		result = result || 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4898
		var num = 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4899
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4900
		for ( ; cur; cur = cur[dir] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4901
			if ( cur.nodeType === 1 && ++num === result ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4902
				break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4903
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4904
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4905
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4906
		return cur;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4907
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4908
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4909
	sibling: function( n, elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4910
		var r = [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4911
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4912
		for ( ; n; n = n.nextSibling ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4913
			if ( n.nodeType === 1 && n !== elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4914
				r.push( n );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4915
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4916
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4917
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4918
		return r;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4919
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4920
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4921
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4922
// Implement the identical functionality for filter and not
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4923
function winnow( elements, qualifier, keep ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4924
	if ( jQuery.isFunction( qualifier ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4925
		return jQuery.grep(elements, function( elem, i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4926
			var retVal = !!qualifier.call( elem, i, elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4927
			return retVal === keep;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4928
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4929
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4930
	} else if ( qualifier.nodeType ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4931
		return jQuery.grep(elements, function( elem, i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4932
			return (elem === qualifier) === keep;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4933
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4934
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4935
	} else if ( typeof qualifier === "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4936
		var filtered = jQuery.grep(elements, function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4937
			return elem.nodeType === 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4938
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4939
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4940
		if ( isSimple.test( qualifier ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4941
			return jQuery.filter(qualifier, filtered, !keep);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4942
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4943
			qualifier = jQuery.filter( qualifier, filtered );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4944
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4945
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4946
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4947
	return jQuery.grep(elements, function( elem, i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4948
		return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4949
	});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4950
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4951
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4952
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4953
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4954
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4955
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4956
	rleadingWhitespace = /^\s+/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4957
	rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4958
	rtagName = /<([\w:]+)/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4959
	rtbody = /<tbody/i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4960
	rhtml = /<|&#?\w+;/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4961
	rnocache = /<(?:script|object|embed|option|style)/i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4962
	// checked="checked" or checked (html5)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4963
	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4964
	wrapMap = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4965
		option: [ 1, "<select multiple='multiple'>", "</select>" ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4966
		legend: [ 1, "<fieldset>", "</fieldset>" ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4967
		thead: [ 1, "<table>", "</table>" ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4968
		tr: [ 2, "<table><tbody>", "</tbody></table>" ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4969
		td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4970
		col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4971
		area: [ 1, "<map>", "</map>" ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4972
		_default: [ 0, "", "" ]
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4973
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4974
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4975
wrapMap.optgroup = wrapMap.option;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4976
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4977
wrapMap.th = wrapMap.td;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4978
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4979
// IE can't serialize <link> and <script> tags normally
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4980
if ( !jQuery.support.htmlSerialize ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4981
	wrapMap._default = [ 1, "div<div>", "</div>" ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4982
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4983
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4984
jQuery.fn.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4985
	text: function( text ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4986
		if ( jQuery.isFunction(text) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4987
			return this.each(function(i) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4988
				var self = jQuery( this );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4989
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4990
				self.text( text.call(this, i, self.text()) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4991
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4992
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4993
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4994
		if ( typeof text !== "object" && text !== undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4995
			return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4996
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4997
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4998
		return jQuery.text( this );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  4999
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5000
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5001
	wrapAll: function( html ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5002
		if ( jQuery.isFunction( html ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5003
			return this.each(function(i) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5004
				jQuery(this).wrapAll( html.call(this, i) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5005
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5006
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5007
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5008
		if ( this[0] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5009
			// The elements to wrap the target around
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5010
			var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5011
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5012
			if ( this[0].parentNode ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5013
				wrap.insertBefore( this[0] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5014
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5015
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5016
			wrap.map(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5017
				var elem = this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5018
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5019
				while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5020
					elem = elem.firstChild;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5021
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5022
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5023
				return elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5024
			}).append(this);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5025
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5026
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5027
		return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5028
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5029
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5030
	wrapInner: function( html ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5031
		if ( jQuery.isFunction( html ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5032
			return this.each(function(i) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5033
				jQuery(this).wrapInner( html.call(this, i) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5034
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5035
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5036
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5037
		return this.each(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5038
			var self = jQuery( this ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5039
				contents = self.contents();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5040
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5041
			if ( contents.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5042
				contents.wrapAll( html );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5043
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5044
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5045
				self.append( html );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5046
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5047
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5048
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5049
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5050
	wrap: function( html ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5051
		return this.each(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5052
			jQuery( this ).wrapAll( html );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5053
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5054
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5055
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5056
	unwrap: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5057
		return this.parent().each(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5058
			if ( !jQuery.nodeName( this, "body" ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5059
				jQuery( this ).replaceWith( this.childNodes );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5060
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5061
		}).end();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5062
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5063
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5064
	append: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5065
		return this.domManip(arguments, true, function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5066
			if ( this.nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5067
				this.appendChild( elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5068
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5069
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5070
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5071
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5072
	prepend: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5073
		return this.domManip(arguments, true, function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5074
			if ( this.nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5075
				this.insertBefore( elem, this.firstChild );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5076
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5077
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5078
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5079
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5080
	before: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5081
		if ( this[0] && this[0].parentNode ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5082
			return this.domManip(arguments, false, function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5083
				this.parentNode.insertBefore( elem, this );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5084
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5085
		} else if ( arguments.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5086
			var set = jQuery(arguments[0]);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5087
			set.push.apply( set, this.toArray() );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5088
			return this.pushStack( set, "before", arguments );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5089
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5090
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5091
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5092
	after: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5093
		if ( this[0] && this[0].parentNode ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5094
			return this.domManip(arguments, false, function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5095
				this.parentNode.insertBefore( elem, this.nextSibling );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5096
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5097
		} else if ( arguments.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5098
			var set = this.pushStack( this, "after", arguments );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5099
			set.push.apply( set, jQuery(arguments[0]).toArray() );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5100
			return set;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5101
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5102
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5103
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5104
	// keepData is for internal use only--do not document
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5105
	remove: function( selector, keepData ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5106
		for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5107
			if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5108
				if ( !keepData && elem.nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5109
					jQuery.cleanData( elem.getElementsByTagName("*") );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5110
					jQuery.cleanData( [ elem ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5111
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5112
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5113
				if ( elem.parentNode ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5114
					 elem.parentNode.removeChild( elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5115
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5116
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5117
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5118
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5119
		return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5120
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5121
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5122
	empty: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5123
		for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5124
			// Remove element nodes and prevent memory leaks
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5125
			if ( elem.nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5126
				jQuery.cleanData( elem.getElementsByTagName("*") );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5127
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5128
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5129
			// Remove any remaining nodes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5130
			while ( elem.firstChild ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5131
				elem.removeChild( elem.firstChild );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5132
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5133
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5134
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5135
		return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5136
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5137
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5138
	clone: function( dataAndEvents, deepDataAndEvents ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5139
		dataAndEvents = dataAndEvents == null ? true : dataAndEvents;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5140
		deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5141
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5142
		return this.map( function () {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5143
			return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5144
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5145
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5146
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5147
	html: function( value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5148
		if ( value === undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5149
			return this[0] && this[0].nodeType === 1 ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5150
				this[0].innerHTML.replace(rinlinejQuery, "") :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5151
				null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5152
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5153
		// See if we can take a shortcut and just use innerHTML
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5154
		} else if ( typeof value === "string" && !rnocache.test( value ) &&
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5155
			(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5156
			!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5157
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5158
			value = value.replace(rxhtmlTag, "<$1></$2>");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5159
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5160
			try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5161
				for ( var i = 0, l = this.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5162
					// Remove element nodes and prevent memory leaks
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5163
					if ( this[i].nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5164
						jQuery.cleanData( this[i].getElementsByTagName("*") );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5165
						this[i].innerHTML = value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5166
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5167
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5168
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5169
			// If using innerHTML throws an exception, use the fallback method
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5170
			} catch(e) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5171
				this.empty().append( value );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5172
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5173
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5174
		} else if ( jQuery.isFunction( value ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5175
			this.each(function(i){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5176
				var self = jQuery( this );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5177
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5178
				self.html( value.call(this, i, self.html()) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5179
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5180
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5181
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5182
			this.empty().append( value );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5183
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5184
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5185
		return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5186
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5187
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5188
	replaceWith: function( value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5189
		if ( this[0] && this[0].parentNode ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5190
			// Make sure that the elements are removed from the DOM before they are inserted
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5191
			// this can help fix replacing a parent with child elements
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5192
			if ( jQuery.isFunction( value ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5193
				return this.each(function(i) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5194
					var self = jQuery(this), old = self.html();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5195
					self.replaceWith( value.call( this, i, old ) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5196
				});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5197
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5198
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5199
			if ( typeof value !== "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5200
				value = jQuery( value ).detach();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5201
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5202
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5203
			return this.each(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5204
				var next = this.nextSibling,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5205
					parent = this.parentNode;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5206
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5207
				jQuery( this ).remove();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5208
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5209
				if ( next ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5210
					jQuery(next).before( value );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5211
				} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5212
					jQuery(parent).append( value );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5213
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5214
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5215
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5216
			return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5217
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5218
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5219
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5220
	detach: function( selector ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5221
		return this.remove( selector, true );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5222
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5223
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5224
	domManip: function( args, table, callback ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5225
		var results, first, fragment, parent,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5226
			value = args[0],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5227
			scripts = [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5228
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5229
		// We can't cloneNode fragments that contain checked, in WebKit
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5230
		if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5231
			return this.each(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5232
				jQuery(this).domManip( args, table, callback, true );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5233
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5234
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5235
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5236
		if ( jQuery.isFunction(value) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5237
			return this.each(function(i) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5238
				var self = jQuery(this);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5239
				args[0] = value.call(this, i, table ? self.html() : undefined);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5240
				self.domManip( args, table, callback );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5241
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5242
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5243
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5244
		if ( this[0] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5245
			parent = value && value.parentNode;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5246
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5247
			// If we're in a fragment, just use that instead of building a new one
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5248
			if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5249
				results = { fragment: parent };
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5250
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5251
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5252
				results = jQuery.buildFragment( args, this, scripts );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5253
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5254
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5255
			fragment = results.fragment;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5256
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5257
			if ( fragment.childNodes.length === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5258
				first = fragment = fragment.firstChild;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5259
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5260
				first = fragment.firstChild;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5261
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5262
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5263
			if ( first ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5264
				table = table && jQuery.nodeName( first, "tr" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5265
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5266
				for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5267
					callback.call(
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5268
						table ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5269
							root(this[i], first) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5270
							this[i],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5271
						// Make sure that we do not leak memory by inadvertently discarding
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5272
						// the original fragment (which might have attached data) instead of
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5273
						// using it; in addition, use the original fragment object for the last
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5274
						// item instead of first because it can end up being emptied incorrectly
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5275
						// in certain situations (Bug #8070).
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5276
						// Fragments from the fragment cache must always be cloned and never used
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5277
						// in place.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5278
						results.cacheable || (l > 1 && i < lastIndex) ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5279
							jQuery.clone( fragment, true, true ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5280
							fragment
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5281
					);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5282
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5283
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5284
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5285
			if ( scripts.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5286
				jQuery.each( scripts, evalScript );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5287
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5288
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5289
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5290
		return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5291
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5292
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5293
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5294
function root( elem, cur ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5295
	return jQuery.nodeName(elem, "table") ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5296
		(elem.getElementsByTagName("tbody")[0] ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5297
		elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5298
		elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5299
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5300
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5301
function cloneCopyEvent( src, dest ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5302
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5303
	if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5304
		return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5305
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5306
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5307
	var internalKey = jQuery.expando,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5308
			oldData = jQuery.data( src ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5309
			curData = jQuery.data( dest, oldData );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5310
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5311
	// Switch to use the internal data object, if it exists, for the next
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5312
	// stage of data copying
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5313
	if ( (oldData = oldData[ internalKey ]) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5314
		var events = oldData.events;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5315
				curData = curData[ internalKey ] = jQuery.extend({}, oldData);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5316
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5317
		if ( events ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5318
			delete curData.handle;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5319
			curData.events = {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5320
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5321
			for ( var type in events ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5322
				for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5323
					jQuery.event.add( dest, type, events[ type ][ i ], events[ type ][ i ].data );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5324
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5325
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5326
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5327
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5328
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5329
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5330
function cloneFixAttributes(src, dest) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5331
	// We do not need to do anything for non-Elements
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5332
	if ( dest.nodeType !== 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5333
		return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5334
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5335
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5336
	var nodeName = dest.nodeName.toLowerCase();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5337
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5338
	// clearAttributes removes the attributes, which we don't want,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5339
	// but also removes the attachEvent events, which we *do* want
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5340
	dest.clearAttributes();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5341
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5342
	// mergeAttributes, in contrast, only merges back on the
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5343
	// original attributes, not the events
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5344
	dest.mergeAttributes(src);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5345
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5346
	// IE6-8 fail to clone children inside object elements that use
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5347
	// the proprietary classid attribute value (rather than the type
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5348
	// attribute) to identify the type of content to display
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5349
	if ( nodeName === "object" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5350
		dest.outerHTML = src.outerHTML;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5351
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5352
	} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5353
		// IE6-8 fails to persist the checked state of a cloned checkbox
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5354
		// or radio button. Worse, IE6-7 fail to give the cloned element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5355
		// a checked appearance if the defaultChecked value isn't also set
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5356
		if ( src.checked ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5357
			dest.defaultChecked = dest.checked = src.checked;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5358
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5359
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5360
		// IE6-7 get confused and end up setting the value of a cloned
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5361
		// checkbox/radio button to an empty string instead of "on"
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5362
		if ( dest.value !== src.value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5363
			dest.value = src.value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5364
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5365
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5366
	// IE6-8 fails to return the selected option to the default selected
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5367
	// state when cloning options
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5368
	} else if ( nodeName === "option" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5369
		dest.selected = src.defaultSelected;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5370
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5371
	// IE6-8 fails to set the defaultValue to the correct value when
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5372
	// cloning other types of input fields
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5373
	} else if ( nodeName === "input" || nodeName === "textarea" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5374
		dest.defaultValue = src.defaultValue;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5375
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5376
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5377
	// Event data gets referenced instead of copied if the expando
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5378
	// gets copied too
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5379
	dest.removeAttribute( jQuery.expando );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5380
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5381
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5382
jQuery.buildFragment = function( args, nodes, scripts ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5383
	var fragment, cacheable, cacheresults,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5384
		doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5385
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5386
	// Only cache "small" (1/2 KB) HTML strings that are associated with the main document
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5387
	// Cloning options loses the selected state, so don't cache them
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5388
	// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5389
	// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5390
	if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5391
		args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5392
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5393
		cacheable = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5394
		cacheresults = jQuery.fragments[ args[0] ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5395
		if ( cacheresults ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5396
			if ( cacheresults !== 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5397
				fragment = cacheresults;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5398
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5399
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5400
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5401
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5402
	if ( !fragment ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5403
		fragment = doc.createDocumentFragment();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5404
		jQuery.clean( args, doc, fragment, scripts );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5405
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5406
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5407
	if ( cacheable ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5408
		jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5409
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5410
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5411
	return { fragment: fragment, cacheable: cacheable };
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5412
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5413
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5414
jQuery.fragments = {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5415
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5416
jQuery.each({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5417
	appendTo: "append",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5418
	prependTo: "prepend",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5419
	insertBefore: "before",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5420
	insertAfter: "after",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5421
	replaceAll: "replaceWith"
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5422
}, function( name, original ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5423
	jQuery.fn[ name ] = function( selector ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5424
		var ret = [],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5425
			insert = jQuery( selector ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5426
			parent = this.length === 1 && this[0].parentNode;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5427
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5428
		if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5429
			insert[ original ]( this[0] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5430
			return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5431
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5432
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5433
			for ( var i = 0, l = insert.length; i < l; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5434
				var elems = (i > 0 ? this.clone(true) : this).get();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5435
				jQuery( insert[i] )[ original ]( elems );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5436
				ret = ret.concat( elems );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5437
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5438
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5439
			return this.pushStack( ret, name, insert.selector );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5440
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5441
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5442
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5443
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5444
jQuery.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5445
	clone: function( elem, dataAndEvents, deepDataAndEvents ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5446
		var clone = elem.cloneNode(true),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5447
				srcElements,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5448
				destElements,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5449
				i;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5450
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5451
		if ( !jQuery.support.noCloneEvent && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5452
			// IE copies events bound via attachEvent when using cloneNode.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5453
			// Calling detachEvent on the clone will also remove the events
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5454
			// from the original. In order to get around this, we use some
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5455
			// proprietary methods to clear the events. Thanks to MooTools
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5456
			// guys for this hotness.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5457
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5458
			// Using Sizzle here is crazy slow, so we use getElementsByTagName
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5459
			// instead
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5460
			srcElements = elem.getElementsByTagName("*");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5461
			destElements = clone.getElementsByTagName("*");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5462
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5463
			// Weird iteration because IE will replace the length property
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5464
			// with an element if you are cloning the body and one of the
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5465
			// elements on the page has a name or id of "length"
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5466
			for ( i = 0; srcElements[i]; ++i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5467
				cloneFixAttributes( srcElements[i], destElements[i] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5468
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5469
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5470
			cloneFixAttributes( elem, clone );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5471
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5472
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5473
		// Copy the events from the original to the clone
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5474
		if ( dataAndEvents ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5475
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5476
			cloneCopyEvent( elem, clone );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5477
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5478
			if ( deepDataAndEvents && "getElementsByTagName" in elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5479
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5480
				srcElements = elem.getElementsByTagName("*");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5481
				destElements = clone.getElementsByTagName("*");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5482
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5483
				if ( srcElements.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5484
					for ( i = 0; srcElements[i]; ++i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5485
						cloneCopyEvent( srcElements[i], destElements[i] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5486
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5487
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5488
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5489
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5490
		// Return the cloned set
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5491
		return clone;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5492
  },
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5493
	clean: function( elems, context, fragment, scripts ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5494
		context = context || document;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5495
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5496
		// !context.createElement fails in IE with an error but returns typeof 'object'
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5497
		if ( typeof context.createElement === "undefined" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5498
			context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5499
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5500
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5501
		var ret = [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5502
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5503
		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5504
			if ( typeof elem === "number" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5505
				elem += "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5506
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5507
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5508
			if ( !elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5509
				continue;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5510
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5511
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5512
			// Convert html string into DOM nodes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5513
			if ( typeof elem === "string" && !rhtml.test( elem ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5514
				elem = context.createTextNode( elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5515
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5516
			} else if ( typeof elem === "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5517
				// Fix "XHTML"-style tags in all browsers
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5518
				elem = elem.replace(rxhtmlTag, "<$1></$2>");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5519
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5520
				// Trim whitespace, otherwise indexOf won't work as expected
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5521
				var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5522
					wrap = wrapMap[ tag ] || wrapMap._default,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5523
					depth = wrap[0],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5524
					div = context.createElement("div");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5525
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5526
				// Go to html and back, then peel off extra wrappers
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5527
				div.innerHTML = wrap[1] + elem + wrap[2];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5528
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5529
				// Move to the right depth
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5530
				while ( depth-- ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5531
					div = div.lastChild;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5532
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5533
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5534
				// Remove IE's autoinserted <tbody> from table fragments
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5535
				if ( !jQuery.support.tbody ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5536
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5537
					// String was a <table>, *may* have spurious <tbody>
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5538
					var hasBody = rtbody.test(elem),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5539
						tbody = tag === "table" && !hasBody ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5540
							div.firstChild && div.firstChild.childNodes :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5541
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5542
							// String was a bare <thead> or <tfoot>
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5543
							wrap[1] === "<table>" && !hasBody ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5544
								div.childNodes :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5545
								[];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5546
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5547
					for ( var j = tbody.length - 1; j >= 0 ; --j ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5548
						if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5549
							tbody[ j ].parentNode.removeChild( tbody[ j ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5550
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5551
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5552
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5553
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5554
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5555
				// IE completely kills leading whitespace when innerHTML is used
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5556
				if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5557
					div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5558
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5559
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5560
				elem = div.childNodes;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5561
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5562
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5563
			if ( elem.nodeType ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5564
				ret.push( elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5565
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5566
				ret = jQuery.merge( ret, elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5567
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5568
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5569
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5570
		if ( fragment ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5571
			for ( i = 0; ret[i]; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5572
				if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5573
					scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5574
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5575
				} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5576
					if ( ret[i].nodeType === 1 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5577
						ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5578
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5579
					fragment.appendChild( ret[i] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5580
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5581
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5582
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5583
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5584
		return ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5585
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5586
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5587
	cleanData: function( elems ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5588
		var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5589
			deleteExpando = jQuery.support.deleteExpando;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5590
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5591
		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5592
			if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5593
				continue;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5594
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5595
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5596
			id = elem[ jQuery.expando ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5597
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5598
			if ( id ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5599
				data = cache[ id ] && cache[ id ][ internalKey ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5600
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5601
				if ( data && data.events ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5602
					for ( var type in data.events ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5603
						if ( special[ type ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5604
							jQuery.event.remove( elem, type );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5605
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5606
						// This is a shortcut to avoid jQuery.event.remove's overhead
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5607
						} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5608
							jQuery.removeEvent( elem, type, data.handle );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5609
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5610
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5611
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5612
					// Null the DOM reference to avoid IE6/7/8 leak (#7054)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5613
					if ( data.handle ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5614
						data.handle.elem = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5615
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5616
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5617
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5618
				if ( deleteExpando ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5619
					delete elem[ jQuery.expando ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5620
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5621
				} else if ( elem.removeAttribute ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5622
					elem.removeAttribute( jQuery.expando );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5623
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5624
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5625
				delete cache[ id ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5626
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5627
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5628
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5629
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5630
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5631
function evalScript( i, elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5632
	if ( elem.src ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5633
		jQuery.ajax({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5634
			url: elem.src,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5635
			async: false,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5636
			dataType: "script"
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5637
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5638
	} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5639
		jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5640
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5641
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5642
	if ( elem.parentNode ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5643
		elem.parentNode.removeChild( elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5644
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5645
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5646
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5647
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5648
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5649
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5650
var ralpha = /alpha\([^)]*\)/i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5651
	ropacity = /opacity=([^)]*)/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5652
	rdashAlpha = /-([a-z])/ig,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5653
	rupper = /([A-Z])/g,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5654
	rnumpx = /^-?\d+(?:px)?$/i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5655
	rnum = /^-?\d/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5656
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5657
	cssShow = { position: "absolute", visibility: "hidden", display: "block" },
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5658
	cssWidth = [ "Left", "Right" ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5659
	cssHeight = [ "Top", "Bottom" ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5660
	curCSS,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5661
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5662
	getComputedStyle,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5663
	currentStyle,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5664
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5665
	fcamelCase = function( all, letter ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5666
		return letter.toUpperCase();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5667
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5668
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5669
jQuery.fn.css = function( name, value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5670
	// Setting 'undefined' is a no-op
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5671
	if ( arguments.length === 2 && value === undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5672
		return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5673
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5674
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5675
	return jQuery.access( this, name, value, true, function( elem, name, value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5676
		return value !== undefined ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5677
			jQuery.style( elem, name, value ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5678
			jQuery.css( elem, name );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5679
	});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5680
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5681
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5682
jQuery.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5683
	// Add in style property hooks for overriding the default
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5684
	// behavior of getting and setting a style property
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5685
	cssHooks: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5686
		opacity: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5687
			get: function( elem, computed ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5688
				if ( computed ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5689
					// We should always get a number back from opacity
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5690
					var ret = curCSS( elem, "opacity", "opacity" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5691
					return ret === "" ? "1" : ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5692
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5693
				} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5694
					return elem.style.opacity;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5695
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5696
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5697
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5698
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5699
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5700
	// Exclude the following css properties to add px
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5701
	cssNumber: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5702
		"zIndex": true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5703
		"fontWeight": true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5704
		"opacity": true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5705
		"zoom": true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5706
		"lineHeight": true
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5707
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5708
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5709
	// Add in properties whose names you wish to fix before
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5710
	// setting or getting the value
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5711
	cssProps: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5712
		// normalize float css property
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5713
		"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5714
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5715
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5716
	// Get and set the style property on a DOM Node
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5717
	style: function( elem, name, value, extra ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5718
		// Don't set styles on text and comment nodes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5719
		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5720
			return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5721
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5722
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5723
		// Make sure that we're working with the right name
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5724
		var ret, origName = jQuery.camelCase( name ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5725
			style = elem.style, hooks = jQuery.cssHooks[ origName ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5726
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5727
		name = jQuery.cssProps[ origName ] || origName;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5728
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5729
		// Check if we're setting a value
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5730
		if ( value !== undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5731
			// Make sure that NaN and null values aren't set. See: #7116
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5732
			if ( typeof value === "number" && isNaN( value ) || value == null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5733
				return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5734
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5735
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5736
			// If a number was passed in, add 'px' to the (except for certain CSS properties)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5737
			if ( typeof value === "number" && !jQuery.cssNumber[ origName ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5738
				value += "px";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5739
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5740
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5741
			// If a hook was provided, use that value, otherwise just set the specified value
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5742
			if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5743
				// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5744
				// Fixes bug #5509
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5745
				try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5746
					style[ name ] = value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5747
				} catch(e) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5748
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5749
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5750
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5751
			// If a hook was provided get the non-computed value from there
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5752
			if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5753
				return ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5754
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5755
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5756
			// Otherwise just get the value from the style object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5757
			return style[ name ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5758
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5759
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5760
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5761
	css: function( elem, name, extra ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5762
		// Make sure that we're working with the right name
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5763
		var ret, origName = jQuery.camelCase( name ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5764
			hooks = jQuery.cssHooks[ origName ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5765
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5766
		name = jQuery.cssProps[ origName ] || origName;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5767
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5768
		// If a hook was provided get the computed value from there
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5769
		if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5770
			return ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5771
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5772
		// Otherwise, if a way to get the computed value exists, use that
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5773
		} else if ( curCSS ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5774
			return curCSS( elem, name, origName );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5775
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5776
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5777
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5778
	// A method for quickly swapping in/out CSS properties to get correct calculations
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5779
	swap: function( elem, options, callback ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5780
		var old = {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5781
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5782
		// Remember the old values, and insert the new ones
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5783
		for ( var name in options ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5784
			old[ name ] = elem.style[ name ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5785
			elem.style[ name ] = options[ name ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5786
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5787
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5788
		callback.call( elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5789
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5790
		// Revert the old values
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5791
		for ( name in options ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5792
			elem.style[ name ] = old[ name ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5793
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5794
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5795
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5796
	camelCase: function( string ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5797
		return string.replace( rdashAlpha, fcamelCase );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5798
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5799
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5800
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5801
// DEPRECATED, Use jQuery.css() instead
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5802
jQuery.curCSS = jQuery.css;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5803
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5804
jQuery.each(["height", "width"], function( i, name ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5805
	jQuery.cssHooks[ name ] = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5806
		get: function( elem, computed, extra ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5807
			var val;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5808
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5809
			if ( computed ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5810
				if ( elem.offsetWidth !== 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5811
					val = getWH( elem, name, extra );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5812
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5813
				} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5814
					jQuery.swap( elem, cssShow, function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5815
						val = getWH( elem, name, extra );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5816
					});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5817
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5818
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5819
				if ( val <= 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5820
					val = curCSS( elem, name, name );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5821
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5822
					if ( val === "0px" && currentStyle ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5823
						val = currentStyle( elem, name, name );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5824
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5825
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5826
					if ( val != null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5827
						// Should return "auto" instead of 0, use 0 for
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5828
						// temporary backwards-compat
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5829
						return val === "" || val === "auto" ? "0px" : val;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5830
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5831
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5832
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5833
				if ( val < 0 || val == null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5834
					val = elem.style[ name ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5835
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5836
					// Should return "auto" instead of 0, use 0 for
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5837
					// temporary backwards-compat
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5838
					return val === "" || val === "auto" ? "0px" : val;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5839
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5840
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5841
				return typeof val === "string" ? val : val + "px";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5842
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5843
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5844
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5845
		set: function( elem, value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5846
			if ( rnumpx.test( value ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5847
				// ignore negative width and height values #1599
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5848
				value = parseFloat(value);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5849
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5850
				if ( value >= 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5851
					return value + "px";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5852
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5853
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5854
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5855
				return value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5856
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5857
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5858
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5859
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5860
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5861
if ( !jQuery.support.opacity ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5862
	jQuery.cssHooks.opacity = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5863
		get: function( elem, computed ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5864
			// IE uses filters for opacity
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5865
			return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5866
				(parseFloat(RegExp.$1) / 100) + "" :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5867
				computed ? "1" : "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5868
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5869
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5870
		set: function( elem, value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5871
			var style = elem.style;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5872
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5873
			// IE has trouble with opacity if it does not have layout
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5874
			// Force it by setting the zoom level
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5875
			style.zoom = 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5876
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5877
			// Set the alpha filter to set the opacity
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5878
			var opacity = jQuery.isNaN(value) ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5879
				"" :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5880
				"alpha(opacity=" + value * 100 + ")",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5881
				filter = style.filter || "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5882
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5883
			style.filter = ralpha.test(filter) ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5884
				filter.replace(ralpha, opacity) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5885
				style.filter + ' ' + opacity;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5886
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5887
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5888
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5889
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5890
if ( document.defaultView && document.defaultView.getComputedStyle ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5891
	getComputedStyle = function( elem, newName, name ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5892
		var ret, defaultView, computedStyle;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5893
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5894
		name = name.replace( rupper, "-$1" ).toLowerCase();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5895
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5896
		if ( !(defaultView = elem.ownerDocument.defaultView) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5897
			return undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5898
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5899
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5900
		if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5901
			ret = computedStyle.getPropertyValue( name );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5902
			if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5903
				ret = jQuery.style( elem, name );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5904
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5905
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5906
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5907
		return ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5908
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5909
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5910
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5911
if ( document.documentElement.currentStyle ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5912
	currentStyle = function( elem, name ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5913
		var left, 
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5914
			ret = elem.currentStyle && elem.currentStyle[ name ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5915
			rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5916
			style = elem.style;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5917
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5918
		// From the awesome hack by Dean Edwards
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5919
		// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5920
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5921
		// If we're not dealing with a regular pixel number
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5922
		// but a number that has a weird ending, we need to convert it to pixels
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5923
		if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5924
			// Remember the original values
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5925
			left = style.left;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5926
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5927
			// Put in the new values to get a computed value out
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5928
			if ( rsLeft ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5929
				elem.runtimeStyle.left = elem.currentStyle.left;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5930
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5931
			style.left = name === "fontSize" ? "1em" : (ret || 0);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5932
			ret = style.pixelLeft + "px";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5933
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5934
			// Revert the changed values
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5935
			style.left = left;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5936
			if ( rsLeft ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5937
				elem.runtimeStyle.left = rsLeft;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5938
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5939
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5940
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5941
		return ret === "" ? "auto" : ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5942
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5943
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5944
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5945
curCSS = getComputedStyle || currentStyle;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5946
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5947
function getWH( elem, name, extra ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5948
	var which = name === "width" ? cssWidth : cssHeight,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5949
		val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5950
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5951
	if ( extra === "border" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5952
		return val;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5953
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5954
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5955
	jQuery.each( which, function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5956
		if ( !extra ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5957
			val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5958
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5959
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5960
		if ( extra === "margin" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5961
			val += parseFloat(jQuery.css( elem, "margin" + this )) || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5962
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5963
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5964
			val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5965
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5966
	});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5967
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5968
	return val;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5969
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5970
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5971
if ( jQuery.expr && jQuery.expr.filters ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5972
	jQuery.expr.filters.hidden = function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5973
		var width = elem.offsetWidth,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5974
			height = elem.offsetHeight;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5975
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5976
		return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5977
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5978
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5979
	jQuery.expr.filters.visible = function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5980
		return !jQuery.expr.filters.hidden( elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5981
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5982
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5983
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5984
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5985
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5986
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5987
var r20 = /%20/g,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5988
	rbracket = /\[\]$/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5989
	rCRLF = /\r?\n/g,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5990
	rhash = /#.*$/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5991
	rheaders = /^(.*?):\s*(.*?)\r?$/mg, // IE leaves an \r character at EOL
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5992
	rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5993
	rnoContent = /^(?:GET|HEAD)$/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5994
	rprotocol = /^\/\//,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5995
	rquery = /\?/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5996
	rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5997
	rselectTextarea = /^(?:select|textarea)/i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5998
	rspacesAjax = /\s+/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  5999
	rts = /([?&])_=[^&]*/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6000
	rurl = /^(\w+:)\/\/([^\/?#:]+)(?::(\d+))?/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6001
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6002
	// Keep a copy of the old load method
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6003
	_load = jQuery.fn.load,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6004
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6005
	/* Prefilters
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6006
	 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6007
	 * 2) These are called:
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6008
	 *    - BEFORE asking for a transport
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6009
	 *    - AFTER param serialization (s.data is a string if s.processData is true)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6010
	 * 3) key is the dataType
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6011
	 * 4) the catchall symbol "*" can be used
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6012
	 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6013
	 */
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6014
	prefilters = {},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6015
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6016
	/* Transports bindings
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6017
	 * 1) key is the dataType
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6018
	 * 2) the catchall symbol "*" can be used
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6019
	 * 3) selection will start with transport dataType and THEN go to "*" if needed
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6020
	 */
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6021
	transports = {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6022
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6023
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6024
function addToPrefiltersOrTransports( structure ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6025
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6026
	// dataTypeExpression is optional and defaults to "*"
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6027
	return function( dataTypeExpression, func ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6028
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6029
		if ( typeof dataTypeExpression !== "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6030
			func = dataTypeExpression;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6031
			dataTypeExpression = "*";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6032
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6033
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6034
		if ( jQuery.isFunction( func ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6035
			var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6036
				i = 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6037
				length = dataTypes.length,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6038
				dataType,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6039
				list,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6040
				placeBefore;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6041
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6042
			// For each dataType in the dataTypeExpression
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6043
			for(; i < length; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6044
				dataType = dataTypes[ i ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6045
				// We control if we're asked to add before
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6046
				// any existing element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6047
				placeBefore = /^\+/.test( dataType );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6048
				if ( placeBefore ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6049
					dataType = dataType.substr( 1 ) || "*";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6050
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6051
				list = structure[ dataType ] = structure[ dataType ] || [];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6052
				// then we add to the structure accordingly
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6053
				list[ placeBefore ? "unshift" : "push" ]( func );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6054
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6055
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6056
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6057
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6058
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6059
//Base inspection function for prefilters and transports
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6060
function inspectPrefiltersOrTransports( structure, options, originalOptions, jXHR,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6061
		dataType /* internal */, inspected /* internal */ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6062
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6063
	dataType = dataType || options.dataTypes[ 0 ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6064
	inspected = inspected || {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6065
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6066
	inspected[ dataType ] = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6067
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6068
	var list = structure[ dataType ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6069
		i = 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6070
		length = list ? list.length : 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6071
		executeOnly = ( structure === prefilters ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6072
		selection;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6073
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6074
	for(; i < length && ( executeOnly || !selection ); i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6075
		selection = list[ i ]( options, originalOptions, jXHR );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6076
		// If we got redirected to another dataType
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6077
		// we try there if not done already
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6078
		if ( typeof selection === "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6079
			if ( inspected[ selection ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6080
				selection = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6081
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6082
				options.dataTypes.unshift( selection );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6083
				selection = inspectPrefiltersOrTransports(
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6084
						structure, options, originalOptions, jXHR, selection, inspected );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6085
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6086
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6087
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6088
	// If we're only executing or nothing was selected
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6089
	// we try the catchall dataType if not done already
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6090
	if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6091
		selection = inspectPrefiltersOrTransports(
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6092
				structure, options, originalOptions, jXHR, "*", inspected );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6093
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6094
	// unnecessary when only executing (prefilters)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6095
	// but it'll be ignored by the caller in that case
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6096
	return selection;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6097
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6098
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6099
jQuery.fn.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6100
	load: function( url, params, callback ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6101
		if ( typeof url !== "string" && _load ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6102
			return _load.apply( this, arguments );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6103
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6104
		// Don't do a request if no elements are being requested
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6105
		} else if ( !this.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6106
			return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6107
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6108
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6109
		var off = url.indexOf( " " );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6110
		if ( off >= 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6111
			var selector = url.slice( off, url.length );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6112
			url = url.slice( 0, off );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6113
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6114
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6115
		// Default to a GET request
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6116
		var type = "GET";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6117
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6118
		// If the second parameter was provided
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6119
		if ( params ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6120
			// If it's a function
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6121
			if ( jQuery.isFunction( params ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6122
				// We assume that it's the callback
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6123
				callback = params;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6124
				params = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6125
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6126
			// Otherwise, build a param string
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6127
			} else if ( typeof params === "object" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6128
				params = jQuery.param( params, jQuery.ajaxSettings.traditional );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6129
				type = "POST";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6130
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6131
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6132
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6133
		var self = this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6134
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6135
		// Request the remote document
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6136
		jQuery.ajax({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6137
			url: url,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6138
			type: type,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6139
			dataType: "html",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6140
			data: params,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6141
			// Complete callback (responseText is used internally)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6142
			complete: function( jXHR, status, responseText ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6143
				// Store the response as specified by the jXHR object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6144
				responseText = jXHR.responseText;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6145
				// If successful, inject the HTML into all the matched elements
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6146
				if ( jXHR.isResolved() ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6147
					// #4825: Get the actual response in case
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6148
					// a dataFilter is present in ajaxSettings
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6149
					jXHR.done(function( r ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6150
						responseText = r;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6151
					});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6152
					// See if a selector was specified
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6153
					self.html( selector ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6154
						// Create a dummy div to hold the results
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6155
						jQuery("<div>")
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6156
							// inject the contents of the document in, removing the scripts
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6157
							// to avoid any 'Permission Denied' errors in IE
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6158
							.append(responseText.replace(rscript, ""))
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6159
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6160
							// Locate the specified elements
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6161
							.find(selector) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6162
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6163
						// If not, just inject the full result
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6164
						responseText );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6165
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6166
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6167
				if ( callback ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6168
					self.each( callback, [ responseText, status, jXHR ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6169
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6170
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6171
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6172
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6173
		return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6174
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6175
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6176
	serialize: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6177
		return jQuery.param( this.serializeArray() );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6178
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6179
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6180
	serializeArray: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6181
		return this.map(function(){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6182
			return this.elements ? jQuery.makeArray( this.elements ) : this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6183
		})
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6184
		.filter(function(){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6185
			return this.name && !this.disabled &&
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6186
				( this.checked || rselectTextarea.test( this.nodeName ) ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6187
					rinput.test( this.type ) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6188
		})
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6189
		.map(function( i, elem ){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6190
			var val = jQuery( this ).val();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6191
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6192
			return val == null ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6193
				null :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6194
				jQuery.isArray( val ) ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6195
					jQuery.map( val, function( val, i ){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6196
						return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6197
					}) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6198
					{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6199
		}).get();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6200
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6201
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6202
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6203
// Attach a bunch of functions for handling common AJAX events
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6204
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6205
	jQuery.fn[ o ] = function( f ){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6206
		return this.bind( o, f );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6207
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6208
} );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6209
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6210
jQuery.each( [ "get", "post" ], function( i, method ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6211
	jQuery[ method ] = function( url, data, callback, type ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6212
		// shift arguments if data argument was omitted
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6213
		if ( jQuery.isFunction( data ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6214
			type = type || callback;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6215
			callback = data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6216
			data = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6217
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6218
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6219
		return jQuery.ajax({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6220
			type: method,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6221
			url: url,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6222
			data: data,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6223
			success: callback,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6224
			dataType: type
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6225
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6226
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6227
} );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6228
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6229
jQuery.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6230
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6231
	getScript: function( url, callback ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6232
		return jQuery.get( url, null, callback, "script" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6233
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6234
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6235
	getJSON: function( url, data, callback ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6236
		return jQuery.get( url, data, callback, "json" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6237
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6238
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6239
	ajaxSetup: function( settings ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6240
		jQuery.extend( true, jQuery.ajaxSettings, settings );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6241
		if ( settings.context ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6242
			jQuery.ajaxSettings.context = settings.context;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6243
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6244
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6245
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6246
	ajaxSettings: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6247
		url: location.href,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6248
		global: true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6249
		type: "GET",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6250
		contentType: "application/x-www-form-urlencoded",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6251
		processData: true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6252
		async: true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6253
		/*
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6254
		timeout: 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6255
		data: null,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6256
		dataType: null,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6257
		username: null,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6258
		password: null,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6259
		cache: null,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6260
		traditional: false,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6261
		headers: {},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6262
		crossDomain: null,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6263
		*/
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6264
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6265
		accepts: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6266
			xml: "application/xml, text/xml",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6267
			html: "text/html",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6268
			text: "text/plain",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6269
			json: "application/json, text/javascript",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6270
			"*": "*/*"
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6271
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6272
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6273
		contents: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6274
			xml: /xml/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6275
			html: /html/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6276
			json: /json/
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6277
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6278
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6279
		responseFields: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6280
			xml: "responseXML",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6281
			text: "responseText"
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6282
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6283
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6284
		// List of data converters
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6285
		// 1) key format is "source_type destination_type" (a single space in-between)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6286
		// 2) the catchall symbol "*" can be used for source_type
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6287
		converters: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6288
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6289
			// Convert anything to text
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6290
			"* text": window.String,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6291
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6292
			// Text to html (true = no transformation)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6293
			"text html": true,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6294
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6295
			// Evaluate text as a json expression
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6296
			"text json": jQuery.parseJSON,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6297
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6298
			// Parse text as xml
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6299
			"text xml": jQuery.parseXML
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6300
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6301
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6302
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6303
	ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6304
	ajaxTransport: addToPrefiltersOrTransports( transports ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6305
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6306
	// Main method
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6307
	ajax: function( url, options ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6308
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6309
		// If options is not an object,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6310
		// we simulate pre-1.5 signature
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6311
		if ( typeof options !== "object" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6312
			options = url;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6313
			url = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6314
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6315
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6316
		// Force options to be an object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6317
		options = options || {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6318
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6319
		var // Create the final options object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6320
			s = jQuery.extend( true, {}, jQuery.ajaxSettings, options ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6321
			// Callbacks contexts
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6322
			// We force the original context if it exists
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6323
			// or take it from jQuery.ajaxSettings otherwise
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6324
			// (plain objects used as context get extended)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6325
			callbackContext =
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6326
				( s.context = ( "context" in options ? options : jQuery.ajaxSettings ).context ) || s,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6327
			globalEventContext = callbackContext === s ? jQuery.event : jQuery( callbackContext ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6328
			// Deferreds
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6329
			deferred = jQuery.Deferred(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6330
			completeDeferred = jQuery._Deferred(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6331
			// Status-dependent callbacks
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6332
			statusCode = s.statusCode || {},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6333
			// Headers (they are sent all at once)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6334
			requestHeaders = {},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6335
			// Response headers
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6336
			responseHeadersString,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6337
			responseHeaders,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6338
			// transport
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6339
			transport,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6340
			// timeout handle
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6341
			timeoutTimer,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6342
			// Cross-domain detection vars
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6343
			loc = document.location,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6344
			protocol = loc.protocol || "http:",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6345
			parts,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6346
			// The jXHR state
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6347
			state = 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6348
			// Loop variable
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6349
			i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6350
			// Fake xhr
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6351
			jXHR = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6352
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6353
				readyState: 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6354
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6355
				// Caches the header
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6356
				setRequestHeader: function( name, value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6357
					if ( state === 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6358
						requestHeaders[ name.toLowerCase() ] = value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6359
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6360
					return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6361
				},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6362
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6363
				// Raw string
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6364
				getAllResponseHeaders: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6365
					return state === 2 ? responseHeadersString : null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6366
				},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6367
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6368
				// Builds headers hashtable if needed
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6369
				getResponseHeader: function( key ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6370
					var match;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6371
					if ( state === 2 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6372
						if ( !responseHeaders ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6373
							responseHeaders = {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6374
							while( ( match = rheaders.exec( responseHeadersString ) ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6375
								responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6376
							}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6377
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6378
						match = responseHeaders[ key.toLowerCase() ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6379
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6380
					return match || null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6381
				},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6382
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6383
				// Cancel the request
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6384
				abort: function( statusText ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6385
					statusText = statusText || "abort";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6386
					if ( transport ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6387
						transport.abort( statusText );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6388
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6389
					done( 0, statusText );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6390
					return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6391
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6392
			};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6393
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6394
		// Callback for when everything is done
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6395
		// It is defined here because jslint complains if it is declared
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6396
		// at the end of the function (which would be more logical and readable)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6397
		function done( status, statusText, responses, headers) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6398
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6399
			// Called once
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6400
			if ( state === 2 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6401
				return;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6402
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6403
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6404
			// State is "done" now
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6405
			state = 2;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6406
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6407
			// Clear timeout if it exists
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6408
			if ( timeoutTimer ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6409
				clearTimeout( timeoutTimer );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6410
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6411
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6412
			// Dereference transport for early garbage collection
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6413
			// (no matter how long the jXHR object will be used)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6414
			transport = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6415
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6416
			// Cache response headers
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6417
			responseHeadersString = headers || "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6418
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6419
			// Set readyState
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6420
			jXHR.readyState = status ? 4 : 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6421
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6422
			var isSuccess,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6423
				success,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6424
				error,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6425
				response = responses ? ajaxHandleResponses( s, jXHR, responses ) : undefined,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6426
				lastModified,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6427
				etag;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6428
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6429
			// If successful, handle type chaining
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6430
			if ( status >= 200 && status < 300 || status === 304 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6431
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6432
				// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6433
				if ( s.ifModified ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6434
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6435
					if ( ( lastModified = jXHR.getResponseHeader( "Last-Modified" ) ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6436
						jQuery.lastModified[ s.url ] = lastModified;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6437
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6438
					if ( ( etag = jXHR.getResponseHeader( "Etag" ) ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6439
						jQuery.etag[ s.url ] = etag;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6440
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6441
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6442
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6443
				// If not modified
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6444
				if ( status === 304 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6445
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6446
					statusText = "notmodified";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6447
					isSuccess = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6448
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6449
				// If we have data
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6450
				} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6451
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6452
					try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6453
						success = ajaxConvert( s, response );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6454
						statusText = "success";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6455
						isSuccess = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6456
					} catch(e) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6457
						// We have a parsererror
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6458
						statusText = "parsererror";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6459
						error = e;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6460
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6461
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6462
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6463
				// We extract error from statusText
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6464
				// then normalize statusText and status for non-aborts
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6465
				error = statusText;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6466
				if( status ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6467
					statusText = "error";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6468
					if ( status < 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6469
						status = 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6470
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6471
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6472
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6473
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6474
			// Set data for the fake xhr object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6475
			jXHR.status = status;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6476
			jXHR.statusText = statusText;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6477
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6478
			// Success/Error
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6479
			if ( isSuccess ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6480
				deferred.resolveWith( callbackContext, [ success, statusText, jXHR ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6481
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6482
				deferred.rejectWith( callbackContext, [ jXHR, statusText, error ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6483
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6484
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6485
			// Status-dependent callbacks
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6486
			jXHR.statusCode( statusCode );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6487
			statusCode = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6488
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6489
			if ( s.global ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6490
				globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6491
						[ jXHR, s, isSuccess ? success : error ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6492
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6493
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6494
			// Complete
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6495
			completeDeferred.resolveWith( callbackContext, [ jXHR, statusText ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6496
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6497
			if ( s.global ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6498
				globalEventContext.trigger( "ajaxComplete", [ jXHR, s] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6499
				// Handle the global AJAX counter
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6500
				if ( !( --jQuery.active ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6501
					jQuery.event.trigger( "ajaxStop" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6502
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6503
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6504
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6505
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6506
		// Attach deferreds
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6507
		deferred.promise( jXHR );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6508
		jXHR.success = jXHR.done;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6509
		jXHR.error = jXHR.fail;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6510
		jXHR.complete = completeDeferred.done;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6511
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6512
		// Status-dependent callbacks
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6513
		jXHR.statusCode = function( map ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6514
			if ( map ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6515
				var tmp;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6516
				if ( state < 2 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6517
					for( tmp in map ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6518
						statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6519
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6520
				} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6521
					tmp = map[ jXHR.status ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6522
					jXHR.then( tmp, tmp );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6523
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6524
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6525
			return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6526
		};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6527
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6528
		// Remove hash character (#7531: and string promotion)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6529
		// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6530
		// We also use the url parameter if available
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6531
		s.url = ( "" + ( url || s.url ) ).replace( rhash, "" ).replace( rprotocol, protocol + "//" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6532
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6533
		// Extract dataTypes list
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6534
		s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6535
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6536
		// Determine if a cross-domain request is in order
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6537
		if ( !s.crossDomain ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6538
			parts = rurl.exec( s.url.toLowerCase() );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6539
			s.crossDomain = !!( parts &&
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6540
				( parts[ 1 ] != protocol || parts[ 2 ] != loc.hostname ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6541
					( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6542
						( loc.port || ( protocol === "http:" ? 80 : 443 ) ) )
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6543
			);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6544
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6545
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6546
		// Convert data if not already a string
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6547
		if ( s.data && s.processData && typeof s.data !== "string" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6548
			s.data = jQuery.param( s.data, s.traditional );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6549
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6550
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6551
		// Apply prefilters
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6552
		inspectPrefiltersOrTransports( prefilters, s, options, jXHR );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6553
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6554
		// Uppercase the type
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6555
		s.type = s.type.toUpperCase();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6556
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6557
		// Determine if request has content
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6558
		s.hasContent = !rnoContent.test( s.type );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6559
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6560
		// Watch for a new set of requests
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6561
		if ( s.global && jQuery.active++ === 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6562
			jQuery.event.trigger( "ajaxStart" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6563
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6564
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6565
		// More options handling for requests with no content
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6566
		if ( !s.hasContent ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6567
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6568
			// If data is available, append data to url
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6569
			if ( s.data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6570
				s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6571
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6572
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6573
			// Add anti-cache in url if needed
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6574
			if ( s.cache === false ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6575
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6576
				var ts = jQuery.now(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6577
					// try replacing _= if it is there
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6578
					ret = s.url.replace( rts, "$1_=" + ts );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6579
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6580
				// if nothing was replaced, add timestamp to the end
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6581
				s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6582
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6583
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6584
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6585
		// Set the correct header, if data is being sent
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6586
		if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6587
			requestHeaders[ "content-type" ] = s.contentType;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6588
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6589
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6590
		// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6591
		if ( s.ifModified ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6592
			if ( jQuery.lastModified[ s.url ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6593
				requestHeaders[ "if-modified-since" ] = jQuery.lastModified[ s.url ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6594
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6595
			if ( jQuery.etag[ s.url ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6596
				requestHeaders[ "if-none-match" ] = jQuery.etag[ s.url ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6597
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6598
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6599
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6600
		// Set the Accepts header for the server, depending on the dataType
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6601
		requestHeaders.accept = s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6602
			s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6603
			s.accepts[ "*" ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6604
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6605
		// Check for headers option
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6606
		for ( i in s.headers ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6607
			requestHeaders[ i.toLowerCase() ] = s.headers[ i ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6608
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6609
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6610
		// Allow custom headers/mimetypes and early abort
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6611
		if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jXHR, s ) === false || state === 2 ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6612
				// Abort if not done already
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6613
				done( 0, "abort" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6614
				// Return false
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6615
				jXHR = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6616
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6617
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6618
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6619
			// Install callbacks on deferreds
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6620
			for ( i in { success: 1, error: 1, complete: 1 } ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6621
				jXHR[ i ]( s[ i ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6622
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6623
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6624
			// Get transport
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6625
			transport = inspectPrefiltersOrTransports( transports, s, options, jXHR );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6626
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6627
			// If no transport, we auto-abort
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6628
			if ( !transport ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6629
				done( -1, "No Transport" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6630
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6631
				// Set state as sending
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6632
				state = jXHR.readyState = 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6633
				// Send global event
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6634
				if ( s.global ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6635
					globalEventContext.trigger( "ajaxSend", [ jXHR, s ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6636
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6637
				// Timeout
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6638
				if ( s.async && s.timeout > 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6639
					timeoutTimer = setTimeout( function(){
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6640
						jXHR.abort( "timeout" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6641
					}, s.timeout );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6642
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6643
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6644
				try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6645
					transport.send( requestHeaders, done );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6646
				} catch (e) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6647
					// Propagate exception as error if not done
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6648
					if ( status < 2 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6649
						done( -1, e );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6650
					// Simply rethrow otherwise
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6651
					} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6652
						jQuery.error( e );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6653
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6654
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6655
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6656
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6657
		return jXHR;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6658
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6659
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6660
	// Serialize an array of form elements or a set of
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6661
	// key/values into a query string
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6662
	param: function( a, traditional ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6663
		var s = [],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6664
			add = function( key, value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6665
				// If value is a function, invoke it and return its value
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6666
				value = jQuery.isFunction( value ) ? value() : value;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6667
				s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6668
			};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6669
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6670
		// Set traditional to true for jQuery <= 1.3.2 behavior.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6671
		if ( traditional === undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6672
			traditional = jQuery.ajaxSettings.traditional;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6673
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6674
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6675
		// If an array was passed in, assume that it is an array of form elements.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6676
		if ( jQuery.isArray( a ) || a.jquery ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6677
			// Serialize the form elements
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6678
			jQuery.each( a, function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6679
				add( this.name, this.value );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6680
			} );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6681
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6682
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6683
			// If traditional, encode the "old" way (the way 1.3.2 or older
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6684
			// did it), otherwise encode params recursively.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6685
			for ( var prefix in a ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6686
				buildParams( prefix, a[ prefix ], traditional, add );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6687
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6688
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6689
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6690
		// Return the resulting serialization
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6691
		return s.join( "&" ).replace( r20, "+" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6692
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6693
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6694
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6695
function buildParams( prefix, obj, traditional, add ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6696
	if ( jQuery.isArray( obj ) && obj.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6697
		// Serialize array item.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6698
		jQuery.each( obj, function( i, v ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6699
			if ( traditional || rbracket.test( prefix ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6700
				// Treat each array item as a scalar.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6701
				add( prefix, v );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6702
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6703
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6704
				// If array item is non-scalar (array or object), encode its
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6705
				// numeric index to resolve deserialization ambiguity issues.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6706
				// Note that rack (as of 1.0.0) can't currently deserialize
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6707
				// nested arrays properly, and attempting to do so may cause
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6708
				// a server error. Possible fixes are to modify rack's
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6709
				// deserialization algorithm or to provide an option or flag
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6710
				// to force array serialization to be shallow.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6711
				buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6712
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6713
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6714
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6715
	} else if ( !traditional && obj != null && typeof obj === "object" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6716
		// If we see an array here, it is empty and should be treated as an empty
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6717
		// object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6718
		if ( jQuery.isArray( obj ) || jQuery.isEmptyObject( obj ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6719
			add( prefix, "" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6720
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6721
		// Serialize object item.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6722
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6723
			jQuery.each( obj, function( k, v ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6724
				buildParams( prefix + "[" + k + "]", v, traditional, add );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6725
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6726
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6727
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6728
	} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6729
		// Serialize scalar item.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6730
		add( prefix, obj );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6731
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6732
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6733
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6734
// This is still on the jQuery object... for now
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6735
// Want to move this to jQuery.ajax some day
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6736
jQuery.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6737
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6738
	// Counter for holding the number of active queries
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6739
	active: 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6740
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6741
	// Last-Modified header cache for next request
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6742
	lastModified: {},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6743
	etag: {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6744
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6745
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6746
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6747
/* Handles responses to an ajax request:
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6748
 * - sets all responseXXX fields accordingly
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6749
 * - finds the right dataType (mediates between content-type and expected dataType)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6750
 * - returns the corresponding response
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6751
 */
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6752
function ajaxHandleResponses( s, jXHR, responses ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6753
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6754
	var contents = s.contents,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6755
		dataTypes = s.dataTypes,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6756
		responseFields = s.responseFields,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6757
		ct,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6758
		type,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6759
		finalDataType,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6760
		firstDataType;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6761
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6762
	// Fill responseXXX fields
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6763
	for( type in responseFields ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6764
		if ( type in responses ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6765
			jXHR[ responseFields[type] ] = responses[ type ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6766
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6767
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6768
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6769
	// Remove auto dataType and get content-type in the process
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6770
	while( dataTypes[ 0 ] === "*" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6771
		dataTypes.shift();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6772
		if ( ct === undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6773
			ct = jXHR.getResponseHeader( "content-type" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6774
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6775
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6776
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6777
	// Check if we're dealing with a known content-type
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6778
	if ( ct ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6779
		for ( type in contents ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6780
			if ( contents[ type ] && contents[ type ].test( ct ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6781
				dataTypes.unshift( type );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6782
				break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6783
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6784
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6785
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6786
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6787
	// Check to see if we have a response for the expected dataType
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6788
	if ( dataTypes[ 0 ] in responses ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6789
		finalDataType = dataTypes[ 0 ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6790
	} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6791
		// Try convertible dataTypes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6792
		for ( type in responses ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6793
			if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6794
				finalDataType = type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6795
				break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6796
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6797
			if ( !firstDataType ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6798
				firstDataType = type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6799
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6800
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6801
		// Or just use first one
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6802
		finalDataType = finalDataType || firstDataType;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6803
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6804
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6805
	// If we found a dataType
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6806
	// We add the dataType to the list if needed
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6807
	// and return the corresponding response
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6808
	if ( finalDataType ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6809
		if ( finalDataType !== dataTypes[ 0 ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6810
			dataTypes.unshift( finalDataType );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6811
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6812
		return responses[ finalDataType ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6813
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6814
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6815
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6816
// Chain conversions given the request and the original response
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6817
function ajaxConvert( s, response ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6818
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6819
	// Apply the dataFilter if provided
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6820
	if ( s.dataFilter ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6821
		response = s.dataFilter( response, s.dataType );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6822
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6823
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6824
	var dataTypes = s.dataTypes,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6825
		converters = s.converters,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6826
		i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6827
		length = dataTypes.length,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6828
		tmp,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6829
		// Current and previous dataTypes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6830
		current = dataTypes[ 0 ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6831
		prev,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6832
		// Conversion expression
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6833
		conversion,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6834
		// Conversion function
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6835
		conv,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6836
		// Conversion functions (transitive conversion)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6837
		conv1,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6838
		conv2;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6839
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6840
	// For each dataType in the chain
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6841
	for( i = 1; i < length; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6842
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6843
		// Get the dataTypes
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6844
		prev = current;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6845
		current = dataTypes[ i ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6846
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6847
		// If current is auto dataType, update it to prev
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6848
		if( current === "*" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6849
			current = prev;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6850
		// If no auto and dataTypes are actually different
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6851
		} else if ( prev !== "*" && prev !== current ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6852
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6853
			// Get the converter
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6854
			conversion = prev + " " + current;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6855
			conv = converters[ conversion ] || converters[ "* " + current ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6856
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6857
			// If there is no direct converter, search transitively
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6858
			if ( !conv ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6859
				conv2 = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6860
				for( conv1 in converters ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6861
					tmp = conv1.split( " " );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6862
					if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6863
						conv2 = converters[ tmp[1] + " " + current ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6864
						if ( conv2 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6865
							conv1 = converters[ conv1 ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6866
							if ( conv1 === true ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6867
								conv = conv2;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6868
							} else if ( conv2 === true ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6869
								conv = conv1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6870
							}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6871
							break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6872
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6873
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6874
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6875
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6876
			// If we found no converter, dispatch an error
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6877
			if ( !( conv || conv2 ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6878
				jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6879
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6880
			// If found converter is not an equivalence
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6881
			if ( conv !== true ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6882
				// Convert with 1 or 2 converters accordingly
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6883
				response = conv ? conv( response ) : conv2( conv1(response) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6884
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6885
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6886
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6887
	return response;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6888
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6889
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6890
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6891
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6892
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6893
var jsc = jQuery.now(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6894
	jsre = /(\=)\?(&|$)|()\?\?()/i;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6895
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6896
// Default jsonp settings
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6897
jQuery.ajaxSetup({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6898
	jsonp: "callback",
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6899
	jsonpCallback: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6900
		return jQuery.expando + "_" + ( jsc++ );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6901
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6902
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6903
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6904
// Detect, normalize options and install callbacks for jsonp requests
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6905
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, dataIsString /* internal */ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6906
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6907
	dataIsString = ( typeof s.data === "string" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6908
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6909
	if ( s.dataTypes[ 0 ] === "jsonp" ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6910
		originalSettings.jsonpCallback ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6911
		originalSettings.jsonp != null ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6912
		s.jsonp !== false && ( jsre.test( s.url ) ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6913
				dataIsString && jsre.test( s.data ) ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6914
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6915
		var responseContainer,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6916
			jsonpCallback = s.jsonpCallback =
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6917
				jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6918
			previous = window[ jsonpCallback ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6919
			url = s.url,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6920
			data = s.data,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6921
			replace = "$1" + jsonpCallback + "$2";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6922
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6923
		if ( s.jsonp !== false ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6924
			url = url.replace( jsre, replace );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6925
			if ( s.url === url ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6926
				if ( dataIsString ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6927
					data = data.replace( jsre, replace );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6928
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6929
				if ( s.data === data ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6930
					// Add callback manually
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6931
					url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6932
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6933
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6934
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6935
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6936
		s.url = url;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6937
		s.data = data;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6938
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6939
		window[ jsonpCallback ] = function( response ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6940
			responseContainer = [ response ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6941
		};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6942
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6943
		s.complete = [ function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6944
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6945
			// Set callback back to previous value
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6946
			window[ jsonpCallback ] = previous;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6947
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6948
			// Call if it was a function and we have a response
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6949
			if ( previous) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6950
				if ( responseContainer && jQuery.isFunction( previous ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6951
					window[ jsonpCallback ] ( responseContainer[ 0 ] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6952
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6953
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6954
				// else, more memory leak avoidance
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6955
				try{
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6956
					delete window[ jsonpCallback ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6957
				} catch( e ) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6958
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6959
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6960
		}, s.complete ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6961
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6962
		// Use data converter to retrieve json after script execution
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6963
		s.converters["script json"] = function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6964
			if ( ! responseContainer ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6965
				jQuery.error( jsonpCallback + " was not called" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6966
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6967
			return responseContainer[ 0 ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6968
		};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6969
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6970
		// force json dataType
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6971
		s.dataTypes[ 0 ] = "json";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6972
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6973
		// Delegate to script
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6974
		return "script";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6975
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6976
} );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6977
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6978
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6979
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6980
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6981
// Install script dataType
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6982
jQuery.ajaxSetup({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6983
	accepts: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6984
		script: "text/javascript, application/javascript"
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6985
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6986
	contents: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6987
		script: /javascript/
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6988
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6989
	converters: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6990
		"text script": function( text ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6991
			jQuery.globalEval( text );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6992
			return text;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6993
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6994
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6995
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6996
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6997
// Handle cache's special case and global
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6998
jQuery.ajaxPrefilter( "script", function( s ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  6999
	if ( s.cache === undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7000
		s.cache = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7001
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7002
	if ( s.crossDomain ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7003
		s.type = "GET";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7004
		s.global = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7005
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7006
} );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7007
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7008
// Bind script tag hack transport
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7009
jQuery.ajaxTransport( "script", function(s) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7010
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7011
	// This transport only deals with cross domain requests
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7012
	if ( s.crossDomain ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7013
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7014
		var script,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7015
			head = document.getElementsByTagName( "head" )[ 0 ] || document.documentElement;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7016
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7017
		return {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7018
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7019
			send: function( _, callback ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7020
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7021
				script = document.createElement( "script" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7022
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7023
				script.async = "async";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7024
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7025
				if ( s.scriptCharset ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7026
					script.charset = s.scriptCharset;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7027
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7028
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7029
				script.src = s.url;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7030
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7031
				// Attach handlers for all browsers
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7032
				script.onload = script.onreadystatechange = function( _, isAbort ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7033
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7034
					if ( !script.readyState || /loaded|complete/.test( script.readyState ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7035
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7036
						// Handle memory leak in IE
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7037
						script.onload = script.onreadystatechange = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7038
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7039
						// Remove the script
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7040
						if ( head && script.parentNode ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7041
							head.removeChild( script );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7042
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7043
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7044
						// Dereference the script
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7045
						script = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7046
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7047
						// Callback if not abort
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7048
						if ( !isAbort ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7049
							callback( 200, "success" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7050
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7051
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7052
				};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7053
				// Use insertBefore instead of appendChild  to circumvent an IE6 bug.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7054
				// This arises when a base node is used (#2709 and #4378).
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7055
				head.insertBefore( script, head.firstChild );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7056
			},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7057
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7058
			abort: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7059
				if ( script ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7060
					script.onload( 0, 1 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7061
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7062
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7063
		};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7064
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7065
} );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7066
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7067
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7068
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7069
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7070
var // Next active xhr id
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7071
	xhrId = jQuery.now(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7072
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7073
	// active xhrs
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7074
	xhrs = {},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7075
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7076
	// #5280: see below
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7077
	xhrUnloadAbortInstalled,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7078
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7079
	// XHR used to determine supports properties
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7080
	testXHR;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7081
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7082
// Create the request object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7083
// (This is still attached to ajaxSettings for backward compatibility)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7084
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7085
	/* Microsoft failed to properly
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7086
	 * implement the XMLHttpRequest in IE7 (can't request local files),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7087
	 * so we use the ActiveXObject when it is available
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7088
	 * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7089
	 * we need a fallback.
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7090
	 */
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7091
	function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7092
		if ( window.location.protocol !== "file:" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7093
			try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7094
				return new window.XMLHttpRequest();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7095
			} catch( xhrError ) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7096
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7097
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7098
		try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7099
			return new window.ActiveXObject("Microsoft.XMLHTTP");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7100
		} catch( activeError ) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7101
	} :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7102
	// For all other browsers, use the standard XMLHttpRequest object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7103
	function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7104
		return new window.XMLHttpRequest();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7105
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7106
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7107
// Test if we can create an xhr object
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7108
try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7109
	testXHR = jQuery.ajaxSettings.xhr();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7110
} catch( xhrCreationException ) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7111
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7112
//Does this browser support XHR requests?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7113
jQuery.support.ajax = !!testXHR;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7114
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7115
// Does this browser support crossDomain XHR requests
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7116
jQuery.support.cors = testXHR && ( "withCredentials" in testXHR );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7117
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7118
// No need for the temporary xhr anymore
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7119
testXHR = undefined;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7120
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7121
// Create transport if the browser can provide an xhr
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7122
if ( jQuery.support.ajax ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7123
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7124
	jQuery.ajaxTransport(function( s ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7125
		// Cross domain only allowed if supported through XMLHttpRequest
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7126
		if ( !s.crossDomain || jQuery.support.cors ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7127
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7128
			var callback;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7129
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7130
			return {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7131
				send: function( headers, complete ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7132
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7133
					// #5280: we need to abort on unload or IE will keep connections alive
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7134
					if ( !xhrUnloadAbortInstalled ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7135
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7136
						xhrUnloadAbortInstalled = 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7137
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7138
						jQuery(window).bind( "unload", function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7139
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7140
							// Abort all pending requests
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7141
							jQuery.each( xhrs, function( _, xhr ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7142
								if ( xhr.onreadystatechange ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7143
									xhr.onreadystatechange( 1 );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7144
								}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7145
							} );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7146
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7147
						} );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7148
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7149
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7150
					// Get a new xhr
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7151
					var xhr = s.xhr(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7152
						handle;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7153
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7154
					// Open the socket
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7155
					// Passing null username, generates a login popup on Opera (#2865)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7156
					if ( s.username ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7157
						xhr.open( s.type, s.url, s.async, s.username, s.password );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7158
					} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7159
						xhr.open( s.type, s.url, s.async );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7160
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7161
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7162
					// Requested-With header
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7163
					// Not set for crossDomain requests with no content
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7164
					// (see why at http://trac.dojotoolkit.org/ticket/9486)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7165
					// Won't change header if already provided
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7166
					if ( !( s.crossDomain && !s.hasContent ) && !headers["x-requested-with"] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7167
						headers[ "x-requested-with" ] = "XMLHttpRequest";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7168
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7169
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7170
					// Need an extra try/catch for cross domain requests in Firefox 3
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7171
					try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7172
						jQuery.each( headers, function( key, value ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7173
							xhr.setRequestHeader( key, value );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7174
						} );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7175
					} catch( _ ) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7176
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7177
					// Do send the request
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7178
					// This may raise an exception which is actually
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7179
					// handled in jQuery.ajax (so no try/catch here)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7180
					xhr.send( ( s.hasContent && s.data ) || null );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7181
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7182
					// Listener
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7183
					callback = function( _, isAbort ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7184
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7185
						// Was never called and is aborted or complete
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7186
						if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7187
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7188
							// Only called once
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7189
							callback = 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7190
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7191
							// Do not keep as active anymore
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7192
							if ( handle ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7193
								xhr.onreadystatechange = jQuery.noop;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7194
								delete xhrs[ handle ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7195
							}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7196
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7197
							// If it's an abort
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7198
							if ( isAbort ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7199
								// Abort it manually if needed
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7200
								if ( xhr.readyState !== 4 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7201
									xhr.abort();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7202
								}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7203
							} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7204
								// Get info
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7205
								var status = xhr.status,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7206
									statusText,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7207
									responseHeaders = xhr.getAllResponseHeaders(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7208
									responses = {},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7209
									xml = xhr.responseXML;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7210
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7211
								// Construct response list
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7212
								if ( xml && xml.documentElement /* #4958 */ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7213
									responses.xml = xml;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7214
								}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7215
								responses.text = xhr.responseText;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7216
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7217
								// Firefox throws an exception when accessing
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7218
								// statusText for faulty cross-domain requests
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7219
								try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7220
									statusText = xhr.statusText;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7221
								} catch( e ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7222
									// We normalize with Webkit giving an empty statusText
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7223
									statusText = "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7224
								}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7225
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7226
								// Filter status for non standard behaviours
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7227
								status =
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7228
									// Opera returns 0 when it should be 304
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7229
									// Webkit returns 0 for failing cross-domain no matter the real status
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7230
									status === 0 ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7231
										(
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7232
											// Webkit, Firefox: filter out faulty cross-domain requests
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7233
											!s.crossDomain || statusText ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7234
											(
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7235
												// Opera: filter out real aborts #6060
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7236
												responseHeaders ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7237
												304 :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7238
												0
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7239
											) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7240
											// We assume 302 but could be anything cross-domain related
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7241
											302
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7242
										) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7243
										(
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7244
											// IE sometimes returns 1223 when it should be 204 (see #1450)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7245
											status == 1223 ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7246
												204 :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7247
												status
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7248
										);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7249
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7250
								// Call complete
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7251
								complete( status, statusText, responses, responseHeaders );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7252
							}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7253
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7254
					};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7255
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7256
					// if we're in sync mode or it's in cache
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7257
					// and has been retrieved directly (IE6 & IE7)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7258
					// we need to manually fire the callback
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7259
					if ( !s.async || xhr.readyState === 4 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7260
						callback();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7261
					} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7262
						// Add to list of active xhrs
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7263
						handle = xhrId++;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7264
						xhrs[ handle ] = xhr;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7265
						xhr.onreadystatechange = callback;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7266
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7267
				},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7268
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7269
				abort: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7270
					if ( callback ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7271
						callback(0,1);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7272
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7273
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7274
			};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7275
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7276
	});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7277
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7278
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7279
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7280
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7281
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7282
var elemdisplay = {},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7283
	rfxtypes = /^(?:toggle|show|hide)$/,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7284
	rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7285
	timerId,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7286
	fxAttrs = [
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7287
		// height animations
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7288
		[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7289
		// width animations
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7290
		[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7291
		// opacity animations
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7292
		[ "opacity" ]
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7293
	];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7294
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7295
jQuery.fn.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7296
	show: function( speed, easing, callback ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7297
		var elem, display;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7298
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7299
		if ( speed || speed === 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7300
			return this.animate( genFx("show", 3), speed, easing, callback);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7301
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7302
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7303
			for ( var i = 0, j = this.length; i < j; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7304
				elem = this[i];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7305
				display = elem.style.display;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7306
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7307
				// Reset the inline display of this element to learn if it is
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7308
				// being hidden by cascaded rules or not
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7309
				if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7310
					display = elem.style.display = "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7311
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7312
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7313
				// Set elements which have been overridden with display: none
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7314
				// in a stylesheet to whatever the default browser style is
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7315
				// for such an element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7316
				if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7317
					jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7318
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7319
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7320
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7321
			// Set the display of most of the elements in a second loop
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7322
			// to avoid the constant reflow
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7323
			for ( i = 0; i < j; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7324
				elem = this[i];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7325
				display = elem.style.display;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7326
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7327
				if ( display === "" || display === "none" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7328
					elem.style.display = jQuery._data(elem, "olddisplay") || "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7329
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7330
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7331
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7332
			return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7333
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7334
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7335
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7336
	hide: function( speed, easing, callback ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7337
		if ( speed || speed === 0 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7338
			return this.animate( genFx("hide", 3), speed, easing, callback);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7339
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7340
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7341
			for ( var i = 0, j = this.length; i < j; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7342
				var display = jQuery.css( this[i], "display" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7343
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7344
				if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7345
					jQuery._data( this[i], "olddisplay", display );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7346
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7347
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7348
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7349
			// Set the display of the elements in a second loop
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7350
			// to avoid the constant reflow
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7351
			for ( i = 0; i < j; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7352
				this[i].style.display = "none";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7353
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7354
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7355
			return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7356
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7357
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7358
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7359
	// Save the old toggle function
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7360
	_toggle: jQuery.fn.toggle,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7361
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7362
	toggle: function( fn, fn2, callback ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7363
		var bool = typeof fn === "boolean";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7364
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7365
		if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7366
			this._toggle.apply( this, arguments );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7367
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7368
		} else if ( fn == null || bool ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7369
			this.each(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7370
				var state = bool ? fn : jQuery(this).is(":hidden");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7371
				jQuery(this)[ state ? "show" : "hide" ]();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7372
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7373
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7374
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7375
			this.animate(genFx("toggle", 3), fn, fn2, callback);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7376
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7377
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7378
		return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7379
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7380
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7381
	fadeTo: function( speed, to, easing, callback ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7382
		return this.filter(":hidden").css("opacity", 0).show().end()
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7383
					.animate({opacity: to}, speed, easing, callback);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7384
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7385
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7386
	animate: function( prop, speed, easing, callback ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7387
		var optall = jQuery.speed(speed, easing, callback);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7388
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7389
		if ( jQuery.isEmptyObject( prop ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7390
			return this.each( optall.complete );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7391
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7392
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7393
		return this[ optall.queue === false ? "each" : "queue" ](function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7394
			// XXX 'this' does not always have a nodeName when running the
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7395
			// test suite
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7396
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7397
			var opt = jQuery.extend({}, optall), p,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7398
				isElement = this.nodeType === 1,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7399
				hidden = isElement && jQuery(this).is(":hidden"),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7400
				self = this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7401
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7402
			for ( p in prop ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7403
				var name = jQuery.camelCase( p );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7404
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7405
				if ( p !== name ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7406
					prop[ name ] = prop[ p ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7407
					delete prop[ p ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7408
					p = name;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7409
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7410
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7411
				if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7412
					return opt.complete.call(this);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7413
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7414
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7415
				if ( isElement && ( p === "height" || p === "width" ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7416
					// Make sure that nothing sneaks out
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7417
					// Record all 3 overflow attributes because IE does not
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7418
					// change the overflow attribute when overflowX and
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7419
					// overflowY are set to the same value
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7420
					opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7421
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7422
					// Set display property to inline-block for height/width
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7423
					// animations on inline elements that are having width/height
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7424
					// animated
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7425
					if ( jQuery.css( this, "display" ) === "inline" &&
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7426
							jQuery.css( this, "float" ) === "none" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7427
						if ( !jQuery.support.inlineBlockNeedsLayout ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7428
							this.style.display = "inline-block";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7429
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7430
						} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7431
							var display = defaultDisplay(this.nodeName);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7432
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7433
							// inline-level elements accept inline-block;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7434
							// block-level elements need to be inline with layout
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7435
							if ( display === "inline" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7436
								this.style.display = "inline-block";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7437
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7438
							} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7439
								this.style.display = "inline";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7440
								this.style.zoom = 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7441
							}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7442
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7443
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7444
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7445
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7446
				if ( jQuery.isArray( prop[p] ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7447
					// Create (if needed) and add to specialEasing
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7448
					(opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7449
					prop[p] = prop[p][0];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7450
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7451
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7452
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7453
			if ( opt.overflow != null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7454
				this.style.overflow = "hidden";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7455
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7456
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7457
			opt.curAnim = jQuery.extend({}, prop);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7458
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7459
			jQuery.each( prop, function( name, val ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7460
				var e = new jQuery.fx( self, opt, name );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7461
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7462
				if ( rfxtypes.test(val) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7463
					e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7464
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7465
				} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7466
					var parts = rfxnum.exec(val),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7467
						start = e.cur() || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7468
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7469
					if ( parts ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7470
						var end = parseFloat( parts[2] ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7471
							unit = parts[3] || "px";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7472
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7473
						// We need to compute starting value
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7474
						if ( unit !== "px" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7475
							jQuery.style( self, name, (end || 1) + unit);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7476
							start = ((end || 1) / e.cur()) * start;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7477
							jQuery.style( self, name, start + unit);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7478
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7479
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7480
						// If a +=/-= token was provided, we're doing a relative animation
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7481
						if ( parts[1] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7482
							end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7483
						}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7484
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7485
						e.custom( start, end, unit );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7486
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7487
					} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7488
						e.custom( start, val, "" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7489
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7490
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7491
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7492
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7493
			// For JS strict compliance
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7494
			return true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7495
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7496
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7497
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7498
	stop: function( clearQueue, gotoEnd ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7499
		var timers = jQuery.timers;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7500
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7501
		if ( clearQueue ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7502
			this.queue([]);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7503
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7504
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7505
		this.each(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7506
			// go in reverse order so anything added to the queue during the loop is ignored
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7507
			for ( var i = timers.length - 1; i >= 0; i-- ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7508
				if ( timers[i].elem === this ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7509
					if (gotoEnd) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7510
						// force the next step to be the last
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7511
						timers[i](true);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7512
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7513
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7514
					timers.splice(i, 1);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7515
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7516
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7517
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7518
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7519
		// start the next in the queue if the last step wasn't forced
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7520
		if ( !gotoEnd ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7521
			this.dequeue();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7522
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7523
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7524
		return this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7525
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7526
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7527
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7528
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7529
function genFx( type, num ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7530
	var obj = {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7531
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7532
	jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7533
		obj[ this ] = type;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7534
	});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7535
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7536
	return obj;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7537
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7538
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7539
// Generate shortcuts for custom animations
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7540
jQuery.each({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7541
	slideDown: genFx("show", 1),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7542
	slideUp: genFx("hide", 1),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7543
	slideToggle: genFx("toggle", 1),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7544
	fadeIn: { opacity: "show" },
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7545
	fadeOut: { opacity: "hide" },
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7546
	fadeToggle: { opacity: "toggle" }
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7547
}, function( name, props ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7548
	jQuery.fn[ name ] = function( speed, easing, callback ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7549
		return this.animate( props, speed, easing, callback );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7550
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7551
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7552
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7553
jQuery.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7554
	speed: function( speed, easing, fn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7555
		var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7556
			complete: fn || !fn && easing ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7557
				jQuery.isFunction( speed ) && speed,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7558
			duration: speed,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7559
			easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7560
		};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7561
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7562
		opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7563
			opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7564
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7565
		// Queueing
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7566
		opt.old = opt.complete;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7567
		opt.complete = function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7568
			if ( opt.queue !== false ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7569
				jQuery(this).dequeue();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7570
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7571
			if ( jQuery.isFunction( opt.old ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7572
				opt.old.call( this );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7573
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7574
		};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7575
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7576
		return opt;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7577
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7578
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7579
	easing: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7580
		linear: function( p, n, firstNum, diff ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7581
			return firstNum + diff * p;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7582
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7583
		swing: function( p, n, firstNum, diff ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7584
			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7585
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7586
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7587
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7588
	timers: [],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7589
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7590
	fx: function( elem, options, prop ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7591
		this.options = options;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7592
		this.elem = elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7593
		this.prop = prop;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7594
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7595
		if ( !options.orig ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7596
			options.orig = {};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7597
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7598
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7599
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7600
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7601
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7602
jQuery.fx.prototype = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7603
	// Simple function for setting a style value
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7604
	update: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7605
		if ( this.options.step ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7606
			this.options.step.call( this.elem, this.now, this );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7607
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7608
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7609
		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7610
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7611
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7612
	// Get the current size
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7613
	cur: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7614
		if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7615
			return this.elem[ this.prop ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7616
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7617
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7618
		var r = parseFloat( jQuery.css( this.elem, this.prop ) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7619
		return r || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7620
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7621
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7622
	// Start an animation from one number to another
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7623
	custom: function( from, to, unit ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7624
		var self = this,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7625
			fx = jQuery.fx;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7626
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7627
		this.startTime = jQuery.now();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7628
		this.start = from;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7629
		this.end = to;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7630
		this.unit = unit || this.unit || "px";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7631
		this.now = this.start;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7632
		this.pos = this.state = 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7633
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7634
		function t( gotoEnd ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7635
			return self.step(gotoEnd);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7636
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7637
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7638
		t.elem = this.elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7639
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7640
		if ( t() && jQuery.timers.push(t) && !timerId ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7641
			timerId = setInterval(fx.tick, fx.interval);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7642
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7643
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7644
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7645
	// Simple 'show' function
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7646
	show: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7647
		// Remember where we started, so that we can go back to it later
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7648
		this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7649
		this.options.show = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7650
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7651
		// Begin the animation
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7652
		// Make sure that we start at a small width/height to avoid any
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7653
		// flash of content
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7654
		this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7655
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7656
		// Start by showing the element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7657
		jQuery( this.elem ).show();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7658
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7659
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7660
	// Simple 'hide' function
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7661
	hide: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7662
		// Remember where we started, so that we can go back to it later
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7663
		this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7664
		this.options.hide = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7665
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7666
		// Begin the animation
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7667
		this.custom(this.cur(), 0);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7668
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7669
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7670
	// Each step of an animation
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7671
	step: function( gotoEnd ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7672
		var t = jQuery.now(), done = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7673
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7674
		if ( gotoEnd || t >= this.options.duration + this.startTime ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7675
			this.now = this.end;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7676
			this.pos = this.state = 1;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7677
			this.update();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7678
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7679
			this.options.curAnim[ this.prop ] = true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7680
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7681
			for ( var i in this.options.curAnim ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7682
				if ( this.options.curAnim[i] !== true ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7683
					done = false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7684
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7685
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7686
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7687
			if ( done ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7688
				// Reset the overflow
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7689
				if ( this.options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7690
					var elem = this.elem,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7691
						options = this.options;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7692
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7693
					jQuery.each( [ "", "X", "Y" ], function (index, value) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7694
						elem.style[ "overflow" + value ] = options.overflow[index];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7695
					} );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7696
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7697
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7698
				// Hide the element if the "hide" operation was done
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7699
				if ( this.options.hide ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7700
					jQuery(this.elem).hide();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7701
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7702
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7703
				// Reset the properties, if the item has been hidden or shown
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7704
				if ( this.options.hide || this.options.show ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7705
					for ( var p in this.options.curAnim ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7706
						jQuery.style( this.elem, p, this.options.orig[p] );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7707
					}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7708
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7709
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7710
				// Execute the complete function
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7711
				this.options.complete.call( this.elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7712
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7713
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7714
			return false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7715
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7716
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7717
			var n = t - this.startTime;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7718
			this.state = n / this.options.duration;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7719
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7720
			// Perform the easing function, defaults to swing
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7721
			var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7722
			var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7723
			this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7724
			this.now = this.start + ((this.end - this.start) * this.pos);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7725
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7726
			// Perform the next step of the animation
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7727
			this.update();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7728
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7729
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7730
		return true;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7731
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7732
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7733
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7734
jQuery.extend( jQuery.fx, {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7735
	tick: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7736
		var timers = jQuery.timers;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7737
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7738
		for ( var i = 0; i < timers.length; i++ ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7739
			if ( !timers[i]() ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7740
				timers.splice(i--, 1);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7741
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7742
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7743
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7744
		if ( !timers.length ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7745
			jQuery.fx.stop();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7746
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7747
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7748
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7749
	interval: 13,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7750
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7751
	stop: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7752
		clearInterval( timerId );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7753
		timerId = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7754
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7755
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7756
	speeds: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7757
		slow: 600,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7758
		fast: 200,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7759
		// Default speed
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7760
		_default: 400
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7761
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7762
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7763
	step: {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7764
		opacity: function( fx ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7765
			jQuery.style( fx.elem, "opacity", fx.now );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7766
		},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7767
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7768
		_default: function( fx ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7769
			if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7770
				fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7771
			} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7772
				fx.elem[ fx.prop ] = fx.now;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7773
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7774
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7775
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7776
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7777
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7778
if ( jQuery.expr && jQuery.expr.filters ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7779
	jQuery.expr.filters.animated = function( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7780
		return jQuery.grep(jQuery.timers, function( fn ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7781
			return elem === fn.elem;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7782
		}).length;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7783
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7784
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7785
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7786
function defaultDisplay( nodeName ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7787
	if ( !elemdisplay[ nodeName ] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7788
		var elem = jQuery("<" + nodeName + ">").appendTo("body"),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7789
			display = elem.css("display");
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7790
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7791
		elem.remove();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7792
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7793
		if ( display === "none" || display === "" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7794
			display = "block";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7795
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7796
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7797
		elemdisplay[ nodeName ] = display;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7798
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7799
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7800
	return elemdisplay[ nodeName ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7801
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7802
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7803
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7804
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7805
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7806
var rtable = /^t(?:able|d|h)$/i,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7807
	rroot = /^(?:body|html)$/i;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7808
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7809
if ( "getBoundingClientRect" in document.documentElement ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7810
	jQuery.fn.offset = function( options ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7811
		var elem = this[0], box;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7812
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7813
		if ( options ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7814
			return this.each(function( i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7815
				jQuery.offset.setOffset( this, options, i );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7816
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7817
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7818
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7819
		if ( !elem || !elem.ownerDocument ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7820
			return null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7821
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7822
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7823
		if ( elem === elem.ownerDocument.body ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7824
			return jQuery.offset.bodyOffset( elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7825
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7826
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7827
		try {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7828
			box = elem.getBoundingClientRect();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7829
		} catch(e) {}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7830
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7831
		var doc = elem.ownerDocument,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7832
			docElem = doc.documentElement;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7833
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7834
		// Make sure we're not dealing with a disconnected DOM node
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7835
		if ( !box || !jQuery.contains( docElem, elem ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7836
			return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7837
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7838
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7839
		var body = doc.body,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7840
			win = getWindow(doc),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7841
			clientTop  = docElem.clientTop  || body.clientTop  || 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7842
			clientLeft = docElem.clientLeft || body.clientLeft || 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7843
			scrollTop  = (win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7844
			scrollLeft = (win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7845
			top  = box.top  + scrollTop  - clientTop,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7846
			left = box.left + scrollLeft - clientLeft;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7847
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7848
		return { top: top, left: left };
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7849
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7850
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7851
} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7852
	jQuery.fn.offset = function( options ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7853
		var elem = this[0];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7854
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7855
		if ( options ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7856
			return this.each(function( i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7857
				jQuery.offset.setOffset( this, options, i );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7858
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7859
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7860
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7861
		if ( !elem || !elem.ownerDocument ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7862
			return null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7863
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7864
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7865
		if ( elem === elem.ownerDocument.body ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7866
			return jQuery.offset.bodyOffset( elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7867
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7868
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7869
		jQuery.offset.initialize();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7870
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7871
		var computedStyle,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7872
			offsetParent = elem.offsetParent,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7873
			prevOffsetParent = elem,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7874
			doc = elem.ownerDocument,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7875
			docElem = doc.documentElement,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7876
			body = doc.body,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7877
			defaultView = doc.defaultView,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7878
			prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7879
			top = elem.offsetTop,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7880
			left = elem.offsetLeft;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7881
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7882
		while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7883
			if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7884
				break;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7885
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7886
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7887
			computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7888
			top  -= elem.scrollTop;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7889
			left -= elem.scrollLeft;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7890
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7891
			if ( elem === offsetParent ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7892
				top  += elem.offsetTop;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7893
				left += elem.offsetLeft;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7894
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7895
				if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7896
					top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7897
					left += parseFloat( computedStyle.borderLeftWidth ) || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7898
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7899
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7900
				prevOffsetParent = offsetParent;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7901
				offsetParent = elem.offsetParent;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7902
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7903
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7904
			if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7905
				top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7906
				left += parseFloat( computedStyle.borderLeftWidth ) || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7907
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7908
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7909
			prevComputedStyle = computedStyle;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7910
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7911
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7912
		if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7913
			top  += body.offsetTop;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7914
			left += body.offsetLeft;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7915
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7916
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7917
		if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7918
			top  += Math.max( docElem.scrollTop, body.scrollTop );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7919
			left += Math.max( docElem.scrollLeft, body.scrollLeft );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7920
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7921
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7922
		return { top: top, left: left };
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7923
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7924
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7925
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7926
jQuery.offset = {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7927
	initialize: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7928
		var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7929
			html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7930
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7931
		jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7932
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7933
		container.innerHTML = html;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7934
		body.insertBefore( container, body.firstChild );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7935
		innerDiv = container.firstChild;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7936
		checkDiv = innerDiv.firstChild;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7937
		td = innerDiv.nextSibling.firstChild.firstChild;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7938
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7939
		this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7940
		this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7941
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7942
		checkDiv.style.position = "fixed";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7943
		checkDiv.style.top = "20px";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7944
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7945
		// safari subtracts parent border width here which is 5px
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7946
		this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7947
		checkDiv.style.position = checkDiv.style.top = "";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7948
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7949
		innerDiv.style.overflow = "hidden";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7950
		innerDiv.style.position = "relative";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7951
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7952
		this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7953
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7954
		this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7955
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7956
		body.removeChild( container );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7957
		body = container = innerDiv = checkDiv = table = td = null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7958
		jQuery.offset.initialize = jQuery.noop;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7959
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7960
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7961
	bodyOffset: function( body ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7962
		var top = body.offsetTop,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7963
			left = body.offsetLeft;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7964
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7965
		jQuery.offset.initialize();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7966
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7967
		if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7968
			top  += parseFloat( jQuery.css(body, "marginTop") ) || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7969
			left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7970
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7971
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7972
		return { top: top, left: left };
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7973
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7974
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7975
	setOffset: function( elem, options, i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7976
		var position = jQuery.css( elem, "position" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7977
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7978
		// set position first, in-case top/left are set even on static elem
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7979
		if ( position === "static" ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7980
			elem.style.position = "relative";
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7981
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7982
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7983
		var curElem = jQuery( elem ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7984
			curOffset = curElem.offset(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7985
			curCSSTop = jQuery.css( elem, "top" ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7986
			curCSSLeft = jQuery.css( elem, "left" ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7987
			calculatePosition = (position === "absolute" && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7988
			props = {}, curPosition = {}, curTop, curLeft;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7989
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7990
		// need to be able to calculate position if either top or left is auto and position is absolute
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7991
		if ( calculatePosition ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7992
			curPosition = curElem.position();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7993
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7994
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7995
		curTop  = calculatePosition ? curPosition.top  : parseInt( curCSSTop,  10 ) || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7996
		curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7997
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7998
		if ( jQuery.isFunction( options ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  7999
			options = options.call( elem, i, curOffset );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8000
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8001
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8002
		if (options.top != null) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8003
			props.top = (options.top - curOffset.top) + curTop;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8004
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8005
		if (options.left != null) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8006
			props.left = (options.left - curOffset.left) + curLeft;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8007
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8008
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8009
		if ( "using" in options ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8010
			options.using.call( elem, props );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8011
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8012
			curElem.css( props );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8013
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8014
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8015
};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8016
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8017
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8018
jQuery.fn.extend({
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8019
	position: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8020
		if ( !this[0] ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8021
			return null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8022
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8023
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8024
		var elem = this[0],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8025
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8026
		// Get *real* offsetParent
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8027
		offsetParent = this.offsetParent(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8028
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8029
		// Get correct offsets
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8030
		offset       = this.offset(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8031
		parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8032
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8033
		// Subtract element margins
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8034
		// note: when an element has margin: auto the offsetLeft and marginLeft
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8035
		// are the same in Safari causing offset.left to incorrectly be 0
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8036
		offset.top  -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8037
		offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8038
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8039
		// Add offsetParent borders
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8040
		parentOffset.top  += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8041
		parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8042
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8043
		// Subtract the two offsets
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8044
		return {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8045
			top:  offset.top  - parentOffset.top,
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8046
			left: offset.left - parentOffset.left
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8047
		};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8048
	},
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8049
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8050
	offsetParent: function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8051
		return this.map(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8052
			var offsetParent = this.offsetParent || document.body;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8053
			while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8054
				offsetParent = offsetParent.offsetParent;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8055
			}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8056
			return offsetParent;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8057
		});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8058
	}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8059
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8060
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8061
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8062
// Create scrollLeft and scrollTop methods
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8063
jQuery.each( ["Left", "Top"], function( i, name ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8064
	var method = "scroll" + name;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8065
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8066
	jQuery.fn[ method ] = function(val) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8067
		var elem = this[0], win;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8068
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8069
		if ( !elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8070
			return null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8071
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8072
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8073
		if ( val !== undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8074
			// Set the scroll offset
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8075
			return this.each(function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8076
				win = getWindow( this );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8077
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8078
				if ( win ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8079
					win.scrollTo(
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8080
						!i ? val : jQuery(win).scrollLeft(),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8081
						 i ? val : jQuery(win).scrollTop()
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8082
					);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8083
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8084
				} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8085
					this[ method ] = val;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8086
				}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8087
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8088
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8089
			win = getWindow( elem );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8090
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8091
			// Return the scroll offset
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8092
			return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8093
				jQuery.support.boxModel && win.document.documentElement[ method ] ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8094
					win.document.body[ method ] :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8095
				elem[ method ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8096
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8097
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8098
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8099
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8100
function getWindow( elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8101
	return jQuery.isWindow( elem ) ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8102
		elem :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8103
		elem.nodeType === 9 ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8104
			elem.defaultView || elem.parentWindow :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8105
			false;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8106
}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8107
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8108
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8109
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8110
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8111
// Create innerHeight, innerWidth, outerHeight and outerWidth methods
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8112
jQuery.each([ "Height", "Width" ], function( i, name ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8113
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8114
	var type = name.toLowerCase();
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8115
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8116
	// innerHeight and innerWidth
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8117
	jQuery.fn["inner" + name] = function() {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8118
		return this[0] ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8119
			parseFloat( jQuery.css( this[0], type, "padding" ) ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8120
			null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8121
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8122
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8123
	// outerHeight and outerWidth
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8124
	jQuery.fn["outer" + name] = function( margin ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8125
		return this[0] ?
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8126
			parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) :
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8127
			null;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8128
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8129
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8130
	jQuery.fn[ type ] = function( size ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8131
		// Get window width or height
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8132
		var elem = this[0];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8133
		if ( !elem ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8134
			return size == null ? null : this;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8135
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8136
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8137
		if ( jQuery.isFunction( size ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8138
			return this.each(function( i ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8139
				var self = jQuery( this );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8140
				self[ type ]( size.call( this, i, self[ type ]() ) );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8141
			});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8142
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8143
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8144
		if ( jQuery.isWindow( elem ) ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8145
			// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8146
			// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8147
			var docElemProp = elem.document.documentElement[ "client" + name ];
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8148
			return elem.document.compatMode === "CSS1Compat" && docElemProp ||
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8149
				elem.document.body[ "client" + name ] || docElemProp;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8150
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8151
		// Get document width or height
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8152
		} else if ( elem.nodeType === 9 ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8153
			// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8154
			return Math.max(
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8155
				elem.documentElement["client" + name],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8156
				elem.body["scroll" + name], elem.documentElement["scroll" + name],
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8157
				elem.body["offset" + name], elem.documentElement["offset" + name]
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8158
			);
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8159
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8160
		// Get or set width or height on the element
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8161
		} else if ( size === undefined ) {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8162
			var orig = jQuery.css( elem, type ),
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8163
				ret = parseFloat( orig );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8164
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8165
			return jQuery.isNaN( ret ) ? orig : ret;
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8166
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8167
		// Set the width or height on the element (default to pixels if value is unitless)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8168
		} else {
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8169
			return this.css( type, typeof size === "string" ? size : size + "px" );
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8170
		}
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8171
	};
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8172
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8173
});
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8174
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8175
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  8176
})(window);