1 | | /*! jQuery v1.8.3 jquery.com | jquery.org/license */ |
2 | | (function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}function Fn(){try{return new e.XMLHttpRequest}catch(t){}}function In(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $n(){return setTimeout(function(){qn=t},0),qn=v.now()}function Jn(e,t){v.each(t,function(t,n){var r=(Vn[t]||[]).concat(Vn["*"]),i=0,s=r.length;for(;i<s;i++)if(r[i].call(e,t,n))return})}function Kn(e,t,n){var r,i=0,s=0,o=Xn.length,u=v.Deferred().always(function(){delete a.elem}),a=function(){var t=qn||$n(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,i=1-r,s=0,o=f.tweens.length;for(;s<o;s++)f.tweens[s].run(i);return u.notifyWith(e,[f,i,n]),i<1&&o?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:qn||$n(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=v.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(i),i},stop:function(t){var n=0,r=t?f.tweens.length:0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;Qn(l,f.opts.specialEasing);for(;i<o;i++){r=Xn[i].call(f,e,l,f.opts);if(r)return r}return Jn(f,l),v.isFunction(f.opts.start)&&f.opts.start.call(e,f),v.fx.timer(v.extend(a,{anim:f,queue:f.opts.queue,elem:e})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Qn(e,t){var n,r,i,s,o;for(n in e){r=v.camelCase(n),i=t[r],s=e[n],v.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=v.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function Gn(e,t,n){var r,i,s,o,u,a,f,l,c,h=this,p=e.style,d={},m=[],g=e.nodeType&&Gt(e);n.queue||(l=v._queueHooks(e,"fx"),l.unqueued==null&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,h.always(function(){h.always(function(){l.unqueued--,v.queue(e,"fx").length||l.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)==="inline"?p.display="inline-block":p.zoom=1)),n.overflow&&(p.overflow="hidden",v.support.shrinkWrapBlocks||h.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r],a=a||s==="toggle";if(s===(g?"hide":"show"))continue;m.push(r)}}o=m.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),"hidden"in u&&(g=u.hidden),a&&(u.hidden=!g),g?v(e).show():h.done(function(){v(e).hide()}),h.done(function(){var t;v.removeData(e,"fxshow",!0);for(t in d)v.style(e,t,d[t])});for(r=0;r<o;r++)i=m[r],f=h.createTween(i,g?u[i]:0),d[i]=u[i]||v.style(e,i),i in u||(u[i]=f.start,g&&(f.end=f.start,f.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s<o;)if(n.apply(e[s++],r)===!1)break}else if(u){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call("\ufeff\u00a0")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":(e+"").replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||v.guid++,s):t},access:function(e,n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&&function o(){if(!v.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}v.ready()}}()}}return r.promise(t)},v.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),n=v(i);var M={};v.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):v.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){n=e.memory&&t,r=!0,u=s||0,s=0,o=a.length,i=!0;for(;a&&u<o;u++)if(a[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!=="string"&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this},remove:function(){return a&&v.each(arguments,function(e,t){var n;while((n=v.inArray(t,a,n))>-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&v.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),v.support=function(){var t,n,r,s,o,u,a,f,l,c,h,p=i.createElement("div");p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i<s;i++)delete r[t[i]];if(!(n?B:v.isEmptyObject)(r))return}}if(!n){delete u[a].data;if(!B(u[a]))return}o?v.cleanData([e],!0):v.support.deleteExpando||u!=u.window?delete u[a]:u[a]=null},_data:function(e,t,n){return v.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&v.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),v.fn.extend({data:function(e,n){var r,i,s,o,u,a=this[0],f=0,l=null;if(e===t){if(this.length){l=v.data(a);if(a.nodeType===1&&!v._data(a,"parsedAttrs")){s=a.attributes;for(u=s.length;f<u;f++)o=s[f].name,o.indexOf("data-")||(o=v.camelCase(o.substring(5)),H(a,o,l[o]));v._data(a,"parsedAttrs",!0)}}return l}return typeof e=="object"?this.each(function(){v.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",v.access(this,function(n){if(n===t)return l=this.triggerHandler("getData"+i,[r[0]]),l===t&&a&&(l=v.data(a,e),l=H(a,e,l)),l===t&&r[1]?this.data(r[0]):l;r[1]=n,this.each(function(){var t=v(this);t.triggerHandler("setData"+i,r),v.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):n===t?this:this.each(function(){var t=v.queue(this,e,n);v._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&v.dequeue(this,e)})},dequeue:function(e){return this.each(function(){v.dequeue(this,e)})},delay:function(e,t){return e=v.fx?v.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)s.indexOf(" "+t[o]+" ")<0&&(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(v.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!v.nodeName(n.parentNode,"optgroup"))){t=v(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o<r.length;o++)i=r[o],i&&(n=v.propFix[i]||i,s=X.test(i),s||v.attr(e,i,""),e.removeAttribute(V?i:n),s&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)v.error("type property can't be changed");else if(!v.support.radioValue&&t==="radio"&&v.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return j&&v.nodeName(e,"button")?j.get(e,t):t in e?e.value:null},set:function(e,t,n){if(j&&v.nodeName(e,"button"))return j.set(e,t,n);e.value=t}}},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(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!v.isXMLDoc(e),o&&(n=v.propFix[n]||n,s=v.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):z.test(e.nodeName)||W.test(e.nodeName)&&e.href?0:t}}}}),F={get:function(e,n){var r,i=v.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?v.removeAttr(e,n):(r=v.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},V||(I={name:!0,id:!0,coords:!0},j=v.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(I[n]?r.value!=="":r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=i.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},v.each(["width","height"],function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),v.attrHooks.contenteditable={get:j.get,set:function(e,t,n){t===""&&(t="false"),j.set(e,t,n)}}),v.support.hrefNormalized||v.each(["href","src","width","height"],function(e,n){v.attrHooks[n]=v.extend(v.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],function(){v.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),v.each(["radio","checkbox"],function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f<n.length;f++){l=J.exec(n[f])||[],c=l[1],h=(l[2]||"").split(".").sort(),g=v.event.special[c]||{},c=(s?g.delegateType:g.bindType)||c,g=v.event.special[c]||{},p=v.extend({type:c,origType:l[1],data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&v.expr.match.needsContext.test(s),namespace:h.join(".")},d),m=a[c];if(!m){m=a[c]=[],m.delegateCount=0;if(!g.setup||g.setup.call(e,i,h,u)===!1)e.addEventListener?e.addEventListener(c,u,!1):e.attachEvent&&e.attachEvent("on"+c,u)}g.add&&(g.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?m.splice(m.delegateCount++,0,p):m.push(p),v.event.global[c]=!0}e=null},global:{},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,m,g=v.hasData(e)&&v._data(e);if(!g||!(h=g.events))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,c,h,p,d=(v._data(this,"events")||{})[n.type]||[],m=d.delegateCount,g=l.call(arguments),y=!n.exclusive&&!n.namespace,b=v.event.special[n.type]||{},w=[];g[0]=n,n.delegateTarget=this;if(b.preDispatch&&b.preDispatch.call(this,n)===!1)return;if(m&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||n.type!=="click"){u={},f=[];for(r=0;r<m;r++)c=d[r],h=c.selector,u[h]===t&&(u[h]=c.needsContext?v(h,this).index(s)>=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r<w.length&&!n.isPropagationStopped();r++){a=w[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){c=a.matches[i];if(y||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))n.data=c.data,n.handleObj=c,o=((v.event.special[c.origType]||{}).handle||c.handler).apply(a.elem,g),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return b.postDispatch&&b.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[v.expando])return e;var t,n,r=e,s=v.event.fixHooks[e.type]||{},o=s.props?this.props.concat(s.props):this.props;e=v.Event(r);for(t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||i),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){v.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=v.extend(new v.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?v.event.trigger(i,null,t):v.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},v.event.handle=v.event.dispatch,v.removeEvent=i.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]=="undefined"&&(e[r]=null),e.detachEvent(r,n))},v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?tt:et):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0},v.Event.prototype={preventDefault:function(){this.isDefaultPrevented=tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){v.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function ct(e,t,n,r,i,s){return r&&!r[d]&&(r=ct(r)),i&&!i[d]&&(i=ct(i,s)),N(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||dt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?lt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=lt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?T.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a<s;a++)if(n=i.relative[e[a].type])h=[at(ft(h),n)];else{n=i.filter[e[a].type].apply(null,e[a].matches);if(n[d]){r=++a;for(;r<s;r++)if(i.relative[e[r].type])break;return ct(a>1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a<r&&ht(e.slice(a,r)),r<s&&ht(e=e.slice(r)),r<s&&e.join(""))}h.push(n)}return ft(h)}function pt(e,t){var r=t.length>0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r<i;r++)nt(e,t[r],n);return n}function vt(e,t,n,r,s){var o,u,f,l,c,h=ut(e),p=h.length;if(!r&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[d]=t==null||t,e},C=function(){var e={},t=[];return N(function(n,r){return t.push(n)>i.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="<a name='"+d+"'></a><div name='"+d+"'></div>",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:st(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:st(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},f=y.compareDocumentPosition?function(e,t){return e===t?(l=!0,0):(!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition:e.compareDocumentPosition(t)&4)?-1:1}:function(e,t){if(e===t)return l=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,u=t.parentNode,a=o;if(o===u)return ot(e,t);if(!o)return-1;if(!u)return 1;while(a)i.unshift(a),a=a.parentNode;a=u;while(a)s.unshift(a),a=a.parentNode;n=i.length,r=s.length;for(var f=0;f<n&&f<r;f++)if(i[f]!==s[f])return ot(i[f],s[f]);return f===n?ot(e,s[f],-1):ot(i[f],t,1)},[0,0].sort(f),h=!l,nt.uniqueSort=function(e){var t,n=[],r=1,i=0;l=h,e.sort(f);if(l){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},nt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},a=nt.compile=function(e,t){var n,r=[],i=[],s=A[d][e+" "];if(!s){t||(t=ut(e)),n=t.length;while(n--)s=ht(t[n]),s[d]?r.push(s):i.push(s);s=A(e,pt(i,r))}return s},g.querySelectorAll&&function(){var e,t=vt,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],s=[":active"],u=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector||y.oMatchesSelector||y.msMatchesSelector;K(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/<tbody/i,gt=/<|&#?\w+;/,yt=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,wt=new RegExp("<(?:"+ct+")[\\s/>]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Nt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X<div>","</div>"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)==="<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Vn[n]=Vn[n]||[],Vn[n].unshift(t)},prefilter:function(e,t){t?Xn.unshift(e):Xn.push(e)}}),v.Tween=Yn,Yn.prototype={constructor:Yn,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(v.cssNumber[n]?"":"px")},cur:function(){var e=Yn.propHooks[this.prop];return e&&e.get?e.get(this):Yn.propHooks._default.get(this)},run:function(e){var t,n=Yn.propHooks[this.prop];return this.options.duration?this.pos=t=v.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Yn.propHooks._default.set(this),this}},Yn.prototype.init.prototype=Yn.prototype,Yn.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=v.css(e.elem,e.prop,!1,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):e.elem.style&&(e.elem.style[v.cssProps[e.prop]]!=null||v.cssHooks[e.prop])?v.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Yn.propHooks.scrollTop=Yn.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.each(["toggle","show","hide"],function(e,t){var n=v.fn[t];v.fn[t]=function(r,i,s){return r==null||typeof r=="boolean"||!e&&v.isFunction(r)&&v.isFunction(i)?n.apply(this,arguments):this.animate(Zn(t,!0),r,i,s)}}),v.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=v.isEmptyObject(e),s=v.speed(t,n,r),o=function(){var t=Kn(this,v.extend({},e),s);i&&t.stop(!0)};return i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=v.timers,o=v._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Wn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&v.dequeue(this,e)})}}),v.each({slideDown:Zn("show"),slideUp:Zn("hide"),slideToggle:Zn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){v.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),v.speed=function(e,t,n){var r=e&&typeof e=="object"?v.extend({},e):{complete:n||!n&&t||v.isFunction(e)&&e,duration:e,easing:n&&t||t&&!v.isFunction(t)&&t};r.duration=v.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in v.fx.speeds?v.fx.speeds[r.duration]:v.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){v.isFunction(r.old)&&r.old.call(this),r.queue&&v.dequeue(this,r.queue)},r},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},v.timers=[],v.fx=Yn.prototype.init,v.fx.tick=function(){var e,n=v.timers,r=0;qn=v.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||v.fx.stop(),qn=t},v.fx.timer=function(e){e()&&v.timers.push(e)&&!Rn&&(Rn=setInterval(v.fx.tick,v.fx.interval))},v.fx.interval=13,v.fx.stop=function(){clearInterval(Rn),Rn=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fx.step={},v.expr&&v.expr.filters&&(v.expr.filters.animated=function(e){return v.grep(v.timers,function(t){return e===t.elem}).length});var er=/^(?:body|html)$/i;v.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){v.offset.setOffset(this,e,t)});var n,r,i,s,o,u,a,f={top:0,left:0},l=this[0],c=l&&l.ownerDocument;if(!c)return;return(r=c.body)===l?v.offset.bodyOffset(l):(n=c.documentElement,v.contains(n,l)?(typeof l.getBoundingClientRect!="undefined"&&(f=l.getBoundingClientRect()),i=tr(c),s=n.clientTop||r.clientTop||0,o=n.clientLeft||r.clientLeft||0,u=i.pageYOffset||n.scrollTop,a=i.pageXOffset||n.scrollLeft,{top:f.top+u-s,left:f.left+a-o}):f)},v.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return v.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(v.css(e,"marginTop"))||0,n+=parseFloat(v.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=v.css(e,"position");r==="static"&&(e.style.position="relative");var i=v(e),s=i.offset(),o=v.css(e,"top"),u=v.css(e,"left"),a=(r==="absolute"||r==="fixed")&&v.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); |
| 1 | /*! |
| 2 | * jQuery JavaScript Library v1.9.0b1 |
| 3 | * http://jquery.com/ |
| 4 | * |
| 5 | * Includes Sizzle.js |
| 6 | * http://sizzlejs.com/ |
| 7 | * |
| 8 | * Copyright 2012 jQuery Foundation and other contributors |
| 9 | * Released under the MIT license |
| 10 | * http://jquery.org/license |
| 11 | * |
| 12 | * Date: 2012-12-16 |
| 13 | */ |
| 14 | (function( window, undefined ) { |
| 15 | "use strict"; |
| 16 | var |
| 17 | // A central reference to the root jQuery(document) |
| 18 | rootjQuery, |
| 19 | |
| 20 | // The deferred used on DOM ready |
| 21 | readyList, |
| 22 | |
| 23 | // Use the correct document accordingly with window argument (sandbox) |
| 24 | document = window.document, |
| 25 | location = window.location, |
| 26 | |
| 27 | // Map over jQuery in case of overwrite |
| 28 | _jQuery = window.jQuery, |
| 29 | |
| 30 | // Map over the $ in case of overwrite |
| 31 | _$ = window.$, |
| 32 | |
| 33 | // [[Class]] -> type pairs |
| 34 | class2type = {}, |
| 35 | |
| 36 | // List of deleted data cache ids, so we can reuse them |
| 37 | core_deletedIds = [], |
| 38 | |
| 39 | core_version = "1.9.0b1", |
| 40 | |
| 41 | // Save a reference to some core methods |
| 42 | core_concat = core_deletedIds.concat, |
| 43 | core_push = core_deletedIds.push, |
| 44 | core_slice = core_deletedIds.slice, |
| 45 | core_indexOf = core_deletedIds.indexOf, |
| 46 | core_toString = class2type.toString, |
| 47 | core_hasOwn = class2type.hasOwnProperty, |
| 48 | core_trim = core_version.trim, |
| 49 | |
| 50 | // Define a local copy of jQuery |
| 51 | jQuery = function( selector, context ) { |
| 52 | // The jQuery object is actually just the init constructor 'enhanced' |
| 53 | return new jQuery.fn.init( selector, context, rootjQuery ); |
| 54 | }, |
| 55 | |
| 56 | // Used for matching numbers |
| 57 | core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, |
| 58 | |
| 59 | // Used for splitting on whitespace |
| 60 | core_rnotwhite = /\S+/g, |
| 61 | |
| 62 | // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) |
| 63 | rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, |
| 64 | |
| 65 | // A simple way to check for HTML strings |
| 66 | // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) |
| 67 | // Strict HTML recognition (#11290: must start with <) |
| 68 | rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/, |
| 69 | |
| 70 | // Match a standalone tag |
| 71 | rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, |
| 72 | |
| 73 | // JSON RegExp |
| 74 | rvalidchars = /^[\],:{}\s]*$/, |
| 75 | rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, |
| 76 | rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, |
| 77 | rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, |
| 78 | |
| 79 | // Matches dashed string for camelizing |
| 80 | rmsPrefix = /^-ms-/, |
| 81 | rdashAlpha = /-([\da-z])/gi, |
| 82 | |
| 83 | // Used by jQuery.camelCase as callback to replace() |
| 84 | fcamelCase = function( all, letter ) { |
| 85 | return letter.toUpperCase(); |
| 86 | }, |
| 87 | |
| 88 | // The ready event handler and self cleanup method |
| 89 | DOMContentLoaded = function() { |
| 90 | if ( document.addEventListener ) { |
| 91 | document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); |
| 92 | jQuery.ready(); |
| 93 | } else if ( document.readyState === "complete" ) { |
| 94 | // we're here because readyState === "complete" in oldIE |
| 95 | // which is good enough for us to call the dom ready! |
| 96 | document.detachEvent( "onreadystatechange", DOMContentLoaded ); |
| 97 | jQuery.ready(); |
| 98 | } |
| 99 | }; |
| 100 | |
| 101 | jQuery.fn = jQuery.prototype = { |
| 102 | // The current version of jQuery being used |
| 103 | jquery: core_version, |
| 104 | |
| 105 | constructor: jQuery, |
| 106 | init: function( selector, context, rootjQuery ) { |
| 107 | var match, elem; |
| 108 | |
| 109 | // HANDLE: $(""), $(null), $(undefined), $(false) |
| 110 | if ( !selector ) { |
| 111 | return this; |
| 112 | } |
| 113 | |
| 114 | // HANDLE: $(DOMElement) |
| 115 | if ( selector.nodeType ) { |
| 116 | this.context = this[0] = selector; |
| 117 | this.length = 1; |
| 118 | return this; |
| 119 | } |
| 120 | |
| 121 | // Handle HTML strings |
| 122 | if ( typeof selector === "string" ) { |
| 123 | if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { |
| 124 | // Assume that strings that start and end with <> are HTML and skip the regex check |
| 125 | match = [ null, selector, null ]; |
| 126 | |
| 127 | } else { |
| 128 | match = rquickExpr.exec( selector ); |
| 129 | } |
| 130 | |
| 131 | // Match html or make sure no context is specified for #id |
| 132 | if ( match && (match[1] || !context) ) { |
| 133 | |
| 134 | // HANDLE: $(html) -> $(array) |
| 135 | if ( match[1] ) { |
| 136 | context = context instanceof jQuery ? context[0] : context; |
| 137 | |
| 138 | // scripts is true for back-compat |
| 139 | jQuery.merge( this, jQuery.parseHTML( |
| 140 | match[1], |
| 141 | context && context.nodeType ? context.ownerDocument || context : document, |
| 142 | true |
| 143 | ) ); |
| 144 | |
| 145 | // HANDLE: $(html, props) |
| 146 | if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { |
| 147 | for ( match in context ) { |
| 148 | // Properties of context are called as methods if possible |
| 149 | if ( jQuery.isFunction( this[ match ] ) ) { |
| 150 | this[ match ]( context[ match ] ); |
| 151 | |
| 152 | // ...and otherwise set as attributes |
| 153 | } else { |
| 154 | this.attr( match, context[ match ] ); |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | return this; |
| 160 | |
| 161 | // HANDLE: $(#id) |
| 162 | } else { |
| 163 | elem = document.getElementById( match[2] ); |
| 164 | |
| 165 | // Check parentNode to catch when Blackberry 4.6 returns |
| 166 | // nodes that are no longer in the document #6963 |
| 167 | if ( elem && elem.parentNode ) { |
| 168 | // Handle the case where IE and Opera return items |
| 169 | // by name instead of ID |
| 170 | if ( elem.id !== match[2] ) { |
| 171 | return rootjQuery.find( selector ); |
| 172 | } |
| 173 | |
| 174 | // Otherwise, we inject the element directly into the jQuery object |
| 175 | this.length = 1; |
| 176 | this[0] = elem; |
| 177 | } |
| 178 | |
| 179 | this.context = document; |
| 180 | this.selector = selector; |
| 181 | return this; |
| 182 | } |
| 183 | |
| 184 | // HANDLE: $(expr, $(...)) |
| 185 | } else if ( !context || context.jquery ) { |
| 186 | return ( context || rootjQuery ).find( selector ); |
| 187 | |
| 188 | // HANDLE: $(expr, context) |
| 189 | // (which is just equivalent to: $(context).find(expr) |
| 190 | } else { |
| 191 | return this.constructor( context ).find( selector ); |
| 192 | } |
| 193 | |
| 194 | // HANDLE: $(function) |
| 195 | // Shortcut for document ready |
| 196 | } else if ( jQuery.isFunction( selector ) ) { |
| 197 | return rootjQuery.ready( selector ); |
| 198 | } |
| 199 | |
| 200 | if ( selector.selector !== undefined ) { |
| 201 | this.selector = selector.selector; |
| 202 | this.context = selector.context; |
| 203 | } |
| 204 | |
| 205 | return jQuery.makeArray( selector, this ); |
| 206 | }, |
| 207 | |
| 208 | // Start with an empty selector |
| 209 | selector: "", |
| 210 | |
| 211 | // The default length of a jQuery object is 0 |
| 212 | length: 0, |
| 213 | |
| 214 | // The number of elements contained in the matched element set |
| 215 | size: function() { |
| 216 | return this.length; |
| 217 | }, |
| 218 | |
| 219 | toArray: function() { |
| 220 | return core_slice.call( this ); |
| 221 | }, |
| 222 | |
| 223 | // Get the Nth element in the matched element set OR |
| 224 | // Get the whole matched element set as a clean array |
| 225 | get: function( num ) { |
| 226 | return num == null ? |
| 227 | |
| 228 | // Return a 'clean' array |
| 229 | this.toArray() : |
| 230 | |
| 231 | // Return just the object |
| 232 | ( num < 0 ? this[ this.length + num ] : this[ num ] ); |
| 233 | }, |
| 234 | |
| 235 | // Take an array of elements and push it onto the stack |
| 236 | // (returning the new matched element set) |
| 237 | pushStack: function( elems ) { |
| 238 | |
| 239 | // Build a new jQuery matched element set |
| 240 | var ret = jQuery.merge( this.constructor(), elems ); |
| 241 | |
| 242 | // Add the old object onto the stack (as a reference) |
| 243 | ret.prevObject = this; |
| 244 | ret.context = this.context; |
| 245 | |
| 246 | // Return the newly-formed element set |
| 247 | return ret; |
| 248 | }, |
| 249 | |
| 250 | // Execute a callback for every element in the matched set. |
| 251 | // (You can seed the arguments with an array of args, but this is |
| 252 | // only used internally.) |
| 253 | each: function( callback, args ) { |
| 254 | return jQuery.each( this, callback, args ); |
| 255 | }, |
| 256 | |
| 257 | ready: function( fn ) { |
| 258 | // Add the callback |
| 259 | jQuery.ready.promise().done( fn ); |
| 260 | |
| 261 | return this; |
| 262 | }, |
| 263 | |
| 264 | slice: function() { |
| 265 | return this.pushStack( core_slice.apply( this, arguments ) ); |
| 266 | }, |
| 267 | |
| 268 | first: function() { |
| 269 | return this.eq( 0 ); |
| 270 | }, |
| 271 | |
| 272 | last: function() { |
| 273 | return this.eq( -1 ); |
| 274 | }, |
| 275 | |
| 276 | eq: function( i ) { |
| 277 | var len = this.length, |
| 278 | j = +i + ( i < 0 ? len : 0 ); |
| 279 | return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); |
| 280 | }, |
| 281 | |
| 282 | map: function( callback ) { |
| 283 | return this.pushStack( jQuery.map(this, function( elem, i ) { |
| 284 | return callback.call( elem, i, elem ); |
| 285 | })); |
| 286 | }, |
| 287 | |
| 288 | end: function() { |
| 289 | return this.prevObject || this.constructor(null); |
| 290 | }, |
| 291 | |
| 292 | // For internal use only. |
| 293 | // Behaves like an Array's method, not like a jQuery method. |
| 294 | push: core_push, |
| 295 | sort: [].sort, |
| 296 | splice: [].splice |
| 297 | }; |
| 298 | |
| 299 | // Give the init function the jQuery prototype for later instantiation |
| 300 | jQuery.fn.init.prototype = jQuery.fn; |
| 301 | |
| 302 | jQuery.extend = jQuery.fn.extend = function() { |
| 303 | var options, name, src, copy, copyIsArray, clone, |
| 304 | target = arguments[0] || {}, |
| 305 | i = 1, |
| 306 | length = arguments.length, |
| 307 | deep = false; |
| 308 | |
| 309 | // Handle a deep copy situation |
| 310 | if ( typeof target === "boolean" ) { |
| 311 | deep = target; |
| 312 | target = arguments[1] || {}; |
| 313 | // skip the boolean and the target |
| 314 | i = 2; |
| 315 | } |
| 316 | |
| 317 | // Handle case when target is a string or something (possible in deep copy) |
| 318 | if ( typeof target !== "object" && !jQuery.isFunction(target) ) { |
| 319 | target = {}; |
| 320 | } |
| 321 | |
| 322 | // extend jQuery itself if only one argument is passed |
| 323 | if ( length === i ) { |
| 324 | target = this; |
| 325 | --i; |
| 326 | } |
| 327 | |
| 328 | for ( ; i < length; i++ ) { |
| 329 | // Only deal with non-null/undefined values |
| 330 | if ( (options = arguments[ i ]) != null ) { |
| 331 | // Extend the base object |
| 332 | for ( name in options ) { |
| 333 | src = target[ name ]; |
| 334 | copy = options[ name ]; |
| 335 | |
| 336 | // Prevent never-ending loop |
| 337 | if ( target === copy ) { |
| 338 | continue; |
| 339 | } |
| 340 | |
| 341 | // Recurse if we're merging plain objects or arrays |
| 342 | if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { |
| 343 | if ( copyIsArray ) { |
| 344 | copyIsArray = false; |
| 345 | clone = src && jQuery.isArray(src) ? src : []; |
| 346 | |
| 347 | } else { |
| 348 | clone = src && jQuery.isPlainObject(src) ? src : {}; |
| 349 | } |
| 350 | |
| 351 | // Never move original objects, clone them |
| 352 | target[ name ] = jQuery.extend( deep, clone, copy ); |
| 353 | |
| 354 | // Don't bring in undefined values |
| 355 | } else if ( copy !== undefined ) { |
| 356 | target[ name ] = copy; |
| 357 | } |
| 358 | } |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | // Return the modified object |
| 363 | return target; |
| 364 | }; |
| 365 | |
| 366 | jQuery.extend({ |
| 367 | noConflict: function( deep ) { |
| 368 | if ( window.$ === jQuery ) { |
| 369 | window.$ = _$; |
| 370 | } |
| 371 | |
| 372 | if ( deep && window.jQuery === jQuery ) { |
| 373 | window.jQuery = _jQuery; |
| 374 | } |
| 375 | |
| 376 | return jQuery; |
| 377 | }, |
| 378 | |
| 379 | // Is the DOM ready to be used? Set to true once it occurs. |
| 380 | isReady: false, |
| 381 | |
| 382 | // A counter to track how many items to wait for before |
| 383 | // the ready event fires. See #6781 |
| 384 | readyWait: 1, |
| 385 | |
| 386 | // Hold (or release) the ready event |
| 387 | holdReady: function( hold ) { |
| 388 | if ( hold ) { |
| 389 | jQuery.readyWait++; |
| 390 | } else { |
| 391 | jQuery.ready( true ); |
| 392 | } |
| 393 | }, |
| 394 | |
| 395 | // Handle when the DOM is ready |
| 396 | ready: function( wait ) { |
| 397 | |
| 398 | // Abort if there are pending holds or we're already ready |
| 399 | if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { |
| 400 | return; |
| 401 | } |
| 402 | |
| 403 | // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). |
| 404 | if ( !document.body ) { |
| 405 | return setTimeout( jQuery.ready ); |
| 406 | } |
| 407 | |
| 408 | // Remember that the DOM is ready |
| 409 | jQuery.isReady = true; |
| 410 | |
| 411 | // If a normal DOM Ready event fired, decrement, and wait if need be |
| 412 | if ( wait !== true && --jQuery.readyWait > 0 ) { |
| 413 | return; |
| 414 | } |
| 415 | |
| 416 | // If there are functions bound, to execute |
| 417 | readyList.resolveWith( document, [ jQuery ] ); |
| 418 | |
| 419 | // Trigger any bound ready events |
| 420 | if ( jQuery.fn.trigger ) { |
| 421 | jQuery( document ).trigger("ready").off("ready"); |
| 422 | } |
| 423 | }, |
| 424 | |
| 425 | // See test/unit/core.js for details concerning isFunction. |
| 426 | // Since version 1.3, DOM methods and functions like alert |
| 427 | // aren't supported. They return false on IE (#2968). |
| 428 | isFunction: function( obj ) { |
| 429 | return jQuery.type(obj) === "function"; |
| 430 | }, |
| 431 | |
| 432 | isArray: Array.isArray || function( obj ) { |
| 433 | return jQuery.type(obj) === "array"; |
| 434 | }, |
| 435 | |
| 436 | isWindow: function( obj ) { |
| 437 | return obj != null && obj == obj.window; |
| 438 | }, |
| 439 | |
| 440 | isNumeric: function( obj ) { |
| 441 | return !isNaN( parseFloat(obj) ) && isFinite( obj ); |
| 442 | }, |
| 443 | |
| 444 | type: function( obj ) { |
| 445 | return obj == null ? |
| 446 | String( obj ) : |
| 447 | class2type[ core_toString.call(obj) ] || "object"; |
| 448 | }, |
| 449 | |
| 450 | isPlainObject: function( obj ) { |
| 451 | // Must be an Object. |
| 452 | // Because of IE, we also have to check the presence of the constructor property. |
| 453 | // Make sure that DOM nodes and window objects don't pass through, as well |
| 454 | if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { |
| 455 | return false; |
| 456 | } |
| 457 | |
| 458 | try { |
| 459 | // Not own constructor property must be Object |
| 460 | if ( obj.constructor && |
| 461 | !core_hasOwn.call(obj, "constructor") && |
| 462 | !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { |
| 463 | return false; |
| 464 | } |
| 465 | } catch ( e ) { |
| 466 | // IE8,9 Will throw exceptions on certain host objects #9897 |
| 467 | return false; |
| 468 | } |
| 469 | |
| 470 | // Own properties are enumerated firstly, so to speed up, |
| 471 | // if last one is own, then all properties are own. |
| 472 | |
| 473 | var key; |
| 474 | for ( key in obj ) {} |
| 475 | |
| 476 | return key === undefined || core_hasOwn.call( obj, key ); |
| 477 | }, |
| 478 | |
| 479 | isEmptyObject: function( obj ) { |
| 480 | var name; |
| 481 | for ( name in obj ) { |
| 482 | return false; |
| 483 | } |
| 484 | return true; |
| 485 | }, |
| 486 | |
| 487 | error: function( msg ) { |
| 488 | throw new Error( msg ); |
| 489 | }, |
| 490 | |
| 491 | // data: string of html |
| 492 | // context (optional): If specified, the fragment will be created in this context, defaults to document |
| 493 | // keepScripts (optional): If true, will include scripts passed in the html string |
| 494 | parseHTML: function( data, context, keepScripts ) { |
| 495 | if ( !data || typeof data !== "string" ) { |
| 496 | return null; |
| 497 | } |
| 498 | if ( typeof context === "boolean" ) { |
| 499 | keepScripts = context; |
| 500 | context = false; |
| 501 | } |
| 502 | context = context || document; |
| 503 | |
| 504 | var parsed = rsingleTag.exec( data ), |
| 505 | scripts = !keepScripts && []; |
| 506 | |
| 507 | // Single tag |
| 508 | if ( parsed ) { |
| 509 | return [ context.createElement( parsed[1] ) ]; |
| 510 | } |
| 511 | |
| 512 | parsed = context.createDocumentFragment(); |
| 513 | jQuery.clean( [ data ], context, parsed, scripts ); |
| 514 | if ( scripts ) { |
| 515 | jQuery( scripts ).remove(); |
| 516 | } |
| 517 | return jQuery.merge( [], parsed.childNodes ); |
| 518 | }, |
| 519 | |
| 520 | parseJSON: function( data ) { |
| 521 | // Attempt to parse using the native JSON parser first |
| 522 | if ( window.JSON && window.JSON.parse ) { |
| 523 | return window.JSON.parse( data ); |
| 524 | } |
| 525 | |
| 526 | if ( data === null ) { |
| 527 | return data; |
| 528 | } |
| 529 | |
| 530 | if ( typeof data === "string" ) { |
| 531 | |
| 532 | // Make sure leading/trailing whitespace is removed (IE can't handle it) |
| 533 | data = jQuery.trim( data ); |
| 534 | |
| 535 | if ( data ) { |
| 536 | // Make sure the incoming data is actual JSON |
| 537 | // Logic borrowed from http://json.org/json2.js |
| 538 | if ( rvalidchars.test( data.replace( rvalidescape, "@" ) |
| 539 | .replace( rvalidtokens, "]" ) |
| 540 | .replace( rvalidbraces, "")) ) { |
| 541 | |
| 542 | return ( new Function( "return " + data ) )(); |
| 543 | } |
| 544 | } |
| 545 | } |
| 546 | |
| 547 | jQuery.error( "Invalid JSON: " + data ); |
| 548 | }, |
| 549 | |
| 550 | // Cross-browser xml parsing |
| 551 | parseXML: function( data ) { |
| 552 | var xml, tmp; |
| 553 | if ( !data || typeof data !== "string" ) { |
| 554 | return null; |
| 555 | } |
| 556 | try { |
| 557 | if ( window.DOMParser ) { // Standard |
| 558 | tmp = new DOMParser(); |
| 559 | xml = tmp.parseFromString( data , "text/xml" ); |
| 560 | } else { // IE |
| 561 | xml = new ActiveXObject( "Microsoft.XMLDOM" ); |
| 562 | xml.async = "false"; |
| 563 | xml.loadXML( data ); |
| 564 | } |
| 565 | } catch( e ) { |
| 566 | xml = undefined; |
| 567 | } |
| 568 | if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { |
| 569 | jQuery.error( "Invalid XML: " + data ); |
| 570 | } |
| 571 | return xml; |
| 572 | }, |
| 573 | |
| 574 | noop: function() {}, |
| 575 | |
| 576 | // Evaluates a script in a global context |
| 577 | // Workarounds based on findings by Jim Driscoll |
| 578 | // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context |
| 579 | globalEval: function( data ) { |
| 580 | if ( data && jQuery.trim( data ) ) { |
| 581 | // We use execScript on Internet Explorer |
| 582 | // We use an anonymous function so that context is window |
| 583 | // rather than jQuery in Firefox |
| 584 | ( window.execScript || function( data ) { |
| 585 | window[ "eval" ].call( window, data ); |
| 586 | } )( data ); |
| 587 | } |
| 588 | }, |
| 589 | |
| 590 | // Convert dashed to camelCase; used by the css and data modules |
| 591 | // Microsoft forgot to hump their vendor prefix (#9572) |
| 592 | camelCase: function( string ) { |
| 593 | return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); |
| 594 | }, |
| 595 | |
| 596 | nodeName: function( elem, name ) { |
| 597 | return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); |
| 598 | }, |
| 599 | |
| 600 | // args is for internal usage only |
| 601 | each: function( obj, callback, args ) { |
| 602 | var value, |
| 603 | i = 0, |
| 604 | length = obj.length, |
| 605 | isArray = isArraylike( obj ); |
| 606 | |
| 607 | if ( args ) { |
| 608 | if ( isArray ) { |
| 609 | for ( ; i < length; i++ ) { |
| 610 | value = callback.apply( obj[ i ], args ); |
| 611 | |
| 612 | if ( value === false ) { |
| 613 | break; |
| 614 | } |
| 615 | } |
| 616 | } else { |
| 617 | for ( i in obj ) { |
| 618 | value = callback.apply( obj[ i ], args ); |
| 619 | |
| 620 | if ( value === false ) { |
| 621 | break; |
| 622 | } |
| 623 | } |
| 624 | } |
| 625 | |
| 626 | // A special, fast, case for the most common use of each |
| 627 | } else { |
| 628 | if ( isArray ) { |
| 629 | for ( ; i < length; i++ ) { |
| 630 | value = callback.call( obj[ i ], i, obj[ i ] ); |
| 631 | |
| 632 | if ( value === false ) { |
| 633 | break; |
| 634 | } |
| 635 | } |
| 636 | } else { |
| 637 | for ( i in obj ) { |
| 638 | value = callback.call( obj[ i ], i, obj[ i ] ); |
| 639 | |
| 640 | if ( value === false ) { |
| 641 | break; |
| 642 | } |
| 643 | } |
| 644 | } |
| 645 | } |
| 646 | |
| 647 | return obj; |
| 648 | }, |
| 649 | |
| 650 | // Use native String.trim function wherever possible |
| 651 | trim: core_trim && !core_trim.call("\uFEFF\xA0") ? |
| 652 | function( text ) { |
| 653 | return text == null ? |
| 654 | "" : |
| 655 | core_trim.call( text ); |
| 656 | } : |
| 657 | |
| 658 | // Otherwise use our own trimming functionality |
| 659 | function( text ) { |
| 660 | return text == null ? |
| 661 | "" : |
| 662 | ( text + "" ).replace( rtrim, "" ); |
| 663 | }, |
| 664 | |
| 665 | // results is for internal usage only |
| 666 | makeArray: function( arr, results ) { |
| 667 | var ret = results || []; |
| 668 | |
| 669 | if ( arr != null ) { |
| 670 | if ( isArraylike( Object(arr) ) ) { |
| 671 | jQuery.merge( ret, |
| 672 | typeof arr === "string" ? |
| 673 | [ arr ] : arr |
| 674 | ); |
| 675 | } else { |
| 676 | core_push.call( ret, arr ); |
| 677 | } |
| 678 | } |
| 679 | |
| 680 | return ret; |
| 681 | }, |
| 682 | |
| 683 | inArray: function( elem, arr, i ) { |
| 684 | var len; |
| 685 | |
| 686 | if ( arr ) { |
| 687 | if ( core_indexOf ) { |
| 688 | return core_indexOf.call( arr, elem, i ); |
| 689 | } |
| 690 | |
| 691 | len = arr.length; |
| 692 | i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; |
| 693 | |
| 694 | for ( ; i < len; i++ ) { |
| 695 | // Skip accessing in sparse arrays |
| 696 | if ( i in arr && arr[ i ] === elem ) { |
| 697 | return i; |
| 698 | } |
| 699 | } |
| 700 | } |
| 701 | |
| 702 | return -1; |
| 703 | }, |
| 704 | |
| 705 | merge: function( first, second ) { |
| 706 | var l = second.length, |
| 707 | i = first.length, |
| 708 | j = 0; |
| 709 | |
| 710 | if ( typeof l === "number" ) { |
| 711 | for ( ; j < l; j++ ) { |
| 712 | first[ i++ ] = second[ j ]; |
| 713 | } |
| 714 | } else { |
| 715 | while ( second[j] !== undefined ) { |
| 716 | first[ i++ ] = second[ j++ ]; |
| 717 | } |
| 718 | } |
| 719 | |
| 720 | first.length = i; |
| 721 | |
| 722 | return first; |
| 723 | }, |
| 724 | |
| 725 | grep: function( elems, callback, inv ) { |
| 726 | var retVal, |
| 727 | ret = [], |
| 728 | i = 0, |
| 729 | length = elems.length; |
| 730 | inv = !!inv; |
| 731 | |
| 732 | // Go through the array, only saving the items |
| 733 | // that pass the validator function |
| 734 | for ( ; i < length; i++ ) { |
| 735 | retVal = !!callback( elems[ i ], i ); |
| 736 | if ( inv !== retVal ) { |
| 737 | ret.push( elems[ i ] ); |
| 738 | } |
| 739 | } |
| 740 | |
| 741 | return ret; |
| 742 | }, |
| 743 | |
| 744 | // arg is for internal usage only |
| 745 | map: function( elems, callback, arg ) { |
| 746 | var value, |
| 747 | i = 0, |
| 748 | length = elems.length, |
| 749 | isArray = isArraylike( elems ), |
| 750 | ret = []; |
| 751 | |
| 752 | // Go through the array, translating each of the items to their |
| 753 | if ( isArray ) { |
| 754 | for ( ; i < length; i++ ) { |
| 755 | value = callback( elems[ i ], i, arg ); |
| 756 | |
| 757 | if ( value != null ) { |
| 758 | ret[ ret.length ] = value; |
| 759 | } |
| 760 | } |
| 761 | |
| 762 | // Go through every key on the object, |
| 763 | } else { |
| 764 | for ( i in elems ) { |
| 765 | value = callback( elems[ i ], i, arg ); |
| 766 | |
| 767 | if ( value != null ) { |
| 768 | ret[ ret.length ] = value; |
| 769 | } |
| 770 | } |
| 771 | } |
| 772 | |
| 773 | // Flatten any nested arrays |
| 774 | return core_concat.apply( [], ret ); |
| 775 | }, |
| 776 | |
| 777 | // A global GUID counter for objects |
| 778 | guid: 1, |
| 779 | |
| 780 | // Bind a function to a context, optionally partially applying any |
| 781 | // arguments. |
| 782 | proxy: function( fn, context ) { |
| 783 | var tmp, args, proxy; |
| 784 | |
| 785 | if ( typeof context === "string" ) { |
| 786 | tmp = fn[ context ]; |
| 787 | context = fn; |
| 788 | fn = tmp; |
| 789 | } |
| 790 | |
| 791 | // Quick check to determine if target is callable, in the spec |
| 792 | // this throws a TypeError, but we will just return undefined. |
| 793 | if ( !jQuery.isFunction( fn ) ) { |
| 794 | return undefined; |
| 795 | } |
| 796 | |
| 797 | // Simulated bind |
| 798 | args = core_slice.call( arguments, 2 ); |
| 799 | proxy = function() { |
| 800 | return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); |
| 801 | }; |
| 802 | |
| 803 | // Set the guid of unique handler to the same of original handler, so it can be removed |
| 804 | proxy.guid = fn.guid = fn.guid || jQuery.guid++; |
| 805 | |
| 806 | return proxy; |
| 807 | }, |
| 808 | |
| 809 | // Multifunctional method to get and set values of a collection |
| 810 | // The value/s can optionally be executed if it's a function |
| 811 | access: function( elems, fn, key, value, chainable, emptyGet, raw ) { |
| 812 | var i = 0, |
| 813 | length = elems.length, |
| 814 | bulk = key == null; |
| 815 | |
| 816 | // Sets many values |
| 817 | if ( jQuery.type( key ) === "object" ) { |
| 818 | chainable = true; |
| 819 | for ( i in key ) { |
| 820 | jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); |
| 821 | } |
| 822 | |
| 823 | // Sets one value |
| 824 | } else if ( value !== undefined ) { |
| 825 | chainable = true; |
| 826 | |
| 827 | if ( !jQuery.isFunction( value ) ) { |
| 828 | raw = true; |
| 829 | } |
| 830 | |
| 831 | if ( bulk ) { |
| 832 | // Bulk operations run against the entire set |
| 833 | if ( raw ) { |
| 834 | fn.call( elems, value ); |
| 835 | fn = null; |
| 836 | |
| 837 | // ...except when executing function values |
| 838 | } else { |
| 839 | bulk = fn; |
| 840 | fn = function( elem, key, value ) { |
| 841 | return bulk.call( jQuery( elem ), value ); |
| 842 | }; |
| 843 | } |
| 844 | } |
| 845 | |
| 846 | if ( fn ) { |
| 847 | for ( ; i < length; i++ ) { |
| 848 | fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); |
| 849 | } |
| 850 | } |
| 851 | } |
| 852 | |
| 853 | return chainable ? |
| 854 | elems : |
| 855 | |
| 856 | // Gets |
| 857 | bulk ? |
| 858 | fn.call( elems ) : |
| 859 | length ? fn( elems[0], key ) : emptyGet; |
| 860 | }, |
| 861 | |
| 862 | now: function() { |
| 863 | return ( new Date() ).getTime(); |
| 864 | } |
| 865 | }); |
| 866 | |
| 867 | jQuery.ready.promise = function( obj ) { |
| 868 | if ( !readyList ) { |
| 869 | |
| 870 | readyList = jQuery.Deferred(); |
| 871 | |
| 872 | // Catch cases where $(document).ready() is called after the browser event has already occurred. |
| 873 | // we once tried to use readyState "interactive" here, but it caused issues like the one |
| 874 | // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 |
| 875 | if ( document.readyState === "complete" ) { |
| 876 | // Handle it asynchronously to allow scripts the opportunity to delay ready |
| 877 | setTimeout( jQuery.ready ); |
| 878 | |
| 879 | // Standards-based browsers support DOMContentLoaded |
| 880 | } else if ( document.addEventListener ) { |
| 881 | // Use the handy event callback |
| 882 | document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); |
| 883 | |
| 884 | // A fallback to window.onload, that will always work |
| 885 | window.addEventListener( "load", jQuery.ready, false ); |
| 886 | |
| 887 | // If IE event model is used |
| 888 | } else { |
| 889 | // Ensure firing before onload, maybe late but safe also for iframes |
| 890 | document.attachEvent( "onreadystatechange", DOMContentLoaded ); |
| 891 | |
| 892 | // A fallback to window.onload, that will always work |
| 893 | window.attachEvent( "onload", jQuery.ready ); |
| 894 | |
| 895 | // If IE and not a frame |
| 896 | // continually check to see if the document is ready |
| 897 | var top = false; |
| 898 | |
| 899 | try { |
| 900 | top = window.frameElement == null && document.documentElement; |
| 901 | } catch(e) {} |
| 902 | |
| 903 | if ( top && top.doScroll ) { |
| 904 | (function doScrollCheck() { |
| 905 | if ( !jQuery.isReady ) { |
| 906 | |
| 907 | try { |
| 908 | // Use the trick by Diego Perini |
| 909 | // http://javascript.nwbox.com/IEContentLoaded/ |
| 910 | top.doScroll("left"); |
| 911 | } catch(e) { |
| 912 | return setTimeout( doScrollCheck, 50 ); |
| 913 | } |
| 914 | |
| 915 | // and execute any waiting functions |
| 916 | jQuery.ready(); |
| 917 | } |
| 918 | })(); |
| 919 | } |
| 920 | } |
| 921 | } |
| 922 | return readyList.promise( obj ); |
| 923 | }; |
| 924 | |
| 925 | // Populate the class2type map |
| 926 | jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { |
| 927 | class2type[ "[object " + name + "]" ] = name.toLowerCase(); |
| 928 | }); |
| 929 | |
| 930 | function isArraylike( obj ) { |
| 931 | var length = obj.length, |
| 932 | type = jQuery.type( obj ); |
| 933 | |
| 934 | if ( jQuery.isWindow( obj ) ) { |
| 935 | return false; |
| 936 | } |
| 937 | |
| 938 | if ( obj.nodeType === 1 && length ) { |
| 939 | return true; |
| 940 | } |
| 941 | |
| 942 | return type === "array" || type !== "function" && |
| 943 | ( length === 0 || |
| 944 | typeof length === "number" && length > 0 && ( length - 1 ) in obj ); |
| 945 | } |
| 946 | |
| 947 | // All jQuery objects should point back to these |
| 948 | rootjQuery = jQuery(document); |
| 949 | // String to Object options format cache |
| 950 | var optionsCache = {}; |
| 951 | |
| 952 | // Convert String-formatted options into Object-formatted ones and store in cache |
| 953 | function createOptions( options ) { |
| 954 | var object = optionsCache[ options ] = {}; |
| 955 | jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { |
| 956 | object[ flag ] = true; |
| 957 | }); |
| 958 | return object; |
| 959 | } |
| 960 | |
| 961 | /* |
| 962 | * Create a callback list using the following parameters: |
| 963 | * |
| 964 | * options: an optional list of space-separated options that will change how |
| 965 | * the callback list behaves or a more traditional option object |
| 966 | * |
| 967 | * By default a callback list will act like an event callback list and can be |
| 968 | * "fired" multiple times. |
| 969 | * |
| 970 | * Possible options: |
| 971 | * |
| 972 | * once: will ensure the callback list can only be fired once (like a Deferred) |
| 973 | * |
| 974 | * memory: will keep track of previous values and will call any callback added |
| 975 | * after the list has been fired right away with the latest "memorized" |
| 976 | * values (like a Deferred) |
| 977 | * |
| 978 | * unique: will ensure a callback can only be added once (no duplicate in the list) |
| 979 | * |
| 980 | * stopOnFalse: interrupt callings when a callback returns false |
| 981 | * |
| 982 | */ |
| 983 | jQuery.Callbacks = function( options ) { |
| 984 | |
| 985 | // Convert options from String-formatted to Object-formatted if needed |
| 986 | // (we check in cache first) |
| 987 | options = typeof options === "string" ? |
| 988 | ( optionsCache[ options ] || createOptions( options ) ) : |
| 989 | jQuery.extend( {}, options ); |
| 990 | |
| 991 | var // Last fire value (for non-forgettable lists) |
| 992 | memory, |
| 993 | // Flag to know if list was already fired |
| 994 | fired, |
| 995 | // Flag to know if list is currently firing |
| 996 | firing, |
| 997 | // First callback to fire (used internally by add and fireWith) |
| 998 | firingStart, |
| 999 | // End of the loop when firing |
| 1000 | firingLength, |
| 1001 | // Index of currently firing callback (modified by remove if needed) |
| 1002 | firingIndex, |
| 1003 | // Actual callback list |
| 1004 | list = [], |
| 1005 | // Stack of fire calls for repeatable lists |
| 1006 | stack = !options.once && [], |
| 1007 | // Fire callbacks |
| 1008 | fire = function( data ) { |
| 1009 | memory = options.memory && data; |
| 1010 | fired = true; |
| 1011 | firingIndex = firingStart || 0; |
| 1012 | firingStart = 0; |
| 1013 | firingLength = list.length; |
| 1014 | firing = true; |
| 1015 | for ( ; list && firingIndex < firingLength; firingIndex++ ) { |
| 1016 | if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { |
| 1017 | memory = false; // To prevent further calls using add |
| 1018 | break; |
| 1019 | } |
| 1020 | } |
| 1021 | firing = false; |
| 1022 | if ( list ) { |
| 1023 | if ( stack ) { |
| 1024 | if ( stack.length ) { |
| 1025 | fire( stack.shift() ); |
| 1026 | } |
| 1027 | } else if ( memory ) { |
| 1028 | list = []; |
| 1029 | } else { |
| 1030 | self.disable(); |
| 1031 | } |
| 1032 | } |
| 1033 | }, |
| 1034 | // Actual Callbacks object |
| 1035 | self = { |
| 1036 | // Add a callback or a collection of callbacks to the list |
| 1037 | add: function() { |
| 1038 | if ( list ) { |
| 1039 | // First, we save the current length |
| 1040 | var start = list.length; |
| 1041 | (function add( args ) { |
| 1042 | jQuery.each( args, function( _, arg ) { |
| 1043 | var type = jQuery.type( arg ); |
| 1044 | if ( type === "function" ) { |
| 1045 | if ( !options.unique || !self.has( arg ) ) { |
| 1046 | list.push( arg ); |
| 1047 | } |
| 1048 | } else if ( arg && arg.length && type !== "string" ) { |
| 1049 | // Inspect recursively |
| 1050 | add( arg ); |
| 1051 | } |
| 1052 | }); |
| 1053 | })( arguments ); |
| 1054 | // Do we need to add the callbacks to the |
| 1055 | // current firing batch? |
| 1056 | if ( firing ) { |
| 1057 | firingLength = list.length; |
| 1058 | // With memory, if we're not firing then |
| 1059 | // we should call right away |
| 1060 | } else if ( memory ) { |
| 1061 | firingStart = start; |
| 1062 | fire( memory ); |
| 1063 | } |
| 1064 | } |
| 1065 | return this; |
| 1066 | }, |
| 1067 | // Remove a callback from the list |
| 1068 | remove: function() { |
| 1069 | if ( list ) { |
| 1070 | jQuery.each( arguments, function( _, arg ) { |
| 1071 | var index; |
| 1072 | while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { |
| 1073 | list.splice( index, 1 ); |
| 1074 | // Handle firing indexes |
| 1075 | if ( firing ) { |
| 1076 | if ( index <= firingLength ) { |
| 1077 | firingLength--; |
| 1078 | } |
| 1079 | if ( index <= firingIndex ) { |
| 1080 | firingIndex--; |
| 1081 | } |
| 1082 | } |
| 1083 | } |
| 1084 | }); |
| 1085 | } |
| 1086 | return this; |
| 1087 | }, |
| 1088 | // Control if a given callback is in the list |
| 1089 | has: function( fn ) { |
| 1090 | return jQuery.inArray( fn, list ) > -1; |
| 1091 | }, |
| 1092 | // Remove all callbacks from the list |
| 1093 | empty: function() { |
| 1094 | list = []; |
| 1095 | return this; |
| 1096 | }, |
| 1097 | // Have the list do nothing anymore |
| 1098 | disable: function() { |
| 1099 | list = stack = memory = undefined; |
| 1100 | return this; |
| 1101 | }, |
| 1102 | // Is it disabled? |
| 1103 | disabled: function() { |
| 1104 | return !list; |
| 1105 | }, |
| 1106 | // Lock the list in its current state |
| 1107 | lock: function() { |
| 1108 | stack = undefined; |
| 1109 | if ( !memory ) { |
| 1110 | self.disable(); |
| 1111 | } |
| 1112 | return this; |
| 1113 | }, |
| 1114 | // Is it locked? |
| 1115 | locked: function() { |
| 1116 | return !stack; |
| 1117 | }, |
| 1118 | // Call all callbacks with the given context and arguments |
| 1119 | fireWith: function( context, args ) { |
| 1120 | args = args || []; |
| 1121 | args = [ context, args.slice ? args.slice() : args ]; |
| 1122 | if ( list && ( !fired || stack ) ) { |
| 1123 | if ( firing ) { |
| 1124 | stack.push( args ); |
| 1125 | } else { |
| 1126 | fire( args ); |
| 1127 | } |
| 1128 | } |
| 1129 | return this; |
| 1130 | }, |
| 1131 | // Call all the callbacks with the given arguments |
| 1132 | fire: function() { |
| 1133 | self.fireWith( this, arguments ); |
| 1134 | return this; |
| 1135 | }, |
| 1136 | // To know if the callbacks have already been called at least once |
| 1137 | fired: function() { |
| 1138 | return !!fired; |
| 1139 | } |
| 1140 | }; |
| 1141 | |
| 1142 | return self; |
| 1143 | }; |
| 1144 | jQuery.extend({ |
| 1145 | |
| 1146 | Deferred: function( func ) { |
| 1147 | var tuples = [ |
| 1148 | // action, add listener, listener list, final state |
| 1149 | [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], |
| 1150 | [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], |
| 1151 | [ "notify", "progress", jQuery.Callbacks("memory") ] |
| 1152 | ], |
| 1153 | state = "pending", |
| 1154 | promise = { |
| 1155 | state: function() { |
| 1156 | return state; |
| 1157 | }, |
| 1158 | always: function() { |
| 1159 | deferred.done( arguments ).fail( arguments ); |
| 1160 | return this; |
| 1161 | }, |
| 1162 | then: function( /* fnDone, fnFail, fnProgress */ ) { |
| 1163 | var fns = arguments; |
| 1164 | return jQuery.Deferred(function( newDefer ) { |
| 1165 | jQuery.each( tuples, function( i, tuple ) { |
| 1166 | var action = tuple[ 0 ], |
| 1167 | fn = fns[ i ]; |
| 1168 | // deferred[ done | fail | progress ] for forwarding actions to newDefer |
| 1169 | deferred[ tuple[1] ]( jQuery.isFunction( fn ) ? |
| 1170 | function() { |
| 1171 | var returned = fn.apply( this, arguments ); |
| 1172 | if ( returned && jQuery.isFunction( returned.promise ) ) { |
| 1173 | returned.promise() |
| 1174 | .done( newDefer.resolve ) |
| 1175 | .fail( newDefer.reject ) |
| 1176 | .progress( newDefer.notify ); |
| 1177 | } else { |
| 1178 | newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, [ returned ] ); |
| 1179 | } |
| 1180 | } : |
| 1181 | newDefer[ action ] |
| 1182 | ); |
| 1183 | }); |
| 1184 | fns = null; |
| 1185 | }).promise(); |
| 1186 | }, |
| 1187 | // Get a promise for this deferred |
| 1188 | // If obj is provided, the promise aspect is added to the object |
| 1189 | promise: function( obj ) { |
| 1190 | return obj != null ? jQuery.extend( obj, promise ) : promise; |
| 1191 | } |
| 1192 | }, |
| 1193 | deferred = {}; |
| 1194 | |
| 1195 | // Keep pipe for back-compat |
| 1196 | promise.pipe = promise.then; |
| 1197 | |
| 1198 | // Add list-specific methods |
| 1199 | jQuery.each( tuples, function( i, tuple ) { |
| 1200 | var list = tuple[ 2 ], |
| 1201 | stateString = tuple[ 3 ]; |
| 1202 | |
| 1203 | // promise[ done | fail | progress ] = list.add |
| 1204 | promise[ tuple[1] ] = list.add; |
| 1205 | |
| 1206 | // Handle state |
| 1207 | if ( stateString ) { |
| 1208 | list.add(function() { |
| 1209 | // state = [ resolved | rejected ] |
| 1210 | state = stateString; |
| 1211 | |
| 1212 | // [ reject_list | resolve_list ].disable; progress_list.lock |
| 1213 | }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); |
| 1214 | } |
| 1215 | |
| 1216 | // deferred[ resolve | reject | notify ] |
| 1217 | deferred[ tuple[0] ] = function() { |
| 1218 | deferred[ tuple[0] + "With" ]( promise, arguments ); |
| 1219 | return this; |
| 1220 | }; |
| 1221 | deferred[ tuple[0] + "With" ] = list.fireWith; |
| 1222 | }); |
| 1223 | |
| 1224 | // Make the deferred a promise |
| 1225 | promise.promise( deferred ); |
| 1226 | |
| 1227 | // Call given func if any |
| 1228 | if ( func ) { |
| 1229 | func.call( deferred, deferred ); |
| 1230 | } |
| 1231 | |
| 1232 | // All done! |
| 1233 | return deferred; |
| 1234 | }, |
| 1235 | |
| 1236 | // Deferred helper |
| 1237 | when: function( subordinate /* , ..., subordinateN */ ) { |
| 1238 | var i = 0, |
| 1239 | resolveValues = core_slice.call( arguments ), |
| 1240 | length = resolveValues.length, |
| 1241 | |
| 1242 | // the count of uncompleted subordinates |
| 1243 | remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, |
| 1244 | |
| 1245 | // the master Deferred. If resolveValues consist of only a single Deferred, just use that. |
| 1246 | deferred = remaining === 1 ? subordinate : jQuery.Deferred(), |
| 1247 | |
| 1248 | // Update function for both resolve and progress values |
| 1249 | updateFunc = function( i, contexts, values ) { |
| 1250 | return function( value ) { |
| 1251 | contexts[ i ] = this; |
| 1252 | values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; |
| 1253 | if( values === progressValues ) { |
| 1254 | deferred.notifyWith( contexts, values ); |
| 1255 | } else if ( !( --remaining ) ) { |
| 1256 | deferred.resolveWith( contexts, values ); |
| 1257 | } |
| 1258 | }; |
| 1259 | }, |
| 1260 | |
| 1261 | progressValues, progressContexts, resolveContexts; |
| 1262 | |
| 1263 | // add listeners to Deferred subordinates; treat others as resolved |
| 1264 | if ( length > 1 ) { |
| 1265 | progressValues = new Array( length ); |
| 1266 | progressContexts = new Array( length ); |
| 1267 | resolveContexts = new Array( length ); |
| 1268 | for ( ; i < length; i++ ) { |
| 1269 | if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { |
| 1270 | resolveValues[ i ].promise() |
| 1271 | .done( updateFunc( i, resolveContexts, resolveValues ) ) |
| 1272 | .fail( deferred.reject ) |
| 1273 | .progress( updateFunc( i, progressContexts, progressValues ) ); |
| 1274 | } else { |
| 1275 | --remaining; |
| 1276 | } |
| 1277 | } |
| 1278 | } |
| 1279 | |
| 1280 | // if we're not waiting on anything, resolve the master |
| 1281 | if ( !remaining ) { |
| 1282 | deferred.resolveWith( resolveContexts, resolveValues ); |
| 1283 | } |
| 1284 | |
| 1285 | return deferred.promise(); |
| 1286 | } |
| 1287 | }); |
| 1288 | jQuery.support = (function() { |
| 1289 | |
| 1290 | var support, |
| 1291 | all, |
| 1292 | a, |
| 1293 | select, |
| 1294 | opt, |
| 1295 | input, |
| 1296 | fragment, |
| 1297 | eventName, |
| 1298 | i, |
| 1299 | isSupported, |
| 1300 | clickFn, |
| 1301 | div = document.createElement("div"); |
| 1302 | |
| 1303 | // Setup |
| 1304 | div.setAttribute( "className", "t" ); |
| 1305 | div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; |
| 1306 | |
| 1307 | // Support tests won't run in some limited or non-browser environments |
| 1308 | all = div.getElementsByTagName("*"); |
| 1309 | a = div.getElementsByTagName("a")[ 0 ]; |
| 1310 | if ( !all || !a || !all.length ) { |
| 1311 | return {}; |
| 1312 | } |
| 1313 | |
| 1314 | // First batch of tests |
| 1315 | select = document.createElement("select"); |
| 1316 | opt = select.appendChild( document.createElement("option") ); |
| 1317 | input = div.getElementsByTagName("input")[ 0 ]; |
| 1318 | |
| 1319 | a.style.cssText = "top:1px;float:left;opacity:.5"; |
| 1320 | support = { |
| 1321 | // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) |
| 1322 | getSetAttribute: div.className !== "t", |
| 1323 | |
| 1324 | // IE strips leading whitespace when .innerHTML is used |
| 1325 | leadingWhitespace: div.firstChild.nodeType === 3, |
| 1326 | |
| 1327 | // Make sure that tbody elements aren't automatically inserted |
| 1328 | // IE will insert them into empty tables |
| 1329 | tbody: !div.getElementsByTagName("tbody").length, |
| 1330 | |
| 1331 | // Make sure that link elements get serialized correctly by innerHTML |
| 1332 | // This requires a wrapper element in IE |
| 1333 | htmlSerialize: !!div.getElementsByTagName("link").length, |
| 1334 | |
| 1335 | // Get the style information from getAttribute |
| 1336 | // (IE uses .cssText instead) |
| 1337 | style: /top/.test( a.getAttribute("style") ), |
| 1338 | |
| 1339 | // Make sure that URLs aren't manipulated |
| 1340 | // (IE normalizes it by default) |
| 1341 | hrefNormalized: a.getAttribute("href") === "/a", |
| 1342 | |
| 1343 | // Make sure that element opacity exists |
| 1344 | // (IE uses filter instead) |
| 1345 | // Use a regex to work around a WebKit issue. See #5145 |
| 1346 | opacity: /^0.5/.test( a.style.opacity ), |
| 1347 | |
| 1348 | // Verify style float existence |
| 1349 | // (IE uses styleFloat instead of cssFloat) |
| 1350 | cssFloat: !!a.style.cssFloat, |
| 1351 | |
| 1352 | // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) |
| 1353 | checkOn: !!input.value, |
| 1354 | |
| 1355 | // Make sure that a selected-by-default option has a working selected property. |
| 1356 | // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) |
| 1357 | optSelected: opt.selected, |
| 1358 | |
| 1359 | // Tests for enctype support on a form (#6743) |
| 1360 | enctype: !!document.createElement("form").enctype, |
| 1361 | |
| 1362 | // Makes sure cloning an html5 element does not cause problems |
| 1363 | // Where outerHTML is undefined, this still works |
| 1364 | html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>", |
| 1365 | |
| 1366 | // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode |
| 1367 | boxModel: document.compatMode === "CSS1Compat", |
| 1368 | |
| 1369 | // Will be defined later |
| 1370 | submitBubbles: true, |
| 1371 | changeBubbles: true, |
| 1372 | focusinBubbles: false, |
| 1373 | deleteExpando: true, |
| 1374 | noCloneEvent: true, |
| 1375 | inlineBlockNeedsLayout: false, |
| 1376 | shrinkWrapBlocks: false, |
| 1377 | reliableMarginRight: true, |
| 1378 | boxSizingReliable: true, |
| 1379 | pixelPosition: false |
| 1380 | }; |
| 1381 | |
| 1382 | // Make sure checked status is properly cloned |
| 1383 | input.checked = true; |
| 1384 | support.noCloneChecked = input.cloneNode( true ).checked; |
| 1385 | |
| 1386 | // Make sure that the options inside disabled selects aren't marked as disabled |
| 1387 | // (WebKit marks them as disabled) |
| 1388 | select.disabled = true; |
| 1389 | support.optDisabled = !opt.disabled; |
| 1390 | |
| 1391 | // Test to see if it's possible to delete an expando from an element |
| 1392 | // Fails in Internet Explorer |
| 1393 | try { |
| 1394 | delete div.test; |
| 1395 | } catch( e ) { |
| 1396 | support.deleteExpando = false; |
| 1397 | } |
| 1398 | |
| 1399 | if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { |
| 1400 | div.attachEvent( "onclick", clickFn = function() { |
| 1401 | // Cloning a node shouldn't copy over any |
| 1402 | // bound event handlers (IE does this) |
| 1403 | support.noCloneEvent = false; |
| 1404 | }); |
| 1405 | div.cloneNode( true ).fireEvent("onclick"); |
| 1406 | div.detachEvent( "onclick", clickFn ); |
| 1407 | } |
| 1408 | |
| 1409 | // Check if we can trust getAttribute("value") |
| 1410 | input = document.createElement("input"); |
| 1411 | input.setAttribute( "value", "" ); |
| 1412 | support.input = input.getAttribute( "value" ) === ""; |
| 1413 | |
| 1414 | // Check if an input maintains its value after becoming a radio |
| 1415 | input.value = "t"; |
| 1416 | input.setAttribute( "type", "radio" ); |
| 1417 | support.radioValue = input.value === "t"; |
| 1418 | |
| 1419 | // #11217 - WebKit loses check when the name is after the checked attribute |
| 1420 | input.setAttribute( "checked", "checked" ); |
| 1421 | input.setAttribute( "name", "t" ); |
| 1422 | |
| 1423 | div.appendChild( input ); |
| 1424 | fragment = document.createDocumentFragment(); |
| 1425 | fragment.appendChild( div.lastChild ); |
| 1426 | |
| 1427 | // WebKit doesn't clone checked state correctly in fragments |
| 1428 | support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; |
| 1429 | |
| 1430 | // Check if a disconnected checkbox will retain its checked |
| 1431 | // value of true after appended to the DOM (IE6/7) |
| 1432 | support.appendChecked = input.checked; |
| 1433 | |
| 1434 | fragment.removeChild( input ); |
| 1435 | fragment.appendChild( div ); |
| 1436 | |
| 1437 | // Technique from Juriy Zaytsev |
| 1438 | // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ |
| 1439 | // We only care about the case where non-standard event systems |
| 1440 | // are used, namely in IE. Short-circuiting here helps us to |
| 1441 | // avoid an eval call (in setAttribute) which can cause CSP |
| 1442 | // to go haywire. See: https://developer.mozilla.org/en/Security/CSP |
| 1443 | if ( div.attachEvent ) { |
| 1444 | for ( i in { |
| 1445 | submit: true, |
| 1446 | change: true, |
| 1447 | focusin: true |
| 1448 | }) { |
| 1449 | eventName = "on" + i; |
| 1450 | isSupported = ( eventName in div ); |
| 1451 | if ( !isSupported ) { |
| 1452 | div.setAttribute( eventName, "return;" ); |
| 1453 | isSupported = ( typeof div[ eventName ] === "function" ); |
| 1454 | } |
| 1455 | support[ i + "Bubbles" ] = isSupported; |
| 1456 | } |
| 1457 | } |
| 1458 | |
| 1459 | // Run tests that need a body at doc ready |
| 1460 | jQuery(function() { |
| 1461 | var container, div, tds, marginDiv, |
| 1462 | divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", |
| 1463 | body = document.getElementsByTagName("body")[0]; |
| 1464 | |
| 1465 | if ( !body ) { |
| 1466 | // Return for frameset docs that don't have a body |
| 1467 | return; |
| 1468 | } |
| 1469 | |
| 1470 | container = document.createElement("div"); |
| 1471 | container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px"; |
| 1472 | body.insertBefore( container, body.firstChild ); |
| 1473 | |
| 1474 | // Construct the test element |
| 1475 | div = document.createElement("div"); |
| 1476 | container.appendChild( div ); |
| 1477 | |
| 1478 | // Check if table cells still have offsetWidth/Height when they are set |
| 1479 | // to display:none and there are still other visible table cells in a |
| 1480 | // table row; if so, offsetWidth/Height are not reliable for use when |
| 1481 | // determining if an element has been hidden directly using |
| 1482 | // display:none (it is still safe to use offsets if a parent element is |
| 1483 | // hidden; don safety goggles and see bug #4512 for more information). |
| 1484 | // (only IE 8 fails this test) |
| 1485 | div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; |
| 1486 | tds = div.getElementsByTagName("td"); |
| 1487 | tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; |
| 1488 | isSupported = ( tds[ 0 ].offsetHeight === 0 ); |
| 1489 | |
| 1490 | tds[ 0 ].style.display = ""; |
| 1491 | tds[ 1 ].style.display = "none"; |
| 1492 | |
| 1493 | // Check if empty table cells still have offsetWidth/Height |
| 1494 | // (IE <= 8 fail this test) |
| 1495 | support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); |
| 1496 | |
| 1497 | // Check box-sizing and margin behavior |
| 1498 | div.innerHTML = ""; |
| 1499 | div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; |
| 1500 | support.boxSizing = ( div.offsetWidth === 4 ); |
| 1501 | support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); |
| 1502 | |
| 1503 | // NOTE: To any future maintainer, we've window.getComputedStyle |
| 1504 | // because jsdom on node.js will break without it. |
| 1505 | if ( window.getComputedStyle ) { |
| 1506 | support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; |
| 1507 | support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; |
| 1508 | |
| 1509 | // Check if div with explicit width and no margin-right incorrectly |
| 1510 | // gets computed margin-right based on width of container. For more |
| 1511 | // info see bug #3333 |
| 1512 | // Fails in WebKit before Feb 2011 nightlies |
| 1513 | // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right |
| 1514 | marginDiv = document.createElement("div"); |
| 1515 | marginDiv.style.cssText = div.style.cssText = divReset; |
| 1516 | marginDiv.style.marginRight = marginDiv.style.width = "0"; |
| 1517 | div.style.width = "1px"; |
| 1518 | div.appendChild( marginDiv ); |
| 1519 | support.reliableMarginRight = |
| 1520 | !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); |
| 1521 | } |
| 1522 | |
| 1523 | if ( typeof div.style.zoom !== "undefined" ) { |
| 1524 | // Check if natively block-level elements act like inline-block |
| 1525 | // elements when setting their display to 'inline' and giving |
| 1526 | // them layout |
| 1527 | // (IE < 8 does this) |
| 1528 | div.innerHTML = ""; |
| 1529 | div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; |
| 1530 | support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); |
| 1531 | |
| 1532 | // Check if elements with layout shrink-wrap their children |
| 1533 | // (IE 6 does this) |
| 1534 | div.style.display = "block"; |
| 1535 | div.style.overflow = "visible"; |
| 1536 | div.innerHTML = "<div></div>"; |
| 1537 | div.firstChild.style.width = "5px"; |
| 1538 | support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); |
| 1539 | |
| 1540 | // Prevent IE 6 from affecting layout for positioned elements #11048 |
| 1541 | // Prevent IE from shrinking the body in IE 7 mode #12869 |
| 1542 | body.style.zoom = 1; |
| 1543 | } |
| 1544 | |
| 1545 | // Null elements to avoid leaks in IE |
| 1546 | body.removeChild( container ); |
| 1547 | container = div = tds = marginDiv = null; |
| 1548 | }); |
| 1549 | |
| 1550 | // Null elements to avoid leaks in IE |
| 1551 | fragment.removeChild( div ); |
| 1552 | all = a = select = opt = input = fragment = div = null; |
| 1553 | |
| 1554 | return support; |
| 1555 | })(); |
| 1556 | var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, |
| 1557 | rmultiDash = /([A-Z])/g; |
| 1558 | |
| 1559 | function internalData( elem, name, data, pvt /* Internal Use Only */ ){ |
| 1560 | if ( !jQuery.acceptData( elem ) ) { |
| 1561 | return; |
| 1562 | } |
| 1563 | |
| 1564 | var thisCache, ret, |
| 1565 | internalKey = jQuery.expando, |
| 1566 | getByName = typeof name === "string", |
| 1567 | |
| 1568 | // We have to handle DOM nodes and JS objects differently because IE6-7 |
| 1569 | // can't GC object references properly across the DOM-JS boundary |
| 1570 | isNode = elem.nodeType, |
| 1571 | |
| 1572 | // Only DOM nodes need the global jQuery cache; JS object data is |
| 1573 | // attached directly to the object so GC can occur automatically |
| 1574 | cache = isNode ? jQuery.cache : elem, |
| 1575 | |
| 1576 | // Only defining an ID for JS objects if its cache already exists allows |
| 1577 | // the code to shortcut on the same path as a DOM node with no cache |
| 1578 | id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; |
| 1579 | |
| 1580 | // Avoid doing any more work than we need to when trying to get data on an |
| 1581 | // object that has no data at all |
| 1582 | if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { |
| 1583 | return; |
| 1584 | } |
| 1585 | |
| 1586 | if ( !id ) { |
| 1587 | // Only DOM nodes need a new unique ID for each element since their data |
| 1588 | // ends up in the global cache |
| 1589 | if ( isNode ) { |
| 1590 | elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++; |
| 1591 | } else { |
| 1592 | id = internalKey; |
| 1593 | } |
| 1594 | } |
| 1595 | |
| 1596 | if ( !cache[ id ] ) { |
| 1597 | cache[ id ] = {}; |
| 1598 | |
| 1599 | // Avoids exposing jQuery metadata on plain JS objects when the object |
| 1600 | // is serialized using JSON.stringify |
| 1601 | if ( !isNode ) { |
| 1602 | cache[ id ].toJSON = jQuery.noop; |
| 1603 | } |
| 1604 | } |
| 1605 | |
| 1606 | // An object can be passed to jQuery.data instead of a key/value pair; this gets |
| 1607 | // shallow copied over onto the existing cache |
| 1608 | if ( typeof name === "object" || typeof name === "function" ) { |
| 1609 | if ( pvt ) { |
| 1610 | cache[ id ] = jQuery.extend( cache[ id ], name ); |
| 1611 | } else { |
| 1612 | cache[ id ].data = jQuery.extend( cache[ id ].data, name ); |
| 1613 | } |
| 1614 | } |
| 1615 | |
| 1616 | thisCache = cache[ id ]; |
| 1617 | |
| 1618 | // jQuery data() is stored in a separate object inside the object's internal data |
| 1619 | // cache in order to avoid key collisions between internal data and user-defined |
| 1620 | // data. |
| 1621 | if ( !pvt ) { |
| 1622 | if ( !thisCache.data ) { |
| 1623 | thisCache.data = {}; |
| 1624 | } |
| 1625 | |
| 1626 | thisCache = thisCache.data; |
| 1627 | } |
| 1628 | |
| 1629 | if ( data !== undefined ) { |
| 1630 | thisCache[ jQuery.camelCase( name ) ] = data; |
| 1631 | } |
| 1632 | |
| 1633 | // Check for both converted-to-camel and non-converted data property names |
| 1634 | // If a data property was specified |
| 1635 | if ( getByName ) { |
| 1636 | |
| 1637 | // First Try to find as-is property data |
| 1638 | ret = thisCache[ name ]; |
| 1639 | |
| 1640 | // Test for null|undefined property data |
| 1641 | if ( ret == null ) { |
| 1642 | |
| 1643 | // Try to find the camelCased property |
| 1644 | ret = thisCache[ jQuery.camelCase( name ) ]; |
| 1645 | } |
| 1646 | } else { |
| 1647 | ret = thisCache; |
| 1648 | } |
| 1649 | |
| 1650 | return ret; |
| 1651 | } |
| 1652 | |
| 1653 | function internalRemoveData( elem, name, pvt /* For internal use only */ ){ |
| 1654 | if ( !jQuery.acceptData( elem ) ) { |
| 1655 | return; |
| 1656 | } |
| 1657 | |
| 1658 | var thisCache, i, l, |
| 1659 | |
| 1660 | isNode = elem.nodeType, |
| 1661 | |
| 1662 | // See jQuery.data for more information |
| 1663 | cache = isNode ? jQuery.cache : elem, |
| 1664 | id = isNode ? elem[ jQuery.expando ] : jQuery.expando; |
| 1665 | |
| 1666 | // If there is already no cache entry for this object, there is no |
| 1667 | // purpose in continuing |
| 1668 | if ( !cache[ id ] ) { |
| 1669 | return; |
| 1670 | } |
| 1671 | |
| 1672 | if ( name ) { |
| 1673 | |
| 1674 | thisCache = pvt ? cache[ id ] : cache[ id ].data; |
| 1675 | |
| 1676 | if ( thisCache ) { |
| 1677 | |
| 1678 | // Support array or space separated string names for data keys |
| 1679 | if ( !jQuery.isArray( name ) ) { |
| 1680 | |
| 1681 | // try the string as a key before any manipulation |
| 1682 | if ( name in thisCache ) { |
| 1683 | name = [ name ]; |
| 1684 | } else { |
| 1685 | |
| 1686 | // split the camel cased version by spaces unless a key with the spaces exists |
| 1687 | name = jQuery.camelCase( name ); |
| 1688 | if ( name in thisCache ) { |
| 1689 | name = [ name ]; |
| 1690 | } else { |
| 1691 | name = name.split(" "); |
| 1692 | } |
| 1693 | } |
| 1694 | } else { |
| 1695 | // If "name" is an array of keys... |
| 1696 | // When data is initially created, via ("key", "val") signature, |
| 1697 | // keys will be converted to camelCase. |
| 1698 | // Since there is no way to tell _how_ a key was added, remove |
| 1699 | // both plain key and camelCase key. #12786 |
| 1700 | // This will only penalize the array argument path. |
| 1701 | name = name.concat( jQuery.map( name, jQuery.camelCase ) ); |
| 1702 | } |
| 1703 | |
| 1704 | for ( i = 0, l = name.length; i < l; i++ ) { |
| 1705 | delete thisCache[ name[i] ]; |
| 1706 | } |
| 1707 | |
| 1708 | // If there is no data left in the cache, we want to continue |
| 1709 | // and let the cache object itself get destroyed |
| 1710 | if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { |
| 1711 | return; |
| 1712 | } |
| 1713 | } |
| 1714 | } |
| 1715 | |
| 1716 | // See jQuery.data for more information |
| 1717 | if ( !pvt ) { |
| 1718 | delete cache[ id ].data; |
| 1719 | |
| 1720 | // Don't destroy the parent cache unless the internal data object |
| 1721 | // had been the only thing left in it |
| 1722 | if ( !isEmptyDataObject( cache[ id ] ) ) { |
| 1723 | return; |
| 1724 | } |
| 1725 | } |
| 1726 | |
| 1727 | // Destroy the cache |
| 1728 | if ( isNode ) { |
| 1729 | jQuery.cleanData( [ elem ], true ); |
| 1730 | |
| 1731 | // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) |
| 1732 | } else if ( jQuery.support.deleteExpando || cache != cache.window ) { |
| 1733 | delete cache[ id ]; |
| 1734 | |
| 1735 | // When all else fails, null |
| 1736 | } else { |
| 1737 | cache[ id ] = null; |
| 1738 | } |
| 1739 | } |
| 1740 | |
| 1741 | jQuery.extend({ |
| 1742 | cache: {}, |
| 1743 | |
| 1744 | // Unique for each copy of jQuery on the page |
| 1745 | // Non-digits removed to match rinlinejQuery |
| 1746 | expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), |
| 1747 | |
| 1748 | // The following elements throw uncatchable exceptions if you |
| 1749 | // attempt to add expando properties to them. |
| 1750 | noData: { |
| 1751 | "embed": true, |
| 1752 | // Ban all objects except for Flash (which handle expandos) |
| 1753 | "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", |
| 1754 | "applet": true |
| 1755 | }, |
| 1756 | |
| 1757 | hasData: function( elem ) { |
| 1758 | elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; |
| 1759 | return !!elem && !isEmptyDataObject( elem ); |
| 1760 | }, |
| 1761 | |
| 1762 | data: function( elem, name, data ) { |
| 1763 | return internalData( elem, name, data, false ); |
| 1764 | }, |
| 1765 | |
| 1766 | removeData: function( elem, name ) { |
| 1767 | return internalRemoveData( elem, name, false ); |
| 1768 | }, |
| 1769 | |
| 1770 | // For internal use only. |
| 1771 | _data: function( elem, name, data ) { |
| 1772 | return internalData( elem, name, data, true ); |
| 1773 | }, |
| 1774 | |
| 1775 | _removeData: function( elem, name ) { |
| 1776 | return internalRemoveData( elem, name, true ); |
| 1777 | }, |
| 1778 | |
| 1779 | // A method for determining if a DOM node can handle the data expando |
| 1780 | acceptData: function( elem ) { |
| 1781 | var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; |
| 1782 | |
| 1783 | // nodes accept data unless otherwise specified; rejection can be conditional |
| 1784 | return !noData || noData !== true && elem.getAttribute("classid") === noData; |
| 1785 | } |
| 1786 | }); |
| 1787 | |
| 1788 | jQuery.fn.extend({ |
| 1789 | data: function( key, value ) { |
| 1790 | var attrs, name, |
| 1791 | elem = this[0], |
| 1792 | i = 0, |
| 1793 | data = null; |
| 1794 | |
| 1795 | // Gets all values |
| 1796 | if ( key === undefined ) { |
| 1797 | if ( this.length ) { |
| 1798 | data = jQuery.data( elem ); |
| 1799 | |
| 1800 | if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { |
| 1801 | attrs = elem.attributes; |
| 1802 | for ( ; i < attrs.length; i++ ) { |
| 1803 | name = attrs[i].name; |
| 1804 | |
| 1805 | if ( !name.indexOf( "data-" ) ) { |
| 1806 | name = jQuery.camelCase( name.substring(5) ); |
| 1807 | |
| 1808 | dataAttr( elem, name, data[ name ] ); |
| 1809 | } |
| 1810 | } |
| 1811 | jQuery._data( elem, "parsedAttrs", true ); |
| 1812 | } |
| 1813 | } |
| 1814 | |
| 1815 | return data; |
| 1816 | } |
| 1817 | |
| 1818 | // Sets multiple values |
| 1819 | if ( typeof key === "object" ) { |
| 1820 | return this.each(function() { |
| 1821 | jQuery.data( this, key ); |
| 1822 | }); |
| 1823 | } |
| 1824 | |
| 1825 | return jQuery.access( this, function( value ) { |
| 1826 | |
| 1827 | if ( value === undefined ) { |
| 1828 | // Try to fetch any internally stored data first |
| 1829 | return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; |
| 1830 | } |
| 1831 | |
| 1832 | this.each(function() { |
| 1833 | jQuery.data( this, key, value ); |
| 1834 | }); |
| 1835 | }, null, value, arguments.length > 1, null, true ); |
| 1836 | }, |
| 1837 | |
| 1838 | removeData: function( key ) { |
| 1839 | return this.each(function() { |
| 1840 | jQuery.removeData( this, key ); |
| 1841 | }); |
| 1842 | } |
| 1843 | }); |
| 1844 | |
| 1845 | function dataAttr( elem, key, data ) { |
| 1846 | // If nothing was found internally, try to fetch any |
| 1847 | // data from the HTML5 data-* attribute |
| 1848 | if ( data === undefined && elem.nodeType === 1 ) { |
| 1849 | |
| 1850 | var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); |
| 1851 | |
| 1852 | data = elem.getAttribute( name ); |
| 1853 | |
| 1854 | if ( typeof data === "string" ) { |
| 1855 | try { |
| 1856 | data = data === "true" ? true : |
| 1857 | data === "false" ? false : |
| 1858 | data === "null" ? null : |
| 1859 | // Only convert to a number if it doesn't change the string |
| 1860 | +data + "" === data ? +data : |
| 1861 | rbrace.test( data ) ? jQuery.parseJSON( data ) : |
| 1862 | data; |
| 1863 | } catch( e ) {} |
| 1864 | |
| 1865 | // Make sure we set the data so it isn't changed later |
| 1866 | jQuery.data( elem, key, data ); |
| 1867 | |
| 1868 | } else { |
| 1869 | data = undefined; |
| 1870 | } |
| 1871 | } |
| 1872 | |
| 1873 | return data; |
| 1874 | } |
| 1875 | |
| 1876 | // checks a cache object for emptiness |
| 1877 | function isEmptyDataObject( obj ) { |
| 1878 | var name; |
| 1879 | for ( name in obj ) { |
| 1880 | |
| 1881 | // if the public data object is empty, the private is still empty |
| 1882 | if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { |
| 1883 | continue; |
| 1884 | } |
| 1885 | if ( name !== "toJSON" ) { |
| 1886 | return false; |
| 1887 | } |
| 1888 | } |
| 1889 | |
| 1890 | return true; |
| 1891 | } |
| 1892 | jQuery.extend({ |
| 1893 | queue: function( elem, type, data ) { |
| 1894 | var queue; |
| 1895 | |
| 1896 | if ( elem ) { |
| 1897 | type = ( type || "fx" ) + "queue"; |
| 1898 | queue = jQuery._data( elem, type ); |
| 1899 | |
| 1900 | // Speed up dequeue by getting out quickly if this is just a lookup |
| 1901 | if ( data ) { |
| 1902 | if ( !queue || jQuery.isArray(data) ) { |
| 1903 | queue = jQuery._data( elem, type, jQuery.makeArray(data) ); |
| 1904 | } else { |
| 1905 | queue.push( data ); |
| 1906 | } |
| 1907 | } |
| 1908 | return queue || []; |
| 1909 | } |
| 1910 | }, |
| 1911 | |
| 1912 | dequeue: function( elem, type ) { |
| 1913 | type = type || "fx"; |
| 1914 | |
| 1915 | var queue = jQuery.queue( elem, type ), |
| 1916 | startLength = queue.length, |
| 1917 | fn = queue.shift(), |
| 1918 | hooks = jQuery._queueHooks( elem, type ), |
| 1919 | next = function() { |
| 1920 | jQuery.dequeue( elem, type ); |
| 1921 | }; |
| 1922 | |
| 1923 | // If the fx queue is dequeued, always remove the progress sentinel |
| 1924 | if ( fn === "inprogress" ) { |
| 1925 | fn = queue.shift(); |
| 1926 | startLength--; |
| 1927 | } |
| 1928 | |
| 1929 | if ( fn ) { |
| 1930 | |
| 1931 | // Add a progress sentinel to prevent the fx queue from being |
| 1932 | // automatically dequeued |
| 1933 | if ( type === "fx" ) { |
| 1934 | queue.unshift( "inprogress" ); |
| 1935 | } |
| 1936 | |
| 1937 | // clear up the last queue stop function |
| 1938 | delete hooks.stop; |
| 1939 | fn.call( elem, next, hooks ); |
| 1940 | } |
| 1941 | |
| 1942 | if ( !startLength && hooks ) { |
| 1943 | hooks.empty.fire(); |
| 1944 | } |
| 1945 | }, |
| 1946 | |
| 1947 | // not intended for public consumption - generates a queueHooks object, or returns the current one |
| 1948 | _queueHooks: function( elem, type ) { |
| 1949 | var key = type + "queueHooks"; |
| 1950 | return jQuery._data( elem, key ) || jQuery._data( elem, key, { |
| 1951 | empty: jQuery.Callbacks("once memory").add(function() { |
| 1952 | jQuery._removeData( elem, type + "queue" ); |
| 1953 | jQuery._removeData( elem, key ); |
| 1954 | }) |
| 1955 | }); |
| 1956 | } |
| 1957 | }); |
| 1958 | |
| 1959 | jQuery.fn.extend({ |
| 1960 | queue: function( type, data ) { |
| 1961 | var setter = 2; |
| 1962 | |
| 1963 | if ( typeof type !== "string" ) { |
| 1964 | data = type; |
| 1965 | type = "fx"; |
| 1966 | setter--; |
| 1967 | } |
| 1968 | |
| 1969 | if ( arguments.length < setter ) { |
| 1970 | return jQuery.queue( this[0], type ); |
| 1971 | } |
| 1972 | |
| 1973 | return data === undefined ? |
| 1974 | this : |
| 1975 | this.each(function() { |
| 1976 | var queue = jQuery.queue( this, type, data ); |
| 1977 | |
| 1978 | // ensure a hooks for this queue |
| 1979 | jQuery._queueHooks( this, type ); |
| 1980 | |
| 1981 | if ( type === "fx" && queue[0] !== "inprogress" ) { |
| 1982 | jQuery.dequeue( this, type ); |
| 1983 | } |
| 1984 | }); |
| 1985 | }, |
| 1986 | dequeue: function( type ) { |
| 1987 | return this.each(function() { |
| 1988 | jQuery.dequeue( this, type ); |
| 1989 | }); |
| 1990 | }, |
| 1991 | // Based off of the plugin by Clint Helfers, with permission. |
| 1992 | // http://blindsignals.com/index.php/2009/07/jquery-delay/ |
| 1993 | delay: function( time, type ) { |
| 1994 | time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; |
| 1995 | type = type || "fx"; |
| 1996 | |
| 1997 | return this.queue( type, function( next, hooks ) { |
| 1998 | var timeout = setTimeout( next, time ); |
| 1999 | hooks.stop = function() { |
| 2000 | clearTimeout( timeout ); |
| 2001 | }; |
| 2002 | }); |
| 2003 | }, |
| 2004 | clearQueue: function( type ) { |
| 2005 | return this.queue( type || "fx", [] ); |
| 2006 | }, |
| 2007 | // Get a promise resolved when queues of a certain type |
| 2008 | // are emptied (fx is the type by default) |
| 2009 | promise: function( type, obj ) { |
| 2010 | var tmp, |
| 2011 | count = 1, |
| 2012 | defer = jQuery.Deferred(), |
| 2013 | elements = this, |
| 2014 | i = this.length, |
| 2015 | resolve = function() { |
| 2016 | if ( !( --count ) ) { |
| 2017 | defer.resolveWith( elements, [ elements ] ); |
| 2018 | } |
| 2019 | }; |
| 2020 | |
| 2021 | if ( typeof type !== "string" ) { |
| 2022 | obj = type; |
| 2023 | type = undefined; |
| 2024 | } |
| 2025 | type = type || "fx"; |
| 2026 | |
| 2027 | while( i-- ) { |
| 2028 | tmp = jQuery._data( elements[ i ], type + "queueHooks" ); |
| 2029 | if ( tmp && tmp.empty ) { |
| 2030 | count++; |
| 2031 | tmp.empty.add( resolve ); |
| 2032 | } |
| 2033 | } |
| 2034 | resolve(); |
| 2035 | return defer.promise( obj ); |
| 2036 | } |
| 2037 | }); |
| 2038 | var nodeHook, boolHook, |
| 2039 | rclass = /[\t\r\n]/g, |
| 2040 | rreturn = /\r/g, |
| 2041 | rfocusable = /^(?:input|select|textarea|button|object)$/i, |
| 2042 | rclickable = /^(?:a|area)$/i, |
| 2043 | rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i, |
| 2044 | ruseDefault = /^(?:checked|selected)$/i, |
| 2045 | getSetAttribute = jQuery.support.getSetAttribute, |
| 2046 | getSetInput = jQuery.support.input; |
| 2047 | |
| 2048 | jQuery.fn.extend({ |
| 2049 | attr: function( name, value ) { |
| 2050 | return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); |
| 2051 | }, |
| 2052 | |
| 2053 | removeAttr: function( name ) { |
| 2054 | return this.each(function() { |
| 2055 | jQuery.removeAttr( this, name ); |
| 2056 | }); |
| 2057 | }, |
| 2058 | |
| 2059 | prop: function( name, value ) { |
| 2060 | return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); |
| 2061 | }, |
| 2062 | |
| 2063 | removeProp: function( name ) { |
| 2064 | name = jQuery.propFix[ name ] || name; |
| 2065 | return this.each(function() { |
| 2066 | // try/catch handles cases where IE balks (such as removing a property on window) |
| 2067 | try { |
| 2068 | this[ name ] = undefined; |
| 2069 | delete this[ name ]; |
| 2070 | } catch( e ) {} |
| 2071 | }); |
| 2072 | }, |
| 2073 | |
| 2074 | addClass: function( value ) { |
| 2075 | var classes, elem, cur, clazz, j, |
| 2076 | i = 0, |
| 2077 | len = this.length, |
| 2078 | proceed = typeof value === "string" && value; |
| 2079 | |
| 2080 | if ( jQuery.isFunction( value ) ) { |
| 2081 | return this.each(function( j ) { |
| 2082 | jQuery( this ).addClass( value.call( this, j, this.className ) ); |
| 2083 | }); |
| 2084 | } |
| 2085 | |
| 2086 | if ( proceed ) { |
| 2087 | // The disjunction here is for better compressibility (see removeClass) |
| 2088 | classes = ( value || "" ).match( core_rnotwhite ) || []; |
| 2089 | |
| 2090 | for ( ; i < len; i++ ) { |
| 2091 | elem = this[ i ]; |
| 2092 | cur = elem.nodeType === 1 && ( elem.className ? |
| 2093 | ( " " + elem.className + " " ).replace( rclass, " " ) : |
| 2094 | " " |
| 2095 | ); |
| 2096 | |
| 2097 | if ( cur ) { |
| 2098 | j = 0; |
| 2099 | while ( (clazz = classes[j++]) ) { |
| 2100 | if ( cur.indexOf( " " + clazz + " " ) < 0 ) { |
| 2101 | cur += clazz + " "; |
| 2102 | } |
| 2103 | } |
| 2104 | elem.className = jQuery.trim( cur ); |
| 2105 | |
| 2106 | } |
| 2107 | } |
| 2108 | } |
| 2109 | |
| 2110 | return this; |
| 2111 | }, |
| 2112 | |
| 2113 | removeClass: function( value ) { |
| 2114 | var classes, elem, cur, clazz, j, |
| 2115 | i = 0, |
| 2116 | len = this.length, |
| 2117 | proceed = arguments.length === 0 || typeof value === "string" && value; |
| 2118 | |
| 2119 | if ( jQuery.isFunction( value ) ) { |
| 2120 | return this.each(function( j ) { |
| 2121 | jQuery( this ).removeClass( value.call( this, j, this.className ) ); |
| 2122 | }); |
| 2123 | } |
| 2124 | if ( proceed ) { |
| 2125 | classes = ( value || "" ).match( core_rnotwhite ) || []; |
| 2126 | |
| 2127 | for ( ; i < len; i++ ) { |
| 2128 | elem = this[ i ]; |
| 2129 | // This expression is here for better compressibility (see addClass) |
| 2130 | cur = elem.nodeType === 1 && ( elem.className ? |
| 2131 | ( " " + elem.className + " " ).replace( rclass, " " ) : |
| 2132 | "" |
| 2133 | ); |
| 2134 | |
| 2135 | if ( cur ) { |
| 2136 | j = 0; |
| 2137 | while ( (clazz = classes[j++]) ) { |
| 2138 | // Remove *all* instances |
| 2139 | while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { |
| 2140 | cur = cur.replace( " " + clazz + " ", " " ); |
| 2141 | } |
| 2142 | } |
| 2143 | elem.className = value ? jQuery.trim( cur ) : ""; |
| 2144 | } |
| 2145 | } |
| 2146 | } |
| 2147 | |
| 2148 | return this; |
| 2149 | }, |
| 2150 | |
| 2151 | toggleClass: function( value, stateVal ) { |
| 2152 | var type = typeof value, |
| 2153 | isBool = typeof stateVal === "boolean"; |
| 2154 | |
| 2155 | if ( jQuery.isFunction( value ) ) { |
| 2156 | return this.each(function( i ) { |
| 2157 | jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); |
| 2158 | }); |
| 2159 | } |
| 2160 | |
| 2161 | return this.each(function() { |
| 2162 | if ( type === "string" ) { |
| 2163 | // toggle individual class names |
| 2164 | var className, |
| 2165 | i = 0, |
| 2166 | self = jQuery( this ), |
| 2167 | state = stateVal, |
| 2168 | classNames = value.match( core_rnotwhite ) || []; |
| 2169 | |
| 2170 | while ( (className = classNames[ i++ ]) ) { |
| 2171 | // check each className given, space separated list |
| 2172 | state = isBool ? state : !self.hasClass( className ); |
| 2173 | self[ state ? "addClass" : "removeClass" ]( className ); |
| 2174 | } |
| 2175 | |
| 2176 | // Toggle whole class name |
| 2177 | } else if ( type === "undefined" || type === "boolean" ) { |
| 2178 | if ( this.className ) { |
| 2179 | // store className if set |
| 2180 | jQuery._data( this, "__className__", this.className ); |
| 2181 | } |
| 2182 | |
| 2183 | // If the element has a class name or if we're passed "false", |
| 2184 | // then remove the whole classname (if there was one, the above saved it). |
| 2185 | // Otherwise bring back whatever was previously saved (if anything), |
| 2186 | // falling back to the empty string if nothing was stored. |
| 2187 | this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; |
| 2188 | } |
| 2189 | }); |
| 2190 | }, |
| 2191 | |
| 2192 | hasClass: function( selector ) { |
| 2193 | var className = " " + selector + " ", |
| 2194 | i = 0, |
| 2195 | l = this.length; |
| 2196 | for ( ; i < l; i++ ) { |
| 2197 | if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { |
| 2198 | return true; |
| 2199 | } |
| 2200 | } |
| 2201 | |
| 2202 | return false; |
| 2203 | }, |
| 2204 | |
| 2205 | val: function( value ) { |
| 2206 | var hooks, ret, isFunction, |
| 2207 | elem = this[0]; |
| 2208 | |
| 2209 | if ( !arguments.length ) { |
| 2210 | if ( elem ) { |
| 2211 | hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; |
| 2212 | |
| 2213 | if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { |
| 2214 | return ret; |
| 2215 | } |
| 2216 | |
| 2217 | ret = elem.value; |
| 2218 | |
| 2219 | return typeof ret === "string" ? |
| 2220 | // handle most common string cases |
| 2221 | ret.replace(rreturn, "") : |
| 2222 | // handle cases where value is null/undef or number |
| 2223 | ret == null ? "" : ret; |
| 2224 | } |
| 2225 | |
| 2226 | return; |
| 2227 | } |
| 2228 | |
| 2229 | isFunction = jQuery.isFunction( value ); |
| 2230 | |
| 2231 | return this.each(function( i ) { |
| 2232 | var val, |
| 2233 | self = jQuery(this); |
| 2234 | |
| 2235 | if ( this.nodeType !== 1 ) { |
| 2236 | return; |
| 2237 | } |
| 2238 | |
| 2239 | if ( isFunction ) { |
| 2240 | val = value.call( this, i, self.val() ); |
| 2241 | } else { |
| 2242 | val = value; |
| 2243 | } |
| 2244 | |
| 2245 | // Treat null/undefined as ""; convert numbers to string |
| 2246 | if ( val == null ) { |
| 2247 | val = ""; |
| 2248 | } else if ( typeof val === "number" ) { |
| 2249 | val += ""; |
| 2250 | } else if ( jQuery.isArray( val ) ) { |
| 2251 | val = jQuery.map(val, function ( value ) { |
| 2252 | return value == null ? "" : value + ""; |
| 2253 | }); |
| 2254 | } |
| 2255 | |
| 2256 | hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; |
| 2257 | |
| 2258 | // If set returns undefined, fall back to normal setting |
| 2259 | if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { |
| 2260 | this.value = val; |
| 2261 | } |
| 2262 | }); |
| 2263 | } |
| 2264 | }); |
| 2265 | |
| 2266 | jQuery.extend({ |
| 2267 | valHooks: { |
| 2268 | option: { |
| 2269 | get: function( elem ) { |
| 2270 | // attributes.value is undefined in Blackberry 4.7 but |
| 2271 | // uses .value. See #6932 |
| 2272 | var val = elem.attributes.value; |
| 2273 | return !val || val.specified ? elem.value : elem.text; |
| 2274 | } |
| 2275 | }, |
| 2276 | select: { |
| 2277 | get: function( elem ) { |
| 2278 | var value, option, |
| 2279 | options = elem.options, |
| 2280 | index = elem.selectedIndex, |
| 2281 | one = elem.type === "select-one" || index < 0, |
| 2282 | values = one ? null : [], |
| 2283 | max = one ? index + 1 : options.length, |
| 2284 | i = index < 0 ? |
| 2285 | max : |
| 2286 | one ? index : 0; |
| 2287 | |
| 2288 | // Loop through all the selected options |
| 2289 | for ( ; i < max; i++ ) { |
| 2290 | option = options[ i ]; |
| 2291 | |
| 2292 | // oldIE doesn't update selected after form reset (#2551) |
| 2293 | if ( ( option.selected || i === index ) && |
| 2294 | // Don't return options that are disabled or in a disabled optgroup |
| 2295 | ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && |
| 2296 | ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { |
| 2297 | |
| 2298 | // Get the specific value for the option |
| 2299 | value = jQuery( option ).val(); |
| 2300 | |
| 2301 | // We don't need an array for one selects |
| 2302 | if ( one ) { |
| 2303 | return value; |
| 2304 | } |
| 2305 | |
| 2306 | // Multi-Selects return an array |
| 2307 | values.push( value ); |
| 2308 | } |
| 2309 | } |
| 2310 | |
| 2311 | return values; |
| 2312 | }, |
| 2313 | |
| 2314 | set: function( elem, value ) { |
| 2315 | var values = jQuery.makeArray( value ); |
| 2316 | |
| 2317 | jQuery(elem).find("option").each(function() { |
| 2318 | this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; |
| 2319 | }); |
| 2320 | |
| 2321 | if ( !values.length ) { |
| 2322 | elem.selectedIndex = -1; |
| 2323 | } |
| 2324 | return values; |
| 2325 | } |
| 2326 | } |
| 2327 | }, |
| 2328 | |
| 2329 | attr: function( elem, name, value ) { |
| 2330 | var ret, hooks, notxml, |
| 2331 | nType = elem.nodeType; |
| 2332 | |
| 2333 | // don't get/set attributes on text, comment and attribute nodes |
| 2334 | if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { |
| 2335 | return; |
| 2336 | } |
| 2337 | |
| 2338 | // Fallback to prop when attributes are not supported |
| 2339 | if ( typeof elem.getAttribute === "undefined" ) { |
| 2340 | return jQuery.prop( elem, name, value ); |
| 2341 | } |
| 2342 | |
| 2343 | notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); |
| 2344 | |
| 2345 | // All attributes are lowercase |
| 2346 | // Grab necessary hook if one is defined |
| 2347 | if ( notxml ) { |
| 2348 | name = name.toLowerCase(); |
| 2349 | hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); |
| 2350 | } |
| 2351 | |
| 2352 | if ( value !== undefined ) { |
| 2353 | |
| 2354 | if ( value === null ) { |
| 2355 | jQuery.removeAttr( elem, name ); |
| 2356 | |
| 2357 | } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { |
| 2358 | return ret; |
| 2359 | |
| 2360 | } else { |
| 2361 | elem.setAttribute( name, value + "" ); |
| 2362 | return value; |
| 2363 | } |
| 2364 | |
| 2365 | } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { |
| 2366 | return ret; |
| 2367 | |
| 2368 | } else { |
| 2369 | |
| 2370 | ret = elem.getAttribute( name ); |
| 2371 | |
| 2372 | // Non-existent attributes return null, we normalize to undefined |
| 2373 | return ret == null ? |
| 2374 | undefined : |
| 2375 | ret; |
| 2376 | } |
| 2377 | }, |
| 2378 | |
| 2379 | removeAttr: function( elem, value ) { |
| 2380 | var name, propName, |
| 2381 | i = 0, |
| 2382 | attrNames = value && value.match( core_rnotwhite ); |
| 2383 | |
| 2384 | if ( attrNames && elem.nodeType === 1 ) { |
| 2385 | while ( (name = attrNames[i++]) ) { |
| 2386 | propName = jQuery.propFix[ name ] || name; |
| 2387 | |
| 2388 | // Boolean attributes get special treatment (#10870) |
| 2389 | if ( rboolean.test( name ) ) { |
| 2390 | // Set corresponding property to false for boolean attributes |
| 2391 | // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8 |
| 2392 | if ( !getSetAttribute && ruseDefault.test( name ) ) { |
| 2393 | elem[ jQuery.camelCase( "default-" + name ) ] = |
| 2394 | elem[ propName ] = false; |
| 2395 | } else { |
| 2396 | elem[ propName ] = false; |
| 2397 | } |
| 2398 | |
| 2399 | // See #9699 for explanation of this approach (setting first, then removal) |
| 2400 | } else { |
| 2401 | jQuery.attr( elem, name, "" ); |
| 2402 | } |
| 2403 | |
| 2404 | elem.removeAttribute( getSetAttribute ? name : propName ); |
| 2405 | } |
| 2406 | } |
| 2407 | }, |
| 2408 | |
| 2409 | attrHooks: { |
| 2410 | type: { |
| 2411 | set: function( elem, value ) { |
| 2412 | if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { |
| 2413 | // Setting the type on a radio button after the value resets the value in IE6-9 |
| 2414 | // Reset value to default in case type is set after value during creation |
| 2415 | var val = elem.value; |
| 2416 | elem.setAttribute( "type", value ); |
| 2417 | if ( val ) { |
| 2418 | elem.value = val; |
| 2419 | } |
| 2420 | return value; |
| 2421 | } |
| 2422 | } |
| 2423 | } |
| 2424 | }, |
| 2425 | |
| 2426 | propFix: { |
| 2427 | tabindex: "tabIndex", |
| 2428 | readonly: "readOnly", |
| 2429 | "for": "htmlFor", |
| 2430 | "class": "className", |
| 2431 | maxlength: "maxLength", |
| 2432 | cellspacing: "cellSpacing", |
| 2433 | cellpadding: "cellPadding", |
| 2434 | rowspan: "rowSpan", |
| 2435 | colspan: "colSpan", |
| 2436 | usemap: "useMap", |
| 2437 | frameborder: "frameBorder", |
| 2438 | contenteditable: "contentEditable" |
| 2439 | }, |
| 2440 | |
| 2441 | prop: function( elem, name, value ) { |
| 2442 | var ret, hooks, notxml, |
| 2443 | nType = elem.nodeType; |
| 2444 | |
| 2445 | // don't get/set properties on text, comment and attribute nodes |
| 2446 | if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { |
| 2447 | return; |
| 2448 | } |
| 2449 | |
| 2450 | notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); |
| 2451 | |
| 2452 | if ( notxml ) { |
| 2453 | // Fix name and attach hooks |
| 2454 | name = jQuery.propFix[ name ] || name; |
| 2455 | hooks = jQuery.propHooks[ name ]; |
| 2456 | } |
| 2457 | |
| 2458 | if ( value !== undefined ) { |
| 2459 | if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { |
| 2460 | return ret; |
| 2461 | |
| 2462 | } else { |
| 2463 | return ( elem[ name ] = value ); |
| 2464 | } |
| 2465 | |
| 2466 | } else { |
| 2467 | if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { |
| 2468 | return ret; |
| 2469 | |
| 2470 | } else { |
| 2471 | return elem[ name ]; |
| 2472 | } |
| 2473 | } |
| 2474 | }, |
| 2475 | |
| 2476 | propHooks: { |
| 2477 | tabIndex: { |
| 2478 | get: function( elem ) { |
| 2479 | // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set |
| 2480 | // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ |
| 2481 | var attributeNode = elem.getAttributeNode("tabindex"); |
| 2482 | |
| 2483 | return attributeNode && attributeNode.specified ? |
| 2484 | parseInt( attributeNode.value, 10 ) : |
| 2485 | rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? |
| 2486 | 0 : |
| 2487 | undefined; |
| 2488 | } |
| 2489 | } |
| 2490 | } |
| 2491 | }); |
| 2492 | |
| 2493 | // Hook for boolean attributes |
| 2494 | boolHook = { |
| 2495 | get: function( elem, name ) { |
| 2496 | var |
| 2497 | // Use .prop to determine if this attribute is understood as boolean |
| 2498 | prop = jQuery.prop( elem, name ), |
| 2499 | |
| 2500 | // Fetch it accordingly |
| 2501 | attr = typeof prop === "boolean" && elem.getAttribute( name ), |
| 2502 | detail = typeof prop === "boolean" ? |
| 2503 | |
| 2504 | getSetInput && getSetAttribute ? |
| 2505 | attr != null : |
| 2506 | // oldIE fabricates an empty string for missing boolean attributes |
| 2507 | // and conflates checked/selected into attroperties |
| 2508 | ruseDefault.test( name ) ? |
| 2509 | elem[ jQuery.camelCase( "default-" + name ) ] : |
| 2510 | !!attr : |
| 2511 | |
| 2512 | // fetch an attribute node for properties not recognized as boolean |
| 2513 | elem.getAttributeNode( name ); |
| 2514 | |
| 2515 | return detail && detail.value !== false ? |
| 2516 | name.toLowerCase() : |
| 2517 | undefined; |
| 2518 | }, |
| 2519 | set: function( elem, value, name ) { |
| 2520 | if ( value === false ) { |
| 2521 | // Remove boolean attributes when set to false |
| 2522 | jQuery.removeAttr( elem, name ); |
| 2523 | } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { |
| 2524 | // IE<8 needs the *property* name |
| 2525 | elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); |
| 2526 | |
| 2527 | // Use defaultChecked and defaultSelected for oldIE |
| 2528 | } else { |
| 2529 | elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; |
| 2530 | } |
| 2531 | |
| 2532 | return name; |
| 2533 | } |
| 2534 | }; |
| 2535 | |
| 2536 | // fix oldIE value attroperty |
| 2537 | if ( !getSetInput || !getSetAttribute ) { |
| 2538 | jQuery.attrHooks.value = { |
| 2539 | get: function( elem, name ) { |
| 2540 | var ret = elem.getAttributeNode( name ); |
| 2541 | return jQuery.nodeName( elem, "input" ) ? |
| 2542 | |
| 2543 | // Ignore the value *property* by using defaultValue |
| 2544 | elem.defaultValue : |
| 2545 | |
| 2546 | ret && ret.specified ? ret.value : undefined; |
| 2547 | }, |
| 2548 | set: function( elem, value, name ) { |
| 2549 | if ( jQuery.nodeName( elem, "input" ) ) { |
| 2550 | // Does not return so that setAttribute is also used |
| 2551 | elem.defaultValue = value; |
| 2552 | } else { |
| 2553 | // Use nodeHook if defined (#1954); otherwise setAttribute is fine |
| 2554 | return nodeHook && nodeHook.set( elem, value, name ); |
| 2555 | } |
| 2556 | } |
| 2557 | }; |
| 2558 | } |
| 2559 | |
| 2560 | // IE6/7 do not support getting/setting some attributes with get/setAttribute |
| 2561 | if ( !getSetAttribute ) { |
| 2562 | |
| 2563 | // Use this for any attribute in IE6/7 |
| 2564 | // This fixes almost every IE6/7 issue |
| 2565 | nodeHook = jQuery.valHooks.button = { |
| 2566 | get: function( elem, name ) { |
| 2567 | var ret = elem.getAttributeNode( name ); |
| 2568 | return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ? |
| 2569 | ret.value : |
| 2570 | undefined; |
| 2571 | }, |
| 2572 | set: function( elem, value, name ) { |
| 2573 | // Set the existing or create a new attribute node |
| 2574 | var ret = elem.getAttributeNode( name ); |
| 2575 | if ( !ret ) { |
| 2576 | elem.setAttributeNode( |
| 2577 | (ret = elem.ownerDocument.createAttribute( name )) |
| 2578 | ); |
| 2579 | } |
| 2580 | |
| 2581 | ret.value = value += ""; |
| 2582 | |
| 2583 | // Break association with cloned elements by also using setAttribute (#9646) |
| 2584 | return name === "value" || value === elem.getAttribute( name ) ? |
| 2585 | value : |
| 2586 | undefined; |
| 2587 | } |
| 2588 | }; |
| 2589 | |
| 2590 | // Set contenteditable to false on removals(#10429) |
| 2591 | // Setting to empty string throws an error as an invalid value |
| 2592 | jQuery.attrHooks.contenteditable = { |
| 2593 | get: nodeHook.get, |
| 2594 | set: function( elem, value, name ) { |
| 2595 | nodeHook.set( elem, value === "" ? false : value, name ); |
| 2596 | } |
| 2597 | }; |
| 2598 | |
| 2599 | // Set width and height to auto instead of 0 on empty string( Bug #8150 ) |
| 2600 | // This is for removals |
| 2601 | jQuery.each([ "width", "height" ], function( i, name ) { |
| 2602 | jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { |
| 2603 | set: function( elem, value ) { |
| 2604 | if ( value === "" ) { |
| 2605 | elem.setAttribute( name, "auto" ); |
| 2606 | return value; |
| 2607 | } |
| 2608 | } |
| 2609 | }); |
| 2610 | }); |
| 2611 | } |
| 2612 | |
| 2613 | |
| 2614 | // Some attributes require a special call on IE |
| 2615 | // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx |
| 2616 | if ( !jQuery.support.hrefNormalized ) { |
| 2617 | jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { |
| 2618 | jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { |
| 2619 | get: function( elem ) { |
| 2620 | var ret = elem.getAttribute( name, 2 ); |
| 2621 | return ret == null ? undefined : ret; |
| 2622 | } |
| 2623 | }); |
| 2624 | }); |
| 2625 | |
| 2626 | // href/src property should get the full normalized URL (#10299/#12915) |
| 2627 | jQuery.each([ "href", "src" ], function( i, name ) { |
| 2628 | jQuery.propHooks[ name ] = { |
| 2629 | get: function( elem ) { |
| 2630 | return elem.getAttribute( name, 4 ); |
| 2631 | } |
| 2632 | }; |
| 2633 | }); |
| 2634 | } |
| 2635 | |
| 2636 | if ( !jQuery.support.style ) { |
| 2637 | jQuery.attrHooks.style = { |
| 2638 | get: function( elem ) { |
| 2639 | // Return undefined in the case of empty string |
| 2640 | // Normalize to lowercase since IE uppercases css property names |
| 2641 | return elem.style.cssText.toLowerCase() || undefined; |
| 2642 | }, |
| 2643 | set: function( elem, value ) { |
| 2644 | return ( elem.style.cssText = value + "" ); |
| 2645 | } |
| 2646 | }; |
| 2647 | } |
| 2648 | |
| 2649 | // Safari mis-reports the default selected property of an option |
| 2650 | // Accessing the parent's selectedIndex property fixes it |
| 2651 | if ( !jQuery.support.optSelected ) { |
| 2652 | jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { |
| 2653 | get: function( elem ) { |
| 2654 | var parent = elem.parentNode; |
| 2655 | |
| 2656 | if ( parent ) { |
| 2657 | parent.selectedIndex; |
| 2658 | |
| 2659 | // Make sure that it also works with optgroups, see #5701 |
| 2660 | if ( parent.parentNode ) { |
| 2661 | parent.parentNode.selectedIndex; |
| 2662 | } |
| 2663 | } |
| 2664 | return null; |
| 2665 | } |
| 2666 | }); |
| 2667 | } |
| 2668 | |
| 2669 | // IE6/7 call enctype encoding |
| 2670 | if ( !jQuery.support.enctype ) { |
| 2671 | jQuery.propFix.enctype = "encoding"; |
| 2672 | } |
| 2673 | |
| 2674 | // Radios and checkboxes getter/setter |
| 2675 | if ( !jQuery.support.checkOn ) { |
| 2676 | jQuery.each([ "radio", "checkbox" ], function() { |
| 2677 | jQuery.valHooks[ this ] = { |
| 2678 | get: function( elem ) { |
| 2679 | // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified |
| 2680 | return elem.getAttribute("value") === null ? "on" : elem.value; |
| 2681 | } |
| 2682 | }; |
| 2683 | }); |
| 2684 | } |
| 2685 | jQuery.each([ "radio", "checkbox" ], function() { |
| 2686 | jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { |
| 2687 | set: function( elem, value ) { |
| 2688 | if ( jQuery.isArray( value ) ) { |
| 2689 | return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); |
| 2690 | } |
| 2691 | } |
| 2692 | }); |
| 2693 | }); |
| 2694 | var rformElems = /^(?:input|select|textarea)$/i, |
| 2695 | rkeyEvent = /^key/, |
| 2696 | rmouseEvent = /^(?:mouse|contextmenu)|click/, |
| 2697 | rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, |
| 2698 | rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; |
| 2699 | |
| 2700 | /* |
| 2701 | * Helper functions for managing events -- not part of the public interface. |
| 2702 | * Props to Dean Edwards' addEvent library for many of the ideas. |
| 2703 | */ |
| 2704 | jQuery.event = { |
| 2705 | |
| 2706 | add: function( elem, types, handler, data, selector ) { |
| 2707 | var elemData, eventHandle, events, |
| 2708 | tns, type, namespaces, handleObj, |
| 2709 | handleObjIn, handlers, special, |
| 2710 | t = 0; |
| 2711 | |
| 2712 | // Don't attach events to noData or text/comment nodes (allow plain objects tho) |
| 2713 | if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { |
| 2714 | return; |
| 2715 | } |
| 2716 | |
| 2717 | // Caller can pass in an object of custom data in lieu of the handler |
| 2718 | if ( handler.handler ) { |
| 2719 | handleObjIn = handler; |
| 2720 | handler = handleObjIn.handler; |
| 2721 | selector = handleObjIn.selector; |
| 2722 | } |
| 2723 | |
| 2724 | // Make sure that the handler has a unique ID, used to find/remove it later |
| 2725 | if ( !handler.guid ) { |
| 2726 | handler.guid = jQuery.guid++; |
| 2727 | } |
| 2728 | |
| 2729 | // Init the element's event structure and main handler, if this is the first |
| 2730 | events = elemData.events; |
| 2731 | if ( !events ) { |
| 2732 | elemData.events = events = {}; |
| 2733 | } |
| 2734 | eventHandle = elemData.handle; |
| 2735 | if ( !eventHandle ) { |
| 2736 | elemData.handle = eventHandle = function( e ) { |
| 2737 | // Discard the second event of a jQuery.event.trigger() and |
| 2738 | // when an event is called after a page has unloaded |
| 2739 | return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? |
| 2740 | jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : |
| 2741 | undefined; |
| 2742 | }; |
| 2743 | // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events |
| 2744 | eventHandle.elem = elem; |
| 2745 | } |
| 2746 | |
| 2747 | // Handle multiple events separated by a space |
| 2748 | // jQuery(...).bind("mouseover mouseout", fn); |
| 2749 | types = ( types || "" ).match( core_rnotwhite ) || [""]; |
| 2750 | for ( ; t < types.length; t++ ) { |
| 2751 | |
| 2752 | tns = rtypenamespace.exec( types[t] ) || []; |
| 2753 | type = tns[1]; |
| 2754 | namespaces = ( tns[2] || "" ).split( "." ).sort(); |
| 2755 | |
| 2756 | // If event changes its type, use the special event handlers for the changed type |
| 2757 | special = jQuery.event.special[ type ] || {}; |
| 2758 | |
| 2759 | // If selector defined, determine special event api type, otherwise given type |
| 2760 | type = ( selector ? special.delegateType : special.bindType ) || type; |
| 2761 | |
| 2762 | // Update special based on newly reset type |
| 2763 | special = jQuery.event.special[ type ] || {}; |
| 2764 | |
| 2765 | // handleObj is passed to all event handlers |
| 2766 | handleObj = jQuery.extend({ |
| 2767 | type: type, |
| 2768 | origType: tns[1], |
| 2769 | data: data, |
| 2770 | handler: handler, |
| 2771 | guid: handler.guid, |
| 2772 | selector: selector, |
| 2773 | needsContext: selector && jQuery.expr.match.needsContext.test( selector ), |
| 2774 | namespace: namespaces.join(".") |
| 2775 | }, handleObjIn ); |
| 2776 | |
| 2777 | // Init the event handler queue if we're the first |
| 2778 | handlers = events[ type ]; |
| 2779 | if ( !handlers ) { |
| 2780 | handlers = events[ type ] = []; |
| 2781 | handlers.delegateCount = 0; |
| 2782 | |
| 2783 | // Only use addEventListener/attachEvent if the special events handler returns false |
| 2784 | if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { |
| 2785 | // Bind the global event handler to the element |
| 2786 | if ( elem.addEventListener ) { |
| 2787 | elem.addEventListener( type, eventHandle, false ); |
| 2788 | |
| 2789 | } else if ( elem.attachEvent ) { |
| 2790 | elem.attachEvent( "on" + type, eventHandle ); |
| 2791 | } |
| 2792 | } |
| 2793 | } |
| 2794 | |
| 2795 | if ( special.add ) { |
| 2796 | special.add.call( elem, handleObj ); |
| 2797 | |
| 2798 | if ( !handleObj.handler.guid ) { |
| 2799 | handleObj.handler.guid = handler.guid; |
| 2800 | } |
| 2801 | } |
| 2802 | |
| 2803 | // Add to the element's handler list, delegates in front |
| 2804 | if ( selector ) { |
| 2805 | handlers.splice( handlers.delegateCount++, 0, handleObj ); |
| 2806 | } else { |
| 2807 | handlers.push( handleObj ); |
| 2808 | } |
| 2809 | |
| 2810 | // Keep track of which events have ever been used, for event optimization |
| 2811 | jQuery.event.global[ type ] = true; |
| 2812 | } |
| 2813 | |
| 2814 | // Nullify elem to prevent memory leaks in IE |
| 2815 | elem = null; |
| 2816 | }, |
| 2817 | |
| 2818 | global: {}, |
| 2819 | |
| 2820 | // Detach an event or set of events from an element |
| 2821 | remove: function( elem, types, handler, selector, mappedTypes ) { |
| 2822 | |
| 2823 | var tns, type, origType, namespaces, origCount, |
| 2824 | j, events, special, eventType, handleObj, |
| 2825 | t = 0, |
| 2826 | elemData = jQuery.hasData( elem ) && jQuery._data( elem ); |
| 2827 | |
| 2828 | if ( !elemData || !(events = elemData.events) ) { |
| 2829 | return; |
| 2830 | } |
| 2831 | |
| 2832 | // Once for each type.namespace in types; type may be omitted |
| 2833 | types = ( types || "" ).match( core_rnotwhite ) || [""]; |
| 2834 | for ( ; t < types.length; t++ ) { |
| 2835 | tns = rtypenamespace.exec( types[t] ) || []; |
| 2836 | type = origType = tns[1]; |
| 2837 | namespaces = tns[2]; |
| 2838 | |
| 2839 | // Unbind all events (on this namespace, if provided) for the element |
| 2840 | if ( !type ) { |
| 2841 | for ( type in events ) { |
| 2842 | jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); |
| 2843 | } |
| 2844 | continue; |
| 2845 | } |
| 2846 | |
| 2847 | special = jQuery.event.special[ type ] || {}; |
| 2848 | type = ( selector? special.delegateType : special.bindType ) || type; |
| 2849 | eventType = events[ type ] || []; |
| 2850 | origCount = eventType.length; |
| 2851 | namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null; |
| 2852 | |
| 2853 | // Remove matching events |
| 2854 | for ( j = 0; j < eventType.length; j++ ) { |
| 2855 | handleObj = eventType[ j ]; |
| 2856 | |
| 2857 | if ( ( mappedTypes || origType === handleObj.origType ) && |
| 2858 | ( !handler || handler.guid === handleObj.guid ) && |
| 2859 | ( !namespaces || namespaces.test( handleObj.namespace ) ) && |
| 2860 | ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { |
| 2861 | eventType.splice( j--, 1 ); |
| 2862 | |
| 2863 | if ( handleObj.selector ) { |
| 2864 | eventType.delegateCount--; |
| 2865 | } |
| 2866 | if ( special.remove ) { |
| 2867 | special.remove.call( elem, handleObj ); |
| 2868 | } |
| 2869 | } |
| 2870 | } |
| 2871 | |
| 2872 | // Remove generic event handler if we removed something and no more handlers exist |
| 2873 | // (avoids potential for endless recursion during removal of special event handlers) |
| 2874 | if ( eventType.length === 0 && origCount !== eventType.length ) { |
| 2875 | if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { |
| 2876 | jQuery.removeEvent( elem, type, elemData.handle ); |
| 2877 | } |
| 2878 | |
| 2879 | delete events[ type ]; |
| 2880 | } |
| 2881 | } |
| 2882 | |
| 2883 | // Remove the expando if it's no longer used |
| 2884 | if ( jQuery.isEmptyObject( events ) ) { |
| 2885 | delete elemData.handle; |
| 2886 | |
| 2887 | // removeData also checks for emptiness and clears the expando if empty |
| 2888 | // so use it instead of delete |
| 2889 | jQuery._removeData( elem, "events" ); |
| 2890 | } |
| 2891 | }, |
| 2892 | |
| 2893 | trigger: function( event, data, elem, onlyHandlers ) { |
| 2894 | |
| 2895 | var i, cur, old, ontype, special, handle, eventPath, bubbleType, |
| 2896 | type = event.type || event, |
| 2897 | namespaces = event.namespace ? event.namespace.split(".") : []; |
| 2898 | |
| 2899 | elem = elem || document; |
| 2900 | |
| 2901 | // Don't do events on text and comment nodes |
| 2902 | if ( elem.nodeType === 3 || elem.nodeType === 8 ) { |
| 2903 | return; |
| 2904 | } |
| 2905 | |
| 2906 | // focus/blur morphs to focusin/out; ensure we're not firing them right now |
| 2907 | if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { |
| 2908 | return; |
| 2909 | } |
| 2910 | |
| 2911 | if ( type.indexOf(".") >= 0 ) { |
| 2912 | // Namespaced trigger; create a regexp to match event type in handle() |
| 2913 | namespaces = type.split("."); |
| 2914 | type = namespaces.shift(); |
| 2915 | namespaces.sort(); |
| 2916 | } |
| 2917 | |
| 2918 | // Caller can pass in an Event, Object, or just an event type string |
| 2919 | event = typeof event === "object" ? |
| 2920 | // jQuery.Event object |
| 2921 | event[ jQuery.expando ] ? event : |
| 2922 | // Object literal |
| 2923 | new jQuery.Event( type, event ) : |
| 2924 | // Just the event type (string) |
| 2925 | new jQuery.Event( type ); |
| 2926 | |
| 2927 | event.type = type; |
| 2928 | event.isTrigger = true; |
| 2929 | event.namespace = namespaces.join("."); |
| 2930 | event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; |
| 2931 | ontype = type.indexOf(":") < 0 ? "on" + type : ""; |
| 2932 | |
| 2933 | // Clean up the event in case it is being reused |
| 2934 | event.result = undefined; |
| 2935 | if ( !event.target ) { |
| 2936 | event.target = elem; |
| 2937 | } |
| 2938 | |
| 2939 | // Clone any incoming data and prepend the event, creating the handler arg list |
| 2940 | data = data != null ? jQuery.makeArray( data ) : []; |
| 2941 | data.unshift( event ); |
| 2942 | |
| 2943 | // Allow special events to draw outside the lines |
| 2944 | special = jQuery.event.special[ type ] || {}; |
| 2945 | if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { |
| 2946 | return; |
| 2947 | } |
| 2948 | |
| 2949 | // Determine event propagation path in advance, per W3C events spec (#9951) |
| 2950 | // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) |
| 2951 | eventPath = [[ elem, special.bindType || type ]]; |
| 2952 | if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { |
| 2953 | |
| 2954 | bubbleType = special.delegateType || type; |
| 2955 | cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; |
| 2956 | for ( old = elem; cur; cur = cur.parentNode ) { |
| 2957 | eventPath.push([ cur, bubbleType ]); |
| 2958 | old = cur; |
| 2959 | } |
| 2960 | |
| 2961 | // Only add window if we got to document (e.g., not plain obj or detached DOM) |
| 2962 | if ( old === (elem.ownerDocument || document) ) { |
| 2963 | eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); |
| 2964 | } |
| 2965 | } |
| 2966 | |
| 2967 | // Fire handlers on the event path |
| 2968 | for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { |
| 2969 | |
| 2970 | cur = eventPath[i][0]; |
| 2971 | event.type = eventPath[i][1]; |
| 2972 | |
| 2973 | handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); |
| 2974 | if ( handle ) { |
| 2975 | handle.apply( cur, data ); |
| 2976 | } |
| 2977 | // Note that this is a bare JS function and not a jQuery handler |
| 2978 | handle = ontype && cur[ ontype ]; |
| 2979 | if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { |
| 2980 | event.preventDefault(); |
| 2981 | } |
| 2982 | } |
| 2983 | event.type = type; |
| 2984 | |
| 2985 | // If nobody prevented the default action, do it now |
| 2986 | if ( !onlyHandlers && !event.isDefaultPrevented() ) { |
| 2987 | |
| 2988 | if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && |
| 2989 | !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { |
| 2990 | |
| 2991 | // Call a native DOM method on the target with the same name name as the event. |
| 2992 | // Can't use an .isFunction() check here because IE6/7 fails that test. |
| 2993 | // Don't do default actions on window, that's where global variables be (#6170) |
| 2994 | if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { |
| 2995 | |
| 2996 | // Don't re-trigger an onFOO event when we call its FOO() method |
| 2997 | old = elem[ ontype ]; |
| 2998 | |
| 2999 | if ( old ) { |
| 3000 | elem[ ontype ] = null; |
| 3001 | } |
| 3002 | |
| 3003 | // Prevent re-triggering of the same event, since we already bubbled it above |
| 3004 | jQuery.event.triggered = type; |
| 3005 | try { |
| 3006 | elem[ type ](); |
| 3007 | } catch ( e ) { |
| 3008 | // IE<9 dies on focus/blur to hidden element (#1486,#12518) |
| 3009 | // only reproducible on winXP IE8 native, not IE9 in IE8 mode |
| 3010 | } |
| 3011 | jQuery.event.triggered = undefined; |
| 3012 | |
| 3013 | if ( old ) { |
| 3014 | elem[ ontype ] = old; |
| 3015 | } |
| 3016 | } |
| 3017 | } |
| 3018 | } |
| 3019 | |
| 3020 | return event.result; |
| 3021 | }, |
| 3022 | |
| 3023 | dispatch: function( event ) { |
| 3024 | |
| 3025 | // Make a writable jQuery.Event from the native event object |
| 3026 | event = jQuery.event.fix( event ); |
| 3027 | |
| 3028 | var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, |
| 3029 | handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), |
| 3030 | delegateCount = handlers.delegateCount, |
| 3031 | args = core_slice.call( arguments ), |
| 3032 | special = jQuery.event.special[ event.type ] || {}, |
| 3033 | handlerQueue = []; |
| 3034 | |
| 3035 | // Use the fix-ed jQuery.Event rather than the (read-only) native event |
| 3036 | args[0] = event; |
| 3037 | event.delegateTarget = this; |
| 3038 | |
| 3039 | // Call the preDispatch hook for the mapped type, and let it bail if desired |
| 3040 | if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { |
| 3041 | return; |
| 3042 | } |
| 3043 | |
| 3044 | // Determine handlers that should run if there are delegated events |
| 3045 | // Avoid non-left-click bubbling in Firefox (#3861) |
| 3046 | if ( delegateCount && !(event.button && event.type === "click") ) { |
| 3047 | |
| 3048 | for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { |
| 3049 | |
| 3050 | // Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764) |
| 3051 | if ( cur.disabled !== true || event.type !== "click" ) { |
| 3052 | selMatch = {}; |
| 3053 | matches = []; |
| 3054 | for ( i = 0; i < delegateCount; i++ ) { |
| 3055 | handleObj = handlers[ i ]; |
| 3056 | sel = handleObj.selector; |
| 3057 | |
| 3058 | if ( selMatch[ sel ] === undefined ) { |
| 3059 | selMatch[ sel ] = handleObj.needsContext ? |
| 3060 | jQuery( sel, this ).index( cur ) >= 0 : |
| 3061 | jQuery.find( sel, this, null, [ cur ] ).length; |
| 3062 | } |
| 3063 | if ( selMatch[ sel ] ) { |
| 3064 | matches.push( handleObj ); |
| 3065 | } |
| 3066 | } |
| 3067 | if ( matches.length ) { |
| 3068 | handlerQueue.push({ elem: cur, matches: matches }); |
| 3069 | } |
| 3070 | } |
| 3071 | } |
| 3072 | } |
| 3073 | |
| 3074 | // Add the remaining (directly-bound) handlers |
| 3075 | if ( handlers.length > delegateCount ) { |
| 3076 | handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); |
| 3077 | } |
| 3078 | |
| 3079 | // Run delegates first; they may want to stop propagation beneath us |
| 3080 | for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { |
| 3081 | matched = handlerQueue[ i ]; |
| 3082 | event.currentTarget = matched.elem; |
| 3083 | |
| 3084 | for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { |
| 3085 | handleObj = matched.matches[ j ]; |
| 3086 | |
| 3087 | // Triggered event must either 1) have no namespace, or |
| 3088 | // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). |
| 3089 | if ( !event.namespace || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { |
| 3090 | |
| 3091 | event.data = handleObj.data; |
| 3092 | event.handleObj = handleObj; |
| 3093 | |
| 3094 | ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) |
| 3095 | .apply( matched.elem, args ); |
| 3096 | |
| 3097 | if ( ret !== undefined ) { |
| 3098 | event.result = ret; |
| 3099 | if ( ret === false ) { |
| 3100 | event.preventDefault(); |
| 3101 | event.stopPropagation(); |
| 3102 | } |
| 3103 | } |
| 3104 | } |
| 3105 | } |
| 3106 | } |
| 3107 | |
| 3108 | // Call the postDispatch hook for the mapped type |
| 3109 | if ( special.postDispatch ) { |
| 3110 | special.postDispatch.call( this, event ); |
| 3111 | } |
| 3112 | |
| 3113 | return event.result; |
| 3114 | }, |
| 3115 | |
| 3116 | // Includes some event props shared by KeyEvent and MouseEvent |
| 3117 | props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), |
| 3118 | |
| 3119 | fixHooks: {}, |
| 3120 | |
| 3121 | keyHooks: { |
| 3122 | props: "char charCode key keyCode".split(" "), |
| 3123 | filter: function( event, original ) { |
| 3124 | |
| 3125 | // Add which for key events |
| 3126 | if ( event.which == null ) { |
| 3127 | event.which = original.charCode != null ? original.charCode : original.keyCode; |
| 3128 | } |
| 3129 | |
| 3130 | return event; |
| 3131 | } |
| 3132 | }, |
| 3133 | |
| 3134 | mouseHooks: { |
| 3135 | props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), |
| 3136 | filter: function( event, original ) { |
| 3137 | var eventDoc, doc, body, |
| 3138 | button = original.button, |
| 3139 | fromElement = original.fromElement; |
| 3140 | |
| 3141 | // Calculate pageX/Y if missing and clientX/Y available |
| 3142 | if ( event.pageX == null && original.clientX != null ) { |
| 3143 | eventDoc = event.target.ownerDocument || document; |
| 3144 | doc = eventDoc.documentElement; |
| 3145 | body = eventDoc.body; |
| 3146 | |
| 3147 | event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); |
| 3148 | event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); |
| 3149 | } |
| 3150 | |
| 3151 | // Add relatedTarget, if necessary |
| 3152 | if ( !event.relatedTarget && fromElement ) { |
| 3153 | event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; |
| 3154 | } |
| 3155 | |
| 3156 | // Add which for click: 1 === left; 2 === middle; 3 === right |
| 3157 | // Note: button is not normalized, so don't use it |
| 3158 | if ( !event.which && button !== undefined ) { |
| 3159 | event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); |
| 3160 | } |
| 3161 | |
| 3162 | return event; |
| 3163 | } |
| 3164 | }, |
| 3165 | |
| 3166 | fix: function( event ) { |
| 3167 | if ( event[ jQuery.expando ] ) { |
| 3168 | return event; |
| 3169 | } |
| 3170 | |
| 3171 | // Create a writable copy of the event object and normalize some properties |
| 3172 | var i, prop, |
| 3173 | originalEvent = event, |
| 3174 | fixHook = jQuery.event.fixHooks[ event.type ] || {}, |
| 3175 | copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; |
| 3176 | |
| 3177 | event = jQuery.Event( originalEvent ); |
| 3178 | |
| 3179 | for ( i = copy.length; i; ) { |
| 3180 | prop = copy[ --i ]; |
| 3181 | event[ prop ] = originalEvent[ prop ]; |
| 3182 | } |
| 3183 | |
| 3184 | // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) |
| 3185 | if ( !event.target ) { |
| 3186 | event.target = originalEvent.srcElement || document; |
| 3187 | } |
| 3188 | |
| 3189 | // Target should not be a text node (#504, Safari) |
| 3190 | if ( event.target.nodeType === 3 ) { |
| 3191 | event.target = event.target.parentNode; |
| 3192 | } |
| 3193 | |
| 3194 | // For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8) |
| 3195 | event.metaKey = !!event.metaKey; |
| 3196 | |
| 3197 | return fixHook.filter? fixHook.filter( event, originalEvent ) : event; |
| 3198 | }, |
| 3199 | |
| 3200 | special: { |
| 3201 | load: { |
| 3202 | // Prevent triggered image.load events from bubbling to window.load |
| 3203 | noBubble: true |
| 3204 | }, |
| 3205 | click: { |
| 3206 | // For checkbox, fire native event so checked state will be right |
| 3207 | trigger: function() { |
| 3208 | if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { |
| 3209 | this.click(); |
| 3210 | return false; |
| 3211 | } |
| 3212 | } |
| 3213 | }, |
| 3214 | focus: { |
| 3215 | // Fire native event if possible so blur/focus sequence is correct |
| 3216 | trigger: function() { |
| 3217 | if ( this !== document.activeElement && this.focus ) { |
| 3218 | try { |
| 3219 | this.focus(); |
| 3220 | return false; |
| 3221 | } catch ( e ) { |
| 3222 | // IE<9 dies on focus to hidden element (#1486,#12518) |
| 3223 | // If this happens, let .trigger() run the handlers |
| 3224 | } |
| 3225 | } |
| 3226 | }, |
| 3227 | delegateType: "focusin" |
| 3228 | }, |
| 3229 | blur: { |
| 3230 | trigger: function() { |
| 3231 | if ( this === document.activeElement && this.blur ) { |
| 3232 | this.blur(); |
| 3233 | return false; |
| 3234 | } |
| 3235 | }, |
| 3236 | delegateType: "focusout" |
| 3237 | }, |
| 3238 | |
| 3239 | beforeunload: { |
| 3240 | postDispatch: function( event ) { |
| 3241 | |
| 3242 | // Even when returnValue equals to undefined Firefox will still show alert |
| 3243 | if ( event.result !== undefined ) { |
| 3244 | event.originalEvent.returnValue = event.result; |
| 3245 | } |
| 3246 | } |
| 3247 | } |
| 3248 | }, |
| 3249 | |
| 3250 | simulate: function( type, elem, event, bubble ) { |
| 3251 | // Piggyback on a donor event to simulate a different one. |
| 3252 | // Fake originalEvent to avoid donor's stopPropagation, but if the |
| 3253 | // simulated event prevents default then we do the same on the donor. |
| 3254 | var e = jQuery.extend( |
| 3255 | new jQuery.Event(), |
| 3256 | event, |
| 3257 | { type: type, |
| 3258 | isSimulated: true, |
| 3259 | originalEvent: {} |
| 3260 | } |
| 3261 | ); |
| 3262 | if ( bubble ) { |
| 3263 | jQuery.event.trigger( e, null, elem ); |
| 3264 | } else { |
| 3265 | jQuery.event.dispatch.call( elem, e ); |
| 3266 | } |
| 3267 | if ( e.isDefaultPrevented() ) { |
| 3268 | event.preventDefault(); |
| 3269 | } |
| 3270 | } |
| 3271 | }; |
| 3272 | |
| 3273 | // Some plugins are using, but it's undocumented/deprecated and will be removed. |
| 3274 | // The 1.7 special event interface should provide all the hooks needed now. |
| 3275 | jQuery.event.handle = jQuery.event.dispatch; |
| 3276 | |
| 3277 | jQuery.removeEvent = document.removeEventListener ? |
| 3278 | function( elem, type, handle ) { |
| 3279 | if ( elem.removeEventListener ) { |
| 3280 | elem.removeEventListener( type, handle, false ); |
| 3281 | } |
| 3282 | } : |
| 3283 | function( elem, type, handle ) { |
| 3284 | var name = "on" + type; |
| 3285 | |
| 3286 | if ( elem.detachEvent ) { |
| 3287 | |
| 3288 | // #8545, #7054, preventing memory leaks for custom events in IE6-8 |
| 3289 | // detachEvent needed property on element, by name of that event, to properly expose it to GC |
| 3290 | if ( typeof elem[ name ] === "undefined" ) { |
| 3291 | elem[ name ] = null; |
| 3292 | } |
| 3293 | |
| 3294 | elem.detachEvent( name, handle ); |
| 3295 | } |
| 3296 | }; |
| 3297 | |
| 3298 | jQuery.Event = function( src, props ) { |
| 3299 | // Allow instantiation without the 'new' keyword |
| 3300 | if ( !(this instanceof jQuery.Event) ) { |
| 3301 | return new jQuery.Event( src, props ); |
| 3302 | } |
| 3303 | |
| 3304 | // Event object |
| 3305 | if ( src && src.type ) { |
| 3306 | this.originalEvent = src; |
| 3307 | this.type = src.type; |
| 3308 | |
| 3309 | // Events bubbling up the document may have been marked as prevented |
| 3310 | // by a handler lower down the tree; reflect the correct value. |
| 3311 | this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || |
| 3312 | src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; |
| 3313 | |
| 3314 | // Event type |
| 3315 | } else { |
| 3316 | this.type = src; |
| 3317 | } |
| 3318 | |
| 3319 | // Put explicitly provided properties onto the event object |
| 3320 | if ( props ) { |
| 3321 | jQuery.extend( this, props ); |
| 3322 | } |
| 3323 | |
| 3324 | // Create a timestamp if incoming event doesn't have one |
| 3325 | this.timeStamp = src && src.timeStamp || jQuery.now(); |
| 3326 | |
| 3327 | // Mark it as fixed |
| 3328 | this[ jQuery.expando ] = true; |
| 3329 | }; |
| 3330 | |
| 3331 | function returnFalse() { |
| 3332 | return false; |
| 3333 | } |
| 3334 | function returnTrue() { |
| 3335 | return true; |
| 3336 | } |
| 3337 | |
| 3338 | // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding |
| 3339 | // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html |
| 3340 | jQuery.Event.prototype = { |
| 3341 | preventDefault: function() { |
| 3342 | this.isDefaultPrevented = returnTrue; |
| 3343 | |
| 3344 | var e = this.originalEvent; |
| 3345 | if ( !e ) { |
| 3346 | return; |
| 3347 | } |
| 3348 | |
| 3349 | // if preventDefault exists run it on the original event |
| 3350 | if ( e.preventDefault ) { |
| 3351 | e.preventDefault(); |
| 3352 | |
| 3353 | // otherwise set the returnValue property of the original event to false (IE) |
| 3354 | } else { |
| 3355 | e.returnValue = false; |
| 3356 | } |
| 3357 | }, |
| 3358 | stopPropagation: function() { |
| 3359 | this.isPropagationStopped = returnTrue; |
| 3360 | |
| 3361 | var e = this.originalEvent; |
| 3362 | if ( !e ) { |
| 3363 | return; |
| 3364 | } |
| 3365 | // if stopPropagation exists run it on the original event |
| 3366 | if ( e.stopPropagation ) { |
| 3367 | e.stopPropagation(); |
| 3368 | } |
| 3369 | // otherwise set the cancelBubble property of the original event to true (IE) |
| 3370 | e.cancelBubble = true; |
| 3371 | }, |
| 3372 | stopImmediatePropagation: function() { |
| 3373 | this.isImmediatePropagationStopped = returnTrue; |
| 3374 | this.stopPropagation(); |
| 3375 | }, |
| 3376 | isDefaultPrevented: returnFalse, |
| 3377 | isPropagationStopped: returnFalse, |
| 3378 | isImmediatePropagationStopped: returnFalse |
| 3379 | }; |
| 3380 | |
| 3381 | // Create mouseenter/leave events using mouseover/out and event-time checks |
| 3382 | jQuery.each({ |
| 3383 | mouseenter: "mouseover", |
| 3384 | mouseleave: "mouseout" |
| 3385 | }, function( orig, fix ) { |
| 3386 | jQuery.event.special[ orig ] = { |
| 3387 | delegateType: fix, |
| 3388 | bindType: fix, |
| 3389 | |
| 3390 | handle: function( event ) { |
| 3391 | var ret, |
| 3392 | target = this, |
| 3393 | related = event.relatedTarget, |
| 3394 | handleObj = event.handleObj; |
| 3395 | |
| 3396 | // For mousenter/leave call the handler if related is outside the target. |
| 3397 | // NB: No relatedTarget if the mouse left/entered the browser window |
| 3398 | if ( !related || (related !== target && !jQuery.contains( target, related )) ) { |
| 3399 | event.type = handleObj.origType; |
| 3400 | ret = handleObj.handler.apply( this, arguments ); |
| 3401 | event.type = fix; |
| 3402 | } |
| 3403 | return ret; |
| 3404 | } |
| 3405 | }; |
| 3406 | }); |
| 3407 | |
| 3408 | // IE submit delegation |
| 3409 | if ( !jQuery.support.submitBubbles ) { |
| 3410 | |
| 3411 | jQuery.event.special.submit = { |
| 3412 | setup: function() { |
| 3413 | // Only need this for delegated form submit events |
| 3414 | if ( jQuery.nodeName( this, "form" ) ) { |
| 3415 | return false; |
| 3416 | } |
| 3417 | |
| 3418 | // Lazy-add a submit handler when a descendant form may potentially be submitted |
| 3419 | jQuery.event.add( this, "click._submit keypress._submit", function( e ) { |
| 3420 | // Node name check avoids a VML-related crash in IE (#9807) |
| 3421 | var elem = e.target, |
| 3422 | form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; |
| 3423 | if ( form && !jQuery._data( form, "_submit_attached" ) ) { |
| 3424 | jQuery.event.add( form, "submit._submit", function( event ) { |
| 3425 | event._submit_bubble = true; |
| 3426 | }); |
| 3427 | jQuery._data( form, "_submit_attached", true ); |
| 3428 | } |
| 3429 | }); |
| 3430 | // return undefined since we don't need an event listener |
| 3431 | }, |
| 3432 | |
| 3433 | postDispatch: function( event ) { |
| 3434 | // If form was submitted by the user, bubble the event up the tree |
| 3435 | if ( event._submit_bubble ) { |
| 3436 | delete event._submit_bubble; |
| 3437 | if ( this.parentNode && !event.isTrigger ) { |
| 3438 | jQuery.event.simulate( "submit", this.parentNode, event, true ); |
| 3439 | } |
| 3440 | } |
| 3441 | }, |
| 3442 | |
| 3443 | teardown: function() { |
| 3444 | // Only need this for delegated form submit events |
| 3445 | if ( jQuery.nodeName( this, "form" ) ) { |
| 3446 | return false; |
| 3447 | } |
| 3448 | |
| 3449 | // Remove delegated handlers; cleanData eventually reaps submit handlers attached above |
| 3450 | jQuery.event.remove( this, "._submit" ); |
| 3451 | } |
| 3452 | }; |
| 3453 | } |
| 3454 | |
| 3455 | // IE change delegation and checkbox/radio fix |
| 3456 | if ( !jQuery.support.changeBubbles ) { |
| 3457 | |
| 3458 | jQuery.event.special.change = { |
| 3459 | |
| 3460 | setup: function() { |
| 3461 | |
| 3462 | if ( rformElems.test( this.nodeName ) ) { |
| 3463 | // IE doesn't fire change on a check/radio until blur; trigger it on click |
| 3464 | // after a propertychange. Eat the blur-change in special.change.handle. |
| 3465 | // This still fires onchange a second time for check/radio after blur. |
| 3466 | if ( this.type === "checkbox" || this.type === "radio" ) { |
| 3467 | jQuery.event.add( this, "propertychange._change", function( event ) { |
| 3468 | if ( event.originalEvent.propertyName === "checked" ) { |
| 3469 | this._just_changed = true; |
| 3470 | } |
| 3471 | }); |
| 3472 | jQuery.event.add( this, "click._change", function( event ) { |
| 3473 | if ( this._just_changed && !event.isTrigger ) { |
| 3474 | this._just_changed = false; |
| 3475 | } |
| 3476 | // Allow triggered, simulated change events (#11500) |
| 3477 | jQuery.event.simulate( "change", this, event, true ); |
| 3478 | }); |
| 3479 | } |
| 3480 | return false; |
| 3481 | } |
| 3482 | // Delegated event; lazy-add a change handler on descendant inputs |
| 3483 | jQuery.event.add( this, "beforeactivate._change", function( e ) { |
| 3484 | var elem = e.target; |
| 3485 | |
| 3486 | if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "_change_attached" ) ) { |
| 3487 | jQuery.event.add( elem, "change._change", function( event ) { |
| 3488 | if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { |
| 3489 | jQuery.event.simulate( "change", this.parentNode, event, true ); |
| 3490 | } |
| 3491 | }); |
| 3492 | jQuery._data( elem, "_change_attached", true ); |
| 3493 | } |
| 3494 | }); |
| 3495 | }, |
| 3496 | |
| 3497 | handle: function( event ) { |
| 3498 | var elem = event.target; |
| 3499 | |
| 3500 | // Swallow native change events from checkbox/radio, we already triggered them above |
| 3501 | if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { |
| 3502 | return event.handleObj.handler.apply( this, arguments ); |
| 3503 | } |
| 3504 | }, |
| 3505 | |
| 3506 | teardown: function() { |
| 3507 | jQuery.event.remove( this, "._change" ); |
| 3508 | |
| 3509 | return !rformElems.test( this.nodeName ); |
| 3510 | } |
| 3511 | }; |
| 3512 | } |
| 3513 | |
| 3514 | // Create "bubbling" focus and blur events |
| 3515 | if ( !jQuery.support.focusinBubbles ) { |
| 3516 | jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { |
| 3517 | |
| 3518 | // Attach a single capturing handler while someone wants focusin/focusout |
| 3519 | var attaches = 0, |
| 3520 | handler = function( event ) { |
| 3521 | jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); |
| 3522 | }; |
| 3523 | |
| 3524 | jQuery.event.special[ fix ] = { |
| 3525 | setup: function() { |
| 3526 | if ( attaches++ === 0 ) { |
| 3527 | document.addEventListener( orig, handler, true ); |
| 3528 | } |
| 3529 | }, |
| 3530 | teardown: function() { |
| 3531 | if ( --attaches === 0 ) { |
| 3532 | document.removeEventListener( orig, handler, true ); |
| 3533 | } |
| 3534 | } |
| 3535 | }; |
| 3536 | }); |
| 3537 | } |
| 3538 | |
| 3539 | jQuery.fn.extend({ |
| 3540 | |
| 3541 | on: function( types, selector, data, fn, /*INTERNAL*/ one ) { |
| 3542 | var origFn, type; |
| 3543 | |
| 3544 | // Types can be a map of types/handlers |
| 3545 | if ( typeof types === "object" ) { |
| 3546 | // ( types-Object, selector, data ) |
| 3547 | if ( typeof selector !== "string" ) { // && selector != null |
| 3548 | // ( types-Object, data ) |
| 3549 | data = data || selector; |
| 3550 | selector = undefined; |
| 3551 | } |
| 3552 | for ( type in types ) { |
| 3553 | this.on( type, selector, data, types[ type ], one ); |
| 3554 | } |
| 3555 | return this; |
| 3556 | } |
| 3557 | |
| 3558 | if ( data == null && fn == null ) { |
| 3559 | // ( types, fn ) |
| 3560 | fn = selector; |
| 3561 | data = selector = undefined; |
| 3562 | } else if ( fn == null ) { |
| 3563 | if ( typeof selector === "string" ) { |
| 3564 | // ( types, selector, fn ) |
| 3565 | fn = data; |
| 3566 | data = undefined; |
| 3567 | } else { |
| 3568 | // ( types, data, fn ) |
| 3569 | fn = data; |
| 3570 | data = selector; |
| 3571 | selector = undefined; |
| 3572 | } |
| 3573 | } |
| 3574 | if ( fn === false ) { |
| 3575 | fn = returnFalse; |
| 3576 | } else if ( !fn ) { |
| 3577 | return this; |
| 3578 | } |
| 3579 | |
| 3580 | if ( one === 1 ) { |
| 3581 | origFn = fn; |
| 3582 | fn = function( event ) { |
| 3583 | // Can use an empty set, since event contains the info |
| 3584 | jQuery().off( event ); |
| 3585 | return origFn.apply( this, arguments ); |
| 3586 | }; |
| 3587 | // Use same guid so caller can remove using origFn |
| 3588 | fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); |
| 3589 | } |
| 3590 | return this.each( function() { |
| 3591 | jQuery.event.add( this, types, fn, data, selector ); |
| 3592 | }); |
| 3593 | }, |
| 3594 | one: function( types, selector, data, fn ) { |
| 3595 | return this.on( types, selector, data, fn, 1 ); |
| 3596 | }, |
| 3597 | off: function( types, selector, fn ) { |
| 3598 | var handleObj, type; |
| 3599 | if ( types && types.preventDefault && types.handleObj ) { |
| 3600 | // ( event ) dispatched jQuery.Event |
| 3601 | handleObj = types.handleObj; |
| 3602 | jQuery( types.delegateTarget ).off( |
| 3603 | handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, |
| 3604 | handleObj.selector, |
| 3605 | handleObj.handler |
| 3606 | ); |
| 3607 | return this; |
| 3608 | } |
| 3609 | if ( typeof types === "object" ) { |
| 3610 | // ( types-object [, selector] ) |
| 3611 | for ( type in types ) { |
| 3612 | this.off( type, selector, types[ type ] ); |
| 3613 | } |
| 3614 | return this; |
| 3615 | } |
| 3616 | if ( selector === false || typeof selector === "function" ) { |
| 3617 | // ( types [, fn] ) |
| 3618 | fn = selector; |
| 3619 | selector = undefined; |
| 3620 | } |
| 3621 | if ( fn === false ) { |
| 3622 | fn = returnFalse; |
| 3623 | } |
| 3624 | return this.each(function() { |
| 3625 | jQuery.event.remove( this, types, fn, selector ); |
| 3626 | }); |
| 3627 | }, |
| 3628 | |
| 3629 | bind: function( types, data, fn ) { |
| 3630 | return this.on( types, null, data, fn ); |
| 3631 | }, |
| 3632 | unbind: function( types, fn ) { |
| 3633 | return this.off( types, null, fn ); |
| 3634 | }, |
| 3635 | |
| 3636 | live: function( types, data, fn ) { |
| 3637 | jQuery( this.context ).on( types, this.selector, data, fn ); |
| 3638 | return this; |
| 3639 | }, |
| 3640 | die: function( types, fn ) { |
| 3641 | jQuery( this.context ).off( types, this.selector || "**", fn ); |
| 3642 | return this; |
| 3643 | }, |
| 3644 | |
| 3645 | delegate: function( selector, types, data, fn ) { |
| 3646 | return this.on( types, selector, data, fn ); |
| 3647 | }, |
| 3648 | undelegate: function( selector, types, fn ) { |
| 3649 | // ( namespace ) or ( selector, types [, fn] ) |
| 3650 | return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); |
| 3651 | }, |
| 3652 | |
| 3653 | trigger: function( type, data ) { |
| 3654 | return this.each(function() { |
| 3655 | jQuery.event.trigger( type, data, this ); |
| 3656 | }); |
| 3657 | }, |
| 3658 | triggerHandler: function( type, data ) { |
| 3659 | if ( this[0] ) { |
| 3660 | return jQuery.event.trigger( type, data, this[0], true ); |
| 3661 | } |
| 3662 | }, |
| 3663 | |
| 3664 | hover: function( fnOver, fnOut ) { |
| 3665 | return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); |
| 3666 | } |
| 3667 | }); |
| 3668 | |
| 3669 | jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + |
| 3670 | "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + |
| 3671 | "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { |
| 3672 | |
| 3673 | // Handle event binding |
| 3674 | jQuery.fn[ name ] = function( data, fn ) { |
| 3675 | return arguments.length > 0 ? |
| 3676 | this.on( name, null, data, fn ) : |
| 3677 | this.trigger( name ); |
| 3678 | }; |
| 3679 | |
| 3680 | if ( rkeyEvent.test( name ) ) { |
| 3681 | jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; |
| 3682 | } |
| 3683 | |
| 3684 | if ( rmouseEvent.test( name ) ) { |
| 3685 | jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; |
| 3686 | } |
| 3687 | }); |
| 3688 | /*! |
| 3689 | * Sizzle CSS Selector Engine |
| 3690 | * Copyright 2012 jQuery Foundation and other contributors |
| 3691 | * Released under the MIT license |
| 3692 | * http://sizzlejs.com/ |
| 3693 | */ |
| 3694 | (function( window, undefined ) { |
| 3695 | |
| 3696 | var i, |
| 3697 | cachedruns, |
| 3698 | Expr, |
| 3699 | getText, |
| 3700 | isXML, |
| 3701 | compile, |
| 3702 | hasDuplicate, |
| 3703 | outermostContext, |
| 3704 | |
| 3705 | // Local document vars |
| 3706 | setDocument, |
| 3707 | document, |
| 3708 | docElem, |
| 3709 | documentIsXML, |
| 3710 | rbuggyQSA, |
| 3711 | rbuggyMatches, |
| 3712 | matches, |
| 3713 | contains, |
| 3714 | sortOrder, |
| 3715 | |
| 3716 | expando = "sizzle" + -(new Date()), |
| 3717 | |
| 3718 | strundefined = typeof undefined, |
| 3719 | |
| 3720 | // Used in sorting |
| 3721 | MAX_NEGATIVE = 1 << 31, |
| 3722 | preferredDoc = window.document, |
| 3723 | |
| 3724 | Token = String, |
| 3725 | dirruns = 0, |
| 3726 | done = 0, |
| 3727 | support = {}, |
| 3728 | |
| 3729 | // Array methods |
| 3730 | arr = [], |
| 3731 | pop = arr.pop, |
| 3732 | push = arr.push, |
| 3733 | slice = arr.slice, |
| 3734 | // Use a stripped-down indexOf if we can't use a native one |
| 3735 | indexOf = arr.indexOf || function( elem ) { |
| 3736 | var i = 0, |
| 3737 | len = this.length; |
| 3738 | for ( ; i < len; i++ ) { |
| 3739 | if ( this[i] === elem ) { |
| 3740 | return i; |
| 3741 | } |
| 3742 | } |
| 3743 | return -1; |
| 3744 | }, |
| 3745 | |
| 3746 | // Augment a function for special use by Sizzle |
| 3747 | markFunction = function( fn, value ) { |
| 3748 | fn[ expando ] = value == null || value; |
| 3749 | return fn; |
| 3750 | }, |
| 3751 | |
| 3752 | createCache = function() { |
| 3753 | var cache = {}, |
| 3754 | keys = []; |
| 3755 | |
| 3756 | return markFunction(function( key, value ) { |
| 3757 | // Only keep the most recent entries |
| 3758 | if ( keys.push( key ) > Expr.cacheLength ) { |
| 3759 | delete cache[ keys.shift() ]; |
| 3760 | } |
| 3761 | |
| 3762 | // Retrieve with (key + " ") to avoid collision with native Object.prototype properties (see Issue #157) |
| 3763 | return (cache[ key + " " ] = value); |
| 3764 | }, cache ); |
| 3765 | }, |
| 3766 | |
| 3767 | classCache = createCache(), |
| 3768 | tokenCache = createCache(), |
| 3769 | compilerCache = createCache(), |
| 3770 | |
| 3771 | // Regex |
| 3772 | |
| 3773 | // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace |
| 3774 | whitespace = "[\\x20\\t\\r\\n\\f]", |
| 3775 | // http://www.w3.org/TR/css3-syntax/#characters |
| 3776 | characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", |
| 3777 | |
| 3778 | // Loosely modeled on CSS identifier characters |
| 3779 | // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors) |
| 3780 | // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier |
| 3781 | identifier = characterEncoding.replace( "w", "w#" ), |
| 3782 | |
| 3783 | // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors |
| 3784 | operators = "([*^$|!~]?=)", |
| 3785 | attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + |
| 3786 | "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", |
| 3787 | |
| 3788 | // Prefer arguments quoted, |
| 3789 | // then not containing pseudos/brackets, |
| 3790 | // then attribute selectors/non-parenthetical expressions, |
| 3791 | // then anything else |
| 3792 | // These preferences are here to reduce the number of selectors |
| 3793 | // needing tokenize in the PSEUDO preFilter |
| 3794 | pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", |
| 3795 | |
| 3796 | // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter |
| 3797 | rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), |
| 3798 | |
| 3799 | rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), |
| 3800 | rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), |
| 3801 | rpseudo = new RegExp( pseudos ), |
| 3802 | |
| 3803 | // Easily-parseable/retrievable ID or TAG or CLASS selectors |
| 3804 | rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, |
| 3805 | |
| 3806 | rsibling = /[\x20\t\r\n\f]*[+~]/, |
| 3807 | |
| 3808 | rheader = /h\d/i, |
| 3809 | rinputs = /input|select|textarea|button/i, |
| 3810 | |
| 3811 | rnative = /\{\s*\[native code\]\s*\}/, |
| 3812 | |
| 3813 | rbackslash = /\\(?!\\)/g, |
| 3814 | |
| 3815 | rescape = /'|\\/g, |
| 3816 | rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, |
| 3817 | |
| 3818 | matchExpr = { |
| 3819 | "ID": new RegExp( "^#(" + characterEncoding + ")" ), |
| 3820 | "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), |
| 3821 | "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), |
| 3822 | "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), |
| 3823 | "ATTR": new RegExp( "^" + attributes ), |
| 3824 | "PSEUDO": new RegExp( "^" + pseudos ), |
| 3825 | "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + |
| 3826 | "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + |
| 3827 | "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), |
| 3828 | // For use in libraries implementing .is() |
| 3829 | // We use this for POS matching in `select` |
| 3830 | "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + |
| 3831 | whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) |
| 3832 | }, |
| 3833 | |
| 3834 | /** |
| 3835 | * For feature detection |
| 3836 | * @param {Function} fn The function to test for native support |
| 3837 | */ |
| 3838 | isNative = function( fn ) { |
| 3839 | return rnative.test( fn + "" ); |
| 3840 | }, |
| 3841 | |
| 3842 | /** |
| 3843 | * Support testing using an element |
| 3844 | * @param {Function} fn Passed the created div and expects a boolean result |
| 3845 | */ |
| 3846 | assert = function( fn ) { |
| 3847 | var div = document.createElement("div"); |
| 3848 | |
| 3849 | try { |
| 3850 | return fn( div ); |
| 3851 | } catch (e) { |
| 3852 | return false; |
| 3853 | } finally { |
| 3854 | // release memory in IE |
| 3855 | div = null; |
| 3856 | } |
| 3857 | }; |
| 3858 | |
| 3859 | // Use a stripped-down slice if we can't use a native one |
| 3860 | try { |
| 3861 | slice.call( docElem.childNodes, 0 )[0].nodeType; |
| 3862 | } catch ( e ) { |
| 3863 | slice = function( i ) { |
| 3864 | var elem, |
| 3865 | results = []; |
| 3866 | for ( ; (elem = this[i]); i++ ) { |
| 3867 | results.push( elem ); |
| 3868 | } |
| 3869 | return results; |
| 3870 | }; |
| 3871 | } |
| 3872 | |
| 3873 | function Sizzle( selector, context, results, seed ) { |
| 3874 | var match, elem, m, nodeType, |
| 3875 | // QSA vars |
| 3876 | i, groups, old, nid, newContext, newSelector; |
| 3877 | |
| 3878 | if ( context && (( context.ownerDocument || context ) !== document) ) { |
| 3879 | setDocument( context ); |
| 3880 | } |
| 3881 | |
| 3882 | context = context || document; |
| 3883 | results = results || []; |
| 3884 | |
| 3885 | if ( !selector || typeof selector !== "string" ) { |
| 3886 | return results; |
| 3887 | } |
| 3888 | |
| 3889 | if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { |
| 3890 | return []; |
| 3891 | } |
| 3892 | |
| 3893 | if ( !documentIsXML && !seed ) { |
| 3894 | |
| 3895 | // Shortcuts |
| 3896 | if ( (match = rquickExpr.exec( selector )) ) { |
| 3897 | // Speed-up: Sizzle("#ID") |
| 3898 | if ( (m = match[1]) ) { |
| 3899 | if ( nodeType === 9 ) { |
| 3900 | elem = context.getElementById( m ); |
| 3901 | // Check parentNode to catch when Blackberry 4.6 returns |
| 3902 | // nodes that are no longer in the document #6963 |
| 3903 | if ( elem && elem.parentNode ) { |
| 3904 | // Handle the case where IE, Opera, and Webkit return items |
| 3905 | // by name instead of ID |
| 3906 | if ( elem.id === m ) { |
| 3907 | results.push( elem ); |
| 3908 | return results; |
| 3909 | } |
| 3910 | } else { |
| 3911 | return results; |
| 3912 | } |
| 3913 | } else { |
| 3914 | // Context is not a document |
| 3915 | if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && |
| 3916 | contains( context, elem ) && elem.id === m ) { |
| 3917 | results.push( elem ); |
| 3918 | return results; |
| 3919 | } |
| 3920 | } |
| 3921 | |
| 3922 | // Speed-up: Sizzle("TAG") |
| 3923 | } else if ( match[2] ) { |
| 3924 | push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) ); |
| 3925 | return results; |
| 3926 | |
| 3927 | // Speed-up: Sizzle(".CLASS") |
| 3928 | } else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) { |
| 3929 | push.apply( results, slice.call(context.getElementsByClassName( m ), 0) ); |
| 3930 | return results; |
| 3931 | } |
| 3932 | } |
| 3933 | |
| 3934 | // QSA path |
| 3935 | if ( support.qsa && !rbuggyQSA.test(selector) ) { |
| 3936 | old = true; |
| 3937 | nid = expando; |
| 3938 | newContext = context; |
| 3939 | newSelector = nodeType === 9 && selector; |
| 3940 | |
| 3941 | // qSA works strangely on Element-rooted queries |
| 3942 | // We can work around this by specifying an extra ID on the root |
| 3943 | // and working up from there (Thanks to Andrew Dupont for the technique) |
| 3944 | // IE 8 doesn't work on object elements |
| 3945 | if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { |
| 3946 | groups = tokenize( selector ); |
| 3947 | |
| 3948 | if ( (old = context.getAttribute("id")) ) { |
| 3949 | nid = old.replace( rescape, "\\$&" ); |
| 3950 | } else { |
| 3951 | context.setAttribute( "id", nid ); |
| 3952 | } |
| 3953 | nid = "[id='" + nid + "'] "; |
| 3954 | |
| 3955 | i = groups.length; |
| 3956 | while ( i-- ) { |
| 3957 | groups[i] = nid + groups[i].join(""); |
| 3958 | } |
| 3959 | newContext = rsibling.test( selector ) && context.parentNode || context; |
| 3960 | newSelector = groups.join(","); |
| 3961 | } |
| 3962 | |
| 3963 | if ( newSelector ) { |
| 3964 | try { |
| 3965 | push.apply( results, slice.call( newContext.querySelectorAll( |
| 3966 | newSelector |
| 3967 | ), 0 ) ); |
| 3968 | return results; |
| 3969 | } catch(qsaError) { |
| 3970 | } finally { |
| 3971 | if ( !old ) { |
| 3972 | context.removeAttribute("id"); |
| 3973 | } |
| 3974 | } |
| 3975 | } |
| 3976 | } |
| 3977 | } |
| 3978 | |
| 3979 | // All others |
| 3980 | return select( selector.replace( rtrim, "$1" ), context, results, seed ); |
| 3981 | } |
| 3982 | |
| 3983 | /** |
| 3984 | * Detect xml |
| 3985 | * @param {Element|Object} elem An element or a document |
| 3986 | */ |
| 3987 | isXML = Sizzle.isXML = function( elem ) { |
| 3988 | // documentElement is verified for cases where it doesn't yet exist |
| 3989 | // (such as loading iframes in IE - #4833) |
| 3990 | var documentElement = elem && (elem.ownerDocument || elem).documentElement; |
| 3991 | return documentElement ? documentElement.nodeName !== "HTML" : false; |
| 3992 | }; |
| 3993 | |
| 3994 | /** |
| 3995 | * Sets document-related variables once based on the current document |
| 3996 | * @param {Element|Object} [doc] An element or document object to use to set the document |
| 3997 | * @returns {Object} Returns the current document |
| 3998 | */ |
| 3999 | setDocument = Sizzle.setDocument = function( doc ) { |
| 4000 | doc = doc && doc.ownerDocument || doc || window.document; |
| 4001 | |
| 4002 | // If no document and documentElement is available, return |
| 4003 | if ( !doc || doc.nodeType !== 9 || !doc.documentElement || document === doc ) { |
| 4004 | return document; |
| 4005 | } |
| 4006 | |
| 4007 | // Set our document |
| 4008 | document = doc; |
| 4009 | docElem = doc.documentElement; |
| 4010 | |
| 4011 | // Support tests |
| 4012 | documentIsXML = isXML( doc ); |
| 4013 | |
| 4014 | // Check if getElementsByTagName("*") returns only elements |
| 4015 | support.tagNameNoComments = assert(function( div ) { |
| 4016 | div.appendChild( doc.createComment("") ); |
| 4017 | return !div.getElementsByTagName("*").length; |
| 4018 | }); |
| 4019 | |
| 4020 | // Check if attributes should be retrieved by attribute nodes |
| 4021 | support.attributes = assert(function( div ) { |
| 4022 | div.innerHTML = "<select></select>"; |
| 4023 | var type = typeof div.lastChild.getAttribute("multiple"); |
| 4024 | // IE8 returns a string for some attributes even when not present |
| 4025 | return type !== "boolean" && type !== "string"; |
| 4026 | }); |
| 4027 | |
| 4028 | // Check if getElementsByClassName can be trusted |
| 4029 | support.getByClassName = assert(function( div ) { |
| 4030 | // Opera can't find a second classname (in 9.6) |
| 4031 | div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>"; |
| 4032 | if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { |
| 4033 | return false; |
| 4034 | } |
| 4035 | |
| 4036 | // Safari 3.2 caches class attributes and doesn't catch changes |
| 4037 | div.lastChild.className = "e"; |
| 4038 | return div.getElementsByClassName("e").length === 2; |
| 4039 | }); |
| 4040 | |
| 4041 | // Check if getElementById returns elements by name |
| 4042 | // Check if getElementsByName privileges form controls or returns elements by ID |
| 4043 | support.getByName = assert(function( div ) { |
| 4044 | // Inject content |
| 4045 | div.id = expando + 0; |
| 4046 | div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>"; |
| 4047 | docElem.insertBefore( div, docElem.firstChild ); |
| 4048 | |
| 4049 | // Test |
| 4050 | var pass = doc.getElementsByName && |
| 4051 | // buggy browsers will return fewer than the correct 2 |
| 4052 | doc.getElementsByName( expando ).length === 2 + |
| 4053 | // buggy browsers will return more than the correct 0 |
| 4054 | doc.getElementsByName( expando + 0 ).length; |
| 4055 | support.getIdNotName = !doc.getElementById( expando ); |
| 4056 | |
| 4057 | // Cleanup |
| 4058 | docElem.removeChild( div ); |
| 4059 | |
| 4060 | return pass; |
| 4061 | }); |
| 4062 | |
| 4063 | // IE6/7 return modified attributes |
| 4064 | Expr.attrHandle = assert(function( div ) { |
| 4065 | div.innerHTML = "<a href='#'></a>"; |
| 4066 | return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && |
| 4067 | div.firstChild.getAttribute("href") === "#"; |
| 4068 | }) ? |
| 4069 | {} : |
| 4070 | { |
| 4071 | "href": function( elem ) { |
| 4072 | return elem.getAttribute( "href", 2 ); |
| 4073 | }, |
| 4074 | "type": function( elem ) { |
| 4075 | return elem.getAttribute("type"); |
| 4076 | } |
| 4077 | }; |
| 4078 | |
| 4079 | // ID find and filter |
| 4080 | if ( support.getIdNotName ) { |
| 4081 | Expr.find["ID"] = function( id, context ) { |
| 4082 | if ( typeof context.getElementById !== strundefined && !documentIsXML ) { |
| 4083 | var m = context.getElementById( id ); |
| 4084 | // Check parentNode to catch when Blackberry 4.6 returns |
| 4085 | // nodes that are no longer in the document #6963 |
| 4086 | return m && m.parentNode ? [m] : []; |
| 4087 | } |
| 4088 | }; |
| 4089 | Expr.filter["ID"] = function( id ) { |
| 4090 | var attrId = id.replace( rbackslash, "" ); |
| 4091 | return function( elem ) { |
| 4092 | return elem.getAttribute("id") === attrId; |
| 4093 | }; |
| 4094 | }; |
| 4095 | } else { |
| 4096 | Expr.find["ID"] = function( id, context ) { |
| 4097 | if ( typeof context.getElementById !== strundefined && !documentIsXML ) { |
| 4098 | var m = context.getElementById( id ); |
| 4099 | |
| 4100 | return m ? |
| 4101 | m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? |
| 4102 | [m] : |
| 4103 | undefined : |
| 4104 | []; |
| 4105 | } |
| 4106 | }; |
| 4107 | Expr.filter["ID"] = function( id ) { |
| 4108 | var attrId = id.replace( rbackslash, "" ); |
| 4109 | return function( elem ) { |
| 4110 | var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); |
| 4111 | return node && node.value === attrId; |
| 4112 | }; |
| 4113 | }; |
| 4114 | } |
| 4115 | |
| 4116 | // Tag |
| 4117 | Expr.find["TAG"] = support.tagNameNoComments ? |
| 4118 | function( tag, context ) { |
| 4119 | if ( typeof context.getElementsByTagName !== strundefined ) { |
| 4120 | return context.getElementsByTagName( tag ); |
| 4121 | } |
| 4122 | } : |
| 4123 | function( tag, context ) { |
| 4124 | var elem, |
| 4125 | tmp = [], |
| 4126 | i = 0, |
| 4127 | results = context.getElementsByTagName( tag ); |
| 4128 | |
| 4129 | // Filter out possible comments |
| 4130 | if ( tag === "*" ) { |
| 4131 | for ( ; (elem = results[i]); i++ ) { |
| 4132 | if ( elem.nodeType === 1 ) { |
| 4133 | tmp.push( elem ); |
| 4134 | } |
| 4135 | } |
| 4136 | |
| 4137 | return tmp; |
| 4138 | } |
| 4139 | return results; |
| 4140 | }; |
| 4141 | |
| 4142 | // Name |
| 4143 | Expr.find["NAME"] = support.getByName && function( tag, context ) { |
| 4144 | if ( typeof context.getElementsByName !== strundefined ) { |
| 4145 | return context.getElementsByName( name ); |
| 4146 | } |
| 4147 | }; |
| 4148 | |
| 4149 | // Class |
| 4150 | Expr.find["CLASS"] = support.getByClassName && function( className, context ) { |
| 4151 | if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) { |
| 4152 | return context.getElementsByClassName( className ); |
| 4153 | } |
| 4154 | }; |
| 4155 | |
| 4156 | // QSA and matchesSelector support |
| 4157 | |
| 4158 | // matchesSelector(:active) reports false when true (IE9/Opera 11.5) |
| 4159 | rbuggyMatches = []; |
| 4160 | |
| 4161 | // qSa(:focus) reports false when true (Chrome 21), |
| 4162 | // no need to also add to buggyMatches since matches checks buggyQSA |
| 4163 | // A support test would require too much code (would include document ready) |
| 4164 | rbuggyQSA = [ ":focus" ]; |
| 4165 | |
| 4166 | if ( (support.qsa = isNative(doc.querySelectorAll)) ) { |
| 4167 | // Build QSA regex |
| 4168 | // Regex strategy adopted from Diego Perini |
| 4169 | assert(function( div ) { |
| 4170 | // Select is set to empty string on purpose |
| 4171 | // This is to test IE's treatment of not explictly |
| 4172 | // setting a boolean content attribute, |
| 4173 | // since its presence should be enough |
| 4174 | // http://bugs.jquery.com/ticket/12359 |
| 4175 | div.innerHTML = "<select><option selected=''></option></select>"; |
| 4176 | |
| 4177 | // IE8 - Some boolean attributes are not treated correctly |
| 4178 | if ( !div.querySelectorAll("[selected]").length ) { |
| 4179 | rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); |
| 4180 | } |
| 4181 | |
| 4182 | // Webkit/Opera - :checked should return selected option elements |
| 4183 | // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked |
| 4184 | // IE8 throws error here and will not see later tests |
| 4185 | if ( !div.querySelectorAll(":checked").length ) { |
| 4186 | rbuggyQSA.push(":checked"); |
| 4187 | } |
| 4188 | }); |
| 4189 | |
| 4190 | assert(function( div ) { |
| 4191 | |
| 4192 | // Opera 10-12/IE9 - ^= $= *= and empty values |
| 4193 | // Should not select anything |
| 4194 | div.innerHTML = "<p test=''></p>"; |
| 4195 | if ( div.querySelectorAll("[test^='']").length ) { |
| 4196 | rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); |
| 4197 | } |
| 4198 | |
| 4199 | // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) |
| 4200 | // IE8 throws error here and will not see later tests |
| 4201 | div.innerHTML = "<input type='hidden'/>"; |
| 4202 | if ( !div.querySelectorAll(":enabled").length ) { |
| 4203 | rbuggyQSA.push( ":enabled", ":disabled" ); |
| 4204 | } |
| 4205 | |
| 4206 | // Opera 10-11 does not throw on post-comma invalid pseudos |
| 4207 | div.querySelectorAll("*,:x"); |
| 4208 | rbuggyQSA.push(",.*:"); |
| 4209 | }); |
| 4210 | } |
| 4211 | |
| 4212 | if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector || |
| 4213 | docElem.mozMatchesSelector || |
| 4214 | docElem.webkitMatchesSelector || |
| 4215 | docElem.oMatchesSelector || |
| 4216 | docElem.msMatchesSelector) )) ) { |
| 4217 | |
| 4218 | assert(function( div ) { |
| 4219 | // Check to see if it's possible to do matchesSelector |
| 4220 | // on a disconnected node (IE 9) |
| 4221 | support.disconnectedMatch = matches.call( div, "div" ); |
| 4222 | |
| 4223 | // This should fail with an exception |
| 4224 | // Gecko does not error, returns false instead |
| 4225 | matches.call( div, "[test!='']:x" ); |
| 4226 | rbuggyMatches.push( "!=", pseudos ); |
| 4227 | }); |
| 4228 | } |
| 4229 | |
| 4230 | rbuggyQSA = new RegExp( rbuggyQSA.join("|") ); |
| 4231 | rbuggyMatches = new RegExp( rbuggyMatches.join("|") ); |
| 4232 | |
| 4233 | // Element contains another |
| 4234 | // Purposefully does not implement inclusive descendent |
| 4235 | // As in, an element does not contain itself |
| 4236 | contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? |
| 4237 | function( a, b ) { |
| 4238 | var adown = a.nodeType === 9 ? a.documentElement : a, |
| 4239 | bup = b && b.parentNode; |
| 4240 | return a === bup || !!( bup && bup.nodeType === 1 && ( |
| 4241 | adown.contains ? |
| 4242 | adown.contains( bup ) : |
| 4243 | a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 |
| 4244 | )); |
| 4245 | } : |
| 4246 | function( a, b ) { |
| 4247 | if ( b ) { |
| 4248 | while ( (b = b.parentNode) ) { |
| 4249 | if ( b === a ) { |
| 4250 | return true; |
| 4251 | } |
| 4252 | } |
| 4253 | } |
| 4254 | return false; |
| 4255 | }; |
| 4256 | |
| 4257 | // Document order sorting |
| 4258 | sortOrder = docElem.compareDocumentPosition ? |
| 4259 | function( a, b ) { |
| 4260 | var compare; |
| 4261 | |
| 4262 | if ( a === b ) { |
| 4263 | hasDuplicate = true; |
| 4264 | return 0; |
| 4265 | } |
| 4266 | |
| 4267 | if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) { |
| 4268 | if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) { |
| 4269 | if ( a === doc || contains( preferredDoc, a ) ) { |
| 4270 | return -1; |
| 4271 | } |
| 4272 | if ( b === doc || contains( preferredDoc, b ) ) { |
| 4273 | return 1; |
| 4274 | } |
| 4275 | return 0; |
| 4276 | } |
| 4277 | return compare & 4 ? -1 : 1; |
| 4278 | } |
| 4279 | |
| 4280 | return a.compareDocumentPosition ? -1 : 1; |
| 4281 | } : |
| 4282 | function( a, b ) { |
| 4283 | var cur, |
| 4284 | i = 0, |
| 4285 | aup = a.parentNode, |
| 4286 | bup = b.parentNode, |
| 4287 | ap = [ a ], |
| 4288 | bp = [ b ]; |
| 4289 | |
| 4290 | // The nodes are identical, we can exit early |
| 4291 | if ( a === b ) { |
| 4292 | hasDuplicate = true; |
| 4293 | return 0; |
| 4294 | |
| 4295 | // Fallback to using sourceIndex (in IE) if it's available on both nodes |
| 4296 | } else if ( a.sourceIndex && b.sourceIndex ) { |
| 4297 | return ( ~b.sourceIndex || MAX_NEGATIVE ) - ( contains( preferredDoc, a ) && ~a.sourceIndex || MAX_NEGATIVE ); |
| 4298 | |
| 4299 | // Parentless nodes are either documents or disconnected |
| 4300 | } else if ( !aup || !bup ) { |
| 4301 | return a === doc ? -1 : |
| 4302 | b === doc ? 1 : |
| 4303 | aup ? -1 : |
| 4304 | bup ? 1 : |
| 4305 | 0; |
| 4306 | |
| 4307 | // If the nodes are siblings, we can do a quick check |
| 4308 | } else if ( aup === bup ) { |
| 4309 | return siblingCheck( a, b ); |
| 4310 | } |
| 4311 | |
| 4312 | // Otherwise we need full lists of their ancestors for comparison |
| 4313 | cur = a; |
| 4314 | while ( (cur = cur.parentNode) ) { |
| 4315 | ap.unshift( cur ); |
| 4316 | } |
| 4317 | cur = b; |
| 4318 | while ( (cur = cur.parentNode) ) { |
| 4319 | bp.unshift( cur ); |
| 4320 | } |
| 4321 | |
| 4322 | // Walk down the tree looking for a discrepancy |
| 4323 | while ( ap[i] === bp[i] ) { |
| 4324 | i++; |
| 4325 | } |
| 4326 | |
| 4327 | return i ? |
| 4328 | // Do a sibling check if the nodes have a common ancestor |
| 4329 | siblingCheck( ap[i], bp[i] ) : |
| 4330 | |
| 4331 | // Otherwise nodes in our document sort first |
| 4332 | ap[i] === preferredDoc ? -1 : |
| 4333 | bp[i] === preferredDoc ? 1 : |
| 4334 | 0; |
| 4335 | }; |
| 4336 | |
| 4337 | // Always assume the presence of duplicates if sort doesn't |
| 4338 | // pass them to our comparison function (as in Google Chrome). |
| 4339 | hasDuplicate = false; |
| 4340 | [0, 0].sort( sortOrder ); |
| 4341 | support.detectDuplicates = hasDuplicate; |
| 4342 | |
| 4343 | return document; |
| 4344 | }; |
| 4345 | |
| 4346 | Sizzle.matches = function( expr, elements ) { |
| 4347 | return Sizzle( expr, window.document, null, elements ); |
| 4348 | }; |
| 4349 | |
| 4350 | Sizzle.matchesSelector = function( elem, expr ) { |
| 4351 | // Set document vars if needed |
| 4352 | if ( elem && (( elem.ownerDocument || elem ) !== document) ) { |
| 4353 | setDocument( elem ); |
| 4354 | } |
| 4355 | |
| 4356 | // Make sure that attribute selectors are quoted |
| 4357 | expr = expr.replace( rattributeQuotes, "='$1']" ); |
| 4358 | |
| 4359 | // rbuggyQSA always contains :focus, so no need for an existence check |
| 4360 | if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) { |
| 4361 | try { |
| 4362 | var ret = matches.call( elem, expr ); |
| 4363 | |
| 4364 | // IE 9's matchesSelector returns false on disconnected nodes |
| 4365 | if ( ret || support.disconnectedMatch || |
| 4366 | // As well, disconnected nodes are said to be in a document |
| 4367 | // fragment in IE 9 |
| 4368 | elem.document && elem.document.nodeType !== 11 ) { |
| 4369 | return ret; |
| 4370 | } |
| 4371 | } catch(e) {} |
| 4372 | } |
| 4373 | |
| 4374 | return Sizzle( expr, document, null, [elem] ).length > 0; |
| 4375 | }; |
| 4376 | |
| 4377 | Sizzle.contains = function( context, elem ) { |
| 4378 | // Set document vars if needed |
| 4379 | if ( context && (( context.ownerDocument || context ) !== document) ) { |
| 4380 | setDocument( context ); |
| 4381 | } |
| 4382 | return contains( context, elem ); |
| 4383 | }; |
| 4384 | |
| 4385 | Sizzle.attr = function( elem, name ) { |
| 4386 | var val; |
| 4387 | |
| 4388 | // Set document vars if needed |
| 4389 | if ( elem && (( elem.ownerDocument || elem ) !== document) ) { |
| 4390 | setDocument( elem ); |
| 4391 | } |
| 4392 | |
| 4393 | if ( !documentIsXML ) { |
| 4394 | name = name.toLowerCase(); |
| 4395 | } |
| 4396 | if ( (val = Expr.attrHandle[ name ]) ) { |
| 4397 | return val( elem ); |
| 4398 | } |
| 4399 | if ( documentIsXML || support.attributes ) { |
| 4400 | return elem.getAttribute( name ); |
| 4401 | } |
| 4402 | return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ? |
| 4403 | name : |
| 4404 | val && val.specified ? val.value : null; |
| 4405 | }; |
| 4406 | |
| 4407 | Sizzle.error = function( msg ) { |
| 4408 | throw new Error( "Syntax error, unrecognized expression: " + msg ); |
| 4409 | }; |
| 4410 | |
| 4411 | // Document sorting and removing duplicates |
| 4412 | Sizzle.uniqueSort = function( results ) { |
| 4413 | var elem, |
| 4414 | duplicates = [], |
| 4415 | i = 1, |
| 4416 | j = 0; |
| 4417 | |
| 4418 | // Unless we *know* we can detect duplicates, assume their presence |
| 4419 | hasDuplicate = !support.detectDuplicates; |
| 4420 | results.sort( sortOrder ); |
| 4421 | |
| 4422 | if ( hasDuplicate ) { |
| 4423 | for ( ; (elem = results[i]); i++ ) { |
| 4424 | if ( elem === results[ i - 1 ] ) { |
| 4425 | j = duplicates.push( i ); |
| 4426 | } |
| 4427 | } |
| 4428 | while ( j-- ) { |
| 4429 | results.splice( duplicates[ j ], 1 ); |
| 4430 | } |
| 4431 | } |
| 4432 | |
| 4433 | return results; |
| 4434 | }; |
| 4435 | |
| 4436 | function siblingCheck( a, b ) { |
| 4437 | var cur = a && b && a.nextSibling; |
| 4438 | |
| 4439 | for ( ; cur; cur = cur.nextSibling ) { |
| 4440 | if ( cur === b ) { |
| 4441 | return -1; |
| 4442 | } |
| 4443 | } |
| 4444 | |
| 4445 | return a ? 1 : -1; |
| 4446 | } |
| 4447 | |
| 4448 | // Returns a function to use in pseudos for input types |
| 4449 | function createInputPseudo( type ) { |
| 4450 | return function( elem ) { |
| 4451 | var name = elem.nodeName.toLowerCase(); |
| 4452 | return name === "input" && elem.type === type; |
| 4453 | }; |
| 4454 | } |
| 4455 | |
| 4456 | // Returns a function to use in pseudos for buttons |
| 4457 | function createButtonPseudo( type ) { |
| 4458 | return function( elem ) { |
| 4459 | var name = elem.nodeName.toLowerCase(); |
| 4460 | return (name === "input" || name === "button") && elem.type === type; |
| 4461 | }; |
| 4462 | } |
| 4463 | |
| 4464 | // Returns a function to use in pseudos for positionals |
| 4465 | function createPositionalPseudo( fn ) { |
| 4466 | return markFunction(function( argument ) { |
| 4467 | argument = +argument; |
| 4468 | return markFunction(function( seed, matches ) { |
| 4469 | var j, |
| 4470 | matchIndexes = fn( [], seed.length, argument ), |
| 4471 | i = matchIndexes.length; |
| 4472 | |
| 4473 | // Match elements found at the specified indexes |
| 4474 | while ( i-- ) { |
| 4475 | if ( seed[ (j = matchIndexes[i]) ] ) { |
| 4476 | seed[j] = !(matches[j] = seed[j]); |
| 4477 | } |
| 4478 | } |
| 4479 | }); |
| 4480 | }); |
| 4481 | } |
| 4482 | |
| 4483 | /** |
| 4484 | * Utility function for retrieving the text value of an array of DOM nodes |
| 4485 | * @param {Array|Element} elem |
| 4486 | */ |
| 4487 | getText = Sizzle.getText = function( elem ) { |
| 4488 | var node, |
| 4489 | ret = "", |
| 4490 | i = 0, |
| 4491 | nodeType = elem.nodeType; |
| 4492 | |
| 4493 | if ( !nodeType ) { |
| 4494 | // If no nodeType, this is expected to be an array |
| 4495 | for ( ; (node = elem[i]); i++ ) { |
| 4496 | // Do not traverse comment nodes |
| 4497 | ret += getText( node ); |
| 4498 | } |
| 4499 | } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { |
| 4500 | // Use textContent for elements |
| 4501 | // innerText usage removed for consistency of new lines (see #11153) |
| 4502 | if ( typeof elem.textContent === "string" ) { |
| 4503 | return elem.textContent; |
| 4504 | } else { |
| 4505 | // Traverse its children |
| 4506 | for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { |
| 4507 | ret += getText( elem ); |
| 4508 | } |
| 4509 | } |
| 4510 | } else if ( nodeType === 3 || nodeType === 4 ) { |
| 4511 | return elem.nodeValue; |
| 4512 | } |
| 4513 | // Do not include comment or processing instruction nodes |
| 4514 | |
| 4515 | return ret; |
| 4516 | }; |
| 4517 | |
| 4518 | Expr = Sizzle.selectors = { |
| 4519 | |
| 4520 | // Can be adjusted by the user |
| 4521 | cacheLength: 50, |
| 4522 | |
| 4523 | createPseudo: markFunction, |
| 4524 | |
| 4525 | match: matchExpr, |
| 4526 | |
| 4527 | find: {}, |
| 4528 | |
| 4529 | relative: { |
| 4530 | ">": { dir: "parentNode", first: true }, |
| 4531 | " ": { dir: "parentNode" }, |
| 4532 | "+": { dir: "previousSibling", first: true }, |
| 4533 | "~": { dir: "previousSibling" } |
| 4534 | }, |
| 4535 | |
| 4536 | preFilter: { |
| 4537 | "ATTR": function( match ) { |
| 4538 | match[1] = match[1].replace( rbackslash, "" ); |
| 4539 | |
| 4540 | // Move the given value to match[3] whether quoted or unquoted |
| 4541 | match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" ); |
| 4542 | |
| 4543 | if ( match[2] === "~=" ) { |
| 4544 | match[3] = " " + match[3] + " "; |
| 4545 | } |
| 4546 | |
| 4547 | return match.slice( 0, 4 ); |
| 4548 | }, |
| 4549 | |
| 4550 | "CHILD": function( match ) { |
| 4551 | /* matches from matchExpr["CHILD"] |
| 4552 | 1 type (only|nth|...) |
| 4553 | 2 what (child|of-type) |
| 4554 | 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) |
| 4555 | 4 xn-component of xn+y argument ([+-]?\d*n|) |
| 4556 | 5 sign of xn-component |
| 4557 | 6 x of xn-component |
| 4558 | 7 sign of y-component |
| 4559 | 8 y of y-component |
| 4560 | */ |
| 4561 | match[1] = match[1].toLowerCase(); |
| 4562 | |
| 4563 | if ( match[1].slice( 0, 3 ) === "nth" ) { |
| 4564 | // nth-* requires argument |
| 4565 | if ( !match[3] ) { |
| 4566 | Sizzle.error( match[0] ); |
| 4567 | } |
| 4568 | |
| 4569 | // numeric x and y parameters for Expr.filter.CHILD |
| 4570 | // remember that false/true cast respectively to 0/1 |
| 4571 | match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); |
| 4572 | match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); |
| 4573 | |
| 4574 | // other types prohibit arguments |
| 4575 | } else if ( match[3] ) { |
| 4576 | Sizzle.error( match[0] ); |
| 4577 | } |
| 4578 | |
| 4579 | return match; |
| 4580 | }, |
| 4581 | |
| 4582 | "PSEUDO": function( match ) { |
| 4583 | var excess, |
| 4584 | unquoted = !match[5] && match[2]; |
| 4585 | |
| 4586 | if ( matchExpr["CHILD"].test( match[0] ) ) { |
| 4587 | return null; |
| 4588 | } |
| 4589 | |
| 4590 | // Accept quoted arguments as-is |
| 4591 | if ( match[4] ) { |
| 4592 | match[2] = match[4]; |
| 4593 | |
| 4594 | // Strip excess characters from unquoted arguments |
| 4595 | } else if ( unquoted && rpseudo.test( unquoted ) && |
| 4596 | // Get excess from tokenize (recursively) |
| 4597 | (excess = tokenize( unquoted, true )) && |
| 4598 | // advance to the next closing parenthesis |
| 4599 | (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { |
| 4600 | |
| 4601 | // excess is a negative index |
| 4602 | match[0] = match[0].slice( 0, excess ); |
| 4603 | match[2] = unquoted.slice( 0, excess ); |
| 4604 | } |
| 4605 | |
| 4606 | // Return only captures needed by the pseudo filter method (type and argument) |
| 4607 | return match.slice( 0, 3 ); |
| 4608 | } |
| 4609 | }, |
| 4610 | |
| 4611 | filter: { |
| 4612 | |
| 4613 | "TAG": function( nodeName ) { |
| 4614 | if ( nodeName === "*" ) { |
| 4615 | return function() { return true; }; |
| 4616 | } |
| 4617 | |
| 4618 | nodeName = nodeName.replace( rbackslash, "" ).toLowerCase(); |
| 4619 | return function( elem ) { |
| 4620 | return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; |
| 4621 | }; |
| 4622 | }, |
| 4623 | |
| 4624 | "CLASS": function( className ) { |
| 4625 | var pattern = classCache[ expando ][ className + " " ]; |
| 4626 | |
| 4627 | return pattern || |
| 4628 | (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && |
| 4629 | classCache( className, function( elem ) { |
| 4630 | return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); |
| 4631 | }); |
| 4632 | }, |
| 4633 | |
| 4634 | "ATTR": function( name, operator, check ) { |
| 4635 | return function( elem ) { |
| 4636 | var result = Sizzle.attr( elem, name ); |
| 4637 | |
| 4638 | if ( result == null ) { |
| 4639 | return operator === "!="; |
| 4640 | } |
| 4641 | if ( !operator ) { |
| 4642 | return true; |
| 4643 | } |
| 4644 | |
| 4645 | result += ""; |
| 4646 | |
| 4647 | return operator === "=" ? result === check : |
| 4648 | operator === "!=" ? result !== check : |
| 4649 | operator === "^=" ? check && result.indexOf( check ) === 0 : |
| 4650 | operator === "*=" ? check && result.indexOf( check ) > -1 : |
| 4651 | operator === "$=" ? check && result.substr( result.length - check.length ) === check : |
| 4652 | operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : |
| 4653 | operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" : |
| 4654 | false; |
| 4655 | }; |
| 4656 | }, |
| 4657 | |
| 4658 | "CHILD": function( type, what, argument, first, last ) { |
| 4659 | var simple = type.slice( 0, 3 ) !== "nth", |
| 4660 | forward = type.slice( -4 ) !== "last", |
| 4661 | ofType = what === "of-type"; |
| 4662 | |
| 4663 | return first === 1 && last === 0 ? |
| 4664 | |
| 4665 | // Shortcut for :nth-*(n) |
| 4666 | function( elem ) { |
| 4667 | return !!elem.parentNode; |
| 4668 | } : |
| 4669 | |
| 4670 | function( elem, context, xml ) { |
| 4671 | var cache, outerCache, node, diff, nodeIndex, start, |
| 4672 | dir = simple !== forward ? "nextSibling" : "previousSibling", |
| 4673 | parent = elem.parentNode, |
| 4674 | name = ofType && elem.nodeName.toLowerCase(), |
| 4675 | useCache = !xml && !ofType; |
| 4676 | |
| 4677 | if ( parent ) { |
| 4678 | |
| 4679 | // :(first|last|only)-(child|of-type) |
| 4680 | if ( simple ) { |
| 4681 | while ( dir ) { |
| 4682 | node = elem; |
| 4683 | while ( (node = node[ dir ]) ) { |
| 4684 | if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { |
| 4685 | return false; |
| 4686 | } |
| 4687 | } |
| 4688 | // Reverse direction for :only-* (if we haven't yet done so) |
| 4689 | start = dir = type === "only" && !start && "nextSibling"; |
| 4690 | } |
| 4691 | return true; |
| 4692 | } |
| 4693 | |
| 4694 | start = [ forward ? parent.firstChild : parent.lastChild ]; |
| 4695 | |
| 4696 | // non-xml :nth-child(...) stores cache data on `parent` |
| 4697 | if ( forward && useCache ) { |
| 4698 | // Seek `elem` from a previously-cached index |
| 4699 | outerCache = parent[ expando ] || (parent[ expando ] = {}); |
| 4700 | cache = outerCache[ type ] || []; |
| 4701 | nodeIndex = cache[0] === dirruns && cache[1]; |
| 4702 | diff = cache[0] === dirruns && cache[2]; |
| 4703 | node = nodeIndex && parent.childNodes[ nodeIndex ]; |
| 4704 | |
| 4705 | while ( (node = ++nodeIndex && node && node[ dir ] || |
| 4706 | |
| 4707 | // Fallback to seeking `elem` from the start |
| 4708 | (diff = nodeIndex = 0) || start.pop()) ) { |
| 4709 | |
| 4710 | // When found, cache indexes on `parent` and break |
| 4711 | if ( node.nodeType === 1 && ++diff && node === elem ) { |
| 4712 | outerCache[ type ] = [ dirruns, nodeIndex, diff ]; |
| 4713 | break; |
| 4714 | } |
| 4715 | } |
| 4716 | |
| 4717 | // Use previously-cached element index if available |
| 4718 | } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { |
| 4719 | diff = cache[1]; |
| 4720 | |
| 4721 | // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) |
| 4722 | } else { |
| 4723 | // Use the same loop as above to seek `elem` from the start |
| 4724 | while ( (node = ++nodeIndex && node && node[ dir ] || |
| 4725 | (diff = nodeIndex = 0) || start.pop()) ) { |
| 4726 | |
| 4727 | if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { |
| 4728 | // Cache the index of each encountered element |
| 4729 | if ( useCache ) { |
| 4730 | (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; |
| 4731 | } |
| 4732 | |
| 4733 | if ( node === elem ) { |
| 4734 | break; |
| 4735 | } |
| 4736 | } |
| 4737 | } |
| 4738 | } |
| 4739 | |
| 4740 | // Incorporate the offset, then check against cycle size |
| 4741 | diff -= last; |
| 4742 | return diff === first || ( diff % first === 0 && diff / first >= 0 ); |
| 4743 | } |
| 4744 | }; |
| 4745 | }, |
| 4746 | |
| 4747 | "PSEUDO": function( pseudo, argument ) { |
| 4748 | // pseudo-class names are case-insensitive |
| 4749 | // http://www.w3.org/TR/selectors/#pseudo-classes |
| 4750 | // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters |
| 4751 | // Remember that setFilters inherits from pseudos |
| 4752 | var args, |
| 4753 | fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || |
| 4754 | Sizzle.error( "unsupported pseudo: " + pseudo ); |
| 4755 | |
| 4756 | // The user may use createPseudo to indicate that |
| 4757 | // arguments are needed to create the filter function |
| 4758 | // just as Sizzle does |
| 4759 | if ( fn[ expando ] ) { |
| 4760 | return fn( argument ); |
| 4761 | } |
| 4762 | |
| 4763 | // But maintain support for old signatures |
| 4764 | if ( fn.length > 1 ) { |
| 4765 | args = [ pseudo, pseudo, "", argument ]; |
| 4766 | return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? |
| 4767 | markFunction(function( seed, matches ) { |
| 4768 | var idx, |
| 4769 | matched = fn( seed, argument ), |
| 4770 | i = matched.length; |
| 4771 | while ( i-- ) { |
| 4772 | idx = indexOf.call( seed, matched[i] ); |
| 4773 | seed[ idx ] = !( matches[ idx ] = matched[i] ); |
| 4774 | } |
| 4775 | }) : |
| 4776 | function( elem ) { |
| 4777 | return fn( elem, 0, args ); |
| 4778 | }; |
| 4779 | } |
| 4780 | |
| 4781 | return fn; |
| 4782 | } |
| 4783 | }, |
| 4784 | |
| 4785 | pseudos: { |
| 4786 | // Potentially complex pseudos |
| 4787 | "not": markFunction(function( selector ) { |
| 4788 | // Trim the selector passed to compile |
| 4789 | // to avoid treating leading and trailing |
| 4790 | // spaces as combinators |
| 4791 | var input = [], |
| 4792 | results = [], |
| 4793 | matcher = compile( selector.replace( rtrim, "$1" ) ); |
| 4794 | |
| 4795 | return matcher[ expando ] ? |
| 4796 | markFunction(function( seed, matches, context, xml ) { |
| 4797 | var elem, |
| 4798 | unmatched = matcher( seed, null, xml, [] ), |
| 4799 | i = seed.length; |
| 4800 | |
| 4801 | // Match elements unmatched by `matcher` |
| 4802 | while ( i-- ) { |
| 4803 | if ( (elem = unmatched[i]) ) { |
| 4804 | seed[i] = !(matches[i] = elem); |
| 4805 | } |
| 4806 | } |
| 4807 | }) : |
| 4808 | function( elem, context, xml ) { |
| 4809 | input[0] = elem; |
| 4810 | matcher( input, null, xml, results ); |
| 4811 | return !results.pop(); |
| 4812 | }; |
| 4813 | }), |
| 4814 | |
| 4815 | "has": markFunction(function( selector ) { |
| 4816 | return function( elem ) { |
| 4817 | return Sizzle( selector, elem ).length > 0; |
| 4818 | }; |
| 4819 | }), |
| 4820 | |
| 4821 | "contains": markFunction(function( text ) { |
| 4822 | return function( elem ) { |
| 4823 | return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; |
| 4824 | }; |
| 4825 | }), |
| 4826 | |
| 4827 | // Miscellaneous |
| 4828 | "target": function( elem ) { |
| 4829 | var hash = window.location && window.location.hash; |
| 4830 | return hash && hash.slice( 1 ) === elem.id; |
| 4831 | }, |
| 4832 | |
| 4833 | "root": function( elem ) { |
| 4834 | return elem === docElem; |
| 4835 | }, |
| 4836 | |
| 4837 | "focus": function( elem ) { |
| 4838 | return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); |
| 4839 | }, |
| 4840 | |
| 4841 | // Boolean properties |
| 4842 | "enabled": function( elem ) { |
| 4843 | return elem.disabled === false; |
| 4844 | }, |
| 4845 | |
| 4846 | "disabled": function( elem ) { |
| 4847 | return elem.disabled === true; |
| 4848 | }, |
| 4849 | |
| 4850 | "checked": function( elem ) { |
| 4851 | // In CSS3, :checked should return both checked and selected elements |
| 4852 | // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked |
| 4853 | var nodeName = elem.nodeName.toLowerCase(); |
| 4854 | return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); |
| 4855 | }, |
| 4856 | |
| 4857 | "selected": function( elem ) { |
| 4858 | // Accessing this property makes selected-by-default |
| 4859 | // options in Safari work properly |
| 4860 | if ( elem.parentNode ) { |
| 4861 | elem.parentNode.selectedIndex; |
| 4862 | } |
| 4863 | |
| 4864 | return elem.selected === true; |
| 4865 | }, |
| 4866 | |
| 4867 | // Contents |
| 4868 | "empty": function( elem ) { |
| 4869 | // http://www.w3.org/TR/selectors/#empty-pseudo |
| 4870 | // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), |
| 4871 | // not comment, processing instructions, or others |
| 4872 | // Thanks to Diego Perini for the nodeName shortcut |
| 4873 | // Greater than "@" means alpha characters (specifically not starting with "#" or "?") |
| 4874 | for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { |
| 4875 | if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { |
| 4876 | return false; |
| 4877 | } |
| 4878 | } |
| 4879 | return true; |
| 4880 | }, |
| 4881 | |
| 4882 | "parent": function( elem ) { |
| 4883 | return !Expr.pseudos["empty"]( elem ); |
| 4884 | }, |
| 4885 | |
| 4886 | // Element/input types |
| 4887 | "header": function( elem ) { |
| 4888 | return rheader.test( elem.nodeName ); |
| 4889 | }, |
| 4890 | |
| 4891 | "input": function( elem ) { |
| 4892 | return rinputs.test( elem.nodeName ); |
| 4893 | }, |
| 4894 | |
| 4895 | "button": function( elem ) { |
| 4896 | var name = elem.nodeName.toLowerCase(); |
| 4897 | return name === "input" && elem.type === "button" || name === "button"; |
| 4898 | }, |
| 4899 | |
| 4900 | "text": function( elem ) { |
| 4901 | var attr; |
| 4902 | // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) |
| 4903 | // use getAttribute instead to test this case |
| 4904 | return elem.nodeName.toLowerCase() === "input" && |
| 4905 | elem.type === "text" && |
| 4906 | ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); |
| 4907 | }, |
| 4908 | |
| 4909 | // Position-in-collection |
| 4910 | "first": createPositionalPseudo(function() { |
| 4911 | return [ 0 ]; |
| 4912 | }), |
| 4913 | |
| 4914 | "last": createPositionalPseudo(function( matchIndexes, length ) { |
| 4915 | return [ length - 1 ]; |
| 4916 | }), |
| 4917 | |
| 4918 | "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { |
| 4919 | return [ argument < 0 ? argument + length : argument ]; |
| 4920 | }), |
| 4921 | |
| 4922 | "even": createPositionalPseudo(function( matchIndexes, length ) { |
| 4923 | var i = 0; |
| 4924 | for ( ; i < length; i += 2 ) { |
| 4925 | matchIndexes.push( i ); |
| 4926 | } |
| 4927 | return matchIndexes; |
| 4928 | }), |
| 4929 | |
| 4930 | "odd": createPositionalPseudo(function( matchIndexes, length ) { |
| 4931 | var i = 1; |
| 4932 | for ( ; i < length; i += 2 ) { |
| 4933 | matchIndexes.push( i ); |
| 4934 | } |
| 4935 | return matchIndexes; |
| 4936 | }), |
| 4937 | |
| 4938 | "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { |
| 4939 | var i = argument < 0 ? argument + length : argument; |
| 4940 | for ( ; --i >= 0; ) { |
| 4941 | matchIndexes.push( i ); |
| 4942 | } |
| 4943 | return matchIndexes; |
| 4944 | }), |
| 4945 | |
| 4946 | "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { |
| 4947 | var i = argument < 0 ? argument + length : argument; |
| 4948 | for ( ; ++i < length; ) { |
| 4949 | matchIndexes.push( i ); |
| 4950 | } |
| 4951 | return matchIndexes; |
| 4952 | }) |
| 4953 | } |
| 4954 | }; |
| 4955 | |
| 4956 | // Add button/input type pseudos |
| 4957 | for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { |
| 4958 | Expr.pseudos[ i ] = createInputPseudo( i ); |
| 4959 | } |
| 4960 | for ( i in { submit: true, reset: true } ) { |
| 4961 | Expr.pseudos[ i ] = createButtonPseudo( i ); |
| 4962 | } |
| 4963 | |
| 4964 | function tokenize( selector, parseOnly ) { |
| 4965 | var matched, match, tokens, type, |
| 4966 | soFar, groups, preFilters, |
| 4967 | cached = tokenCache[ expando ][ selector + " " ]; |
| 4968 | |
| 4969 | if ( cached ) { |
| 4970 | return parseOnly ? 0 : cached.slice( 0 ); |
| 4971 | } |
| 4972 | |
| 4973 | soFar = selector; |
| 4974 | groups = []; |
| 4975 | preFilters = Expr.preFilter; |
| 4976 | |
| 4977 | while ( soFar ) { |
| 4978 | |
| 4979 | // Comma and first run |
| 4980 | if ( !matched || (match = rcomma.exec( soFar )) ) { |
| 4981 | if ( match ) { |
| 4982 | // Don't consume trailing commas as valid |
| 4983 | soFar = soFar.slice( match[0].length ) || soFar; |
| 4984 | } |
| 4985 | groups.push( tokens = [] ); |
| 4986 | } |
| 4987 | |
| 4988 | matched = false; |
| 4989 | |
| 4990 | // Combinators |
| 4991 | if ( (match = rcombinators.exec( soFar )) ) { |
| 4992 | tokens.push( matched = new Token( match.shift() ) ); |
| 4993 | soFar = soFar.slice( matched.length ); |
| 4994 | |
| 4995 | // Cast descendant combinators to space |
| 4996 | matched.type = match[0].replace( rtrim, " " ); |
| 4997 | } |
| 4998 | |
| 4999 | // Filters |
| 5000 | for ( type in Expr.filter ) { |
| 5001 | if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || |
| 5002 | (match = preFilters[ type ]( match ))) ) { |
| 5003 | |
| 5004 | tokens.push( matched = new Token( match.shift() ) ); |
| 5005 | soFar = soFar.slice( matched.length ); |
| 5006 | matched.type = type; |
| 5007 | matched.matches = match; |
| 5008 | } |
| 5009 | } |
| 5010 | |
| 5011 | if ( !matched ) { |
| 5012 | break; |
| 5013 | } |
| 5014 | } |
| 5015 | |
| 5016 | // Return the length of the invalid excess |
| 5017 | // if we're just parsing |
| 5018 | // Otherwise, throw an error or return tokens |
| 5019 | return parseOnly ? |
| 5020 | soFar.length : |
| 5021 | soFar ? |
| 5022 | Sizzle.error( selector ) : |
| 5023 | // Cache the tokens |
| 5024 | tokenCache( selector, groups ).slice( 0 ); |
| 5025 | } |
| 5026 | |
| 5027 | function addCombinator( matcher, combinator, base ) { |
| 5028 | var dir = combinator.dir, |
| 5029 | checkNonElements = base && combinator.dir === "parentNode", |
| 5030 | doneName = done++; |
| 5031 | |
| 5032 | return combinator.first ? |
| 5033 | // Check against closest ancestor/preceding element |
| 5034 | function( elem, context, xml ) { |
| 5035 | while ( (elem = elem[ dir ]) ) { |
| 5036 | if ( elem.nodeType === 1 || checkNonElements ) { |
| 5037 | return matcher( elem, context, xml ); |
| 5038 | } |
| 5039 | } |
| 5040 | } : |
| 5041 | |
| 5042 | // Check against all ancestor/preceding elements |
| 5043 | function( elem, context, xml ) { |
| 5044 | var data, cache, outerCache, |
| 5045 | dirkey = dirruns + " " + doneName; |
| 5046 | |
| 5047 | // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching |
| 5048 | if ( xml ) { |
| 5049 | while ( (elem = elem[ dir ]) ) { |
| 5050 | if ( elem.nodeType === 1 || checkNonElements ) { |
| 5051 | if ( matcher( elem, context, xml ) ) { |
| 5052 | return true; |
| 5053 | } |
| 5054 | } |
| 5055 | } |
| 5056 | } else { |
| 5057 | while ( (elem = elem[ dir ]) ) { |
| 5058 | if ( elem.nodeType === 1 || checkNonElements ) { |
| 5059 | outerCache = elem[ expando ] || (elem[ expando ] = {}); |
| 5060 | if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { |
| 5061 | if ( (data = cache[1]) === true || data === cachedruns ) { |
| 5062 | return data === true; |
| 5063 | } |
| 5064 | } else { |
| 5065 | cache = outerCache[ dir ] = [ dirkey ]; |
| 5066 | cache[1] = matcher( elem, context, xml ) || cachedruns; |
| 5067 | if ( cache[1] === true ) { |
| 5068 | return true; |
| 5069 | } |
| 5070 | } |
| 5071 | } |
| 5072 | } |
| 5073 | } |
| 5074 | }; |
| 5075 | } |
| 5076 | |
| 5077 | function elementMatcher( matchers ) { |
| 5078 | return matchers.length > 1 ? |
| 5079 | function( elem, context, xml ) { |
| 5080 | var i = matchers.length; |
| 5081 | while ( i-- ) { |
| 5082 | if ( !matchers[i]( elem, context, xml ) ) { |
| 5083 | return false; |
| 5084 | } |
| 5085 | } |
| 5086 | return true; |
| 5087 | } : |
| 5088 | matchers[0]; |
| 5089 | } |
| 5090 | |
| 5091 | function condense( unmatched, map, filter, context, xml ) { |
| 5092 | var elem, |
| 5093 | newUnmatched = [], |
| 5094 | i = 0, |
| 5095 | len = unmatched.length, |
| 5096 | mapped = map != null; |
| 5097 | |
| 5098 | for ( ; i < len; i++ ) { |
| 5099 | if ( (elem = unmatched[i]) ) { |
| 5100 | if ( !filter || filter( elem, context, xml ) ) { |
| 5101 | newUnmatched.push( elem ); |
| 5102 | if ( mapped ) { |
| 5103 | map.push( i ); |
| 5104 | } |
| 5105 | } |
| 5106 | } |
| 5107 | } |
| 5108 | |
| 5109 | return newUnmatched; |
| 5110 | } |
| 5111 | |
| 5112 | function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { |
| 5113 | if ( postFilter && !postFilter[ expando ] ) { |
| 5114 | postFilter = setMatcher( postFilter ); |
| 5115 | } |
| 5116 | if ( postFinder && !postFinder[ expando ] ) { |
| 5117 | postFinder = setMatcher( postFinder, postSelector ); |
| 5118 | } |
| 5119 | return markFunction(function( seed, results, context, xml ) { |
| 5120 | var temp, i, elem, |
| 5121 | preMap = [], |
| 5122 | postMap = [], |
| 5123 | preexisting = results.length, |
| 5124 | |
| 5125 | // Get initial elements from seed or context |
| 5126 | elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), |
| 5127 | |
| 5128 | // Prefilter to get matcher input, preserving a map for seed-results synchronization |
| 5129 | matcherIn = preFilter && ( seed || !selector ) ? |
| 5130 | condense( elems, preMap, preFilter, context, xml ) : |
| 5131 | elems, |
| 5132 | |
| 5133 | matcherOut = matcher ? |
| 5134 | // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, |
| 5135 | postFinder || ( seed ? preFilter : preexisting || postFilter ) ? |
| 5136 | |
| 5137 | // ...intermediate processing is necessary |
| 5138 | [] : |
| 5139 | |
| 5140 | // ...otherwise use results directly |
| 5141 | results : |
| 5142 | matcherIn; |
| 5143 | |
| 5144 | // Find primary matches |
| 5145 | if ( matcher ) { |
| 5146 | matcher( matcherIn, matcherOut, context, xml ); |
| 5147 | } |
| 5148 | |
| 5149 | // Apply postFilter |
| 5150 | if ( postFilter ) { |
| 5151 | temp = condense( matcherOut, postMap ); |
| 5152 | postFilter( temp, [], context, xml ); |
| 5153 | |
| 5154 | // Un-match failing elements by moving them back to matcherIn |
| 5155 | i = temp.length; |
| 5156 | while ( i-- ) { |
| 5157 | if ( (elem = temp[i]) ) { |
| 5158 | matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); |
| 5159 | } |
| 5160 | } |
| 5161 | } |
| 5162 | |
| 5163 | if ( seed ) { |
| 5164 | if ( postFinder || preFilter ) { |
| 5165 | if ( postFinder ) { |
| 5166 | // Get the final matcherOut by condensing this intermediate into postFinder contexts |
| 5167 | temp = []; |
| 5168 | i = matcherOut.length; |
| 5169 | while ( i-- ) { |
| 5170 | if ( (elem = matcherOut[i]) ) { |
| 5171 | // Restore matcherIn since elem is not yet a final match |
| 5172 | temp.push( (matcherIn[i] = elem) ); |
| 5173 | } |
| 5174 | } |
| 5175 | postFinder( null, (matcherOut = []), temp, xml ); |
| 5176 | } |
| 5177 | |
| 5178 | // Move matched elements from seed to results to keep them synchronized |
| 5179 | i = matcherOut.length; |
| 5180 | while ( i-- ) { |
| 5181 | if ( (elem = matcherOut[i]) && |
| 5182 | (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { |
| 5183 | |
| 5184 | seed[temp] = !(results[temp] = elem); |
| 5185 | } |
| 5186 | } |
| 5187 | } |
| 5188 | |
| 5189 | // Add elements to results, through postFinder if defined |
| 5190 | } else { |
| 5191 | matcherOut = condense( |
| 5192 | matcherOut === results ? |
| 5193 | matcherOut.splice( preexisting, matcherOut.length ) : |
| 5194 |   |