";tds=div.getElementsByTagName("td");//CheckiftablecellsstillhaveoffsetWidth/Heightwhentheyareset//todisplay:noneandtherearestillothervisibletablecellsina//tablerow;ifso,offsetWidth/Heightarenotreliableforusewhen//determiningifanelementhasbeenhiddendirectlyusing//display:none(itisstillsafetouseoffsetsifaparentelementis//hidden;donsafetygogglesandseebug#4512formoreinformation).//(onlyIE8failsthistest)isSupported=(tds[0].offsetHeight===0);tds[0].style.display="";tds[1].style.display="none";//CheckifemptytablecellsstillhaveoffsetWidth/Height//(IE< 8 fail this test)
support.reliableHiddenOffsets ? isSupported && ( tds[ 0 ].offsetHeight === 0 );
div.innerHTML = "";
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. For more
// info see bug #3333
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
if ( document.defaultView && document.defaultView.getComputedStyle ) {
marginDiv = document.createElement( "div" );
marginDiv.style.width = "0";
marginDiv.style.marginRight = "0";
div.appendChild( marginDiv );
support.reliableMarginRight =
( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
}
// Remove the body element we added
testElement.innerHTML = "";
testElementParent.removeChild( testElement );
// Technique from Juriy Zaytsev
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
// We only care about the case where non-standard event systems
// are used, namely in IE. Short-circuiting here helps us to
// avoid an eval call (in setAttribute) which can cause CSP
// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
if ( div.attachEvent ) {
for( i in {
submit: 1,
change: 1,
focusin: 1
} ) {
eventName = "on" + i;
isSupported = ( eventName in div );
if ( !isSupported ) {
div.setAttribute( eventName, "return;" );
isSupported = ( typeof div[ eventName ] === "function" );
}
support[ i + "Bubbles" ] = isSupported;
}
}
// Null connected elements to avoid leaks in IE
testElement = fragment = select = opt = body = marginDiv = div = input = null;
return support;
})();
// Keep track of boxModel
jQuery.boxModel = jQuery.support.boxModel;
var rbrace = /^(?:\{.*\}|\[.*\])$/,
rmultiDash = /([a-z])([A-Z])/g;
jQuery.extend({
cache: {},
// Please use with caution
uuid: 0,
// Unique for each copy of jQuery on the page
// Non-digits removed to match rinlinejQuery
expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
// Ban all objects except for Flash (which handle expandos)
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
"applet": true
},
hasData: function( elem ) {
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
return !!elem && !isEmptyDataObject( elem );
},
data: function( elem, name, data, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,
// We have to handle DOM nodes and JS objects differently because IE6-7
// can't GC object references properly across the DOM-JS boundary
isNode = elem.nodeType,
// Only DOM nodes need the global jQuery cache; JS object data is
// attached directly to the object so GC can occur automatically
cache = isNode ? jQuery.cache : elem,
// Only defining an ID for JS objects if its cache already exists allows
// the code to shortcut on the same path as a DOM node with no cache
id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
// Avoid doing any more work than we need to when trying to get data on an
// object that has no data at all
if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
return;
}
if ( !id ) {
// Only DOM nodes need a new unique ID for each element since their data
// ends up in the global cache
if ( isNode ) {
elem[ jQuery.expando ] = id = ++jQuery.uuid;
} else {
id = jQuery.expando;
}
}
if ( !cache[ id ] ) {
cache[ id ] = {};
// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
// metadata on plain JS objects when the object is serialized using
// JSON.stringify
if ( !isNode ) {
cache[ id ].toJSON = jQuery.noop;
}
}
// An object can be passed to jQuery.data instead of a key/value pair; this gets
// shallow copied over onto the existing cache
if ( typeof name === "object" || typeof name === "function" ) {
if ( pvt ) {
cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
} else {
cache[ id ] = jQuery.extend(cache[ id ], name);
}
}
thisCache = cache[ id ];
// Internal jQuery data is stored in a separate object inside the object's data
// cache in order to avoid key collisions between internal data and user-defined
// data
if ( pvt ) {
if ( !thisCache[ internalKey ] ) {
thisCache[ internalKey ] = {};
}
thisCache = thisCache[ internalKey ];
}
if ( data !== undefined ) {
thisCache[ jQuery.camelCase( name ) ] = data;
}
// TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
// not attempt to inspect the internal events object using jQuery.data, as this
// internal data object is undocumented and subject to change.
if ( name === "events" && !thisCache[name] ) {
return thisCache[ internalKey ] && thisCache[ internalKey ].events;
}
return getByName ?
// Check for both converted-to-camel and non-converted data property names
thisCache[ jQuery.camelCase( name ) ] || thisCache[ name ] :
thisCache;
},
removeData: function( elem, name, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
var internalKey = jQuery.expando, isNode = elem.nodeType,
// See jQuery.data for more information
cache = isNode ? jQuery.cache : elem,
// See jQuery.data for more information
id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
// If there is already no cache entry for this object, there is no
// purpose in continuing
if ( !cache[ id ] ) {
return;
}
if ( name ) {
var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
if ( thisCache ) {
delete thisCache[ name ];
// If there is no data left in the cache, we want to continue
// and let the cache object itself get destroyed
if ( !isEmptyDataObject(thisCache) ) {
return;
}
}
}
// See jQuery.data for more information
if ( pvt ) {
delete cache[ id ][ internalKey ];
// Don't destroy the parent cache unless the internal data object
// had been the only thing left in it
if ( !isEmptyDataObject(cache[ id ]) ) {
return;
}
}
var internalCache = cache[ id ][ internalKey ];
// Browsers that fail expando deletion also refuse to delete expandos on
// the window, but it will allow it on all other JS objects; other browsers
// don't care
if ( jQuery.support.deleteExpando || cache != window ) {
delete cache[ id ];
} else {
cache[ id ] = null;
}
// We destroyed the entire user cache at once because it's faster than
// iterating through each key, but we need to continue to persist internal
// data if it existed
if ( internalCache ) {
cache[ id ] = {};
// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
// metadata on plain JS objects when the object is serialized using
// JSON.stringify
if ( !isNode ) {
cache[ id ].toJSON = jQuery.noop;
}
cache[ id ][ internalKey ] = internalCache;
// Otherwise, we need to eliminate the expando on the node to avoid
// false lookups in the cache for entries that no longer exist
} else if ( isNode ) {
// IE does not allow us to delete expando properties from nodes,
// nor does it have a removeAttribute function on Document nodes;
// we must handle all of these cases
if ( jQuery.support.deleteExpando ) {
delete elem[ jQuery.expando ];
} else if ( elem.removeAttribute ) {
elem.removeAttribute( jQuery.expando );
} else {
elem[ jQuery.expando ] = null;
}
}
},
// For internal use only.
_data: function( elem, name, data ) {
return jQuery.data( elem, name, data, true );
},
// A method for determining if a DOM node can handle the data expando
acceptData: function( elem ) {
if ( elem.nodeName ) {
var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
if ( match ) {
return !(match === true || elem.getAttribute("classid") !== match);
}
}
return true;
}
});
jQuery.fn.extend({
data: function( key, value ) {
var data = null;
if ( typeof key === "undefined" ) {
if ( this.length ) {
data = jQuery.data( this[0] );
if ( this[0].nodeType === 1 ) {
var attr = this[0].attributes, name;
for ( var i = 0, l = attr.length; i < l; i++ ) {
name = attr[i].name;
if ( name.indexOf( "data-" ) === 0 ) {
name = jQuery.camelCase( name.substring(5) );
dataAttr( this[0], name, data[ name ] );
}
}
}
}
return data;
} else if ( typeof key === "object" ) {
return this.each(function() {
jQuery.data( this, key );
});
}
var parts = key.split(".");
parts[1] = parts[1] ? "." + parts[1] : "";
if ( value === undefined ) {
data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
// Try to fetch any internally stored data first
if ( data === undefined && this.length ) {
data = jQuery.data( this[0], key );
data = dataAttr( this[0], key, data );
}
return data === undefined && parts[1] ?
this.data( parts[0] ) :
data;
} else {
return this.each(function() {
var $this = jQuery( this ),
args = [ parts[0], value ];
$this.triggerHandler( "setData" + parts[1] + "!", args );
jQuery.data( this, key, value );
$this.triggerHandler( "changeData" + parts[1] + "!", args );
});
}
},
removeData: function( key ) {
return this.each(function() {
jQuery.removeData( this, key );
});
}
});
function dataAttr( elem, key, data ) {
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();
data = elem.getAttribute( name );
if ( typeof data === "string" ) {
try {
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
!jQuery.isNaN( data ) ? parseFloat( data ) :
rbrace.test( data ) ? jQuery.parseJSON( data ) :
data;
} catch( e ) {}
// Make sure we set the data so it isn't changed later
jQuery.data( elem, key, data );
} else {
data = undefined;
}
}
return data;
}
// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
// property to be considered empty objects; this property always exists in
// order to make sure JSON.stringify does not expose internal metadata
function isEmptyDataObject( obj ) {
for ( var name in obj ) {
if ( name !== "toJSON" ) {
return false;
}
}
return true;
}
function handleQueueMarkDefer( elem, type, src ) {
var deferDataKey = type + "defer",
queueDataKey = type + "queue",
markDataKey = type + "mark",
defer = jQuery.data( elem, deferDataKey, undefined, true );
if ( defer &&
( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) &&
( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {
// Give room for hard-coded callbacks to fire first
// and eventually mark/queue something else on the element
setTimeout( function() {
if ( !jQuery.data( elem, queueDataKey, undefined, true ) &&
!jQuery.data( elem, markDataKey, undefined, true ) ) {
jQuery.removeData( elem, deferDataKey, true );
defer.resolve();
}
}, 0 );
}
}
jQuery.extend({
_mark: function( elem, type ) {
if ( elem ) {
type = (type || "fx") + "mark";
jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
}
},
_unmark: function( force, elem, type ) {
if ( force !== true ) {
type = elem;
elem = force;
force = false;
}
if ( elem ) {
type = type || "fx";
var key = type + "mark",
count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
if ( count ) {
jQuery.data( elem, key, count, true );
} else {
jQuery.removeData( elem, key, true );
handleQueueMarkDefer( elem, type, "mark" );
}
}
},
queue: function( elem, type, data ) {
if ( elem ) {
type = (type || "fx") + "queue";
var q = jQuery.data( elem, type, undefined, true );
// Speed up dequeue by getting out quickly if this is just a lookup
if ( data ) {
if ( !q || jQuery.isArray(data) ) {
q = jQuery.data( elem, type, jQuery.makeArray(data), true );
} else {
q.push( data );
}
}
return q || [];
}
},
dequeue: function( elem, type ) {
type = type || "fx";
var queue = jQuery.queue( elem, type ),
fn = queue.shift(),
defer;
// If the fx queue is dequeued, always remove the progress sentinel
if ( fn === "inprogress" ) {
fn = queue.shift();
}
if ( fn ) {
// Add a progress sentinel to prevent the fx queue from being
// automatically dequeued
if ( type === "fx" ) {
queue.unshift("inprogress");
}
fn.call(elem, function() {
jQuery.dequeue(elem, type);
});
}
if ( !queue.length ) {
jQuery.removeData( elem, type + "queue", true );
handleQueueMarkDefer( elem, type, "queue" );
}
}
});
jQuery.fn.extend({
queue: function( type, data ) {
if ( typeof type !== "string" ) {
data = type;
type = "fx";
}
if ( data === undefined ) {
return jQuery.queue( this[0], type );
}
return this.each(function() {
var queue = jQuery.queue( this, type, data );
if ( type === "fx" && queue[0] !== "inprogress" ) {
jQuery.dequeue( this, type );
}
});
},
dequeue: function( type ) {
return this.each(function() {
jQuery.dequeue( this, type );
});
},
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
delay: function( time, type ) {
time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
type = type || "fx";
return this.queue( type, function() {
var elem = this;
setTimeout(function() {
jQuery.dequeue( elem, type );
}, time );
});
},
clearQueue: function( type ) {
return this.queue( type || "fx", [] );
},
// Get a promise resolved when queues of a certain type
// are emptied (fx is the type by default)
promise: function( type, object ) {
if ( typeof type !== "string" ) {
object = type;
type = undefined;
}
type = type || "fx";
var defer = jQuery.Deferred(),
elements = this,
i = elements.length,
count = 1,
deferDataKey = type + "defer",
queueDataKey = type + "queue",
markDataKey = type + "mark",
tmp;
function resolve() {
if ( !( --count ) ) {
defer.resolveWith( elements, [ elements ] );
}
}
while( i-- ) {
if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
count++;
tmp.done( resolve );
}
}
resolve();
return defer.promise();
}
});
var rclass = /[\n\t\r]/g,
rspace = /\s+/,
rreturn = /\r/g,
rtype = /^(?:button|input)$/i,
rfocusable = /^(?:button|input|object|select|textarea)$/i,
rclickable = /^a(?:rea)?$/i,
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
rinvalidChar = /\:|^on/,
formHook, boolHook;
jQuery.fn.extend({
attr: function( name, value ) {
return jQuery.access( this, name, value, true, jQuery.attr );
},
removeAttr: function( name ) {
return this.each(function() {
jQuery.removeAttr( this, name );
});
},
prop: function( name, value ) {
return jQuery.access( this, name, value, true, jQuery.prop );
},
removeProp: function( name ) {
name = jQuery.propFix[ name ] || name;
return this.each(function() {
// try/catch handles cases where IE balks (such as removing a property on window)
try {
this[ name ] = undefined;
delete this[ name ];
} catch( e ) {}
});
},
addClass: function( value ) {
var classNames, i, l, elem,
setClass, c, cl;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).addClass( value.call(this, j, this.className) );
});
}
if ( value && typeof value === "string" ) {
classNames = value.split( rspace );
for ( i = 0, l = this.length; i < l; i++ ) {
elem = this[ i ];
if ( elem.nodeType === 1 ) {
if ( !elem.className && classNames.length === 1 ) {
elem.className = value;
} else {
setClass = " " + elem.className + " ";
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
setClass += classNames[ c ] + " ";
}
}
elem.className = jQuery.trim( setClass );
}
}
}
}
return this;
},
removeClass: function( value ) {
var classNames, i, l, elem, className, c, cl;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).removeClass( value.call(this, j, this.className) );
});
}
if ( (value && typeof value === "string") || value === undefined ) {
classNames = (value || "").split( rspace );
for ( i = 0, l = this.length; i < l; i++ ) {
elem = this[ i ];
if ( elem.nodeType === 1 && elem.className ) {
if ( value ) {
className = (" " + elem.className + " ").replace( rclass, " " );
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
className = className.replace(" " + classNames[ c ] + " ", " ");
}
elem.className = jQuery.trim( className );
} else {
elem.className = "";
}
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
return this.each(function( i ) {
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
});
}
return this.each(function() {
if ( type === "string" ) {
// toggle individual class names
var className,
i = 0,
self = jQuery( this ),
state = stateVal,
classNames = value.split( rspace );
while ( (className = classNames[ i++ ]) ) {
// check each className given, space seperated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
} else if ( type === "undefined" || type === "boolean" ) {
if ( this.className ) {
// store className if set
jQuery._data( this, "__className__", this.className );
}
// toggle whole className
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
}
});
},
hasClass: function( selector ) {
var className = " " + selector + " ";
for ( var i = 0, l = this.length; i < l; i++ ) {
if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >-1){returntrue;}}returnfalse;},val:function(value){varhooks,ret,elem=this[0];if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.nodeName.toLowerCase()]||jQuery.valHooks[elem.type];if(hooks&&"get"inhooks&&(ret=hooks.get(elem,"value"))!==undefined){returnret;}ret=elem.value;returntypeofret==="string"?//handlemostcommonstringcasesret.replace(rreturn,"")://handlecaseswherevalueisnull/undefornumberret==null?"":ret;}returnundefined;}varisFunction=jQuery.isFunction(value);returnthis.each(function(i){varself=jQuery(this),val;if(this.nodeType!==1){return;}if(isFunction){val=value.call(this,i,self.val());}else{val=value;}//Treatnull/undefinedas"";convertnumberstostringif(val==null){val="";}elseif(typeofval==="number"){val+="";}elseif(jQuery.isArray(val)){val=jQuery.map(val,function(value){returnvalue==null?"":value+"";});}hooks=jQuery.valHooks[this.nodeName.toLowerCase()]||jQuery.valHooks[this.type];//Ifsetreturnsundefined,fallbacktonormalsettingif(!hooks||!("set"inhooks)||hooks.set(this,val,"value")===undefined){this.value=val;}});}});jQuery.extend({valHooks:{option:{get:function(elem){//attributes.valueisundefinedinBlackberry4.7but//uses.value.See#6932varval=elem.attributes.value;return!val||val.specified?elem.value:elem.text;}},select:{get:function(elem){varvalue,index=elem.selectedIndex,values=[],options=elem.options,one=elem.type==="select-one";//Nothingwasselectedif(index< 0 ) {
return null;
}
// Loop through all the selected options
for ( var i ? one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
var option = options[ i ];
// Don't return options that are disabled or in a disabled optgroup
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
// Get the specific value for the option
value = jQuery( option ).val();
// We don't need an array for one selects
if ( one ) {
return value;
}
// Multi-Selects return an array
values.push( value );
}
}
// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
if ( one && !values.length && options.length ) {
return jQuery( options[ index ] ).val();
}
return values;
},
set: function( elem, value ) {
var values = jQuery.makeArray( value );
jQuery(elem).find("option").each(function() {
this.selected = jQuery.inArray( jQuery(this).val(), values ) >=0;});if(!values.length){elem.selectedIndex=-1;}returnvalues;}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attrFix:{//Alwaysnormalizetoensurehookusagetabindex:"tabIndex"},attr:function(elem,name,value,pass){varnType=elem.nodeType;//don'tget/setattributesontext,commentandattributenodesif(!elem||nType===3||nType===8||nType===2){returnundefined;}if(pass&&nameinjQuery.attrFn){returnjQuery(elem)[name](value);}//Fallbacktopropwhenattributesarenotsupportedif(!("getAttribute"inelem)){returnjQuery.prop(elem,name,value);}varret,hooks,notxml=nType!==1||!jQuery.isXMLDoc(elem);//Normalizethenameifneededif(notxml){name=jQuery.attrFix[name]||name;hooks=jQuery.attrHooks[name];if(!hooks){//UseboolHookforbooleanattributesif(rboolean.test(name)){hooks=boolHook;//UseformHookforformsandifthenamecontainscertaincharacters}elseif(formHook&&name!=="className"&&(jQuery.nodeName(elem,"form")||rinvalidChar.test(name))){hooks=formHook;}}}if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name);returnundefined;}elseif(hooks&&"set"inhooks&¬xml&&(ret=hooks.set(elem,value,name))!==undefined){returnret;}else{elem.setAttribute(name,""+value);returnvalue;}}elseif(hooks&&"get"inhooks&¬xml&&(ret=hooks.get(elem,name))!==null){returnret;}else{ret=elem.getAttribute(name);//Non-existentattributesreturnnull,wenormalizetoundefinedreturnret===null?undefined:ret;}},removeAttr:function(elem,name){varpropName;if(elem.nodeType===1){name=jQuery.attrFix[name]||name;if(jQuery.support.getSetAttribute){//UseremoveAttributeinbrowsersthatsupportitelem.removeAttribute(name);}else{jQuery.attr(elem,name,"");elem.removeAttributeNode(elem.getAttributeNode(name));}//Setcorrespondingpropertytofalseforbooleanattributesif(rboolean.test(name)&&(propName=jQuery.propFix[name]||name)inelem){elem[propName]=false;}}},attrHooks:{type:{set:function(elem,value){//Wecan'tallowthetypepropertytobechanged(sinceitcausesproblemsinIE)if(rtype.test(elem.nodeName)&&elem.parentNode){jQuery.error("typepropertycan'tbechanged");}elseif(!jQuery.support.radioValue&&value==="radio"&&jQuery.nodeName(elem,"input")){//SettingthetypeonaradiobuttonafterthevalueresetsthevalueinIE6-9//Resetvaluetoit'sdefaultincasetypeissetaftervalue//Thisisforelementcreationvarval=elem.value;elem.setAttribute("type",value);if(val){elem.value=val;}returnvalue;}}},tabIndex:{get:function(elem){//elem.tabIndexdoesn'talwaysreturnthecorrectvaluewhenithasn'tbeenexplicitlyset//http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/varattributeNode=elem.getAttributeNode("tabIndex");returnattributeNode&&attributeNode.specified?parseInt(attributeNode.value,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined;}},//Usethevaluepropertyforbackcompat//UsetheformHookforbuttonelementsinIE6/7(#1954)value:{get:function(elem,name){if(formHook&&jQuery.nodeName(elem,"button")){returnformHook.get(elem,name);}returnnameinelem?elem.value:null;},set:function(elem,value,name){if(formHook&&jQuery.nodeName(elem,"button")){returnformHook.set(elem,value,name);}//DoesnotreturnsothatsetAttributeisalsousedelem.value=value;}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(elem,name,value){varnType=elem.nodeType;//don'tget/setpropertiesontext,commentandattributenodesif(!elem||nType===3||nType===8||nType===2){returnundefined;}varret,hooks,notxml=nType!==1||!jQuery.isXMLDoc(elem);if(notxml){//Fixnameandattachhooksname=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name];}if(value!==undefined){if(hooks&&"set"inhooks&&(ret=hooks.set(elem,value,name))!==undefined){returnret;}else{return(elem[name]=value);}}else{if(hooks&&"get"inhooks&&(ret=hooks.get(elem,name))!==undefined){returnret;}else{returnelem[name];}}},propHooks:{}});//HookforbooleanattributesboolHook={get:function(elem,name){//AlignbooleanattributeswithcorrespondingpropertiesreturnjQuery.prop(elem,name)?name.toLowerCase():undefined;},set:function(elem,value,name){varpropName;if(value===false){//RemovebooleanattributeswhensettofalsejQuery.removeAttr(elem,name);}else{//valueistruesinceweknowatthispointit'stypebooleanandnotfalse//SetbooleanattributestothesamenameandsettheDOMpropertypropName=jQuery.propFix[name]||name;if(propNameinelem){//OnlysettheIDLspecificallyifitalreadyexistsontheelementelem[propName]=true;}elem.setAttribute(name,name.toLowerCase());}returnname;}};//IE6/7donotsupportgetting/settingsomeattributeswithget/setAttributeif(!jQuery.support.getSetAttribute){//propFixismorecomprehensiveandcontainsallfixesjQuery.attrFix=jQuery.propFix;//UsethisforanyattributeonaforminIE6/7formHook=jQuery.attrHooks.name=jQuery.attrHooks.title=jQuery.valHooks.button={get:function(elem,name){varret;ret=elem.getAttributeNode(name);//ReturnundefinedifnodeValueisemptystringreturnret&&ret.nodeValue!==""?ret.nodeValue:undefined;},set:function(elem,value,name){//CheckformobjectsinIE(multiplebugsrelated)//OnlyusenodeValueiftheattributenodeexistsontheformvarret=elem.getAttributeNode(name);if(ret){ret.nodeValue=value;returnvalue;}}};//Setwidthandheighttoautoinsteadof0onemptystring(Bug#8150)//ThisisforremovalsjQuery.each(["width","height"],function(i,name){jQuery.attrHooks[name]=jQuery.extend(jQuery.attrHooks[name],{set:function(elem,value){if(value===""){elem.setAttribute(name,"auto");returnvalue;}}});});}//SomeattributesrequireaspecialcallonIEif(!jQuery.support.hrefNormalized){jQuery.each(["href","src","width","height"],function(i,name){jQuery.attrHooks[name]=jQuery.extend(jQuery.attrHooks[name],{get:function(elem){varret=elem.getAttribute(name,2);returnret===null?undefined:ret;}});});}if(!jQuery.support.style){jQuery.attrHooks.style={get:function(elem){//Returnundefinedinthecaseofemptystring//NormalizetolowercasesinceIEuppercasescsspropertynamesreturnelem.style.cssText.toLowerCase()||undefined;},set:function(elem,value){return(elem.style.cssText=""+value);}};}//Safarimis-reportsthedefaultselectedpropertyofanoption//Accessingtheparent'sselectedIndexpropertyfixesitif(!jQuery.support.optSelected){jQuery.propHooks.selected=jQuery.extend(jQuery.propHooks.selected,{get:function(elem){varparent=elem.parentNode;if(parent){parent.selectedIndex;//Makesurethatitalsoworkswithoptgroups,see#5701if(parent.parentNode){parent.parentNode.selectedIndex;}}}});}//Radiosandcheckboxesgetter/setterif(!jQuery.support.checkOn){jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={get:function(elem){//HandlethecasewhereinWebkit""isreturnedinsteadof"on"ifavalueisn'tspecifiedreturnelem.getAttribute("value")===null?"on":elem.value;}};});}jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]=jQuery.extend(jQuery.valHooks[this],{set:function(elem,value){if(jQuery.isArray(value)){return(elem.checked=jQuery.inArray(jQuery(elem).val(),value)>=0);}}});});varrnamespaces=/\.(.*)$/,rformElems=/^(?:textarea|input|select)$/i,rperiod=/\./g,rspaces=//g,rescape=/[^\w\s.|`]/g,fcleanup=function(nm){returnnm.replace(rescape,"\\$&");};/**Anumberofhelperfunctionsusedformanagingevents.*Manyoftheideasbehindthiscodeoriginatedfrom*DeanEdwards'addEventlibrary.*/jQuery.event={//Bindaneventtoanelement//OriginalbyDeanEdwardsadd:function(elem,types,handler,data){if(elem.nodeType===3||elem.nodeType===8){return;}if(handler===false){handler=returnFalse;}elseif(!handler){//Fixesbug#7229.Fixrecommendedbyjdaltonreturn;}varhandleObjIn,handleObj;if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;}//MakesurethatthefunctionbeingexecutedhasauniqueIDif(!handler.guid){handler.guid=jQuery.guid++;}//Inittheelement'seventstructurevarelemData=jQuery._data(elem);//IfnoelemDataisfoundthenwemustbetryingtobindtooneofthe//bannednoDataelementsif(!elemData){return;}varevents=elemData.events,eventHandle=elemData.handle;if(!events){elemData.events=events={};}if(!eventHandle){elemData.handle=eventHandle=function(e){//DiscardthesecondeventofajQuery.event.trigger()and//whenaneventiscalledafterapagehasunloadedreturntypeofjQuery!=="undefined"&&(!e||jQuery.event.triggered!==e.type)?jQuery.event.handle.apply(eventHandle.elem,arguments):undefined;};}//Addelemasapropertyofthehandlefunction//Thisistopreventamemoryleakwithnon-nativeeventsinIE.eventHandle.elem=elem;//Handlemultipleeventsseparatedbyaspace//jQuery(...).bind("mouseovermouseout",fn);types=types.split("");vartype,i=0,namespaces;while((type=types[i++])){handleObj=handleObjIn?jQuery.extend({},handleObjIn):{handler:handler,data:data};//Namespacedeventhandlersif(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();handleObj.namespace=namespaces.slice(0).sort().join(".");}else{namespaces=[];handleObj.namespace="";}handleObj.type=type;if(!handleObj.guid){handleObj.guid=handler.guid;}//Getthecurrentlistoffunctionsboundtothiseventvarhandlers=events[type],special=jQuery.event.special[type]||{};//Inittheeventhandlerqueueif(!handlers){handlers=events[type]=[];//Checkforaspecialeventhandler//OnlyuseaddEventListener/attachEventifthespecial//eventshandlerreturnsfalseif(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){//Bindtheglobaleventhandlertotheelementif(elem.addEventListener){elem.addEventListener(type,eventHandle,false);}elseif(elem.attachEvent){elem.attachEvent("on"+type,eventHandle);}}}if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid;}}//Addthefunctiontotheelement'shandlerlisthandlers.push(handleObj);//Keeptrackofwhicheventshavebeenused,foreventoptimizationjQuery.event.global[type]=true;}//NullifyelemtopreventmemoryleaksinIEelem=null;},global:{},//Detachaneventorsetofeventsfromanelementremove:function(elem,types,handler,pos){//don'tdoeventsontextandcommentnodesif(elem.nodeType===3||elem.nodeType===8){return;}if(handler===false){handler=returnFalse;}varret,type,fn,j,i=0,all,namespaces,namespace,special,eventType,handleObj,origType,elemData=jQuery.hasData(elem)&&jQuery._data(elem),events=elemData&&elemData.events;if(!elemData||!events){return;}//typesisactuallyaneventobjecthereif(types&&types.type){handler=types.handler;types=types.type;}//Unbindalleventsfortheelementif(!types||typeoftypes==="string"&&types.charAt(0)==="."){types=types||"";for(typeinevents){jQuery.event.remove(elem,type+types);}return;}//Handlemultipleeventsseparatedbyaspace//jQuery(...).unbind("mouseovermouseout",fn);types=types.split("");while((type=types[i++])){origType=type;handleObj=null;all=type.indexOf(".")< 0;
namespaces ? [];
if ( !all ) {
// Namespaced event handlers
namespaces = type.split(".");
type = namespaces.shift();
namespace = new RegExp("(^|\\.)" +
jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
}
eventType = events[ type ];
if ( !eventType ) {
continue;
}
if ( !handler ) {
for ( j = 0; j < eventType.length; j++ ) {
handleObj = eventType[ j ];
if ( all || namespace.test( handleObj.namespace ) ) {
jQuery.event.remove( elem, origType, handleObj.handler, j );
eventType.splice( j--, 1 );
}
}
continue;
}
special = jQuery.event.special[ type ] || {};
for ( j = pos || 0; j < eventType.length; j++ ) {
handleObj = eventType[ j ];
if ( handler.guid === handleObj.guid ) {
// remove the given handler for the given type
if ( all || namespace.test( handleObj.namespace ) ) {
if ( pos == null ) {
eventType.splice( j--, 1 );
}
if ( special.remove ) {
special.remove.call( elem, handleObj );
}
}
if ( pos != null ) {
break;
}
}
}
// remove generic event handler if no more handlers exist
if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
jQuery.removeEvent( elem, type, elemData.handle );
}
ret = null;
delete events[ type ];
}
}
// Remove the expando if it's no longer used
if ( jQuery.isEmptyObject( events ) ) {
var handle = elemData.handle;
if ( handle ) {
handle.elem = null;
}
delete elemData.events;
delete elemData.handle;
if ( jQuery.isEmptyObject( elemData ) ) {
jQuery.removeData( elem, undefined, true );
}
}
},
// Events that are safe to short-circuit if no handlers are attached.
// Native DOM events should not be added, they may have inline handlers.
customEvent: {
"getData": true,
"setData": true,
"changeData": true
},
trigger: function( event, data, elem, onlyHandlers ) {
// Event object or event type
var type = event.type || event,
namespaces = [],
exclusive;
if ( type.indexOf("!") >=0){//Exclusiveeventstriggeronlyfortheexactevent(nonamespaces)type=type.slice(0,-1);exclusive=true;}if(type.indexOf(".")>=0){//Namespacedtrigger;createaregexptomatcheventtypeinhandle()namespaces=type.split(".");type=namespaces.shift();namespaces.sort();}if((!elem||jQuery.event.customEvent[type])&&!jQuery.event.global[type]){//NojQueryhandlersforthiseventtype,anditcan'thaveinlinehandlersreturn;}//CallercanpassinanEvent,Object,orjustaneventtypestringevent=typeofevent==="object"?//jQuery.Eventobjectevent[jQuery.expando]?event://ObjectliteralnewjQuery.Event(type,event)://Justtheeventtype(string)newjQuery.Event(type);event.type=type;event.exclusive=exclusive;event.namespace=namespaces.join(".");event.namespace_re=newRegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.)?")+"(\\.|$)");//triggerHandler()andglobaleventsdon'tbubbleorrunthedefaultactionif(onlyHandlers||!elem){event.preventDefault();event.stopPropagation();}//Handleaglobaltriggerif(!elem){//TODO:Stoptauntingthedatacache;removeglobaleventsandalwaysattachtodocumentjQuery.each(jQuery.cache,function(){//internalKeyvariableisjustusedtomakeiteasiertofind//andpotentiallychangethisstufflater;currentlyitjust//pointstojQuery.expandovarinternalKey=jQuery.expando,internalCache=this[internalKey];if(internalCache&&internalCache.events&&internalCache.events[type]){jQuery.event.trigger(event,data,internalCache.handle.elem);}});return;}//Don'tdoeventsontextandcommentnodesif(elem.nodeType===3||elem.nodeType===8){return;}//Cleanuptheeventincaseitisbeingreusedevent.result=undefined;event.target=elem;//Cloneanyincomingdataandprependtheevent,creatingthehandlerarglistdata=data!=null?jQuery.makeArray(data):[];data.unshift(event);varcur=elem,//IEdoesn'tlikemethodnameswithacolon(#3533,#8272)ontype=type.indexOf(":")< 0 ? "on" + type : "";
// Fire event on the current element, then bubble up the DOM tree
do {
var handle ? jQuery._data( cur, "handle" );
event.currentTarget = cur;
if ( handle ) {
handle.apply( cur, data );
}
// Trigger an inline bound script
if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) {
event.result = false;
event.preventDefault();
}
// Bubble up to document, then to window
cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window;
} while ( cur && !event.isPropagationStopped() );
// If nobody prevented the default action, do it now
if ( !event.isDefaultPrevented() ) {
var old,
special = jQuery.event.special[ type ] || {};
if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) &&
!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
// Call a native DOM method on the target with the same name name as the event.
// Can't use an .isFunction)() check here because IE6/7 fails that test.
// IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch.
try {
if ( ontype && elem[ type ] ) {
// Don't re-trigger an onFOO event when we call its FOO() method
old = elem[ ontype ];
if ( old ) {
elem[ ontype ] = null;
}
jQuery.event.triggered = type;
elem[ type ]();
}
} catch ( ieError ) {}
if ( old ) {
elem[ ontype ] = old;
}
jQuery.event.triggered = undefined;
}
}
return event.result;
},
handle: function( event ) {
event = jQuery.event.fix( event || window.event );
// Snapshot the handlers list since a called handler may add/remove events.
var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),
run_all = !event.exclusive && !event.namespace,
args = Array.prototype.slice.call( arguments, 0 );
// Use the fix-ed Event rather than the (read-only) native event
args[0] = event;
event.currentTarget = this;
for ( var j = 0, l = handlers.length; j < l; j++ ) {
var handleObj = handlers[ j ];
// Triggered event must 1) be non-exclusive and have no namespace, or
// 2) have namespace(s) a subset or equal to those in the bound event.
if ( run_all || event.namespace_re.test( handleObj.namespace ) ) {
// Pass in a reference to the handler function itself
// So that we can later remove it
event.handler = handleObj.handler;
event.data = handleObj.data;
event.handleObj = handleObj;
var ret = handleObj.handler.apply( this, args );
if ( ret !== undefined ) {
event.result = ret;
if ( ret === false ) {
event.preventDefault();
event.stopPropagation();
}
}
if ( event.isImmediatePropagationStopped() ) {
break;
}
}
}
return event.result;
},
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(" "),
fix: function( event ) {
if ( event[ jQuery.expando ] ) {
return event;
}
// store a copy of the original event object
// and "clone" to set read-only properties
var originalEvent = event;
event = jQuery.Event( originalEvent );
for ( var i = this.props.length, prop; i; ) {
prop = this.props[ --i ];
event[ prop ] = originalEvent[ prop ];
}
// Fix target property, if necessary
if ( !event.target ) {
// Fixes #1925 where srcElement might not be defined either
event.target = event.srcElement || document;
}
// check if target is a textnode (safari)
if ( event.target.nodeType === 3 ) {
event.target = event.target.parentNode;
}
// Add relatedTarget, if necessary
if ( !event.relatedTarget && event.fromElement ) {
event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
}
// Calculate pageX/Y if missing and clientX/Y available
if ( event.pageX == null && event.clientX != null ) {
var eventDocument = event.target.ownerDocument || document,
doc = eventDocument.documentElement,
body = eventDocument.body;
event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
}
// Add which for key events
if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
event.which = event.charCode != null ? event.charCode : event.keyCode;
}
// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
if ( !event.metaKey && event.ctrlKey ) {
event.metaKey = event.ctrlKey;
}
// Add which for click: 1 === left; 2 === middle; 3 === right
// Note: button is not normalized, so don't use it
if ( !event.which && event.button !== undefined ) {
event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
}
return event;
},
// Deprecated, use jQuery.guid instead
guid: 1E8,
// Deprecated, use jQuery.proxy instead
proxy: jQuery.proxy,
special: {
ready: {
// Make sure the ready event is setup
setup: jQuery.bindReady,
teardown: jQuery.noop
},
live: {
add: function( handleObj ) {
jQuery.event.add( this,
liveConvert( handleObj.origType, handleObj.selector ),
jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
},
remove: function( handleObj ) {
jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
}
},
beforeunload: {
setup: function( data, namespaces, eventHandle ) {
// We only want to do this special case on windows
if ( jQuery.isWindow( this ) ) {
this.onbeforeunload = eventHandle;
}
},
teardown: function( namespaces, eventHandle ) {
if ( this.onbeforeunload === eventHandle ) {
this.onbeforeunload = null;
}
}
}
}
};
jQuery.removeEvent = document.removeEventListener ?
function( elem, type, handle ) {
if ( elem.removeEventListener ) {
elem.removeEventListener( type, handle, false );
}
} :
function( elem, type, handle ) {
if ( elem.detachEvent ) {
elem.detachEvent( "on" + type, handle );
}
};
jQuery.Event = function( src, props ) {
// Allow instantiation without the 'new' keyword
if ( !this.preventDefault ) {
return new jQuery.Event( src, props );
}
// Event object
if ( src && src.type ) {
this.originalEvent = src;
this.type = src.type;
// Events bubbling up the document may have been marked as prevented
// by a handler lower down the tree; reflect the correct value.
this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
// Event type
} else {
this.type = src;
}
// Put explicitly provided properties onto the event object
if ( props ) {
jQuery.extend( this, props );
}
// timeStamp is buggy for some events on Firefox(#3843)
// So we won't rely on the native value
this.timeStamp = jQuery.now();
// Mark it as fixed
this[ jQuery.expando ] = true;
};
function returnFalse() {
return false;
}
function returnTrue() {
return true;
}
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {
preventDefault: function() {
this.isDefaultPrevented = returnTrue;
var e = this.originalEvent;
if ( !e ) {
return;
}
// if preventDefault exists run it on the original event
if ( e.preventDefault ) {
e.preventDefault();
// otherwise set the returnValue property of the original event to false (IE)
} else {
e.returnValue = false;
}
},
stopPropagation: function() {
this.isPropagationStopped = returnTrue;
var e = this.originalEvent;
if ( !e ) {
return;
}
// if stopPropagation exists run it on the original event
if ( e.stopPropagation ) {
e.stopPropagation();
}
// otherwise set the cancelBubble property of the original event to true (IE)
e.cancelBubble = true;
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = returnTrue;
this.stopPropagation();
},
isDefaultPrevented: returnFalse,
isPropagationStopped: returnFalse,
isImmediatePropagationStopped: returnFalse
};
// Checks if an event happened on an element within another element
// Used in jQuery.event.special.mouseenter and mouseleave handlers
var withinElement = function( event ) {
// Check if mouse(over|out) are still within the same parent element
var related = event.relatedTarget,
inside = false,
eventType = event.type;
event.type = event.data;
if ( related !== this ) {
if ( related ) {
inside = jQuery.contains( this, related );
}
if ( !inside ) {
jQuery.event.handle.apply( this, arguments );
event.type = eventType;
}
}
},
// In case of event delegation, we only need to rename the event.type,
// liveHandler will take care of the rest.
delegate = function( event ) {
event.type = event.data;
jQuery.event.handle.apply( this, arguments );
};
// Create mouseenter and mouseleave events
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function( orig, fix ) {
jQuery.event.special[ orig ] = {
setup: function( data ) {
jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
},
teardown: function( data ) {
jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
}
};
});
// submit delegation
if ( !jQuery.support.submitBubbles ) {
jQuery.event.special.submit = {
setup: function( data, namespaces ) {
if ( !jQuery.nodeName( this, "form" ) ) {
jQuery.event.add(this, "click.specialSubmit", function( e ) {
var elem = e.target,
type = elem.type;
if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
trigger( "submit", this, arguments );
}
});
jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
var elem = e.target,
type = elem.type;
if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
trigger( "submit", this, arguments );
}
});
} else {
return false;
}
},
teardown: function( namespaces ) {
jQuery.event.remove( this, ".specialSubmit" );
}
};
}
// change delegation, happens here so we have bind.
if ( !jQuery.support.changeBubbles ) {
var changeFilters,
getVal = function( elem ) {
var type = elem.type, val = elem.value;
if ( type === "radio" || type === "checkbox" ) {
val = elem.checked;
} else if ( type === "select-multiple" ) {
val = elem.selectedIndex >-1?jQuery.map(elem.options,function(elem){returnelem.selected;}).join("-"):"";}elseif(jQuery.nodeName(elem,"select")){val=elem.selectedIndex;}returnval;},testChange=functiontestChange(e){varelem=e.target,data,val;if(!rformElems.test(elem.nodeName)||elem.readOnly){return;}data=jQuery._data(elem,"_change_data");val=getVal(elem);//thecurrentdatawillbealsoretrievedbybeforeactivateif(e.type!=="focusout"||elem.type!=="radio"){jQuery._data(elem,"_change_data",val);}if(data===undefined||val===data){return;}if(data!=null||val){e.type="change";e.liveFired=undefined;jQuery.event.trigger(e,arguments[1],elem);}};jQuery.event.special.change={filters:{focusout:testChange,beforedeactivate:testChange,click:function(e){varelem=e.target,type=jQuery.nodeName(elem,"input")?elem.type:"";if(type==="radio"||type==="checkbox"||jQuery.nodeName(elem,"select")){testChange.call(this,e);}},//Changehastobecalledbeforesubmit//Keydownwillbecalledbeforekeypress,whichisusedinsubmit-eventdelegationkeydown:function(e){varelem=e.target,type=jQuery.nodeName(elem,"input")?elem.type:"";if((e.keyCode===13&&!jQuery.nodeName(elem,"textarea"))||(e.keyCode===32&&(type==="checkbox"||type==="radio"))||type==="select-multiple"){testChange.call(this,e);}},//Beforeactivatehappensalsobeforethepreviouselementisblurred//withthiseventyoucan'ttriggerachangeevent,butyoucanstore//informationbeforeactivate:function(e){varelem=e.target;jQuery._data(elem,"_change_data",getVal(elem));}},setup:function(data,namespaces){if(this.type==="file"){returnfalse;}for(vartypeinchangeFilters){jQuery.event.add(this,type+".specialChange",changeFilters[type]);}returnrformElems.test(this.nodeName);},teardown:function(namespaces){jQuery.event.remove(this,".specialChange");returnrformElems.test(this.nodeName);}};changeFilters=jQuery.event.special.change.filters;//Handlewhentheinputis.focus()'dchangeFilters.focus=changeFilters.beforeactivate;}functiontrigger(type,elem,args){//Piggybackonadonoreventtosimulateadifferentone.//FakeoriginalEventtoavoiddonor'sstopPropagation,butifthe//simulatedeventpreventsdefaultthenwedothesameonthedonor.//Don'tpassargsorrememberliveFired;theyapplytothedonorevent.varevent=jQuery.extend({},args[0]);event.type=type;event.originalEvent={};event.liveFired=undefined;jQuery.event.handle.call(elem,event);if(event.isDefaultPrevented()){args[0].preventDefault();}}//Create"bubbling"focusandblureventsif(!jQuery.support.focusinBubbles){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){//Attachasinglecapturinghandlerwhilesomeonewantsfocusin/focusoutvarattaches=0;jQuery.event.special[fix]={setup:function(){if(attaches++===0){document.addEventListener(orig,handler,true);}},teardown:function(){if(--attaches===0){document.removeEventListener(orig,handler,true);}}};functionhandler(donor){//Donoreventisalwaysanativeone;fixitandswitchitstype.//Letfocusin/outhandlercancelthedonorfocus/blurevent.vare=jQuery.event.fix(donor);e.type=fix;e.originalEvent={};jQuery.event.trigger(e,null,e.target);if(e.isDefaultPrevented()){donor.preventDefault();}}});}jQuery.each(["bind","one"],function(i,name){jQuery.fn[name]=function(type,data,fn){varhandler;//Handleobjectliteralsif(typeoftype==="object"){for(varkeyintype){this[name](key,data,type[key],fn);}returnthis;}if(arguments.length===2||data===false){fn=data;data=undefined;}if(name==="one"){handler=function(event){jQuery(this).unbind(event,handler);returnfn.apply(this,arguments);};handler.guid=fn.guid||jQuery.guid++;}else{handler=fn;}if(type==="unload"&&name!=="one"){this.one(type,data,fn);}else{for(vari=0,l=this.length;i< l; i++ ) {
jQuery.event.add( this[i], type, handler, data );
}
}
return this;
};
});
jQuery.fn.extend({
unbind: function( type, fn ) {
// Handle object literals
if ( typeof type ?== "object" && !type.preventDefault ) {
for ( var key in type ) {
this.unbind(key, type[key]);
}
} else {
for ( var i = 0, l = this.length; i < l; i++ ) {
jQuery.event.remove( this[i], type, fn );
}
}
return this;
},
delegate: function( selector, types, data, fn ) {
return this.live( types, data, fn, selector );
},
undelegate: function( selector, types, fn ) {
if ( arguments.length === 0 ) {
return this.unbind( "live" );
} else {
return this.die( types, null, fn, selector );
}
},
trigger: function( type, data ) {
return this.each(function() {
jQuery.event.trigger( type, data, this );
});
},
triggerHandler: function( type, data ) {
if ( this[0] ) {
return jQuery.event.trigger( type, data, this[0], true );
}
},
toggle: function( fn ) {
// Save reference to arguments for access in closure
var args = arguments,
guid = fn.guid || jQuery.guid++,
i = 0,
toggler = function( event ) {
// Figure out which function to execute
var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
// Make sure that clicks stop
event.preventDefault();
// and execute the function
return args[ lastToggle ].apply( this, arguments ) || false;
};
// link all the functions, so any of them can unbind this click handler
toggler.guid = guid;
while ( i < args.length ) {
args[ i++ ].guid = guid;
}
return this.click( toggler );
},
hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
}
});
var liveMap = {
focus: "focusin",
blur: "focusout",
mouseenter: "mouseover",
mouseleave: "mouseout"
};
jQuery.each(["live", "die"], function( i, name ) {
jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
var type, i = 0, match, namespaces, preType,
selector = origSelector || this.selector,
context = origSelector ? this : jQuery( this.context );
if ( typeof types === "object" && !types.preventDefault ) {
for ( var key in types ) {
context[ name ]( key, data, types[key], selector );
}
return this;
}
if ( name === "die" && !types &&
origSelector && origSelector.charAt(0) === "." ) {
context.unbind( origSelector );
return this;
}
if ( data === false || jQuery.isFunction( data ) ) {
fn = data || returnFalse;
data = undefined;
}
types = (types || "").split(" ");
while ( (type = types[ i++ ]) != null ) {
match = rnamespaces.exec( type );
namespaces = "";
if ( match ) {
namespaces = match[0];
type = type.replace( rnamespaces, "" );
}
if ( type === "hover" ) {
types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
continue;
}
preType = type;
if ( liveMap[ type ] ) {
types.push( liveMap[ type ] + namespaces );
type = type + namespaces;
} else {
type = (liveMap[ type ] || type) + namespaces;
}
if ( name === "live" ) {
// bind live handler
for ( var j = 0, l = context.length; j < l; j++ ) {
jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
}
} else {
// unbind live handler
context.unbind( "live." + liveConvert( type, selector ), fn );
}
}
return this;
};
});
function liveHandler( event ) {
var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
elems = [],
selectors = [],
events = jQuery._data( this, "events" );
// Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
return;
}
if ( event.namespace ) {
namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
}
event.liveFired = this;
var live = events.live.slice(0);
for ( j = 0; j < live.length; j++ ) {
handleObj = live[j];
if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
selectors.push( handleObj.selector );
} else {
live.splice( j--, 1 );
}
}
match = jQuery( event.target ).closest( selectors, event.currentTarget );
for ( i = 0, l = match.length; i < l; i++ ) {
close = match[i];
for ( j = 0; j < live.length; j++ ) {
handleObj = live[j];
if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) {
elem = close.elem;
related = null;
// Those two events require additional checking
if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
event.type = handleObj.preType;
related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
// Make sure not to accidentally match a child element with the same selector
if ( related && jQuery.contains( elem, related ) ) {
related = elem;
}
}
if ( !related || related !== elem ) {
elems.push({ elem: elem, handleObj: handleObj, level: close.level });
}
}
}
}
for ( i = 0, l = elems.length; i < l; i++ ) {
match = elems[i];
if ( maxLevel && match.level >maxLevel){break;}event.currentTarget=match.elem;event.data=match.handleObj.data;event.handleObj=match.handleObj;ret=match.handleObj.origHandler.apply(match.elem,arguments);if(ret===false||event.isPropagationStopped()){maxLevel=match.level;if(ret===false){stop=false;}if(event.isImmediatePropagationStopped()){break;}}}returnstop;}functionliveConvert(type,selector){return(type&&type!=="*"?type+".":"")+selector.replace(rperiod,"`").replace(rspaces,"&");}jQuery.each(("blurfocusfocusinfocusoutloadresizescrollunloadclickdblclick"+"mousedownmouseupmousemovemouseovermouseoutmouseentermouseleave"+"changeselectsubmitkeydownkeypresskeyuperror").split(""),function(i,name){//HandleeventbindingjQuery.fn[name]=function(data,fn){if(fn==null){fn=data;data=null;}returnarguments.length>0?this.bind(name,data,fn):this.trigger(name);};if(jQuery.attrFn){jQuery.attrFn[name]=true;}});/*!*SizzleCSSSelectorEngine*Copyright2011,TheDojoFoundation*ReleasedundertheMIT,BSD,andGPLLicenses.*Moreinformation:http://sizzlejs.com/*/(function(){varchunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^>+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true,rBackslash=/\\/g,rNonWord=/\W/;//HerewecheckiftheJavaScriptengineisusingsomesortof//optimizationwhereitdoesnotalwayscallourcomparision//function.Ifthatisthecase,discardthehasDuplicatevalue.//ThusfarthatincludesGoogleChrome.[0,0].sort(function(){baseHasDuplicate=false;return0;});varSizzle=function(selector,context,results,seed){results=results||[];context=context||document;varorigContext=context;if(context.nodeType!==1&&context.nodeType!==9){return[];}if(!selector||typeofselector!=="string"){returnresults;}varm,set,checkSet,extra,ret,cur,pop,i,prune=true,contextXML=Sizzle.isXML(context),parts=[],soFar=selector;//Resetthepositionofthechunkerregexp(startfromhead)do{chunker.exec("");m=chunker.exec(soFar);if(m){soFar=m[3];parts.push(m[1]);if(m[2]){extra=m[3];break;}}}while(m);if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context);}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector]){selector+=parts.shift();}set=posProcess(selector,set);}}}else{//TakeashortcutandsetthecontextiftherootselectorisanID//(butnotifit'llbefasteriftheinnerselectorisanID)if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length-1])){ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0];}if(context){ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Sizzle.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set);}else{prune=false;}while(parts.length){cur=parts.pop();pop=cur;if(!Expr.relative[cur]){cur="";}else{pop=parts.pop();}if(pop==null){pop=context;}Expr.relative[cur](checkSet,pop,contextXML);}}else{checkSet=parts=[];}}if(!checkSet){checkSet=set;}if(!checkSet){Sizzle.error(cur||selector);}if(toString.call(checkSet)==="[objectArray]"){if(!prune){results.push.apply(results,checkSet);}elseif(context&&context.nodeType===1){for(i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&Sizzle.contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i]);}}}}else{makeArray(checkSet,results);}if(extra){Sizzle(extra,origContext,results,seed);Sizzle.uniqueSort(results);}returnresults;};Sizzle.uniqueSort=function(results){if(sortOrder){hasDuplicate=baseHasDuplicate;results.sort(sortOrder);if(hasDuplicate){for(vari=1;i< results.length; i++ ) {
if ( results[i] ?== results[ i - 1 ] ) {
results.splice( i--, 1 );
}
}
}
}
return results;
};
Sizzle.matches = function( expr, set ) {
return Sizzle( expr, null, null, set );
};
Sizzle.matchesSelector = function( node, expr ) {
return Sizzle( expr, null, null, [node] ).length >0;};Sizzle.find=function(expr,context,isXML){varset;if(!expr){return[];}for(vari=0,l=Expr.order.length;i< l; i++ ) {
var match,
type ? Expr.order[i];
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
var left = match[1];
match.splice( 1, 1 );
if ( left.substr( left.length - 1 ) !== "\\" ) {
match[1] = (match[1] || "").replace( rBackslash, "" );
set = Expr.find[ type ]( match, context, isXML );
if ( set != null ) {
expr = expr.replace( Expr.match[ type ], "" );
break;
}
}
}
}
if ( !set ) {
set = typeof context.getElementsByTagName !== "undefined" ?
context.getElementsByTagName( "*" ) :
[];
}
return { set: set, expr: expr };
};
Sizzle.filter = function( expr, set, inplace, not ) {
var match, anyFound,
old = expr,
result = [],
curLoop = set,
isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
while ( expr && set.length ) {
for ( var type in Expr.filter ) {
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
var found, item,
filter = Expr.filter[ type ],
left = match[1];
anyFound = false;
match.splice(1,1);
if ( left.substr( left.length - 1 ) === "\\" ) {
continue;
}
if ( curLoop === result ) {
result = [];
}
if ( Expr.preFilter[ type ] ) {
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
if ( !match ) {
anyFound = found = true;
} else if ( match === true ) {
continue;
}
}
if ( match ) {
for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
if ( item ) {
found = filter( item, match, i, curLoop );
var pass = not ^ !!found;
if ( inplace && found != null ) {
if ( pass ) {
anyFound = true;
} else {
curLoop[i] = false;
}
} else if ( pass ) {
result.push( item );
anyFound = true;
}
}
}
}
if ( found !== undefined ) {
if ( !inplace ) {
curLoop = result;
}
expr = expr.replace( Expr.match[ type ], "" );
if ( !anyFound ) {
return [];
}
break;
}
}
}
// Improper expression
if ( expr === old ) {
if ( anyFound == null ) {
Sizzle.error( expr );
} else {
break;
}
}
old = expr;
}
return curLoop;
};
Sizzle.error = function( msg ) {
throw "Syntax error, unrecognized expression: " + msg;
};
var Expr = Sizzle.selectors = {
order: [ "ID", "NAME", "TAG" ],
match: {
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
},
leftMatch: {},
attrMap: {
"class": "className",
"for": "htmlFor"
},
attrHandle: {
href: function( elem ) {
return elem.getAttribute( "href" );
},
type: function( elem ) {
return elem.getAttribute( "type" );
}
},
relative: {
"+": function(checkSet, part){
var isPartStr = typeof part === "string",
isTag = isPartStr && !rNonWord.test( part ),
isPartStrNotTag = isPartStr && !isTag;
if ( isTag ) {
part = part.toLowerCase();
}
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
if ( (elem = checkSet[i]) ) {
while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
elem || false :
elem === part;
}
}
if ( isPartStrNotTag ) {
Sizzle.filter( part, checkSet, true );
}
},
">":function(checkSet,part){varelem,isPartStr=typeofpart==="string",i=0,l=checkSet.length;if(isPartStr&&!rNonWord.test(part)){part=part.toLowerCase();for(;i< l; i++ ) {
elem ? checkSet[i];
if ( elem ) {
var parent = elem.parentNode;
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
}
}
} else {
for ( ; i < l; i++ ) {
elem = checkSet[i];
if ( elem ) {
checkSet[i] = isPartStr ?
elem.parentNode :
elem.parentNode === part;
}
}
if ( isPartStr ) {
Sizzle.filter( part, checkSet, true );
}
}
},
"": function(checkSet, part, isXML){
var nodeCheck,
doneName = done++,
checkFn = dirCheck;
if ( typeof part === "string" && !rNonWord.test( part ) ) {
part = part.toLowerCase();
nodeCheck = part;
checkFn = dirNodeCheck;
}
checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
},
"~": function( checkSet, part, isXML ) {
var nodeCheck,
doneName = done++,
checkFn = dirCheck;
if ( typeof part === "string" && !rNonWord.test( part ) ) {
part = part.toLowerCase();
nodeCheck = part;
checkFn = dirNodeCheck;
}
checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
}
},
find: {
ID: function( match, context, isXML ) {
if ( typeof context.getElementById !== "undefined" && !isXML ) {
var m = context.getElementById(match[1]);
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
return m && m.parentNode ? [m] : [];
}
},
NAME: function( match, context ) {
if ( typeof context.getElementsByName !== "undefined" ) {
var ret = [],
results = context.getElementsByName( match[1] );
for ( var i = 0, l = results.length; i < l; i++ ) {
if ( results[i].getAttribute("name") === match[1] ) {
ret.push( results[i] );
}
}
return ret.length === 0 ? null : ret;
}
},
TAG: function( match, context ) {
if ( typeof context.getElementsByTagName !== "undefined" ) {
return context.getElementsByTagName( match[1] );
}
}
},
preFilter: {
CLASS: function( match, curLoop, inplace, result, not, isXML ) {
match = " " + match[1].replace( rBackslash, "" ) + " ";
if ( isXML ) {
return match;
}
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
if ( elem ) {
if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >=0)){if(!inplace){result.push(elem);}}elseif(inplace){curLoop[i]=false;}}}returnfalse;},ID:function(match){returnmatch[1].replace(rBackslash,"");},TAG:function(match,curLoop){returnmatch[1].replace(rBackslash,"").toLowerCase();},CHILD:function(match){if(match[1]==="nth"){if(!match[2]){Sizzle.error(match[0]);}match[2]=match[2].replace(/^\+|\s*/g,'');//parseequationslike'even','odd','5','2n','3n+2','4n-1','-n+6'vartest=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(match[2]==="even"&&"2n"||match[2]==="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);//calculatethenumbers(first)n+(last)includingiftheyarenegativematch[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0;}elseif(match[2]){Sizzle.error(match[0]);}//TODO:Movetonormalcachingsystemmatch[0]=done++;returnmatch;},ATTR:function(match,curLoop,inplace,result,not,isXML){varname=match[1]=match[1].replace(rBackslash,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name];}//Handleifanun-quotedvaluewasusedmatch[4]=(match[4]||match[5]||"").replace(rBackslash,"");if(match[2]==="~="){match[4]=""+match[4]+"";}returnmatch;},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){//Ifwe'redealingwithacomplexexpression,orasimpleoneif((chunker.exec(match[3])||"").length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop);}else{varret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret);}returnfalse;}}elseif(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){returntrue;}returnmatch;},POS:function(match){match.unshift(true);returnmatch;}},filters:{enabled:function(elem){returnelem.disabled===false&&elem.type!=="hidden";},disabled:function(elem){returnelem.disabled===true;},checked:function(elem){returnelem.checked===true;},selected:function(elem){//Accessingthispropertymakesselected-by-default//optionsinSafariworkproperlyif(elem.parentNode){elem.parentNode.selectedIndex;}returnelem.selected===true;},parent:function(elem){return!!elem.firstChild;},empty:function(elem){return!elem.firstChild;},has:function(elem,i,match){return!!Sizzle(match[3],elem).length;},header:function(elem){return(/h\d/i).test(elem.nodeName);},text:function(elem){varattr=elem.getAttribute("type"),type=elem.type;//IE6and7willmapelem.typeto'text'fornewHTML5types(search,etc)//usegetAttributeinsteadtotestthiscasereturnelem.nodeName.toLowerCase()==="input"&&"text"===type&&(attr===type||attr===null);},radio:function(elem){returnelem.nodeName.toLowerCase()==="input"&&"radio"===elem.type;},checkbox:function(elem){returnelem.nodeName.toLowerCase()==="input"&&"checkbox"===elem.type;},file:function(elem){returnelem.nodeName.toLowerCase()==="input"&&"file"===elem.type;},password:function(elem){returnelem.nodeName.toLowerCase()==="input"&&"password"===elem.type;},submit:function(elem){varname=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&"submit"===elem.type;},image:function(elem){returnelem.nodeName.toLowerCase()==="input"&&"image"===elem.type;},reset:function(elem){varname=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&"reset"===elem.type;},button:function(elem){varname=elem.nodeName.toLowerCase();returnname==="input"&&"button"===elem.type||name==="button";},input:function(elem){return(/input|select|textarea|button/i).test(elem.nodeName);},focus:function(elem){returnelem===elem.ownerDocument.activeElement;}},setFilters:{first:function(elem,i){returni===0;},last:function(elem,i,match,array){returni===array.length-1;},even:function(elem,i){returni%2===0;},odd:function(elem,i){returni%2===1;},lt:function(elem,i,match){returni< match[3] - 0?
},
gt: function( elem, i, match ) {
return i >match[3]-0;},nth:function(elem,i,match){returnmatch[3]-0===i;},eq:function(elem,i,match){returnmatch[3]-0===i;}},filter:{PSEUDO:function(elem,match,i,array){varname=match[1],filter=Expr.filters[name];if(filter){returnfilter(elem,i,match,array);}elseif(name==="contains"){return(elem.textContent||elem.innerText||Sizzle.getText([elem])||"").indexOf(match[3])>=0;}elseif(name==="not"){varnot=match[3];for(varj=0,l=not.length;j< l; j++ ) {
if ( not[j] ?== elem ) {
return false;
}
}
return true;
} else {
Sizzle.error( name );
}
},
CHILD: function( elem, match ) {
var type = match[1],
node = elem;
switch ( type ) {
case "only":
case "first":
while ( (node = node.previousSibling) ) {
if ( node.nodeType === 1 ) {
return false;
}
}
if ( type === "first" ) {
return true;
}
node = elem;
case "last":
while ( (node = node.nextSibling) ) {
if ( node.nodeType === 1 ) {
return false;
}
}
return true;
case "nth":
var first = match[2],
last = match[3];
if ( first === 1 && last === 0 ) {
return true;
}
var doneName = match[0],
parent = elem.parentNode;
if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
var count = 0;
for ( node = parent.firstChild; node; node = node.nextSibling ) {
if ( node.nodeType === 1 ) {
node.nodeIndex = ++count;
}
}
parent.sizcache = doneName;
}
var diff = elem.nodeIndex - last;
if ( first === 0 ) {
return diff === 0;
} else {
return ( diff % first === 0 && diff / first >=0);}}},ID:function(elem,match){returnelem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName.toLowerCase()===match;},CLASS:function(elem,match){return(""+(elem.className||elem.getAttribute("class"))+"").indexOf(match)>-1;},ATTR:function(elem,match){varname=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];returnresult==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(""+value+"").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!==check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false;},POS:function(elem,match,i,array){varname=match[2],filter=Expr.setFilters[name];if(filter){returnfilter(elem,i,match,array);}}}};varorigPOS=Expr.match.POS,fescape=function(all,num){return"\\"+(num-0+1);};for(vartypeinExpr.match){Expr.match[type]=newRegExp(Expr.match[type].source+(/(?![^\[]*\])(?![^\(]*\))/.source));Expr.leftMatch[type]=newRegExp(/(^(?:.|\r|\n)*?)/.source+Expr.match[type].source.replace(/\\(\d+)/g,fescape));}varmakeArray=function(array,results){array=Array.prototype.slice.call(array,0);if(results){results.push.apply(results,array);returnresults;}returnarray;};//Performasimplechecktodetermineifthebrowseriscapableof//convertingaNodeListtoanarrayusingbuiltinmethods.//AlsoverifiesthatthereturnedarrayholdsDOMnodes//(whichisnotthecaseintheBlackberrybrowser)try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType;//Provideafallbackmethodifitdoesnotwork}catch(e){makeArray=function(array,results){vari=0,ret=results||[];if(toString.call(array)==="[objectArray]"){Array.prototype.push.apply(ret,array);}else{if(typeofarray.length==="number"){for(varl=array.length;i< l; i++ ) {
ret.push( array[i] );
}
} else {
for ( ; array[i]; i++ ) {
ret.push( array[i] );
}
}
}
return ret;
};
}
var sortOrder, siblingCheck;
if ( document.documentElement.compareDocumentPosition ) {
sortOrder ? function( a, b ) {
if ( a === b ) {
hasDuplicate = true;
return 0;
}
if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
return a.compareDocumentPosition ? -1 : 1;
}
return a.compareDocumentPosition(b) & 4 ? -1 : 1;
};
} else {
sortOrder = function( a, b ) {
// The nodes are identical, we can exit early
if ( a === b ) {
hasDuplicate = true;
return 0;
// Fallback to using sourceIndex (in IE) if it's available on both nodes
} else if ( a.sourceIndex && b.sourceIndex ) {
return a.sourceIndex - b.sourceIndex;
}
var al, bl,
ap = [],
bp = [],
aup = a.parentNode,
bup = b.parentNode,
cur = aup;
// If the nodes are siblings (or identical) we can do a quick check
if ( aup === bup ) {
return siblingCheck( a, b );
// If no parents were found then the nodes are disconnected
} else if ( !aup ) {
return -1;
} else if ( !bup ) {
return 1;
}
// Otherwise they're somewhere else in the tree so we need
// to build up a full list of the parentNodes for comparison
while ( cur ) {
ap.unshift( cur );
cur = cur.parentNode;
}
cur = bup;
while ( cur ) {
bp.unshift( cur );
cur = cur.parentNode;
}
al = ap.length;
bl = bp.length;
// Start walking down the tree looking for a discrepancy
for ( var i = 0; i < al && i < bl; i++ ) {
if ( ap[i] !== bp[i] ) {
return siblingCheck( ap[i], bp[i] );
}
}
// We ended someplace up the tree so do a sibling check
return i === al ?
siblingCheck( a, bp[i], -1 ) :
siblingCheck( ap[i], b, 1 );
};
siblingCheck = function( a, b, ret ) {
if ( a === b ) {
return ret;
}
var cur = a.nextSibling;
while ( cur ) {
if ( cur === b ) {
return -1;
}
cur = cur.nextSibling;
}
return 1;
};
}
// Utility function for retreiving the text value of an array of DOM nodes
Sizzle.getText = function( elems ) {
var ret = "", elem;
for ( var i = 0; elems[i]; i++ ) {
elem = elems[i];
// Get the text from text nodes and CDATA nodes
if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
ret += elem.nodeValue;
// Traverse everything else, except comment nodes
} else if ( elem.nodeType !== 8 ) {
ret += Sizzle.getText( elem.childNodes );
}
}
return ret;
};
// Check to see if the browser returns elements by name when
// querying by getElementById (and provide a workaround)
(function(){
// We're going to inject a fake input element with a specified name
var form = document.createElement("div"),
id = "script" + (new Date()).getTime(),
root = document.documentElement;
form.innerHTML = "";//Injectitintotherootelement,checkitsstatus,andremoveitquicklyroot.insertBefore(form,root.firstChild);//TheworkaroundhastodoadditionalchecksafteragetElementById//Whichslowsthingsdownforotherbrowsers(hencethebranching)if(document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeofcontext.getElementById!=="undefined"&&!isXML){varm=context.getElementById(match[1]);returnm?m.id===match[1]||typeofm.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[];}};Expr.filter.ID=function(elem,match){varnode=typeofelem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");returnelem.nodeType===1&&node&&node.nodeValue===match;};}root.removeChild(form);//releasememoryinIEroot=form=null;})();(function(){//Checktoseeifthebrowserreturnsonlyelements//whendoinggetElementsByTagName("*")//Createafakeelementvardiv=document.createElement("div");div.appendChild(document.createComment(""));//Makesurenocommentsarefoundif(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){varresults=context.getElementsByTagName(match[1]);//Filteroutpossiblecommentsif(match[1]==="*"){vartmp=[];for(vari=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i]);}}results=tmp;}returnresults;};}//Checktoseeifanattributereturnsnormalizedhrefattributesdiv.innerHTML="";if(div.firstChild&&typeofdiv.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){returnelem.getAttribute("href",2);};}//releasememoryinIEdiv=null;})();if(document.querySelectorAll){(function(){varoldSizzle=Sizzle,div=document.createElement("div"),id="__sizzle__";div.innerHTML=" ";//Safarican'thandleuppercaseorunicodecharacterswhen//inquirksmode.if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;}Sizzle=function(query,context,extra,seed){context=context||document;//OnlyusequerySelectorAllonnon-XMLdocuments//(IDselectorsdon'tworkinnon-HTMLdocuments)if(!seed&&!Sizzle.isXML(context)){//Seeifwefindaselectortospeedupvarmatch=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(query);if(match&&(context.nodeType===1||context.nodeType===9)){//Speed-up:Sizzle("TAG")if(match[1]){returnmakeArray(context.getElementsByTagName(query),extra);//Speed-up:Sizzle(".CLASS")}elseif(match[2]&&Expr.find.CLASS&&context.getElementsByClassName){returnmakeArray(context.getElementsByClassName(match[2]),extra);}}if(context.nodeType===9){//Speed-up:Sizzle("body")//Thebodyelementonlyexistsonce,optimizefindingitif(query==="body"&&context.body){returnmakeArray([context.body],extra);//Speed-up:Sizzle("#ID")}elseif(match&&match[3]){varelem=context.getElementById(match[3]);//CheckparentNodetocatchwhenBlackberry4.6returns//nodesthatarenolongerinthedocument#6963if(elem&&elem.parentNode){//HandlethecasewhereIEandOperareturnitems//bynameinsteadofIDif(elem.id===match[3]){returnmakeArray([elem],extra);}}else{returnmakeArray([],extra);}}try{returnmakeArray(context.querySelectorAll(query),extra);}catch(qsaError){}//qSAworksstrangelyonElement-rootedqueries//WecanworkaroundthisbyspecifyinganextraIDontheroot//andworkingupfromthere(ThankstoAndrewDupontforthetechnique)//IE8doesn'tworkonobjectelements}elseif(context.nodeType===1&&context.nodeName.toLowerCase()!=="object"){varoldContext=context,old=context.getAttribute("id"),nid=old||id,hasParent=context.parentNode,relativeHierarchySelector=/^\s*[+~]/.test(query);if(!old){context.setAttribute("id",nid);}else{nid=nid.replace(/'/g,"\\$&");}if(relativeHierarchySelector&&hasParent){context=context.parentNode;}try{if(!relativeHierarchySelector||hasParent){returnmakeArray(context.querySelectorAll("[id='"+nid+"']"+query),extra);}}catch(pseudoError){}finally{if(!old){oldContext.removeAttribute("id");}}}}returnoldSizzle(query,context,extra,seed);};for(varpropinoldSizzle){Sizzle[prop]=oldSizzle[prop];}//releasememoryinIEdiv=null;})();}(function(){varhtml=document.documentElement,matches=html.matchesSelector||html.mozMatchesSelector||html.webkitMatchesSelector||html.msMatchesSelector;if(matches){//Checktoseeifit'spossibletodomatchesSelector//onadisconnectednode(IE9failsthis)vardisconnectedMatch=!matches.call(document.createElement("div"),"div"),pseudoWorks=false;try{//Thisshouldfailwithanexception//Geckodoesnoterror,returnsfalseinsteadmatches.call(document.documentElement,"[test!='']:sizzle");}catch(pseudoError){pseudoWorks=true;}Sizzle.matchesSelector=function(node,expr){//Makesurethatattributeselectorsarequotedexpr=expr.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!Sizzle.isXML(node)){try{if(pseudoWorks||!Expr.match.PSEUDO.test(expr)&&!/!=/.test(expr)){varret=matches.call(node,expr);//IE9'smatchesSelectorreturnsfalseondisconnectednodesif(ret||!disconnectedMatch||//Aswell,disconnectednodesaresaidtobeinadocument//fragmentinIE9,socheckforthatnode.document&&node.document.nodeType!==11){returnret;}}}catch(e){}}returnSizzle(expr,null,null,[node]).length>0;};}})();(function(){vardiv=document.createElement("div");div.innerHTML="
";//Operacan'tfindasecondclassname(in9.6)//Also,makesurethatgetElementsByClassNameactuallyexistsif(!div.getElementsByClassName||div.getElementsByClassName("e").length===0){return;}//Safaricachesclassattributes,doesn'tcatchchanges(in3.2)div.lastChild.className="e";if(div.getElementsByClassName("e").length===1){return;}Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeofcontext.getElementsByClassName!=="undefined"&&!isXML){returncontext.getElementsByClassName(match[1]);}};//releasememoryinIEdiv=null;})();functiondirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(vari=0,l=checkSet.length;i< l; i++ ) {
var elem ? checkSet[i];
if ( elem ) {
var match = false;
elem = elem[dir];
while ( elem ) {
if ( elem.sizcache === doneName ) {
match = checkSet[elem.sizset];
break;
}
if ( elem.nodeType === 1 && !isXML ){
elem.sizcache = doneName;
elem.sizset = i;
}
if ( elem.nodeName.toLowerCase() === cur ) {
match = elem;
break;
}
elem = elem[dir];
}
checkSet[i] = match;
}
}
}
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
var match = false;
elem = elem[dir];
while ( elem ) {
if ( elem.sizcache === doneName ) {
match = checkSet[elem.sizset];
break;
}
if ( elem.nodeType === 1 ) {
if ( !isXML ) {
elem.sizcache = doneName;
elem.sizset = i;
}
if ( typeof cur !== "string" ) {
if ( elem === cur ) {
match = true;
break;
}
} else if ( Sizzle.filter( cur, [elem] ).length >0){match=elem;break;}}elem=elem[dir];}checkSet[i]=match;}}}if(document.documentElement.contains){Sizzle.contains=function(a,b){returna!==b&&(a.contains?a.contains(b):true);};}elseif(document.documentElement.compareDocumentPosition){Sizzle.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16);};}else{Sizzle.contains=function(){returnfalse;};}Sizzle.isXML=function(elem){//documentElementisverifiedforcaseswhereitdoesn'tyetexist//(suchasloadingiframesinIE-#4833)vardocumentElement=(elem?elem.ownerDocument||elem:0).documentElement;returndocumentElement?documentElement.nodeName!=="HTML":false;};varposProcess=function(selector,context){varmatch,tmpSet=[],later="",root=context.nodeType?[context]:context;//Positionselectorsmustbedoneafterthefilter//Andsomust:not(positional)sowemoveallPSEUDOstotheendwhile((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"");}selector=Expr.relative[selector]?selector+"*":selector;for(vari=0,l=root.length;i< l; i++ ) {
Sizzle( selector, root[i], tmpSet );
}
return Sizzle.filter( later, tmpSet );
};
// EXPOSE
jQuery.find ? Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters;
jQuery.unique = Sizzle.uniqueSort;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;
})();
var runtil = /Until$/,
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
// Note: This RegExp should be improved, or likely pulled from Sizzle
rmultiselector = /,/,
isSimple = /^.[^:#\[\.,]*$/,
slice = Array.prototype.slice,
POS = jQuery.expr.match.POS,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
contents: true,
next: true,
prev: true
};
jQuery.fn.extend({
find: function( selector ) {
var self = this,
i, l;
if ( typeof selector !== "string" ) {
return jQuery( selector ).filter(function() {
for ( i = 0, l = self.length; i < l; i++ ) {
if ( jQuery.contains( self[ i ], this ) ) {
return true;
}
}
});
}
var ret = this.pushStack( "", "find", selector ),
length, n, r;
for ( i = 0, l = this.length; i < l; i++ ) {
length = ret.length;
jQuery.find( selector, this[i], ret );
if ( i >0){//Makesurethattheresultsareuniquefor(n=length;n< ret.length; n++ ) {
for ( r ? 0; r < length; r++ ) {
if ( ret[r] === ret[n] ) {
ret.splice(n--, 1);
break;
}
}
}
}
}
return ret;
},
has: function( target ) {
var targets = jQuery( target );
return this.filter(function() {
for ( var i = 0, l = targets.length; i < l; i++ ) {
if ( jQuery.contains( this, targets[i] ) ) {
return true;
}
}
});
},
not: function( selector ) {
return this.pushStack( winnow(this, selector, false), "not", selector);
},
filter: function( selector ) {
return this.pushStack( winnow(this, selector, true), "filter", selector );
},
is: function( selector ) {
return !!selector && ( typeof selector === "string" ?
jQuery.filter( selector, this ).length >0:this.filter(selector).length>0);},closest:function(selectors,context){varret=[],i,l,cur=this[0];//Arrayif(jQuery.isArray(selectors)){varmatch,selector,matches={},level=1;if(cur&&selectors.length){for(i=0,l=selectors.length;i< l; i++ ) {
selector ? selectors[i];
if ( !matches[ selector ] ) {
matches[ selector ] = POS.test( selector ) ?
jQuery( selector, context || this.context ) :
selector;
}
}
while ( cur && cur.ownerDocument && cur !== context ) {
for ( selector in matches ) {
match = matches[ selector ];
if ( match.jquery ? match.index( cur ) >-1:jQuery(cur).is(match)){ret.push({selector:selector,elem:cur,level:level});}}cur=cur.parentNode;level++;}}returnret;}//Stringvarpos=POS.test(selectors)||typeofselectors!=="string"?jQuery(selectors,context||this.context):0;for(i=0,l=this.length;i< l; i++ ) {
cur ? this[i];
while ( cur ) {
if ( pos ? pos.index(cur) >-1:jQuery.find.matchesSelector(cur,selectors)){ret.push(cur);break;}else{cur=cur.parentNode;if(!cur||!cur.ownerDocument||cur===context||cur.nodeType===11){break;}}}}ret=ret.length>1?jQuery.unique(ret):ret;returnthis.pushStack(ret,"closest",selectors);},//Determinethepositionofanelementwithin//thematchedsetofelementsindex:function(elem){if(!elem||typeofelem==="string"){returnjQuery.inArray(this[0],//Ifitreceivesastring,theselectorisused//Ifitreceivesnothing,thesiblingsareusedelem?jQuery(elem):this.parent().children());}//LocatethepositionofthedesiredelementreturnjQuery.inArray(//IfitreceivesajQueryobject,thefirstelementisusedelem.jquery?elem[0]:elem,this);},add:function(selector,context){varset=typeofselector==="string"?jQuery(selector,context):jQuery.makeArray(selector&&selector.nodeType?[selector]:selector),all=jQuery.merge(this.get(),set);returnthis.pushStack(isDisconnected(set[0])||isDisconnected(all[0])?all:jQuery.unique(all));},andSelf:function(){returnthis.add(this.prevObject);}});//Apainfullysimplechecktoseeifanelementisdisconnected//fromadocument(shouldbeimproved,wherefeasible).functionisDisconnected(node){return!node||!node.parentNode||node.parentNode.nodeType===11;}jQuery.each({parent:function(elem){varparent=elem.parentNode;returnparent&&parent.nodeType!==11?parent:null;},parents:function(elem){returnjQuery.dir(elem,"parentNode");},parentsUntil:function(elem,i,until){returnjQuery.dir(elem,"parentNode",until);},next:function(elem){returnjQuery.nth(elem,2,"nextSibling");},prev:function(elem){returnjQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){returnjQuery.dir(elem,"nextSibling");},prevAll:function(elem){returnjQuery.dir(elem,"previousSibling");},nextUntil:function(elem,i,until){returnjQuery.dir(elem,"nextSibling",until);},prevUntil:function(elem,i,until){returnjQuery.dir(elem,"previousSibling",until);},siblings:function(elem){returnjQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){returnjQuery.sibling(elem.firstChild);},contents:function(elem){returnjQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(until,selector){varret=jQuery.map(this,fn,until),//Thevariable'args'wasintroducedin//https://github.com/jquery/jquery/commit/52a0238//toworkaroundabuginChrome10(Dev)andshouldberemovedwhenthebugisfixed.//http://code.google.com/p/v8/issues/detail?id=1050args=slice.call(arguments);if(!runtil.test(name)){selector=until;}if(selector&&typeofselector==="string"){ret=jQuery.filter(selector,ret);}ret=this.length>1&&!guaranteedUnique[name]?jQuery.unique(ret):ret;if((this.length>1||rmultiselector.test(selector))&&rparentsprev.test(name)){ret=ret.reverse();}returnthis.pushStack(ret,name,args.join(","));};});jQuery.extend({filter:function(expr,elems,not){if(not){expr=":not("+expr+")";}returnelems.length===1?jQuery.find.matchesSelector(elems[0],expr)?[elems[0]]:[]:jQuery.find.matches(expr,elems);},dir:function(elem,dir,until){varmatched=[],cur=elem[dir];while(cur&&cur.nodeType!==9&&(until===undefined||cur.nodeType!==1||!jQuery(cur).is(until))){if(cur.nodeType===1){matched.push(cur);}cur=cur[dir];}returnmatched;},nth:function(cur,result,dir,elem){result=result||1;varnum=0;for(;cur;cur=cur[dir]){if(cur.nodeType===1&&++num===result){break;}}returncur;},sibling:function(n,elem){varr=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){r.push(n);}}returnr;}});//Implementtheidenticalfunctionalityforfilterandnotfunctionwinnow(elements,qualifier,keep){//Can'tpassnullorundefinedtoindexOfinFirefox4//Setto0toskipstringcheckqualifier=qualifier||0;if(jQuery.isFunction(qualifier)){returnjQuery.grep(elements,function(elem,i){varretVal=!!qualifier.call(elem,i,elem);returnretVal===keep;});}elseif(qualifier.nodeType){returnjQuery.grep(elements,function(elem,i){return(elem===qualifier)===keep;});}elseif(typeofqualifier==="string"){varfiltered=jQuery.grep(elements,function(elem){returnelem.nodeType===1;});if(isSimple.test(qualifier)){returnjQuery.filter(qualifier,filtered,!keep);}else{qualifier=jQuery.filter(qualifier,filtered);}}returnjQuery.grep(elements,function(elem,i){return(jQuery.inArray(elem,qualifier)>=0)===keep;});}varrinlinejQuery=/jQuery\d+="(?:\d+|null)"/g,rleadingWhitespace=/^\s+/,rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w?]+)[^>]*)\/>/ig,rtagName=/<([\w:]+)/,
rtbody ? /","" ],
legend: [ 1, "" ],
thead: [ 1, "