Make WordPress Core

Changeset 15991


Ignore:
Timestamp:
10/27/2010 12:58:41 AM (13 years ago)
Author:
nacin
Message:

jQuery 1.4.4 preview as of Wed Oct 27 00:55:02 2010. see #15227.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/jquery/jquery.js

    r15840 r15991  
    11/*!
    2  * jQuery JavaScript Library v1.4.3
     2 * jQuery JavaScript Library vPulled Live From Git
    33 * http://jquery.com/
    44 *
     
    1212 * Released under the MIT, BSD, and GPL Licenses.
    1313 *
    14  * Date: Thu Oct 14 23:10:06 2010 -0400
     14 * Date: Wed Oct 27 00:55:02 2010
    1515 */
    16 (function(E,A){function U(){return false}function ba(){return true}function ja(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ga(a){var b,d,e=[],f=[],h,k,l,n,s,v,B,D;k=c.data(this,this.nodeType?"events":"__events__");if(typeof k==="function")k=k.events;if(!(a.liveFired===this||!k||!k.live||a.button&&a.type==="click")){if(a.namespace)D=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var H=k.live.slice(0);for(n=0;n<H.length;n++){k=H[n];k.origType.replace(X,
    17 "")===a.type?f.push(k.selector):H.splice(n--,1)}f=c(a.target).closest(f,a.currentTarget);s=0;for(v=f.length;s<v;s++){B=f[s];for(n=0;n<H.length;n++){k=H[n];if(B.selector===k.selector&&(!D||D.test(k.namespace))){l=B.elem;h=null;if(k.preType==="mouseenter"||k.preType==="mouseleave"){a.type=k.preType;h=c(a.relatedTarget).closest(k.selector)[0]}if(!h||h!==l)e.push({elem:l,handleObj:k,level:B.level})}}}s=0;for(v=e.length;s<v;s++){f=e[s];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;
    18 a.handleObj=f.handleObj;D=f.handleObj.origHandler.apply(f.elem,arguments);if(D===false||a.isPropagationStopped()){d=f.level;if(D===false)b=false}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(Ha,"`").replace(Ia,"&")}function ka(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Ja.test(b))return c.filter(b,
    19 e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function la(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var k in e[h])c.event.add(this,h,e[h][k],e[h][k].data)}}})}function Ka(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}
    20 function ma(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?La:Ma,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function ca(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Na.test(a)?e(a,h):ca(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?
    21 e(a,""):c.each(b,function(f,h){ca(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(na.concat.apply([],na.slice(0,b)),function(){d[this]=a});return d}function oa(a){if(!da[a]){var b=c("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";da[a]=d}return da[a]}function ea(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var u=E.document,c=function(){function a(){if(!b.isReady){try{u.documentElement.doScroll("left")}catch(i){setTimeout(a,
    22 1);return}b.ready()}}var b=function(i,r){return new b.fn.init(i,r)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,k=/\S/,l=/^\s+/,n=/\s+$/,s=/\W/,v=/\d/,B=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,D=/^[\],:{}\s]*$/,H=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,G=/(?:^|:|,)(?:\s*\[)+/g,M=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,j=/(msie) ([\w.]+)/,o=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,
    23 q=[],t,x=Object.prototype.toString,C=Object.prototype.hasOwnProperty,P=Array.prototype.push,N=Array.prototype.slice,R=String.prototype.trim,Q=Array.prototype.indexOf,L={};b.fn=b.prototype={init:function(i,r){var y,z,F;if(!i)return this;if(i.nodeType){this.context=this[0]=i;this.length=1;return this}if(i==="body"&&!r&&u.body){this.context=u;this[0]=u.body;this.selector="body";this.length=1;return this}if(typeof i==="string")if((y=h.exec(i))&&(y[1]||!r))if(y[1]){F=r?r.ownerDocument||r:u;if(z=B.exec(i))if(b.isPlainObject(r)){i=
    24 [u.createElement(z[1])];b.fn.attr.call(i,r,true)}else i=[F.createElement(z[1])];else{z=b.buildFragment([y[1]],[F]);i=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,i)}else{if((z=u.getElementById(y[2]))&&z.parentNode){if(z.id!==y[2])return f.find(i);this.length=1;this[0]=z}this.context=u;this.selector=i;return this}else if(!r&&!s.test(i)){this.selector=i;this.context=u;i=u.getElementsByTagName(i);return b.merge(this,i)}else return!r||r.jquery?(r||f).find(i):b(r).find(i);
    25 else if(b.isFunction(i))return f.ready(i);if(i.selector!==A){this.selector=i.selector;this.context=i.context}return b.makeArray(i,this)},selector:"",jquery:"1.4.3",length:0,size:function(){return this.length},toArray:function(){return N.call(this,0)},get:function(i){return i==null?this.toArray():i<0?this.slice(i)[0]:this[i]},pushStack:function(i,r,y){var z=b();b.isArray(i)?P.apply(z,i):b.merge(z,i);z.prevObject=this;z.context=this.context;if(r==="find")z.selector=this.selector+(this.selector?" ":
    26 "")+y;else if(r)z.selector=this.selector+"."+r+"("+y+")";return z},each:function(i,r){return b.each(this,i,r)},ready:function(i){b.bindReady();if(b.isReady)i.call(u,b);else q&&q.push(i);return this},eq:function(i){return i===-1?this.slice(i):this.slice(i,+i+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(i){return this.pushStack(b.map(this,function(r,y){return i.call(r,
    27 y,r)}))},end:function(){return this.prevObject||b(null)},push:P,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var i=arguments[0]||{},r=1,y=arguments.length,z=false,F,I,K,J,fa;if(typeof i==="boolean"){z=i;i=arguments[1]||{};r=2}if(typeof i!=="object"&&!b.isFunction(i))i={};if(y===r){i=this;--r}for(;r<y;r++)if((F=arguments[r])!=null)for(I in F){K=i[I];J=F[I];if(i!==J)if(z&&J&&(b.isPlainObject(J)||(fa=b.isArray(J)))){if(fa){fa=false;clone=K&&b.isArray(K)?K:[]}else clone=
    28 K&&b.isPlainObject(K)?K:{};i[I]=b.extend(z,clone,J)}else if(J!==A)i[I]=J}return i};b.extend({noConflict:function(i){E.$=e;if(i)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(i){i===true&&b.readyWait--;if(!b.readyWait||i!==true&&!b.isReady){if(!u.body)return setTimeout(b.ready,1);b.isReady=true;if(!(i!==true&&--b.readyWait>0)){if(q){for(var r=0;i=q[r++];)i.call(u,b);q=null}b.fn.triggerHandler&&b(u).triggerHandler("ready")}}},bindReady:function(){if(!p){p=true;if(u.readyState==="complete")return setTimeout(b.ready,
    29 1);if(u.addEventListener){u.addEventListener("DOMContentLoaded",t,false);E.addEventListener("load",b.ready,false)}else if(u.attachEvent){u.attachEvent("onreadystatechange",t);E.attachEvent("onload",b.ready);var i=false;try{i=E.frameElement==null}catch(r){}u.documentElement.doScroll&&i&&a()}}},isFunction:function(i){return b.type(i)==="function"},isArray:Array.isArray||function(i){return b.type(i)==="array"},isWindow:function(i){return i&&typeof i==="object"&&"setInterval"in i},isNaN:function(i){return i==
    30 null||!v.test(i)||isNaN(i)},type:function(i){return i==null?String(i):L[x.call(i)]||"object"},isPlainObject:function(i){if(!i||b.type(i)!=="object"||i.nodeType||b.isWindow(i))return false;if(i.constructor&&!C.call(i,"constructor")&&!C.call(i.constructor.prototype,"isPrototypeOf"))return false;for(var r in i);return r===A||C.call(i,r)},isEmptyObject:function(i){for(var r in i)return false;return true},error:function(i){throw i;},parseJSON:function(i){if(typeof i!=="string"||!i)return null;i=b.trim(i);
    31 if(D.test(i.replace(H,"@").replace(w,"]").replace(G,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(i):(new Function("return "+i))();else b.error("Invalid JSON: "+i)},noop:function(){},globalEval:function(i){if(i&&k.test(i)){var r=u.getElementsByTagName("head")[0]||u.documentElement,y=u.createElement("script");y.type="text/javascript";if(b.support.scriptEval)y.appendChild(u.createTextNode(i));else y.text=i;r.insertBefore(y,r.firstChild);r.removeChild(y)}},nodeName:function(i,r){return i.nodeName&&i.nodeName.toUpperCase()===
    32 r.toUpperCase()},each:function(i,r,y){var z,F=0,I=i.length,K=I===A||b.isFunction(i);if(y)if(K)for(z in i){if(r.apply(i[z],y)===false)break}else for(;F<I;){if(r.apply(i[F++],y)===false)break}else if(K)for(z in i){if(r.call(i[z],z,i[z])===false)break}else for(y=i[0];F<I&&r.call(y,F,y)!==false;y=i[++F]);return i},trim:R?function(i){return i==null?"":R.call(i)}:function(i){return i==null?"":i.toString().replace(l,"").replace(n,"")},makeArray:function(i,r){var y=r||[];if(i!=null){var z=b.type(i);i.length==
    33 null||z==="string"||z==="function"||z==="regexp"||b.isWindow(i)?P.call(y,i):b.merge(y,i)}return y},inArray:function(i,r){if(r.indexOf)return r.indexOf(i);for(var y=0,z=r.length;y<z;y++)if(r[y]===i)return y;return-1},merge:function(i,r){var y=i.length,z=0;if(typeof r.length==="number")for(var F=r.length;z<F;z++)i[y++]=r[z];else for(;r[z]!==A;)i[y++]=r[z++];i.length=y;return i},grep:function(i,r,y){var z=[],F;y=!!y;for(var I=0,K=i.length;I<K;I++){F=!!r(i[I],I);y!==F&&z.push(i[I])}return z},map:function(i,
    34 r,y){for(var z=[],F,I=0,K=i.length;I<K;I++){F=r(i[I],I,y);if(F!=null)z[z.length]=F}return z.concat.apply([],z)},guid:1,proxy:function(i,r,y){if(arguments.length===2)if(typeof r==="string"){y=i;i=y[r];r=A}else if(r&&!b.isFunction(r)){y=r;r=A}if(!r&&i)r=function(){return i.apply(y||this,arguments)};if(i)r.guid=i.guid=i.guid||r.guid||b.guid++;return r},access:function(i,r,y,z,F,I){var K=i.length;if(typeof r==="object"){for(var J in r)b.access(i,J,r[J],z,F,y);return i}if(y!==A){z=!I&&z&&b.isFunction(y);
    35 for(J=0;J<K;J++)F(i[J],r,z?y.call(i[J],J,F(i[J],r)):y,I);return i}return K?F(i[0],r):A},now:function(){return(new Date).getTime()},uaMatch:function(i){i=i.toLowerCase();i=M.exec(i)||g.exec(i)||j.exec(i)||i.indexOf("compatible")<0&&o.exec(i)||[];return{browser:i[1]||"",version:i[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(i,r){L["[object "+r+"]"]=r.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=
    36 m.version}if(b.browser.webkit)b.browser.safari=true;if(Q)b.inArray=function(i,r){return Q.call(r,i)};if(!/\s/.test("\u00a0")){l=/^[\s\xA0]+/;n=/[\s\xA0]+$/}f=b(u);if(u.addEventListener)t=function(){u.removeEventListener("DOMContentLoaded",t,false);b.ready()};else if(u.attachEvent)t=function(){if(u.readyState==="complete"){u.detachEvent("onreadystatechange",t);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=u.documentElement,b=u.createElement("script"),d=u.createElement("div"),
    37 e="script"+c.now();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],k=u.createElement("select"),l=k.appendChild(u.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),
    38 hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:l.selected,optDisabled:false,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};k.disabled=true;c.support.optDisabled=!l.disabled;b.type="text/javascript";try{b.appendChild(u.createTextNode("window."+e+"=1;"))}catch(n){}a.insertBefore(b,
    39 a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function s(){c.support.noCloneEvent=false;d.detachEvent("onclick",s)});d.cloneNode(true).fireEvent("onclick")}d=u.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=u.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var s=u.createElement("div");
    40 s.style.width=s.style.paddingLeft="1px";u.body.appendChild(s);c.boxModel=c.support.boxModel=s.offsetWidth===2;if("zoom"in s.style){s.style.display="inline";s.style.zoom=1;c.support.inlineBlockNeedsLayout=s.offsetWidth===2;s.style.display="";s.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=s.offsetWidth!==2}s.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var v=s.getElementsByTagName("td");c.support.reliableHiddenOffsets=v[0].offsetHeight===
    41 0;v[0].style.display="";v[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&v[0].offsetHeight===0;s.innerHTML="";u.body.removeChild(s).style.display="none"});a=function(s){var v=u.createElement("div");s="on"+s;var B=s in v;if(!B){v.setAttribute(s,"return;");B=typeof v[s]==="function"}return B};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",
    42 cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var pa={},Oa=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?pa:a;var e=a.nodeType,f=e?a[c.expando]:null,h=c.cache;if(!(e&&!f&&typeof b==="string"&&d===A)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=
    43 c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==A)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?pa:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);else if(d)delete f[e];else for(var k in a)delete a[k]}},acceptData:function(a){if(a.nodeName){var b=
    44 c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){if(typeof a==="undefined")return this.length?c.data(this[0]):null;else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===A){var e=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(e===A&&this.length){e=c.data(this[0],a);if(e===A&&this[0].nodeType===1){e=this[0].getAttribute("data-"+a);if(typeof e===
    45 "string")try{e=e==="true"?true:e==="false"?false:e==="null"?null:!c.isNaN(e)?parseFloat(e):Oa.test(e)?c.parseJSON(e):e}catch(f){}else e=A}}return e===A&&d[1]?this.data(d[0]):e}else return this.each(function(){var h=c(this),k=[d[0],b];h.triggerHandler("setData"+d[1]+"!",k);c.data(this,a,b);h.triggerHandler("changeData"+d[1]+"!",k)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e=c.data(a,b);if(!d)return e||
    46 [];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===A)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,
    47 a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var qa=/[\n\t]/g,ga=/\s+/,Pa=/\r/g,Qa=/^(?:href|src|style)$/,Ra=/^(?:button|input)$/i,Sa=/^(?:button|input|object|select|textarea)$/i,Ta=/^a(?:rea)?$/i,ra=/^(?:radio|checkbox)$/i;c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,
    48 a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(s){var v=c(this);v.addClass(a.call(this,s,v.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ga),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1)if(f.className){for(var h=" "+f.className+" ",k=f.className,l=0,n=b.length;l<n;l++)if(h.indexOf(" "+b[l]+" ")<0)k+=" "+b[l];f.className=c.trim(k)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(n){var s=
    49 c(this);s.removeClass(a.call(this,n,s.attr("class")))});if(a&&typeof a==="string"||a===A)for(var b=(a||"").split(ga),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(qa," "),k=0,l=b.length;k<l;k++)h=h.replace(" "+b[k]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,
    50 f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,k=c(this),l=b,n=a.split(ga);f=n[h++];){l=e?l:!k.hasClass(f);k[l?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(qa," ").indexOf(a)>-1)return true;return false},
    51 val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var k=f[h];if(k.selected&&(c.support.optDisabled?!k.disabled:k.getAttribute("disabled")===null)&&(!k.parentNode.disabled||!c.nodeName(k.parentNode,"optgroup"))){a=c(k).val();if(b)return a;d.push(a)}}return d}if(ra.test(b.type)&&
    52 !c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Pa,"")}return A}var l=c.isFunction(a);return this.each(function(n){var s=c(this),v=a;if(this.nodeType===1){if(l)v=a.call(this,n,s.val());if(v==null)v="";else if(typeof v==="number")v+="";else if(c.isArray(v))v=c.map(v,function(D){return D==null?"":D+""});if(c.isArray(v)&&ra.test(this.type))this.checked=c.inArray(s.val(),v)>=0;else if(c.nodeName(this,"select")){var B=c.makeArray(v);c("option",this).each(function(){this.selected=
    53 c.inArray(c(this).val(),B)>=0});if(!B.length)this.selectedIndex=-1}else this.value=v}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return A;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==A;b=e&&c.props[b]||b;if(a.nodeType===1){var h=Qa.test(b);if((b in a||a[b]!==A)&&e&&!h){if(f){b==="type"&&Ra.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
    54 if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Sa.test(a.nodeName)||Ta.test(a.nodeName)&&a.href?0:A;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return A;a=!c.support.hrefNormalized&&e&&
    55 h?a.getAttribute(b,2):a.getAttribute(b);return a===null?A:a}}});var X=/\.(.*)$/,ha=/^(?:textarea|input|select)$/i,Ha=/\./g,Ia=/ /g,Ua=/[^\w\s.|`]/g,Va=function(a){return a.replace(Ua,"\\$&")},sa={focusin:0,focusout:0};c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var k=a.nodeType?"events":"__events__",l=h[k],n=h.handle;if(typeof l===
    56 "function"){n=l.handle;l=l.events}else if(!l){a.nodeType||(h[k]=h=function(){});h.events=l={}}if(!n)h.handle=n=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(n.elem,arguments):A};n.elem=a;b=b.split(" ");for(var s=0,v;k=b[s++];){h=f?c.extend({},f):{handler:d,data:e};if(k.indexOf(".")>-1){v=k.split(".");k=v.shift();h.namespace=v.slice(0).sort().join(".")}else{v=[];h.namespace=""}h.type=k;if(!h.guid)h.guid=d.guid;var B=l[k],D=c.event.special[k]||{};if(!B){B=l[k]=[];
    57 if(!D.setup||D.setup.call(a,e,v,n)===false)if(a.addEventListener)a.addEventListener(k,n,false);else a.attachEvent&&a.attachEvent("on"+k,n)}if(D.add){D.add.call(a,h);if(!h.handler.guid)h.handler.guid=d.guid}B.push(h);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,k=0,l,n,s,v,B,D,H=a.nodeType?"events":"__events__",w=c.data(a),G=w&&w[H];if(w&&G){if(typeof G==="function"){w=G;G=G.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||
    58 typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in G)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[k++];){v=f;l=f.indexOf(".")<0;n=[];if(!l){n=f.split(".");f=n.shift();s=RegExp("(^|\\.)"+c.map(n.slice(0).sort(),Va).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(B=G[f])if(d){v=c.event.special[f]||{};for(h=e||0;h<B.length;h++){D=B[h];if(d.guid===D.guid){if(l||s.test(D.namespace)){e==null&&B.splice(h--,1);v.remove&&v.remove.call(a,D)}if(e!=null)break}}if(B.length===0||e!=null&&B.length===1){if(!v.teardown||
    59 v.teardown.call(a,n)===false)c.removeEvent(a,f,w.handle);delete G[f]}}else for(h=0;h<B.length;h++){D=B[h];if(l||s.test(D.namespace)){c.event.remove(a,v,D.handler,h);B.splice(h--,1)}}}if(c.isEmptyObject(G)){if(b=w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,H);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=
    60 f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return A;a.result=A;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===
    61 false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){e=a.target;var k,l=f.replace(X,""),n=c.nodeName(e,"a")&&l==="click",s=c.event.special[l]||{};if((!s._default||s._default.call(d,a)===false)&&!n&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[l]){if(k=e["on"+l])e["on"+l]=null;c.event.triggered=true;e[l]()}}catch(v){}if(k)e["on"+l]=k;c.event.triggered=false}}},handle:function(a){var b,d,e;
    62 d=[];var f,h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var k=d.length;f<k;f++){var l=d[f];if(b||e.test(l.namespace)){a.handler=l.handler;a.data=
    63 l.data;a.handleObj=l;l=l.handler.apply(this,h);if(l!==A){a.result=l;if(l===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
    64 fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||u;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=u.documentElement;d=u.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
    65 d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==A)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ga,guid:a.handler.guid}))},remove:function(a){c.event.remove(this,
    66 Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=u.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=
    67 c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ba;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ba;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ba;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U};
    68 var ta=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},ua=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?ua:ta,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?ua:ta)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!==
    69 "form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=A;return ja("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=A;return ja("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V,
    70 va=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ha.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=va(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===A||f===e))if(e!=null||f){a.type="change";a.liveFired=
    71 A;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",va(a))}},setup:function(){if(this.type===
    72 "file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ha.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ha.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}u.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){sa[b]++===0&&u.addEventListener(a,d,true)},teardown:function(){--sa[b]===
    73 0&&u.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=A}var k=b==="one"?c.proxy(f,function(n){c(this).unbind(n,k);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var l=this.length;h<l;h++)c.event.add(this[h],d,k,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,
    74 a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d=
    75 1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var wa={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var k,l=0,n,s,v=h||this.selector;h=h?this:c(this.context);if(typeof d===
    76 "object"&&!d.preventDefault){for(k in d)h[b](k,e,d[k],v);return this}if(c.isFunction(e)){f=e;e=A}for(d=(d||"").split(" ");(k=d[l++])!=null;){n=X.exec(k);s="";if(n){s=n[0];k=k.replace(X,"")}if(k==="hover")d.push("mouseenter"+s,"mouseleave"+s);else{n=k;if(k==="focus"||k==="blur"){d.push(wa[k]+s);k+=s}else k=(wa[k]||k)+s;if(b==="live"){s=0;for(var B=h.length;s<B;s++)c.event.add(h[s],"live."+Y(k,v),{data:e,selector:v,handler:f,origType:k,origHandler:f,preType:n})}else h.unbind("live."+Y(k,v),f)}}return this}});
    77 c.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".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
    78 (function(){function a(g,j,o,m,p,q){p=0;for(var t=m.length;p<t;p++){var x=m[p];if(x){x=x[g];for(var C=false;x;){if(x.sizcache===o){C=m[x.sizset];break}if(x.nodeType===1&&!q){x.sizcache=o;x.sizset=p}if(x.nodeName.toLowerCase()===j){C=x;break}x=x[g]}m[p]=C}}}function b(g,j,o,m,p,q){p=0;for(var t=m.length;p<t;p++){var x=m[p];if(x){x=x[g];for(var C=false;x;){if(x.sizcache===o){C=m[x.sizset];break}if(x.nodeType===1){if(!q){x.sizcache=o;x.sizset=p}if(typeof j!=="string"){if(x===j){C=true;break}}else if(l.filter(j,
    79 [x]).length>0){C=x;break}}x=x[g]}m[p]=C}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,k=true;[0,0].sort(function(){k=false;return 0});var l=function(g,j,o,m){o=o||[];var p=j=j||u;if(j.nodeType!==1&&j.nodeType!==9)return[];if(!g||typeof g!=="string")return o;var q=[],t,x,C,P,N=true,R=l.isXML(j),Q=g,L;do{d.exec("");if(t=d.exec(Q)){Q=t[3];q.push(t[1]);if(t[2]){P=t[3];
    80 break}}}while(t);if(q.length>1&&s.exec(g))if(q.length===2&&n.relative[q[0]])x=M(q[0]+q[1],j);else for(x=n.relative[q[0]]?[j]:l(q.shift(),j);q.length;){g=q.shift();if(n.relative[g])g+=q.shift();x=M(g,x)}else{if(!m&&q.length>1&&j.nodeType===9&&!R&&n.match.ID.test(q[0])&&!n.match.ID.test(q[q.length-1])){t=l.find(q.shift(),j,R);j=t.expr?l.filter(t.expr,t.set)[0]:t.set[0]}if(j){t=m?{expr:q.pop(),set:D(m)}:l.find(q.pop(),q.length===1&&(q[0]==="~"||q[0]==="+")&&j.parentNode?j.parentNode:j,R);x=t.expr?l.filter(t.expr,
    81 t.set):t.set;if(q.length>0)C=D(x);else N=false;for(;q.length;){t=L=q.pop();if(n.relative[L])t=q.pop();else L="";if(t==null)t=j;n.relative[L](C,t,R)}}else C=[]}C||(C=x);C||l.error(L||g);if(f.call(C)==="[object Array]")if(N)if(j&&j.nodeType===1)for(g=0;C[g]!=null;g++){if(C[g]&&(C[g]===true||C[g].nodeType===1&&l.contains(j,C[g])))o.push(x[g])}else for(g=0;C[g]!=null;g++)C[g]&&C[g].nodeType===1&&o.push(x[g]);else o.push.apply(o,C);else D(C,o);if(P){l(P,p,o,m);l.uniqueSort(o)}return o};l.uniqueSort=function(g){if(w){h=
    82 k;g.sort(w);if(h)for(var j=1;j<g.length;j++)g[j]===g[j-1]&&g.splice(j--,1)}return g};l.matches=function(g,j){return l(g,null,null,j)};l.matchesSelector=function(g,j){return l(j,null,null,[g]).length>0};l.find=function(g,j,o){var m;if(!g)return[];for(var p=0,q=n.order.length;p<q;p++){var t=n.order[p],x;if(x=n.leftMatch[t].exec(g)){var C=x[1];x.splice(1,1);if(C.substr(C.length-1)!=="\\"){x[1]=(x[1]||"").replace(/\\/g,"");m=n.find[t](x,j,o);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=j.getElementsByTagName("*"));
    83 return{set:m,expr:g}};l.filter=function(g,j,o,m){for(var p=g,q=[],t=j,x,C,P=j&&j[0]&&l.isXML(j[0]);g&&j.length;){for(var N in n.filter)if((x=n.leftMatch[N].exec(g))!=null&&x[2]){var R=n.filter[N],Q,L;L=x[1];C=false;x.splice(1,1);if(L.substr(L.length-1)!=="\\"){if(t===q)q=[];if(n.preFilter[N])if(x=n.preFilter[N](x,t,o,q,m,P)){if(x===true)continue}else C=Q=true;if(x)for(var i=0;(L=t[i])!=null;i++)if(L){Q=R(L,x,i,t);var r=m^!!Q;if(o&&Q!=null)if(r)C=true;else t[i]=false;else if(r){q.push(L);C=true}}if(Q!==
    84 A){o||(t=q);g=g.replace(n.match[N],"");if(!C)return[];break}}}if(g===p)if(C==null)l.error(g);else break;p=g}return t};l.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=l.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
    85 POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,j){var o=typeof j==="string",m=o&&!/\W/.test(j);o=o&&!m;if(m)j=j.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=o||q&&q.nodeName.toLowerCase()===
    86 j?q||false:q===j}o&&l.filter(j,g,true)},">":function(g,j){var o=typeof j==="string",m,p=0,q=g.length;if(o&&!/\W/.test(j))for(j=j.toLowerCase();p<q;p++){if(m=g[p]){o=m.parentNode;g[p]=o.nodeName.toLowerCase()===j?o:false}}else{for(;p<q;p++)if(m=g[p])g[p]=o?m.parentNode:m.parentNode===j;o&&l.filter(j,g,true)}},"":function(g,j,o){var m=e++,p=b,q;if(typeof j==="string"&&!/\W/.test(j)){q=j=j.toLowerCase();p=a}p("parentNode",j,m,g,q,o)},"~":function(g,j,o){var m=e++,p=b,q;if(typeof j==="string"&&!/\W/.test(j)){q=
    87 j=j.toLowerCase();p=a}p("previousSibling",j,m,g,q,o)}},find:{ID:function(g,j,o){if(typeof j.getElementById!=="undefined"&&!o)return(g=j.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,j){if(typeof j.getElementsByName!=="undefined"){for(var o=[],m=j.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&o.push(m[p]);return o.length===0?null:o}},TAG:function(g,j){return j.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,j,o,m,p,q){g=" "+g[1].replace(/\\/g,
    88 "")+" ";if(q)return g;q=0;for(var t;(t=j[q])!=null;q++)if(t)if(p^(t.className&&(" "+t.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))o||m.push(t);else if(o)j[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var j=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=j[1]+(j[2]||1)-0;g[3]=j[3]-0}g[0]=e++;return g},ATTR:function(g,j,o,
    89 m,p,q){j=g[1].replace(/\\/g,"");if(!q&&n.attrMap[j])g[1]=n.attrMap[j];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,j,o,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=l(g[3],null,null,j);else{g=l.filter(g[3],j,o,true^p);o||m.push.apply(m,g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===
    90 true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,j,o){return!!l(o[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===
    91 g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,j){return j===0},last:function(g,j,o,m){return j===m.length-1},even:function(g,j){return j%2===0},odd:function(g,j){return j%2===1},lt:function(g,j,o){return j<o[3]-0},gt:function(g,j,o){return j>o[3]-0},nth:function(g,j,o){return o[3]-
    92 0===j},eq:function(g,j,o){return o[3]-0===j}},filter:{PSEUDO:function(g,j,o,m){var p=j[1],q=n.filters[p];if(q)return q(g,o,j,m);else if(p==="contains")return(g.textContent||g.innerText||l.getText([g])||"").indexOf(j[3])>=0;else if(p==="not"){j=j[3];o=0;for(m=j.length;o<m;o++)if(j[o]===g)return false;return true}else l.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,j){var o=j[1],m=g;switch(o){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(o===
    93 "first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":o=j[2];var p=j[3];if(o===1&&p===0)return true;var q=j[0],t=g.parentNode;if(t&&(t.sizcache!==q||!g.nodeIndex)){var x=0;for(m=t.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++x;t.sizcache=q}m=g.nodeIndex-p;return o===0?m===0:m%o===0&&m/o>=0}},ID:function(g,j){return g.nodeType===1&&g.getAttribute("id")===j},TAG:function(g,j){return j==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===
    94 j},CLASS:function(g,j){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(j)>-1},ATTR:function(g,j){var o=j[1];o=n.attrHandle[o]?n.attrHandle[o](g):g[o]!=null?g[o]:g.getAttribute(o);var m=o+"",p=j[2],q=j[4];return o==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&o!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,j,o,m){var p=n.setFilters[j[2]];
    95 if(p)return p(g,o,j,m)}}},s=n.match.POS,v=function(g,j){return"\\"+(j-0+1)},B;for(B in n.match){n.match[B]=RegExp(n.match[B].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[B]=RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[B].source.replace(/\\(\d+)/g,v))}var D=function(g,j){g=Array.prototype.slice.call(g,0);if(j){j.push.apply(j,g);return j}return g};try{Array.prototype.slice.call(u.documentElement.childNodes,0)}catch(H){D=function(g,j){var o=j||[],m=0;if(f.call(g)==="[object Array]")Array.prototype.push.apply(o,
    96 g);else if(typeof g.length==="number")for(var p=g.length;m<p;m++)o.push(g[m]);else for(;g[m];m++)o.push(g[m]);return o}}var w,G;if(u.documentElement.compareDocumentPosition)w=function(g,j){if(g===j){h=true;return 0}if(!g.compareDocumentPosition||!j.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(j)&4?-1:1};else{w=function(g,j){var o=[],m=[],p=g.parentNode,q=j.parentNode,t=p;if(g===j){h=true;return 0}else if(p===q)return G(g,j);else if(p){if(!q)return 1}else return-1;
    97 for(;t;){o.unshift(t);t=t.parentNode}for(t=q;t;){m.unshift(t);t=t.parentNode}p=o.length;q=m.length;for(t=0;t<p&&t<q;t++)if(o[t]!==m[t])return G(o[t],m[t]);return t===p?G(g,m[t],-1):G(o[t],j,1)};G=function(g,j,o){if(g===j)return o;for(g=g.nextSibling;g;){if(g===j)return-1;g=g.nextSibling}return 1}}l.getText=function(g){for(var j="",o,m=0;g[m];m++){o=g[m];if(o.nodeType===3||o.nodeType===4)j+=o.nodeValue;else if(o.nodeType!==8)j+=l.getText(o.childNodes)}return j};(function(){var g=u.createElement("div"),
    98 j="script"+(new Date).getTime();g.innerHTML="<a name='"+j+"'/>";var o=u.documentElement;o.insertBefore(g,o.firstChild);if(u.getElementById(j)){n.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:A:[]};n.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}o.removeChild(g);
    99 o=g=null})();(function(){var g=u.createElement("div");g.appendChild(u.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(j,o){var m=o.getElementsByTagName(j[1]);if(j[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(j){return j.getAttribute("href",2)};g=null})();u.querySelectorAll&&
    100 function(){var g=l,j=u.createElement("div");j.innerHTML="<p class='TEST'></p>";if(!(j.querySelectorAll&&j.querySelectorAll(".TEST").length===0)){l=function(m,p,q,t){p=p||u;if(!t&&!l.isXML(p))if(p.nodeType===9)try{return D(p.querySelectorAll(m),q)}catch(x){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var C=p.id,P=p.id="__sizzle__";try{return D(p.querySelectorAll("#"+P+" "+m),q)}catch(N){}finally{if(C)p.id=C;else p.removeAttribute("id")}}return g(m,p,q,t)};for(var o in g)l[o]=g[o];
    101 j=null}}();(function(){var g=u.documentElement,j=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,o=false;try{j.call(u.documentElement,":sizzle")}catch(m){o=true}if(j)l.matchesSelector=function(p,q){try{if(o||!n.match.PSEUDO.test(q))return j.call(p,q)}catch(t){}return l(q,null,null,[p]).length>0}})();(function(){var g=u.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===
    102 0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(j,o,m){if(typeof o.getElementsByClassName!=="undefined"&&!m)return o.getElementsByClassName(j[1])};g=null}}})();l.contains=u.documentElement.contains?function(g,j){return g!==j&&(g.contains?g.contains(j):true)}:function(g,j){return!!(g.compareDocumentPosition(j)&16)};l.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var M=function(g,
    103 j){for(var o=[],m="",p,q=j.nodeType?[j]:j;p=n.match.PSEUDO.exec(g);){m+=p[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;p=0;for(var t=q.length;p<t;p++)l(g,q[p],o);return l.filter(m,o)};c.find=l;c.expr=l.selectors;c.expr[":"]=c.expr.filters;c.unique=l.uniqueSort;c.text=l.getText;c.isXMLDoc=l.isXML;c.contains=l.contains})();var Wa=/Until$/,Xa=/^(?:parents|prevUntil|prevAll)/,Ya=/,/,Ja=/^.[^:#\[\.,]*$/,Za=Array.prototype.slice,$a=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("",
    104 "find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var k=0;k<d;k++)if(b[k]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(ka(this,a,false),"not",a)},filter:function(a){return this.pushStack(ka(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,
    105 b){var d=[],e,f,h=this[0];if(c.isArray(a)){var k={},l,n=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:n})}h=h.parentNode;n++}}return d}k=$a.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(k?k.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||
    106 !h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});
    107 c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",
    108 d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Wa.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||Ya.test(e))&&Xa.test(a))f=f.reverse();return this.pushStack(f,a,Za.call(arguments).join(","))}});
    109 c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===A||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var xa=/ jQuery\d+="(?:\d+|null)"/g,
    110 $=/^\s+/,ya=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,za=/<([\w:]+)/,ab=/<tbody/i,bb=/<|&#?\w+;/,Aa=/<(?:script|object|embed|option|style)/i,Ba=/checked\s*(?:[^=]|=\s*.checked.)/i,cb=/\=([^="'>\s]+\/)>/g,O={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>"],
    111 area:[1,"<map>","</map>"],_default:[0,"",""]};O.optgroup=O.option;O.tbody=O.tfoot=O.colgroup=O.caption=O.thead;O.th=O.td;if(!c.support.htmlSerialize)O._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==A)return this.empty().append((this[0]&&this[0].ownerDocument||u).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,
    112 d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},
    113 unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=
    114 c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));
    115 c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(xa,"").replace(cb,'="$1">').replace($,
    116 "")],e)[0]}else return this.cloneNode(true)});if(a===true){la(this,b);la(this.find("*"),b.find("*"))}return b},html:function(a){if(a===A)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(xa,""):null;else if(typeof a==="string"&&!Aa.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!O[(za.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ya,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?
    117 this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,
    118 true)},domManip:function(a,b,d){var e,f,h=a[0],k=[],l;if(!c.support.checkClone&&arguments.length===3&&typeof h==="string"&&Ba.test(h))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(h))return this.each(function(s){var v=c(this);a[0]=h.call(this,s,b?v.html():A);v.domManip(a,b,d)});if(this[0]){e=h&&h.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);l=e.fragment;if(f=l.childNodes.length===1?l=l.firstChild:
    119 l.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var n=this.length;f<n;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):this[f]:this[f],f>0||e.cacheable||this.length>1?l.cloneNode(true):l)}k.length&&c.each(k,Ka)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:u;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===u&&!Aa.test(a[0])&&(c.support.checkClone||
    120 !Ba.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=
    121 d.length;f<h;f++){var k=(f>0?this.clone(true):this).get();c(d[f])[b](k);e=e.concat(k)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||u;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||u;for(var f=[],h=0,k;(k=a[h])!=null;h++){if(typeof k==="number")k+="";if(k){if(typeof k==="string"&&!bb.test(k))k=b.createTextNode(k);else if(typeof k==="string"){k=k.replace(ya,"<$1></$2>");var l=(za.exec(k)||["",""])[1].toLowerCase(),n=O[l]||O._default,
    122 s=n[0],v=b.createElement("div");for(v.innerHTML=n[1]+k+n[2];s--;)v=v.lastChild;if(!c.support.tbody){s=ab.test(k);l=l==="table"&&!s?v.firstChild&&v.firstChild.childNodes:n[1]==="<table>"&&!s?v.childNodes:[];for(n=l.length-1;n>=0;--n)c.nodeName(l[n],"tbody")&&!l[n].childNodes.length&&l[n].parentNode.removeChild(l[n])}!c.support.leadingWhitespace&&$.test(k)&&v.insertBefore(b.createTextNode($.exec(k)[0]),v.firstChild);k=v.childNodes}if(k.nodeType)f.push(k);else f=c.merge(f,k)}}if(d)for(h=0;f[h];h++)if(e&&
    123 c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,k=0,l;(l=a[k])!=null;k++)if(!(l.nodeName&&c.noData[l.nodeName.toLowerCase()]))if(d=l[c.expando]){if((b=e[d])&&b.events)for(var n in b.events)f[n]?
    124 c.event.remove(l,n):c.removeEvent(l,n,b.handle);if(h)delete l[c.expando];else l.removeAttribute&&l.removeAttribute(c.expando);delete e[d]}}});var Ca=/alpha\([^)]*\)/i,db=/opacity=([^)]*)/,eb=/-([a-z])/ig,fb=/([A-Z])/g,Da=/^-?\d+(?:px)?$/i,gb=/^-?\d/,hb={position:"absolute",visibility:"hidden",display:"block"},La=["Left","Right"],Ma=["Top","Bottom"],W,ib=u.defaultView&&u.defaultView.getComputedStyle,jb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===A)return this;
    125 return c.access(this,a,b,true,function(d,e,f){return f!==A?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),k=a.style,l=c.cssHooks[h];b=c.cssProps[h]||
    126 h;if(d!==A){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!l||!("set"in l)||(d=l.set(a,d))!==A)try{k[b]=d}catch(n){}}}else{if(l&&"get"in l&&(f=l.get(a,false,e))!==A)return f;return k[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==A)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=
    127 e[f]},camelCase:function(a){return a.replace(eb,jb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=ma(d,b,f);else c.swap(d,hb,function(){h=ma(d,b,f)});return h+"px"}},set:function(d,e){if(Da.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return db.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":
    128 b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=d.filter||"";d.filter=Ca.test(f)?f.replace(Ca,e):d.filter+" "+e}};if(ib)W=function(a,b,d){var e;d=d.replace(fb,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return A;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};else if(u.documentElement.currentStyle)W=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],
    129 h=a.style;if(!Da.test(f)&&gb.test(f)){d=h.left;e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f};if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var kb=c.now(),lb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
    130 mb=/^(?:select|textarea)/i,nb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ob=/^(?:GET|HEAD|DELETE)$/,Na=/\[\]$/,T=/\=\?(&|$)/,ia=/\?/,pb=/([?&])_=[^&]*/,qb=/^(\w+:)?\/\/([^\/?#]+)/,rb=/%20/g,sb=/#.*$/,Ea=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ea)return Ea.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=
    131 b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(k,l){if(l==="success"||l==="notmodified")h.html(f?c("<div>").append(k.responseText.replace(lb,"")).find(f):k.responseText);d&&h.each(d,[k.responseText,l,k])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&
    132 !this.disabled&&(this.checked||mb.test(this.nodeName)||nb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},
    133 getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",
    134 script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),k=ob.test(h);b.url=b.url.replace(sb,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ia.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||
    135 !T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+kb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var l=E[d];E[d]=function(m){f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);if(c.isFunction(l))l(m);else{E[d]=A;try{delete E[d]}catch(p){}}v&&v.removeChild(B)}}if(b.dataType==="script"&&b.cache===null)b.cache=
    136 false;if(b.cache===false&&h==="GET"){var n=c.now(),s=b.url.replace(pb,"$1_="+n);b.url=s+(s===b.url?(ia.test(b.url)?"&":"?")+"_="+n:"")}if(b.data&&h==="GET")b.url+=(ia.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");n=(n=qb.exec(b.url))&&(n[1]&&n[1]!==location.protocol||n[2]!==location.host);if(b.dataType==="script"&&h==="GET"&&n){var v=u.getElementsByTagName("head")[0]||u.documentElement,B=u.createElement("script");if(b.scriptCharset)B.charset=b.scriptCharset;B.src=
    137 b.url;if(!d){var D=false;B.onload=B.onreadystatechange=function(){if(!D&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){D=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);B.onload=B.onreadystatechange=null;v&&B.parentNode&&v.removeChild(B)}}}v.insertBefore(B,v.firstChild);return A}var H=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!k||a&&a.contentType)w.setRequestHeader("Content-Type",
    138 b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}n||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(G){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&&
    139 c.triggerGlobal(b,"ajaxSend",[w,b]);var M=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){H||c.handleComplete(b,w,e,f);H=true;if(w)w.onreadystatechange=c.noop}else if(!H&&w&&(w.readyState===4||m==="timeout")){H=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d||
    140 c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&g.call&&g.call(w);M("abort")}}catch(j){}b.async&&b.timeout>0&&setTimeout(function(){w&&!H&&M("timeout")},b.timeout);try{w.send(k||b.data==null?null:b.data)}catch(o){c.handleError(b,w,null,o);c.handleComplete(b,w,e,f)}b.async||M();return w}},param:function(a,b){var d=[],e=function(h,k){k=c.isFunction(k)?k():k;d[d.length]=encodeURIComponent(h)+
    141 "="+encodeURIComponent(k)};if(b===A)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)ca(f,a[f],b,e);return d.join("&").replace(rb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",[b,a])},handleComplete:function(a,
    142 b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),e=a.getResponseHeader("Etag");
    143 if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});if(E.ActiveXObject)c.ajaxSettings.xhr=
    144 function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var da={},tb=/^(?:toggle|show|hide)$/,ub=/^([+\-]=)?([\d+.\-]+)(.*)$/,aa,na=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",3),a,b,d);else{a=
    145 0;for(b=this.length;a<b;a++){if(!c.data(this[a],"olddisplay")&&this[a].style.display==="none")this[a].style.display="";this[a].style.display===""&&c.css(this[a],"display")==="none"&&c.data(this[a],"olddisplay",oa(this[a].nodeName))}for(a=0;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay",d)}for(a=
    146 0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b,d,e);if(c.isEmptyObject(a))return this.each(f.complete);
    147 return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),k,l=this.nodeType===1,n=l&&c(this).is(":hidden"),s=this;for(k in a){var v=c.camelCase(k);if(k!==v){a[v]=a[k];delete a[k];k=v}if(a[k]==="hide"&&n||a[k]==="show"&&!n)return h.complete.call(this);if(l&&(k==="height"||k==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(oa(this.nodeName)===
    148 "inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[k])){(h.specialEasing=h.specialEasing||{})[k]=a[k][1];a[k]=a[k][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(B,D){var H=new c.fx(s,h,B);if(tb.test(D))H[D==="toggle"?n?"show":"hide":D](a);else{var w=ub.exec(D),G=H.cur(true)||0;if(w){var M=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(s,B,(M||1)+g);
    149 G=(M||1)/H.cur(true)*G;c.style(s,B,G+g)}if(w[1])M=(w[1]==="-="?-1:1)*M+G;H.custom(G,M,g)}else H.custom(G,D,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b,
    150 d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*
    151 Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(h){return f.step(h)}
    152 this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var f=this;a=c.fx;e.elem=this.elem;if(e()&&c.timers.push(e)&&!aa)aa=setInterval(a.tick,a.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;
    153 this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(l,n){f.style["overflow"+n]=h.overflow[l]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||
    154 this.options.show)for(var k in this.options.curAnim)c.style(this.elem,k,this.options.orig[k]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=
    155 c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(aa);aa=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===
    156 b.elem}).length};var vb=/^t(?:able|d|h)$/i,Fa=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in u.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(k){c.offset.setOffset(this,a,k)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=ea(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&&
    157 h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(s){c.offset.setOffset(this,a,s)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,e=b.ownerDocument,f,h=e.documentElement,k=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;
    158 for(var l=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==k&&b!==h;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;f=e?e.getComputedStyle(b,null):b.currentStyle;l-=b.scrollTop;n-=b.scrollLeft;if(b===d){l+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&vb.test(b.nodeName))){l+=parseFloat(f.borderTopWidth)||0;n+=parseFloat(f.borderLeftWidth)||0}d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&f.overflow!=="visible"){l+=
    159 parseFloat(f.borderTopWidth)||0;n+=parseFloat(f.borderLeftWidth)||0}f=f}if(f.position==="relative"||f.position==="static"){l+=k.offsetTop;n+=k.offsetLeft}if(c.offset.supportsFixedPosition&&f.position==="fixed"){l+=Math.max(h.scrollTop,k.scrollTop);n+=Math.max(h.scrollLeft,k.scrollLeft)}return{top:l,left:n}};c.offset={initialize:function(){var a=u.body,b=u.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",
    160 height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=
    161 f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a,
    162 "marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),k=c.css(a,"top"),l=c.css(a,"left"),n=e==="absolute"&&c.inArray("auto",[k,l])>-1;e={};var s={};if(n)s=f.position();k=n?s.top:parseInt(k,10)||0;l=n?s.left:parseInt(l,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+k;if(b.left!=null)e.left=b.left-h.left+l;"using"in b?b.using.call(a,
    163 e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Fa.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||u.body;a&&!Fa.test(a.nodeName)&&
    164 c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==A)return this.each(function(){if(h=ea(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=ea(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();
    165 c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(h){var k=c(this);k[d](e.call(this,h,k[d]()))});return c.isWindow(f)?f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b]:f.nodeType===9?Math.max(f.documentElement["client"+
    166 b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]):e===A?parseFloat(c.css(f,d)):this.css(d,typeof e==="string"?e:e+"px")}})})(window);jQuery.noConflict();
     16(function( window, undefined ) {
     17
     18// Use the correct document accordingly with window argument (sandbox)
     19var document = window.document;
     20var jQuery = (function() {
     21
     22// Define a local copy of jQuery
     23var jQuery = function( selector, context ) {
     24        // The jQuery object is actually just the init constructor 'enhanced'
     25        return new jQuery.fn.init( selector, context );
     26    },
     27
     28    // Map over jQuery in case of overwrite
     29    _jQuery = window.jQuery,
     30
     31    // Map over the $ in case of overwrite
     32    _$ = window.$,
     33
     34    // A central reference to the root jQuery(document)
     35    rootjQuery,
     36
     37    // A simple way to check for HTML strings or ID strings
     38    // (both of which we optimize for)
     39    quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
     40
     41    // Is it a simple selector
     42    isSimple = /^.[^:#\[\.,]*$/,
     43
     44    // Check if a string has a non-whitespace character in it
     45    rnotwhite = /\S/,
     46    rwhite = /\s/,
     47
     48    // Used for trimming whitespace
     49    trimLeft = /^\s+/,
     50    trimRight = /\s+$/,
     51
     52    // Check for non-word characters
     53    rnonword = /\W/,
     54
     55    // Check for digits
     56    rdigit = /\d/,
     57
     58    // Match a standalone tag
     59    rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
     60
     61    // JSON RegExp
     62    rvalidchars = /^[\],:{}\s]*$/,
     63    rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
     64    rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
     65    rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
     66
     67    // Useragent RegExp
     68    rwebkit = /(webkit)[ \/]([\w.]+)/,
     69    ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
     70    rmsie = /(msie) ([\w.]+)/,
     71    rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
     72
     73    // Keep a UserAgent string for use with jQuery.browser
     74    userAgent = navigator.userAgent,
     75
     76    // For matching the engine and version of the browser
     77    browserMatch,
     78   
     79    // Has the ready events already been bound?
     80    readyBound = false,
     81   
     82    // The functions to execute on DOM ready
     83    readyList = [],
     84
     85    // The ready event handler
     86    DOMContentLoaded,
     87
     88    // Save a reference to some core methods
     89    toString = Object.prototype.toString,
     90    hasOwn = Object.prototype.hasOwnProperty,
     91    push = Array.prototype.push,
     92    slice = Array.prototype.slice,
     93    trim = String.prototype.trim,
     94    indexOf = Array.prototype.indexOf,
     95   
     96    // [[Class]] -> type pairs
     97    class2type = {};
     98
     99jQuery.fn = jQuery.prototype = {
     100    init: function( selector, context ) {
     101        var match, elem, ret, doc;
     102
     103        // Handle $(""), $(null), or $(undefined)
     104        if ( !selector ) {
     105            return this;
     106        }
     107
     108        // Handle $(DOMElement)
     109        if ( selector.nodeType ) {
     110            this.context = this[0] = selector;
     111            this.length = 1;
     112            return this;
     113        }
     114       
     115        // The body element only exists once, optimize finding it
     116        if ( selector === "body" && !context && document.body ) {
     117            this.context = document;
     118            this[0] = document.body;
     119            this.selector = "body";
     120            this.length = 1;
     121            return this;
     122        }
     123
     124        // Handle HTML strings
     125        if ( typeof selector === "string" ) {
     126            // Are we dealing with HTML string or an ID?
     127            match = quickExpr.exec( selector );
     128
     129            // Verify a match, and that no context was specified for #id
     130            if ( match && (match[1] || !context) ) {
     131
     132                // HANDLE: $(html) -> $(array)
     133                if ( match[1] ) {
     134                    doc = (context ? context.ownerDocument || context : document);
     135
     136                    // If a single string is passed in and it's a single tag
     137                    // just do a createElement and skip the rest
     138                    ret = rsingleTag.exec( selector );
     139
     140                    if ( ret ) {
     141                        if ( jQuery.isPlainObject( context ) ) {
     142                            selector = [ document.createElement( ret[1] ) ];
     143                            jQuery.fn.attr.call( selector, context, true );
     144
     145                        } else {
     146                            selector = [ doc.createElement( ret[1] ) ];
     147                        }
     148
     149                    } else {
     150                        ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
     151                        selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
     152                    }
     153                   
     154                    return jQuery.merge( this, selector );
     155                   
     156                // HANDLE: $("#id")
     157                } else {
     158                    elem = document.getElementById( match[2] );
     159
     160                    // Check parentNode to catch when Blackberry 4.6 returns
     161                    // nodes that are no longer in the document #6963
     162                    if ( elem && elem.parentNode ) {
     163                        // Handle the case where IE and Opera return items
     164                        // by name instead of ID
     165                        if ( elem.id !== match[2] ) {
     166                            return rootjQuery.find( selector );
     167                        }
     168
     169                        // Otherwise, we inject the element directly into the jQuery object
     170                        this.length = 1;
     171                        this[0] = elem;
     172                    }
     173
     174                    this.context = document;
     175                    this.selector = selector;
     176                    return this;
     177                }
     178
     179            // HANDLE: $("TAG")
     180            } else if ( !context && !rnonword.test( selector ) ) {
     181                this.selector = selector;
     182                this.context = document;
     183                selector = document.getElementsByTagName( selector );
     184                return jQuery.merge( this, selector );
     185
     186            // HANDLE: $(expr, $(...))
     187            } else if ( !context || context.jquery ) {
     188                return (context || rootjQuery).find( selector );
     189
     190            // HANDLE: $(expr, context)
     191            // (which is just equivalent to: $(context).find(expr)
     192            } else {
     193                return jQuery( context ).find( selector );
     194            }
     195
     196        // HANDLE: $(function)
     197        // Shortcut for document ready
     198        } else if ( jQuery.isFunction( selector ) ) {
     199            return rootjQuery.ready( selector );
     200        }
     201
     202        if (selector.selector !== undefined) {
     203            this.selector = selector.selector;
     204            this.context = selector.context;
     205        }
     206
     207        return jQuery.makeArray( selector, this );
     208    },
     209
     210    // Start with an empty selector
     211    selector: "",
     212
     213    // The current version of jQuery being used
     214    jquery: "Pulled Live From Git",
     215
     216    // The default length of a jQuery object is 0
     217    length: 0,
     218
     219    // The number of elements contained in the matched element set
     220    size: function() {
     221        return this.length;
     222    },
     223
     224    toArray: function() {
     225        return slice.call( this, 0 );
     226    },
     227
     228    // Get the Nth element in the matched element set OR
     229    // Get the whole matched element set as a clean array
     230    get: function( num ) {
     231        return num == null ?
     232
     233            // Return a 'clean' array
     234            this.toArray() :
     235
     236            // Return just the object
     237            ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
     238    },
     239
     240    // Take an array of elements and push it onto the stack
     241    // (returning the new matched element set)
     242    pushStack: function( elems, name, selector ) {
     243        // Build a new jQuery matched element set
     244        var ret = jQuery();
     245
     246        if ( jQuery.isArray( elems ) ) {
     247            push.apply( ret, elems );
     248       
     249        } else {
     250            jQuery.merge( ret, elems );
     251        }
     252
     253        // Add the old object onto the stack (as a reference)
     254        ret.prevObject = this;
     255
     256        ret.context = this.context;
     257
     258        if ( name === "find" ) {
     259            ret.selector = this.selector + (this.selector ? " " : "") + selector;
     260        } else if ( name ) {
     261            ret.selector = this.selector + "." + name + "(" + selector + ")";
     262        }
     263
     264        // Return the newly-formed element set
     265        return ret;
     266    },
     267
     268    // Execute a callback for every element in the matched set.
     269    // (You can seed the arguments with an array of args, but this is
     270    // only used internally.)
     271    each: function( callback, args ) {
     272        return jQuery.each( this, callback, args );
     273    },
     274   
     275    ready: function( fn ) {
     276        // Attach the listeners
     277        jQuery.bindReady();
     278
     279        // If the DOM is already ready
     280        if ( jQuery.isReady ) {
     281            // Execute the function immediately
     282            fn.call( document, jQuery );
     283
     284        // Otherwise, remember the function for later
     285        } else if ( readyList ) {
     286            // Add the function to the wait list
     287            readyList.push( fn );
     288        }
     289
     290        return this;
     291    },
     292   
     293    eq: function( i ) {
     294        return i === -1 ?
     295            this.slice( i ) :
     296            this.slice( i, +i + 1 );
     297    },
     298
     299    first: function() {
     300        return this.eq( 0 );
     301    },
     302
     303    last: function() {
     304        return this.eq( -1 );
     305    },
     306
     307    slice: function() {
     308        return this.pushStack( slice.apply( this, arguments ),
     309            "slice", slice.call(arguments).join(",") );
     310    },
     311
     312    map: function( callback ) {
     313        return this.pushStack( jQuery.map(this, function( elem, i ) {
     314            return callback.call( elem, i, elem );
     315        }));
     316    },
     317   
     318    end: function() {
     319        return this.prevObject || jQuery(null);
     320    },
     321
     322    // For internal use only.
     323    // Behaves like an Array's method, not like a jQuery method.
     324    push: push,
     325    sort: [].sort,
     326    splice: [].splice
     327};
     328
     329// Give the init function the jQuery prototype for later instantiation
     330jQuery.fn.init.prototype = jQuery.fn;
     331
     332jQuery.extend = jQuery.fn.extend = function() {
     333    // copy reference to target object
     334    var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy, copyIsArray, clone;
     335
     336    // Handle a deep copy situation
     337    if ( typeof target === "boolean" ) {
     338        deep = target;
     339        target = arguments[1] || {};
     340        // skip the boolean and the target
     341        i = 2;
     342    }
     343
     344    // Handle case when target is a string or something (possible in deep copy)
     345    if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
     346        target = {};
     347    }
     348
     349    // extend jQuery itself if only one argument is passed
     350    if ( length === i ) {
     351        target = this;
     352        --i;
     353    }
     354
     355    for ( ; i < length; i++ ) {
     356        // Only deal with non-null/undefined values
     357        if ( (options = arguments[ i ]) != null ) {
     358            // Extend the base object
     359            for ( name in options ) {
     360                src = target[ name ];
     361                copy = options[ name ];
     362
     363                // Prevent never-ending loop
     364                if ( target === copy ) {
     365                    continue;
     366                }
     367
     368                // Recurse if we're merging plain objects or arrays
     369                if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
     370                    if ( copyIsArray ) {
     371                        copyIsArray = false;
     372                        clone = src && jQuery.isArray(src) ? src : [];
     373
     374                    } else {
     375                        clone = src && jQuery.isPlainObject(src) ? src : {};
     376                    }
     377
     378                    // Never move original objects, clone them
     379                    target[ name ] = jQuery.extend( deep, clone, copy );
     380
     381                // Don't bring in undefined values
     382                } else if ( copy !== undefined ) {
     383                    target[ name ] = copy;
     384                }
     385            }
     386        }
     387    }
     388
     389    // Return the modified object
     390    return target;
     391};
     392
     393jQuery.extend({
     394    noConflict: function( deep ) {
     395        window.$ = _$;
     396
     397        if ( deep ) {
     398            window.jQuery = _jQuery;
     399        }
     400
     401        return jQuery;
     402    },
     403   
     404    // Is the DOM ready to be used? Set to true once it occurs.
     405    isReady: false,
     406
     407    // A counter to track how many items to wait for before
     408    // the ready event fires. See #6781
     409    readyWait: 1,
     410   
     411    // Handle when the DOM is ready
     412    ready: function( wait ) {
     413        // A third-party is pushing the ready event forwards
     414        if ( wait === true ) {
     415            jQuery.readyWait--;
     416        }
     417
     418        // Make sure that the DOM is not already loaded
     419        if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
     420            // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
     421            if ( !document.body ) {
     422                return setTimeout( jQuery.ready, 1 );
     423            }
     424
     425            // Remember that the DOM is ready
     426            jQuery.isReady = true;
     427
     428            // If a normal DOM Ready event fired, decrement, and wait if need be
     429            if ( wait !== true && --jQuery.readyWait > 0 ) {
     430                return;
     431            }
     432
     433            // If there are functions bound, to execute
     434            if ( readyList ) {
     435                // Execute all of them
     436                var fn, i = 0;
     437                while ( (fn = readyList[ i++ ]) ) {
     438                    fn.call( document, jQuery );
     439                }
     440
     441                // Reset the list of functions
     442                readyList = null;
     443            }
     444
     445            // Trigger any bound ready events
     446            if ( jQuery.fn.trigger ) {
     447                jQuery( document ).trigger( "ready" ).unbind( "ready" );
     448            }
     449        }
     450    },
     451   
     452    bindReady: function() {
     453        if ( readyBound ) {
     454            return;
     455        }
     456
     457        readyBound = true;
     458
     459        // Catch cases where $(document).ready() is called after the
     460        // browser event has already occurred.
     461        if ( document.readyState === "complete" ) {
     462            // Handle it asynchronously to allow scripts the opportunity to delay ready
     463            return setTimeout( jQuery.ready, 1 );
     464        }
     465
     466        // Mozilla, Opera and webkit nightlies currently support this event
     467        if ( document.addEventListener ) {
     468            // Use the handy event callback
     469            document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
     470           
     471            // A fallback to window.onload, that will always work
     472            window.addEventListener( "load", jQuery.ready, false );
     473
     474        // If IE event model is used
     475        } else if ( document.attachEvent ) {
     476            // ensure firing before onload,
     477            // maybe late but safe also for iframes
     478            document.attachEvent("onreadystatechange", DOMContentLoaded);
     479           
     480            // A fallback to window.onload, that will always work
     481            window.attachEvent( "onload", jQuery.ready );
     482
     483            // If IE and not a frame
     484            // continually check to see if the document is ready
     485            var toplevel = false;
     486
     487            try {
     488                toplevel = window.frameElement == null;
     489            } catch(e) {}
     490
     491            if ( document.documentElement.doScroll && toplevel ) {
     492                doScrollCheck();
     493            }
     494        }
     495    },
     496
     497    // See test/unit/core.js for details concerning isFunction.
     498    // Since version 1.3, DOM methods and functions like alert
     499    // aren't supported. They return false on IE (#2968).
     500    isFunction: function( obj ) {
     501        return jQuery.type(obj) === "function";
     502    },
     503
     504    isArray: Array.isArray || function( obj ) {
     505        return jQuery.type(obj) === "array";
     506    },
     507
     508    // A crude way of determining if an object is a window
     509    isWindow: function( obj ) {
     510        return obj && typeof obj === "object" && "setInterval" in obj;
     511    },
     512
     513    isNaN: function( obj ) {
     514        return obj == null || !rdigit.test( obj ) || isNaN( obj );
     515    },
     516
     517    type: function( obj ) {
     518        return obj == null ?
     519            String( obj ) :
     520            class2type[ toString.call(obj) ] || "object";
     521    },
     522
     523    isPlainObject: function( obj ) {
     524        // Must be an Object.
     525        // Because of IE, we also have to check the presence of the constructor property.
     526        // Make sure that DOM nodes and window objects don't pass through, as well
     527        if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
     528            return false;
     529        }
     530       
     531        // Not own constructor property must be Object
     532        if ( obj.constructor &&
     533            !hasOwn.call(obj, "constructor") &&
     534            !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
     535            return false;
     536        }
     537       
     538        // Own properties are enumerated firstly, so to speed up,
     539        // if last one is own, then all properties are own.
     540   
     541        var key;
     542        for ( key in obj ) {}
     543       
     544        return key === undefined || hasOwn.call( obj, key );
     545    },
     546
     547    isEmptyObject: function( obj ) {
     548        for ( var name in obj ) {
     549            return false;
     550        }
     551        return true;
     552    },
     553   
     554    error: function( msg ) {
     555        throw msg;
     556    },
     557   
     558    parseJSON: function( data ) {
     559        if ( typeof data !== "string" || !data ) {
     560            return null;
     561        }
     562
     563        // Make sure leading/trailing whitespace is removed (IE can't handle it)
     564        data = jQuery.trim( data );
     565       
     566        // Make sure the incoming data is actual JSON
     567        // Logic borrowed from http://json.org/json2.js
     568        if ( rvalidchars.test(data.replace(rvalidescape, "@")
     569            .replace(rvalidtokens, "]")
     570            .replace(rvalidbraces, "")) ) {
     571
     572            // Try to use the native JSON parser first
     573            return window.JSON && window.JSON.parse ?
     574                window.JSON.parse( data ) :
     575                (new Function("return " + data))();
     576
     577        } else {
     578            jQuery.error( "Invalid JSON: " + data );
     579        }
     580    },
     581
     582    noop: function() {},
     583
     584    // Evalulates a script in a global context
     585    globalEval: function( data ) {
     586        if ( data && rnotwhite.test(data) ) {
     587            // Inspired by code by Andrea Giammarchi
     588            // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
     589            var head = document.getElementsByTagName("head")[0] || document.documentElement,
     590                script = document.createElement("script");
     591
     592            script.type = "text/javascript";
     593
     594            if ( jQuery.support.scriptEval ) {
     595                script.appendChild( document.createTextNode( data ) );
     596            } else {
     597                script.text = data;
     598            }
     599
     600            // Use insertBefore instead of appendChild to circumvent an IE6 bug.
     601            // This arises when a base node is used (#2709).
     602            head.insertBefore( script, head.firstChild );
     603            head.removeChild( script );
     604        }
     605    },
     606
     607    nodeName: function( elem, name ) {
     608        return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
     609    },
     610
     611    // args is for internal usage only
     612    each: function( object, callback, args ) {
     613        var name, i = 0,
     614            length = object.length,
     615            isObj = length === undefined || jQuery.isFunction(object);
     616
     617        if ( args ) {
     618            if ( isObj ) {
     619                for ( name in object ) {
     620                    if ( callback.apply( object[ name ], args ) === false ) {
     621                        break;
     622                    }
     623                }
     624            } else {
     625                for ( ; i < length; ) {
     626                    if ( callback.apply( object[ i++ ], args ) === false ) {
     627                        break;
     628                    }
     629                }
     630            }
     631
     632        // A special, fast, case for the most common use of each
     633        } else {
     634            if ( isObj ) {
     635                for ( name in object ) {
     636                    if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
     637                        break;
     638                    }
     639                }
     640            } else {
     641                for ( var value = object[0];
     642                    i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
     643            }
     644        }
     645
     646        return object;
     647    },
     648
     649    // Use native String.trim function wherever possible
     650    trim: trim ?
     651        function( text ) {
     652            return text == null ?
     653                "" :
     654                trim.call( text );
     655        } :
     656
     657        // Otherwise use our own trimming functionality
     658        function( text ) {
     659            return text == null ?
     660                "" :
     661                text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
     662        },
     663
     664    // results is for internal usage only
     665    makeArray: function( array, results ) {
     666        var ret = results || [];
     667
     668        if ( array != null ) {
     669            // The window, strings (and functions) also have 'length'
     670            // The extra typeof function check is to prevent crashes
     671            // in Safari 2 (See: #3039)
     672            // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
     673            var type = jQuery.type(array);
     674
     675            if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
     676                push.call( ret, array );
     677            } else {
     678                jQuery.merge( ret, array );
     679            }
     680        }
     681
     682        return ret;
     683    },
     684
     685    inArray: function( elem, array ) {
     686        if ( array.indexOf ) {
     687            return array.indexOf( elem );
     688        }
     689
     690        for ( var i = 0, length = array.length; i < length; i++ ) {
     691            if ( array[ i ] === elem ) {
     692                return i;
     693            }
     694        }
     695
     696        return -1;
     697    },
     698
     699    merge: function( first, second ) {
     700        var i = first.length, j = 0;
     701
     702        if ( typeof second.length === "number" ) {
     703            for ( var l = second.length; j < l; j++ ) {
     704                first[ i++ ] = second[ j ];
     705            }
     706       
     707        } else {
     708            while ( second[j] !== undefined ) {
     709                first[ i++ ] = second[ j++ ];
     710            }
     711        }
     712
     713        first.length = i;
     714
     715        return first;
     716    },
     717
     718    grep: function( elems, callback, inv ) {
     719        var ret = [], retVal;
     720        inv = !!inv;
     721
     722        // Go through the array, only saving the items
     723        // that pass the validator function
     724        for ( var i = 0, length = elems.length; i < length; i++ ) {
     725            retVal = !!callback( elems[ i ], i );
     726            if ( inv !== retVal ) {
     727                ret.push( elems[ i ] );
     728            }
     729        }
     730
     731        return ret;
     732    },
     733
     734    // arg is for internal usage only
     735    map: function( elems, callback, arg ) {
     736        var ret = [], value;
     737
     738        // Go through the array, translating each of the items to their
     739        // new value (or values).
     740        for ( var i = 0, length = elems.length; i < length; i++ ) {
     741            value = callback( elems[ i ], i, arg );
     742
     743            if ( value != null ) {
     744                ret[ ret.length ] = value;
     745            }
     746        }
     747
     748        return ret.concat.apply( [], ret );
     749    },
     750
     751    // A global GUID counter for objects
     752    guid: 1,
     753
     754    proxy: function( fn, proxy, thisObject ) {
     755        if ( arguments.length === 2 ) {
     756            if ( typeof proxy === "string" ) {
     757                thisObject = fn;
     758                fn = thisObject[ proxy ];
     759                proxy = undefined;
     760
     761            } else if ( proxy && !jQuery.isFunction( proxy ) ) {
     762                thisObject = proxy;
     763                proxy = undefined;
     764            }
     765        }
     766
     767        if ( !proxy && fn ) {
     768            proxy = function() {
     769                return fn.apply( thisObject || this, arguments );
     770            };
     771        }
     772
     773        // Set the guid of unique handler to the same of original handler, so it can be removed
     774        if ( fn ) {
     775            proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
     776        }
     777
     778        // So proxy can be declared as an argument
     779        return proxy;
     780    },
     781
     782    // Mutifunctional method to get and set values to a collection
     783    // The value/s can be optionally by executed if its a function
     784    access: function( elems, key, value, exec, fn, pass ) {
     785        var length = elems.length;
     786   
     787        // Setting many attributes
     788        if ( typeof key === "object" ) {
     789            for ( var k in key ) {
     790                jQuery.access( elems, k, key[k], exec, fn, value );
     791            }
     792            return elems;
     793        }
     794   
     795        // Setting one attribute
     796        if ( value !== undefined ) {
     797            // Optionally, function values get executed if exec is true
     798            exec = !pass && exec && jQuery.isFunction(value);
     799       
     800            for ( var i = 0; i < length; i++ ) {
     801                fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
     802            }
     803       
     804            return elems;
     805        }
     806   
     807        // Getting an attribute
     808        return length ? fn( elems[0], key ) : undefined;
     809    },
     810
     811    now: function() {
     812        return (new Date()).getTime();
     813    },
     814
     815    // Use of jQuery.browser is frowned upon.
     816    // More details: http://docs.jquery.com/Utilities/jQuery.browser
     817    uaMatch: function( ua ) {
     818        ua = ua.toLowerCase();
     819
     820        var match = rwebkit.exec( ua ) ||
     821            ropera.exec( ua ) ||
     822            rmsie.exec( ua ) ||
     823            ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
     824            [];
     825
     826        return { browser: match[1] || "", version: match[2] || "0" };
     827    },
     828
     829    browser: {}
     830});
     831
     832// Populate the class2type map
     833jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
     834    class2type[ "[object " + name + "]" ] = name.toLowerCase();
     835});
     836
     837browserMatch = jQuery.uaMatch( userAgent );
     838if ( browserMatch.browser ) {
     839    jQuery.browser[ browserMatch.browser ] = true;
     840    jQuery.browser.version = browserMatch.version;
     841}
     842
     843// Deprecated, use jQuery.browser.webkit instead
     844if ( jQuery.browser.webkit ) {
     845    jQuery.browser.safari = true;
     846}
     847
     848if ( indexOf ) {
     849    jQuery.inArray = function( elem, array ) {
     850        return indexOf.call( array, elem );
     851    };
     852}
     853
     854// Verify that \s matches non-breaking spaces
     855// (IE fails on this test)
     856if ( !rwhite.test( "\xA0" ) ) {
     857    trimLeft = /^[\s\xA0]+/;
     858    trimRight = /[\s\xA0]+$/;
     859}
     860
     861// All jQuery objects should point back to these
     862rootjQuery = jQuery(document);
     863
     864// Cleanup functions for the document ready method
     865if ( document.addEventListener ) {
     866    DOMContentLoaded = function() {
     867        document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
     868        jQuery.ready();
     869    };
     870
     871} else if ( document.attachEvent ) {
     872    DOMContentLoaded = function() {
     873        // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
     874        if ( document.readyState === "complete" ) {
     875            document.detachEvent( "onreadystatechange", DOMContentLoaded );
     876            jQuery.ready();
     877        }
     878    };
     879}
     880
     881// The DOM ready check for Internet Explorer
     882function doScrollCheck() {
     883    if ( jQuery.isReady ) {
     884        return;
     885    }
     886
     887    try {
     888        // If IE is used, use the trick by Diego Perini
     889        // http://javascript.nwbox.com/IEContentLoaded/
     890        document.documentElement.doScroll("left");
     891    } catch(e) {
     892        setTimeout( doScrollCheck, 1 );
     893        return;
     894    }
     895
     896    // and execute any waiting functions
     897    jQuery.ready();
     898}
     899
     900// Expose jQuery to the global object
     901return (window.jQuery = window.$ = jQuery);
     902
     903})();
     904
     905
     906(function() {
     907
     908    jQuery.support = {};
     909
     910    var root = document.documentElement,
     911        script = document.createElement("script"),
     912        div = document.createElement("div"),
     913        id = "script" + jQuery.now();
     914
     915    div.style.display = "none";
     916    div.innerHTML = "   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
     917
     918    var all = div.getElementsByTagName("*"),
     919        a = div.getElementsByTagName("a")[0],
     920        select = document.createElement("select"),
     921        opt = select.appendChild( document.createElement("option") );
     922
     923    // Can't get basic test support
     924    if ( !all || !all.length || !a ) {
     925        return;
     926    }
     927
     928    jQuery.support = {
     929        // IE strips leading whitespace when .innerHTML is used
     930        leadingWhitespace: div.firstChild.nodeType === 3,
     931
     932        // Make sure that tbody elements aren't automatically inserted
     933        // IE will insert them into empty tables
     934        tbody: !div.getElementsByTagName("tbody").length,
     935
     936        // Make sure that link elements get serialized correctly by innerHTML
     937        // This requires a wrapper element in IE
     938        htmlSerialize: !!div.getElementsByTagName("link").length,
     939
     940        // Get the style information from getAttribute
     941        // (IE uses .cssText insted)
     942        style: /red/.test( a.getAttribute("style") ),
     943
     944        // Make sure that URLs aren't manipulated
     945        // (IE normalizes it by default)
     946        hrefNormalized: a.getAttribute("href") === "/a",
     947
     948        // Make sure that element opacity exists
     949        // (IE uses filter instead)
     950        // Use a regex to work around a WebKit issue. See #5145
     951        opacity: /^0.55$/.test( a.style.opacity ),
     952
     953        // Verify style float existence
     954        // (IE uses styleFloat instead of cssFloat)
     955        cssFloat: !!a.style.cssFloat,
     956
     957        // Make sure that if no value is specified for a checkbox
     958        // that it defaults to "on".
     959        // (WebKit defaults to "" instead)
     960        checkOn: div.getElementsByTagName("input")[0].value === "on",
     961
     962        // Make sure that a selected-by-default option has a working selected property.
     963        // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
     964        optSelected: opt.selected,
     965
     966        // Will be defined later
     967        deleteExpando: true,
     968        optDisabled: false,
     969        checkClone: false,
     970        scriptEval: false,
     971        noCloneEvent: true,
     972        boxModel: null,
     973        inlineBlockNeedsLayout: false,
     974        shrinkWrapBlocks: false,
     975        reliableHiddenOffsets: true
     976    };
     977
     978    // Make sure that the options inside disabled selects aren't marked as disabled
     979    // (WebKit marks them as diabled)
     980    select.disabled = true;
     981    jQuery.support.optDisabled = !opt.disabled;
     982
     983    script.type = "text/javascript";
     984    try {
     985        script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
     986    } catch(e) {}
     987
     988    root.insertBefore( script, root.firstChild );
     989
     990    // Make sure that the execution of code works by injecting a script
     991    // tag with appendChild/createTextNode
     992    // (IE doesn't support this, fails, and uses .text instead)
     993    if ( window[ id ] ) {
     994        jQuery.support.scriptEval = true;
     995        delete window[ id ];
     996    }
     997
     998    // Test to see if it's possible to delete an expando from an element
     999    // Fails in Internet Explorer
     1000    try {
     1001        delete script.test;
     1002
     1003    } catch(e) {
     1004        jQuery.support.deleteExpando = false;
     1005    }
     1006
     1007    root.removeChild( script );
     1008
     1009    if ( div.attachEvent && div.fireEvent ) {
     1010        div.attachEvent("onclick", function click() {
     1011            // Cloning a node shouldn't copy over any
     1012            // bound event handlers (IE does this)
     1013            jQuery.support.noCloneEvent = false;
     1014            div.detachEvent("onclick", click);
     1015        });
     1016        div.cloneNode(true).fireEvent("onclick");
     1017    }
     1018
     1019    div = document.createElement("div");
     1020    div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
     1021
     1022    var fragment = document.createDocumentFragment();
     1023    fragment.appendChild( div.firstChild );
     1024
     1025    // WebKit doesn't clone checked state correctly in fragments
     1026    jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
     1027
     1028    // Figure out if the W3C box model works as expected
     1029    // document.body must exist before we can do this
     1030    jQuery(function() {
     1031        var div = document.createElement("div");
     1032        div.style.width = div.style.paddingLeft = "1px";
     1033
     1034        document.body.appendChild( div );
     1035        jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
     1036
     1037        if ( "zoom" in div.style ) {
     1038            // Check if natively block-level elements act like inline-block
     1039            // elements when setting their display to 'inline' and giving
     1040            // them layout
     1041            // (IE < 8 does this)
     1042            div.style.display = "inline";
     1043            div.style.zoom = 1;
     1044            jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;
     1045
     1046            // Check if elements with layout shrink-wrap their children
     1047            // (IE 6 does this)
     1048            div.style.display = "";
     1049            div.innerHTML = "<div style='width:4px;'></div>";
     1050            jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;
     1051        }
     1052
     1053        div.innerHTML = "<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";
     1054        var tds = div.getElementsByTagName("td");
     1055
     1056        // Check if table cells still have offsetWidth/Height when they are set
     1057        // to display:none and there are still other visible table cells in a
     1058        // table row; if so, offsetWidth/Height are not reliable for use when
     1059        // determining if an element has been hidden directly using
     1060        // display:none (it is still safe to use offsets if a parent element is
     1061        // hidden; don safety goggles and see bug #4512 for more information).
     1062        // (only IE 8 fails this test)
     1063        jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;
     1064
     1065        tds[0].style.display = "";
     1066        tds[1].style.display = "none";
     1067
     1068        // Check if empty table cells still have offsetWidth/Height
     1069        // (IE < 8 fail this test)
     1070        jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
     1071        div.innerHTML = "";
     1072
     1073        document.body.removeChild( div ).style.display = "none";
     1074        div = tds = null;
     1075    });
     1076
     1077    // Technique from Juriy Zaytsev
     1078    // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
     1079    var eventSupported = function( eventName ) {
     1080        var el = document.createElement("div");
     1081        eventName = "on" + eventName;
     1082
     1083        var isSupported = (eventName in el);
     1084        if ( !isSupported ) {
     1085            el.setAttribute(eventName, "return;");
     1086            isSupported = typeof el[eventName] === "function";
     1087        }
     1088        el = null;
     1089
     1090        return isSupported;
     1091    };
     1092
     1093    jQuery.support.submitBubbles = eventSupported("submit");
     1094    jQuery.support.changeBubbles = eventSupported("change");
     1095
     1096    // release memory in IE
     1097    root = script = div = all = a = null;
     1098})();
     1099
     1100
     1101
     1102var windowData = {},
     1103    rbrace = /^(?:\{.*\}|\[.*\])$/;
     1104
     1105jQuery.extend({
     1106    cache: {},
     1107
     1108    // Please use with caution
     1109    uuid: 0,
     1110
     1111    // Unique for each copy of jQuery on the page   
     1112    expando: "jQuery" + jQuery.now(),
     1113
     1114    // The following elements throw uncatchable exceptions if you
     1115    // attempt to add expando properties to them.
     1116    noData: {
     1117        "embed": true,
     1118        // Ban all objects except for Flash (which handle expandos)
     1119        "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
     1120        "applet": true
     1121    },
     1122
     1123    data: function( elem, name, data ) {
     1124        if ( !jQuery.acceptData( elem ) ) {
     1125            return;
     1126        }
     1127
     1128        elem = elem == window ?
     1129            windowData :
     1130            elem;
     1131
     1132        var isNode = elem.nodeType,
     1133            id = isNode ? elem[ jQuery.expando ] : null,
     1134            cache = jQuery.cache, thisCache;
     1135
     1136        if ( isNode && !id && typeof name === "string" && data === undefined ) {
     1137            return;
     1138        }
     1139
     1140        // Get the data from the object directly
     1141        if ( !isNode ) {
     1142            cache = elem;
     1143
     1144        // Compute a unique ID for the element
     1145        } else if ( !id ) {
     1146            elem[ jQuery.expando ] = id = ++jQuery.uuid;
     1147        }
     1148
     1149        // Avoid generating a new cache unless none exists and we
     1150        // want to manipulate it.
     1151        if ( typeof name === "object" ) {
     1152            if ( isNode ) {
     1153                cache[ id ] = jQuery.extend(cache[ id ], name);
     1154
     1155            } else {
     1156                jQuery.extend( cache, name );
     1157            }
     1158
     1159        } else if ( isNode && !cache[ id ] ) {
     1160            cache[ id ] = {};
     1161        }
     1162
     1163        thisCache = isNode ? cache[ id ] : cache;
     1164
     1165        // Prevent overriding the named cache with undefined values
     1166        if ( data !== undefined ) {
     1167            thisCache[ name ] = data;
     1168        }
     1169
     1170        return typeof name === "string" ? thisCache[ name ] : thisCache;
     1171    },
     1172
     1173    removeData: function( elem, name ) {
     1174        if ( !jQuery.acceptData( elem ) ) {
     1175            return;
     1176        }
     1177
     1178        elem = elem == window ?
     1179            windowData :
     1180            elem;
     1181
     1182        var isNode = elem.nodeType,
     1183            id = isNode ? elem[ jQuery.expando ] : elem,
     1184            cache = jQuery.cache,
     1185            thisCache = isNode ? cache[ id ] : id;
     1186
     1187        // If we want to remove a specific section of the element's data
     1188        if ( name ) {
     1189            if ( thisCache ) {
     1190                // Remove the section of cache data
     1191                delete thisCache[ name ];
     1192
     1193                // If we've removed all the data, remove the element's cache
     1194                if ( isNode && jQuery.isEmptyObject(thisCache) ) {
     1195                    jQuery.removeData( elem );
     1196                }
     1197            }
     1198
     1199        // Otherwise, we want to remove all of the element's data
     1200        } else {
     1201            if ( isNode && jQuery.support.deleteExpando ) {
     1202                delete elem[ jQuery.expando ];
     1203
     1204            } else if ( elem.removeAttribute ) {
     1205                elem.removeAttribute( jQuery.expando );
     1206
     1207            // Completely remove the data cache
     1208            } else if ( isNode ) {
     1209                delete cache[ id ];
     1210
     1211            // Remove all fields from the object
     1212            } else {
     1213                for ( var n in elem ) {
     1214                    delete elem[ n ];
     1215                }
     1216            }
     1217        }
     1218    },
     1219
     1220    // A method for determining if a DOM node can handle the data expando
     1221    acceptData: function( elem ) {
     1222        if ( elem.nodeName ) {
     1223            var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
     1224
     1225            if ( match ) {
     1226                return !(match === true || elem.getAttribute("classid") !== match);
     1227            }
     1228        }
     1229
     1230        return true;
     1231    }
     1232});
     1233
     1234jQuery.fn.extend({
     1235    data: function( key, value ) {
     1236        var data = null;
     1237
     1238        if ( typeof key === "undefined" ) {
     1239            if ( this.length ) {
     1240                var attr = this[0].attributes, name;
     1241                data = jQuery.data( this[0] );
     1242
     1243                for ( var i = 0, l = attr.length; i < l; i++ ) {
     1244                    name = attr[i].name;
     1245
     1246                    if ( name.indexOf( "data-" ) === 0 ) {
     1247                        name = name.substr( 5 );
     1248                        dataAttr( this[0], name, data[ name ] );
     1249                    }
     1250                }
     1251            }
     1252
     1253            return data;
     1254
     1255        } else if ( typeof key === "object" ) {
     1256            return this.each(function() {
     1257                jQuery.data( this, key );
     1258            });
     1259        }
     1260
     1261        var parts = key.split(".");
     1262        parts[1] = parts[1] ? "." + parts[1] : "";
     1263
     1264        if ( value === undefined ) {
     1265            data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
     1266
     1267            // Try to fetch any internally stored data first
     1268            if ( data === undefined && this.length ) {
     1269                data = jQuery.data( this[0], key );
     1270                data = dataAttr( this[0], key, data );
     1271            }
     1272
     1273            return data === undefined && parts[1] ?
     1274                this.data( parts[0] ) :
     1275                data;
     1276
     1277        } else {
     1278            return this.each(function() {
     1279                var $this = jQuery( this ), args = [ parts[0], value ];
     1280
     1281                $this.triggerHandler( "setData" + parts[1] + "!", args );
     1282                jQuery.data( this, key, value );
     1283                $this.triggerHandler( "changeData" + parts[1] + "!", args );
     1284            });
     1285        }
     1286    },
     1287
     1288    removeData: function( key ) {
     1289        return this.each(function() {
     1290            jQuery.removeData( this, key );
     1291        });
     1292    }
     1293});
     1294
     1295function dataAttr( elem, key, data ) {
     1296    // If nothing was found internally, try to fetch any
     1297    // data from the HTML5 data-* attribute
     1298    if ( data === undefined && elem.nodeType === 1 ) {
     1299        data = elem.getAttribute( "data-" + key );
     1300
     1301        if ( typeof data === "string" ) {
     1302            try {
     1303                data = data === "true" ? true :
     1304                data === "false" ? false :
     1305                data === "null" ? null :
     1306                !jQuery.isNaN( data ) ? parseFloat( data ) :
     1307                    rbrace.test( data ) ? jQuery.parseJSON( data ) :
     1308                    data;
     1309            } catch( e ) {}
     1310
     1311            // Make sure we set the data so it isn't changed later
     1312            jQuery.data( elem, key, data );
     1313
     1314        } else {
     1315            data = undefined;
     1316        }
     1317    }
     1318
     1319    return data;
     1320}
     1321
     1322
     1323
     1324
     1325jQuery.extend({
     1326    queue: function( elem, type, data ) {
     1327        if ( !elem ) {
     1328            return;
     1329        }
     1330
     1331        type = (type || "fx") + "queue";
     1332        var q = jQuery.data( elem, type );
     1333
     1334        // Speed up dequeue by getting out quickly if this is just a lookup
     1335        if ( !data ) {
     1336            return q || [];
     1337        }
     1338
     1339        if ( !q || jQuery.isArray(data) ) {
     1340            q = jQuery.data( elem, type, jQuery.makeArray(data) );
     1341
     1342        } else {
     1343            q.push( data );
     1344        }
     1345
     1346        return q;
     1347    },
     1348
     1349    dequeue: function( elem, type ) {
     1350        type = type || "fx";
     1351
     1352        var queue = jQuery.queue( elem, type ), fn = queue.shift();
     1353
     1354        // If the fx queue is dequeued, always remove the progress sentinel
     1355        if ( fn === "inprogress" ) {
     1356            fn = queue.shift();
     1357        }
     1358
     1359        if ( fn ) {
     1360            // Add a progress sentinel to prevent the fx queue from being
     1361            // automatically dequeued
     1362            if ( type === "fx" ) {
     1363                queue.unshift("inprogress");
     1364            }
     1365
     1366            fn.call(elem, function() {
     1367                jQuery.dequeue(elem, type);
     1368            });
     1369        }
     1370    }
     1371});
     1372
     1373jQuery.fn.extend({
     1374    queue: function( type, data ) {
     1375        if ( typeof type !== "string" ) {
     1376            data = type;
     1377            type = "fx";
     1378        }
     1379
     1380        if ( data === undefined ) {
     1381            return jQuery.queue( this[0], type );
     1382        }
     1383        return this.each(function( i ) {
     1384            var queue = jQuery.queue( this, type, data );
     1385
     1386            if ( type === "fx" && queue[0] !== "inprogress" ) {
     1387                jQuery.dequeue( this, type );
     1388            }
     1389        });
     1390    },
     1391    dequeue: function( type ) {
     1392        return this.each(function() {
     1393            jQuery.dequeue( this, type );
     1394        });
     1395    },
     1396
     1397    // Based off of the plugin by Clint Helfers, with permission.
     1398    // http://blindsignals.com/index.php/2009/07/jquery-delay/
     1399    delay: function( time, type ) {
     1400        time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
     1401        type = type || "fx";
     1402
     1403        return this.queue( type, function() {
     1404            var elem = this;
     1405            setTimeout(function() {
     1406                jQuery.dequeue( elem, type );
     1407            }, time );
     1408        });
     1409    },
     1410
     1411    clearQueue: function( type ) {
     1412        return this.queue( type || "fx", [] );
     1413    }
     1414});
     1415
     1416
     1417
     1418
     1419var rclass = /[\n\t]/g,
     1420    rspaces = /\s+/,
     1421    rreturn = /\r/g,
     1422    rspecialurl = /^(?:href|src|style)$/,
     1423    rtype = /^(?:button|input)$/i,
     1424    rfocusable = /^(?:button|input|object|select|textarea)$/i,
     1425    rclickable = /^a(?:rea)?$/i,
     1426    rradiocheck = /^(?:radio|checkbox)$/i;
     1427
     1428jQuery.props = {
     1429    "for": "htmlFor",
     1430    "class": "className",
     1431    readonly: "readOnly",
     1432    maxlength: "maxLength",
     1433    cellspacing: "cellSpacing",
     1434    rowspan: "rowSpan",
     1435    colspan: "colSpan",
     1436    tabindex: "tabIndex",
     1437    usemap: "useMap",
     1438    frameborder: "frameBorder"
     1439};
     1440
     1441jQuery.fn.extend({
     1442    attr: function( name, value ) {
     1443        return jQuery.access( this, name, value, true, jQuery.attr );
     1444    },
     1445
     1446    removeAttr: function( name, fn ) {
     1447        return this.each(function(){
     1448            jQuery.attr( this, name, "" );
     1449            if ( this.nodeType === 1 ) {
     1450                this.removeAttribute( name );
     1451            }
     1452        });
     1453    },
     1454
     1455    addClass: function( value ) {
     1456        if ( jQuery.isFunction(value) ) {
     1457            return this.each(function(i) {
     1458                var self = jQuery(this);
     1459                self.addClass( value.call(this, i, self.attr("class")) );
     1460            });
     1461        }
     1462
     1463        if ( value && typeof value === "string" ) {
     1464            var classNames = (value || "").split( rspaces );
     1465
     1466            for ( var i = 0, l = this.length; i < l; i++ ) {
     1467                var elem = this[i];
     1468
     1469                if ( elem.nodeType === 1 ) {
     1470                    if ( !elem.className ) {
     1471                        elem.className = value;
     1472
     1473                    } else {
     1474                        var className = " " + elem.className + " ", setClass = elem.className;
     1475                        for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
     1476                            if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
     1477                                setClass += " " + classNames[c];
     1478                            }
     1479                        }
     1480                        elem.className = jQuery.trim( setClass );
     1481                    }
     1482                }
     1483            }
     1484        }
     1485
     1486        return this;
     1487    },
     1488
     1489    removeClass: function( value ) {
     1490        if ( jQuery.isFunction(value) ) {
     1491            return this.each(function(i) {
     1492                var self = jQuery(this);
     1493                self.removeClass( value.call(this, i, self.attr("class")) );
     1494            });
     1495        }
     1496
     1497        if ( (value && typeof value === "string") || value === undefined ) {
     1498            var classNames = (value || "").split( rspaces );
     1499
     1500            for ( var i = 0, l = this.length; i < l; i++ ) {
     1501                var elem = this[i];
     1502
     1503                if ( elem.nodeType === 1 && elem.className ) {
     1504                    if ( value ) {
     1505                        var className = (" " + elem.className + " ").replace(rclass, " ");
     1506                        for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
     1507                            className = className.replace(" " + classNames[c] + " ", " ");
     1508                        }
     1509                        elem.className = jQuery.trim( className );
     1510
     1511                    } else {
     1512                        elem.className = "";
     1513                    }
     1514                }
     1515            }
     1516        }
     1517
     1518        return this;
     1519    },
     1520
     1521    toggleClass: function( value, stateVal ) {
     1522        var type = typeof value, isBool = typeof stateVal === "boolean";
     1523
     1524        if ( jQuery.isFunction( value ) ) {
     1525            return this.each(function(i) {
     1526                var self = jQuery(this);
     1527                self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
     1528            });
     1529        }
     1530
     1531        return this.each(function() {
     1532            if ( type === "string" ) {
     1533                // toggle individual class names
     1534                var className, i = 0, self = jQuery(this),
     1535                    state = stateVal,
     1536                    classNames = value.split( rspaces );
     1537
     1538                while ( (className = classNames[ i++ ]) ) {
     1539                    // check each className given, space seperated list
     1540                    state = isBool ? state : !self.hasClass( className );
     1541                    self[ state ? "addClass" : "removeClass" ]( className );
     1542                }
     1543
     1544            } else if ( type === "undefined" || type === "boolean" ) {
     1545                if ( this.className ) {
     1546                    // store className if set
     1547                    jQuery.data( this, "__className__", this.className );
     1548                }
     1549
     1550                // toggle whole className
     1551                this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
     1552            }
     1553        });
     1554    },
     1555
     1556    hasClass: function( selector ) {
     1557        var className = " " + selector + " ";
     1558        for ( var i = 0, l = this.length; i < l; i++ ) {
     1559            if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
     1560                return true;
     1561            }
     1562        }
     1563
     1564        return false;
     1565    },
     1566
     1567    val: function( value ) {
     1568        if ( !arguments.length ) {
     1569            var elem = this[0];
     1570
     1571            if ( elem ) {
     1572                if ( jQuery.nodeName( elem, "option" ) ) {
     1573                    // attributes.value is undefined in Blackberry 4.7 but
     1574                    // uses .value. See #6932
     1575                    var val = elem.attributes.value;
     1576                    return !val || val.specified ? elem.value : elem.text;
     1577                }
     1578
     1579                // We need to handle select boxes special
     1580                if ( jQuery.nodeName( elem, "select" ) ) {
     1581                    var index = elem.selectedIndex,
     1582                        values = [],
     1583                        options = elem.options,
     1584                        one = elem.type === "select-one";
     1585
     1586                    // Nothing was selected
     1587                    if ( index < 0 ) {
     1588                        return null;
     1589                    }
     1590
     1591                    // Loop through all the selected options
     1592                    for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
     1593                        var option = options[ i ];
     1594
     1595                        // Don't return options that are disabled or in a disabled optgroup
     1596                        if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
     1597                                (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
     1598
     1599                            // Get the specific value for the option
     1600                            value = jQuery(option).val();
     1601
     1602                            // We don't need an array for one selects
     1603                            if ( one ) {
     1604                                return value;
     1605                            }
     1606
     1607                            // Multi-Selects return an array
     1608                            values.push( value );
     1609                        }
     1610                    }
     1611
     1612                    return values;
     1613                }
     1614
     1615                // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
     1616                if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
     1617                    return elem.getAttribute("value") === null ? "on" : elem.value;
     1618                }
     1619               
     1620
     1621                // Everything else, we just grab the value
     1622                return (elem.value || "").replace(rreturn, "");
     1623
     1624            }
     1625
     1626            return undefined;
     1627        }
     1628
     1629        var isFunction = jQuery.isFunction(value);
     1630
     1631        return this.each(function(i) {
     1632            var self = jQuery(this), val = value;
     1633
     1634            if ( this.nodeType !== 1 ) {
     1635                return;
     1636            }
     1637
     1638            if ( isFunction ) {
     1639                val = value.call(this, i, self.val());
     1640            }
     1641
     1642            // Treat null/undefined as ""; convert numbers to string
     1643            if ( val == null ) {
     1644                val = "";
     1645            } else if ( typeof val === "number" ) {
     1646                val += "";
     1647            } else if ( jQuery.isArray(val) ) {
     1648                val = jQuery.map(val, function (value) {
     1649                    return value == null ? "" : value + "";
     1650                });
     1651            }
     1652
     1653            if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
     1654                this.checked = jQuery.inArray( self.val(), val ) >= 0;
     1655
     1656            } else if ( jQuery.nodeName( this, "select" ) ) {
     1657                var values = jQuery.makeArray(val);
     1658
     1659                jQuery( "option", this ).each(function() {
     1660                    this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
     1661                });
     1662
     1663                if ( !values.length ) {
     1664                    this.selectedIndex = -1;
     1665                }
     1666
     1667            } else {
     1668                this.value = val;
     1669            }
     1670        });
     1671    }
     1672});
     1673
     1674jQuery.extend({
     1675    attrFn: {
     1676        val: true,
     1677        css: true,
     1678        html: true,
     1679        text: true,
     1680        data: true,
     1681        width: true,
     1682        height: true,
     1683        offset: true
     1684    },
     1685       
     1686    attr: function( elem, name, value, pass ) {
     1687        // don't set attributes on text and comment nodes
     1688        if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
     1689            return undefined;
     1690        }
     1691
     1692        if ( pass && name in jQuery.attrFn ) {
     1693            return jQuery(elem)[name](value);
     1694        }
     1695
     1696        var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
     1697            // Whether we are setting (or getting)
     1698            set = value !== undefined;
     1699
     1700        // Try to normalize/fix the name
     1701        name = notxml && jQuery.props[ name ] || name;
     1702
     1703        // Only do all the following if this is a node (faster for style)
     1704        if ( elem.nodeType === 1 ) {
     1705            // These attributes require special treatment
     1706            var special = rspecialurl.test( name );
     1707
     1708            // Safari mis-reports the default selected property of an option
     1709            // Accessing the parent's selectedIndex property fixes it
     1710            if ( name === "selected" && !jQuery.support.optSelected ) {
     1711                var parent = elem.parentNode;
     1712                if ( parent ) {
     1713                    parent.selectedIndex;
     1714   
     1715                    // Make sure that it also works with optgroups, see #5701
     1716                    if ( parent.parentNode ) {
     1717                        parent.parentNode.selectedIndex;
     1718                    }
     1719                }
     1720            }
     1721
     1722            // If applicable, access the attribute via the DOM 0 way
     1723            // 'in' checks fail in Blackberry 4.7 #6931
     1724            if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {
     1725                if ( set ) {
     1726                    // We can't allow the type property to be changed (since it causes problems in IE)
     1727                    if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
     1728                        jQuery.error( "type property can't be changed" );
     1729                    }
     1730
     1731                    if ( value === null ) {
     1732                        if ( elem.nodeType === 1 ) {
     1733                            elem.removeAttribute( name );
     1734                        }
     1735
     1736                    } else {
     1737                        elem[ name ] = value;
     1738                    }
     1739                }
     1740
     1741                // browsers index elements by id/name on forms, give priority to attributes.
     1742                if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
     1743                    return elem.getAttributeNode( name ).nodeValue;
     1744                }
     1745
     1746                // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
     1747                // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
     1748                if ( name === "tabIndex" ) {
     1749                    var attributeNode = elem.getAttributeNode( "tabIndex" );
     1750
     1751                    return attributeNode && attributeNode.specified ?
     1752                        attributeNode.value :
     1753                        rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
     1754                            0 :
     1755                            undefined;
     1756                }
     1757
     1758                return elem[ name ];
     1759            }
     1760
     1761            if ( !jQuery.support.style && notxml && name === "style" ) {
     1762                if ( set ) {
     1763                    elem.style.cssText = "" + value;
     1764                }
     1765
     1766                return elem.style.cssText;
     1767            }
     1768
     1769            if ( set ) {
     1770                // convert the value to a string (all browsers do this but IE) see #1070
     1771                elem.setAttribute( name, "" + value );
     1772            }
     1773
     1774            // Ensure that missing attributes return undefined
     1775            // Blackberry 4.7 returns "" from getAttribute #6938
     1776            if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {
     1777                return undefined;
     1778            }
     1779
     1780            var attr = !jQuery.support.hrefNormalized && notxml && special ?
     1781                    // Some attributes require a special call on IE
     1782                    elem.getAttribute( name, 2 ) :
     1783                    elem.getAttribute( name );
     1784
     1785            // Non-existent attributes return null, we normalize to undefined
     1786            return attr === null ? undefined : attr;
     1787        }
     1788    }
     1789});
     1790
     1791
     1792
     1793
     1794var rnamespaces = /\.(.*)$/,
     1795    rformElems = /^(?:textarea|input|select)$/i,
     1796    rperiod = /\./g,
     1797    rspace = / /g,
     1798    rescape = /[^\w\s.|`]/g,
     1799    fcleanup = function( nm ) {
     1800        return nm.replace(rescape, "\\$&");
     1801    },
     1802    focusCounts = { focusin: 0, focusout: 0 };
     1803
     1804/*
     1805 * A number of helper functions used for managing events.
     1806 * Many of the ideas behind this code originated from
     1807 * Dean Edwards' addEvent library.
     1808 */
     1809jQuery.event = {
     1810
     1811    // Bind an event to an element
     1812    // Original by Dean Edwards
     1813    add: function( elem, types, handler, data ) {
     1814        if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
     1815            return;
     1816        }
     1817
     1818        // For whatever reason, IE has trouble passing the window object
     1819        // around, causing it to be cloned in the process
     1820        if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) {
     1821            elem = window;
     1822        }
     1823
     1824        if ( handler === false ) {
     1825            handler = returnFalse;
     1826        } else if ( !handler ) {
     1827          // Fixes bug #7229. Fix recommended by jdalton
     1828          return;
     1829        }
     1830
     1831        var handleObjIn, handleObj;
     1832
     1833        if ( handler.handler ) {
     1834            handleObjIn = handler;
     1835            handler = handleObjIn.handler;
     1836        }
     1837
     1838        // Make sure that the function being executed has a unique ID
     1839        if ( !handler.guid ) {
     1840            handler.guid = jQuery.guid++;
     1841        }
     1842
     1843        // Init the element's event structure
     1844        var elemData = jQuery.data( elem );
     1845
     1846        // If no elemData is found then we must be trying to bind to one of the
     1847        // banned noData elements
     1848        if ( !elemData ) {
     1849            return;
     1850        }
     1851
     1852        // Use a key less likely to result in collisions for plain JS objects.
     1853        // Fixes bug #7150.
     1854        var eventKey = elem.nodeType ? "events" : "__events__",
     1855            events = elemData[ eventKey ],
     1856            eventHandle = elemData.handle;
     1857           
     1858        if ( typeof events === "function" ) {
     1859            // On plain objects events is a fn that holds the the data
     1860            // which prevents this data from being JSON serialized
     1861            // the function does not need to be called, it just contains the data
     1862            eventHandle = events.handle;
     1863            events = events.events;
     1864
     1865        } else if ( !events ) {
     1866            if ( !elem.nodeType ) {
     1867                // On plain objects, create a fn that acts as the holder
     1868                // of the values to avoid JSON serialization of event data
     1869                elemData[ eventKey ] = elemData = function(){};
     1870            }
     1871
     1872            elemData.events = events = {};
     1873        }
     1874
     1875        if ( !eventHandle ) {
     1876            elemData.handle = eventHandle = function() {
     1877                // Handle the second event of a trigger and when
     1878                // an event is called after a page has unloaded
     1879                return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
     1880                    jQuery.event.handle.apply( eventHandle.elem, arguments ) :
     1881                    undefined;
     1882            };
     1883        }
     1884
     1885        // Add elem as a property of the handle function
     1886        // This is to prevent a memory leak with non-native events in IE.
     1887        eventHandle.elem = elem;
     1888
     1889        // Handle multiple events separated by a space
     1890        // jQuery(...).bind("mouseover mouseout", fn);
     1891        types = types.split(" ");
     1892
     1893        var type, i = 0, namespaces;
     1894
     1895        while ( (type = types[ i++ ]) ) {
     1896            handleObj = handleObjIn ?
     1897                jQuery.extend({}, handleObjIn) :
     1898                { handler: handler, data: data };
     1899
     1900            // Namespaced event handlers
     1901            if ( type.indexOf(".") > -1 ) {
     1902                namespaces = type.split(".");
     1903                type = namespaces.shift();
     1904                handleObj.namespace = namespaces.slice(0).sort().join(".");
     1905
     1906            } else {
     1907                namespaces = [];
     1908                handleObj.namespace = "";
     1909            }
     1910
     1911            handleObj.type = type;
     1912            if ( !handleObj.guid ) {
     1913                handleObj.guid = handler.guid;
     1914            }
     1915
     1916            // Get the current list of functions bound to this event
     1917            var handlers = events[ type ],
     1918                special = jQuery.event.special[ type ] || {};
     1919
     1920            // Init the event handler queue
     1921            if ( !handlers ) {
     1922                handlers = events[ type ] = [];
     1923
     1924                // Check for a special event handler
     1925                // Only use addEventListener/attachEvent if the special
     1926                // events handler returns false
     1927                if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
     1928                    // Bind the global event handler to the element
     1929                    if ( elem.addEventListener ) {
     1930                        elem.addEventListener( type, eventHandle, false );
     1931
     1932                    } else if ( elem.attachEvent ) {
     1933                        elem.attachEvent( "on" + type, eventHandle );
     1934                    }
     1935                }
     1936            }
     1937           
     1938            if ( special.add ) {
     1939                special.add.call( elem, handleObj );
     1940
     1941                if ( !handleObj.handler.guid ) {
     1942                    handleObj.handler.guid = handler.guid;
     1943                }
     1944            }
     1945
     1946            // Add the function to the element's handler list
     1947            handlers.push( handleObj );
     1948
     1949            // Keep track of which events have been used, for global triggering
     1950            jQuery.event.global[ type ] = true;
     1951        }
     1952
     1953        // Nullify elem to prevent memory leaks in IE
     1954        elem = null;
     1955    },
     1956
     1957    global: {},
     1958
     1959    // Detach an event or set of events from an element
     1960    remove: function( elem, types, handler, pos ) {
     1961        // don't do events on text and comment nodes
     1962        if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
     1963            return;
     1964        }
     1965
     1966        if ( handler === false ) {
     1967            handler = returnFalse;
     1968        }
     1969
     1970        var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
     1971            eventKey = elem.nodeType ? "events" : "__events__",
     1972            elemData = jQuery.data( elem ),
     1973            events = elemData && elemData[ eventKey ];
     1974
     1975        if ( !elemData || !events ) {
     1976            return;
     1977        }
     1978       
     1979        if ( typeof events === "function" ) {
     1980            elemData = events;
     1981            events = events.events;
     1982        }
     1983
     1984        // types is actually an event object here
     1985        if ( types && types.type ) {
     1986            handler = types.handler;
     1987            types = types.type;
     1988        }
     1989
     1990        // Unbind all events for the element
     1991        if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
     1992            types = types || "";
     1993
     1994            for ( type in events ) {
     1995                jQuery.event.remove( elem, type + types );
     1996            }
     1997
     1998            return;
     1999        }
     2000
     2001        // Handle multiple events separated by a space
     2002        // jQuery(...).unbind("mouseover mouseout", fn);
     2003        types = types.split(" ");
     2004
     2005        while ( (type = types[ i++ ]) ) {
     2006            origType = type;
     2007            handleObj = null;
     2008            all = type.indexOf(".") < 0;
     2009            namespaces = [];
     2010
     2011            if ( !all ) {
     2012                // Namespaced event handlers
     2013                namespaces = type.split(".");
     2014                type = namespaces.shift();
     2015
     2016                namespace = new RegExp("(^|\\.)" +
     2017                    jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
     2018            }
     2019
     2020            eventType = events[ type ];
     2021
     2022            if ( !eventType ) {
     2023                continue;
     2024            }
     2025
     2026            if ( !handler ) {
     2027                for ( j = 0; j < eventType.length; j++ ) {
     2028                    handleObj = eventType[ j ];
     2029
     2030                    if ( all || namespace.test( handleObj.namespace ) ) {
     2031                        jQuery.event.remove( elem, origType, handleObj.handler, j );
     2032                        eventType.splice( j--, 1 );
     2033                    }
     2034                }
     2035
     2036                continue;
     2037            }
     2038
     2039            special = jQuery.event.special[ type ] || {};
     2040
     2041            for ( j = pos || 0; j < eventType.length; j++ ) {
     2042                handleObj = eventType[ j ];
     2043
     2044                if ( handler.guid === handleObj.guid ) {
     2045                    // remove the given handler for the given type
     2046                    if ( all || namespace.test( handleObj.namespace ) ) {
     2047                        if ( pos == null ) {
     2048                            eventType.splice( j--, 1 );
     2049                        }
     2050
     2051                        if ( special.remove ) {
     2052                            special.remove.call( elem, handleObj );
     2053                        }
     2054                    }
     2055
     2056                    if ( pos != null ) {
     2057                        break;
     2058                    }
     2059                }
     2060            }
     2061
     2062            // remove generic event handler if no more handlers exist
     2063            if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
     2064                if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
     2065                    jQuery.removeEvent( elem, type, elemData.handle );
     2066                }
     2067
     2068                ret = null;
     2069                delete events[ type ];
     2070            }
     2071        }
     2072
     2073        // Remove the expando if it's no longer used
     2074        if ( jQuery.isEmptyObject( events ) ) {
     2075            var handle = elemData.handle;
     2076            if ( handle ) {
     2077                handle.elem = null;
     2078            }
     2079
     2080            delete elemData.events;
     2081            delete elemData.handle;
     2082
     2083            if ( typeof elemData === "function" ) {
     2084                jQuery.removeData( elem, eventKey );
     2085
     2086            } else if ( jQuery.isEmptyObject( elemData ) ) {
     2087                jQuery.removeData( elem );
     2088            }
     2089        }
     2090    },
     2091
     2092    // bubbling is internal
     2093    trigger: function( event, data, elem /*, bubbling */ ) {
     2094        // Event object or event type
     2095        var type = event.type || event,
     2096            bubbling = arguments[3];
     2097
     2098        if ( !bubbling ) {
     2099            event = typeof event === "object" ?
     2100                // jQuery.Event object
     2101                event[ jQuery.expando ] ? event :
     2102                // Object literal
     2103                jQuery.extend( jQuery.Event(type), event ) :
     2104                // Just the event type (string)
     2105                jQuery.Event(type);
     2106
     2107            if ( type.indexOf("!") >= 0 ) {
     2108                event.type = type = type.slice(0, -1);
     2109                event.exclusive = true;
     2110            }
     2111
     2112            // Handle a global trigger
     2113            if ( !elem ) {
     2114                // Don't bubble custom events when global (to avoid too much overhead)
     2115                event.stopPropagation();
     2116
     2117                // Only trigger if we've ever bound an event for it
     2118                if ( jQuery.event.global[ type ] ) {
     2119                    jQuery.each( jQuery.cache, function() {
     2120                        if ( this.events && this.events[type] ) {
     2121                            jQuery.event.trigger( event, data, this.handle.elem );
     2122                        }
     2123                    });
     2124                }
     2125            }
     2126
     2127            // Handle triggering a single element
     2128
     2129            // don't do events on text and comment nodes
     2130            if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
     2131                return undefined;
     2132            }
     2133
     2134            // Clean up in case it is reused
     2135            event.result = undefined;
     2136            event.target = elem;
     2137
     2138            // Clone the incoming data, if any
     2139            data = jQuery.makeArray( data );
     2140            data.unshift( event );
     2141        }
     2142
     2143        event.currentTarget = elem;
     2144
     2145        // Trigger the event, it is assumed that "handle" is a function
     2146        var handle = elem.nodeType ?
     2147            jQuery.data( elem, "handle" ) :
     2148            (jQuery.data( elem, "__events__" ) || {}).handle;
     2149
     2150        if ( handle ) {
     2151            handle.apply( elem, data );
     2152        }
     2153
     2154        var parent = elem.parentNode || elem.ownerDocument;
     2155
     2156        // Trigger an inline bound script
     2157        try {
     2158            if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
     2159                if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
     2160                    event.result = false;
     2161                    event.preventDefault();
     2162                }
     2163            }
     2164
     2165        // prevent IE from throwing an error for some elements with some event types, see #3533
     2166        } catch (inlineError) {}
     2167
     2168        if ( !event.isPropagationStopped() && parent ) {
     2169            jQuery.event.trigger( event, data, parent, true );
     2170
     2171        } else if ( !event.isDefaultPrevented() ) {
     2172            var target = event.target, old, targetType = type.replace(rnamespaces, ""),
     2173                isClick = jQuery.nodeName(target, "a") && targetType === "click",
     2174                special = jQuery.event.special[ targetType ] || {};
     2175
     2176            if ( (!special._default || special._default.call( elem, event ) === false) &&
     2177                !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
     2178
     2179                try {
     2180                    if ( target[ targetType ] ) {
     2181                        // Make sure that we don't accidentally re-trigger the onFOO events
     2182                        old = target[ "on" + targetType ];
     2183
     2184                        if ( old ) {
     2185                            target[ "on" + targetType ] = null;
     2186                        }
     2187
     2188                        jQuery.event.triggered = true;
     2189                        target[ targetType ]();
     2190                    }
     2191
     2192                // prevent IE from throwing an error for some elements with some event types, see #3533
     2193                } catch (triggerError) {}
     2194
     2195                if ( old ) {
     2196                    target[ "on" + targetType ] = old;
     2197                }
     2198
     2199                jQuery.event.triggered = false;
     2200            }
     2201        }
     2202    },
     2203
     2204    handle: function( event ) {
     2205        var all, handlers, namespaces, namespace_sort = [], namespace_re, events, args = jQuery.makeArray( arguments );
     2206
     2207        event = args[0] = jQuery.event.fix( event || window.event );
     2208        event.currentTarget = this;
     2209
     2210        // Namespaced event handlers
     2211        all = event.type.indexOf(".") < 0 && !event.exclusive;
     2212
     2213        if ( !all ) {
     2214            namespaces = event.type.split(".");
     2215            event.type = namespaces.shift();
     2216            namespace_sort = namespaces.slice(0).sort();
     2217            namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)");
     2218        }
     2219
     2220        event.namespace = event.namespace || namespace_sort.join(".");
     2221
     2222        events = jQuery.data(this, this.nodeType ? "events" : "__events__");
     2223
     2224        if ( typeof events === "function" ) {
     2225            events = events.events;
     2226        }
     2227
     2228        handlers = (events || {})[ event.type ];
     2229
     2230        if ( events && handlers ) {
     2231            // Clone the handlers to prevent manipulation
     2232            handlers = handlers.slice(0);
     2233
     2234            for ( var j = 0, l = handlers.length; j < l; j++ ) {
     2235                var handleObj = handlers[ j ];
     2236
     2237                // Filter the functions by class
     2238                if ( all || namespace_re.test( handleObj.namespace ) ) {
     2239                    // Pass in a reference to the handler function itself
     2240                    // So that we can later remove it
     2241                    event.handler = handleObj.handler;
     2242                    event.data = handleObj.data;
     2243                    event.handleObj = handleObj;
     2244   
     2245                    var ret = handleObj.handler.apply( this, args );
     2246
     2247                    if ( ret !== undefined ) {
     2248                        event.result = ret;
     2249                        if ( ret === false ) {
     2250                            event.preventDefault();
     2251                            event.stopPropagation();
     2252                        }
     2253                    }
     2254
     2255                    if ( event.isImmediatePropagationStopped() ) {
     2256                        break;
     2257                    }
     2258                }
     2259            }
     2260        }
     2261
     2262        return event.result;
     2263    },
     2264
     2265    props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
     2266
     2267    fix: function( event ) {
     2268        if ( event[ jQuery.expando ] ) {
     2269            return event;
     2270        }
     2271
     2272        // store a copy of the original event object
     2273        // and "clone" to set read-only properties
     2274        var originalEvent = event;
     2275        event = jQuery.Event( originalEvent );
     2276
     2277        for ( var i = this.props.length, prop; i; ) {
     2278            prop = this.props[ --i ];
     2279            event[ prop ] = originalEvent[ prop ];
     2280        }
     2281
     2282        // Fix target property, if necessary
     2283        if ( !event.target ) {
     2284            event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
     2285        }
     2286
     2287        // check if target is a textnode (safari)
     2288        if ( event.target.nodeType === 3 ) {
     2289            event.target = event.target.parentNode;
     2290        }
     2291
     2292        // Add relatedTarget, if necessary
     2293        if ( !event.relatedTarget && event.fromElement ) {
     2294            event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
     2295        }
     2296
     2297        // Calculate pageX/Y if missing and clientX/Y available
     2298        if ( event.pageX == null && event.clientX != null ) {
     2299            var doc = document.documentElement, body = document.body;
     2300            event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
     2301            event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
     2302        }
     2303
     2304        // Add which for key events
     2305        if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
     2306            event.which = event.charCode != null ? event.charCode : event.keyCode;
     2307        }
     2308
     2309        // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
     2310        if ( !event.metaKey && event.ctrlKey ) {
     2311            event.metaKey = event.ctrlKey;
     2312        }
     2313
     2314        // Add which for click: 1 === left; 2 === middle; 3 === right
     2315        // Note: button is not normalized, so don't use it
     2316        if ( !event.which && event.button !== undefined ) {
     2317            event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
     2318        }
     2319
     2320        return event;
     2321    },
     2322
     2323    // Deprecated, use jQuery.guid instead
     2324    guid: 1E8,
     2325
     2326    // Deprecated, use jQuery.proxy instead
     2327    proxy: jQuery.proxy,
     2328
     2329    special: {
     2330        ready: {
     2331            // Make sure the ready event is setup
     2332            setup: jQuery.bindReady,
     2333            teardown: jQuery.noop
     2334        },
     2335
     2336        live: {
     2337            add: function( handleObj ) {
     2338                jQuery.event.add( this,
     2339                    liveConvert( handleObj.origType, handleObj.selector ),
     2340                    jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
     2341            },
     2342
     2343            remove: function( handleObj ) {
     2344                jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
     2345            }
     2346        },
     2347
     2348        beforeunload: {
     2349            setup: function( data, namespaces, eventHandle ) {
     2350                // We only want to do this special case on windows
     2351                if ( jQuery.isWindow( this ) ) {
     2352                    this.onbeforeunload = eventHandle;
     2353                }
     2354            },
     2355
     2356            teardown: function( namespaces, eventHandle ) {
     2357                if ( this.onbeforeunload === eventHandle ) {
     2358                    this.onbeforeunload = null;
     2359                }
     2360            }
     2361        }
     2362    }
     2363};
     2364
     2365jQuery.removeEvent = document.removeEventListener ?
     2366    function( elem, type, handle ) {
     2367        if ( elem.removeEventListener ) {
     2368            elem.removeEventListener( type, handle, false );
     2369        }
     2370    } :
     2371    function( elem, type, handle ) {
     2372        if ( elem.detachEvent ) {
     2373            elem.detachEvent( "on" + type, handle );
     2374        }
     2375    };
     2376
     2377jQuery.Event = function( src ) {
     2378    // Allow instantiation without the 'new' keyword
     2379    if ( !this.preventDefault ) {
     2380        return new jQuery.Event( src );
     2381    }
     2382
     2383    // Event object
     2384    if ( src && src.type ) {
     2385        this.originalEvent = src;
     2386        this.type = src.type;
     2387    // Event type
     2388    } else {
     2389        this.type = src;
     2390    }
     2391
     2392    // timeStamp is buggy for some events on Firefox(#3843)
     2393    // So we won't rely on the native value
     2394    this.timeStamp = jQuery.now();
     2395
     2396    // Mark it as fixed
     2397    this[ jQuery.expando ] = true;
     2398};
     2399
     2400function returnFalse() {
     2401    return false;
     2402}
     2403function returnTrue() {
     2404    return true;
     2405}
     2406
     2407// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
     2408// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
     2409jQuery.Event.prototype = {
     2410    preventDefault: function() {
     2411        this.isDefaultPrevented = returnTrue;
     2412
     2413        var e = this.originalEvent;
     2414        if ( !e ) {
     2415            return;
     2416        }
     2417       
     2418        // if preventDefault exists run it on the original event
     2419        if ( e.preventDefault ) {
     2420            e.preventDefault();
     2421
     2422        // otherwise set the returnValue property of the original event to false (IE)
     2423        } else {
     2424            e.returnValue = false;
     2425        }
     2426    },
     2427    stopPropagation: function() {
     2428        this.isPropagationStopped = returnTrue;
     2429
     2430        var e = this.originalEvent;
     2431        if ( !e ) {
     2432            return;
     2433        }
     2434        // if stopPropagation exists run it on the original event
     2435        if ( e.stopPropagation ) {
     2436            e.stopPropagation();
     2437        }
     2438        // otherwise set the cancelBubble property of the original event to true (IE)
     2439        e.cancelBubble = true;
     2440    },
     2441    stopImmediatePropagation: function() {
     2442        this.isImmediatePropagationStopped = returnTrue;
     2443        this.stopPropagation();
     2444    },
     2445    isDefaultPrevented: returnFalse,
     2446    isPropagationStopped: returnFalse,
     2447    isImmediatePropagationStopped: returnFalse
     2448};
     2449
     2450// Checks if an event happened on an element within another element
     2451// Used in jQuery.event.special.mouseenter and mouseleave handlers
     2452var withinElement = function( event ) {
     2453    // Check if mouse(over|out) are still within the same parent element
     2454    var parent = event.relatedTarget;
     2455
     2456    // Firefox sometimes assigns relatedTarget a XUL element
     2457    // which we cannot access the parentNode property of
     2458    try {
     2459        // Traverse up the tree
     2460        while ( parent && parent !== this ) {
     2461            parent = parent.parentNode;
     2462        }
     2463
     2464        if ( parent !== this ) {
     2465            // set the correct event type
     2466            event.type = event.data;
     2467
     2468            // handle event if we actually just moused on to a non sub-element
     2469            jQuery.event.handle.apply( this, arguments );
     2470        }
     2471
     2472    // assuming we've left the element since we most likely mousedover a xul element
     2473    } catch(e) { }
     2474},
     2475
     2476// In case of event delegation, we only need to rename the event.type,
     2477// liveHandler will take care of the rest.
     2478delegate = function( event ) {
     2479    event.type = event.data;
     2480    jQuery.event.handle.apply( this, arguments );
     2481};
     2482
     2483// Create mouseenter and mouseleave events
     2484jQuery.each({
     2485    mouseenter: "mouseover",
     2486    mouseleave: "mouseout"
     2487}, function( orig, fix ) {
     2488    jQuery.event.special[ orig ] = {
     2489        setup: function( data ) {
     2490            jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
     2491        },
     2492        teardown: function( data ) {
     2493            jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
     2494        }
     2495    };
     2496});
     2497
     2498// submit delegation
     2499if ( !jQuery.support.submitBubbles ) {
     2500
     2501    jQuery.event.special.submit = {
     2502        setup: function( data, namespaces ) {
     2503            if ( this.nodeName.toLowerCase() !== "form" ) {
     2504                jQuery.event.add(this, "click.specialSubmit", function( e ) {
     2505                    var elem = e.target, type = elem.type;
     2506
     2507                    if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
     2508                        e.liveFired = undefined;
     2509                        return trigger( "submit", this, arguments );
     2510                    }
     2511                });
     2512     
     2513                jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
     2514                    var elem = e.target, type = elem.type;
     2515
     2516                    if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
     2517                        e.liveFired = undefined;
     2518                        return trigger( "submit", this, arguments );
     2519                    }
     2520                });
     2521
     2522            } else {
     2523                return false;
     2524            }
     2525        },
     2526
     2527        teardown: function( namespaces ) {
     2528            jQuery.event.remove( this, ".specialSubmit" );
     2529        }
     2530    };
     2531
     2532}
     2533
     2534// change delegation, happens here so we have bind.
     2535if ( !jQuery.support.changeBubbles ) {
     2536
     2537    var changeFilters,
     2538
     2539    getVal = function( elem ) {
     2540        var type = elem.type, val = elem.value;
     2541
     2542        if ( type === "radio" || type === "checkbox" ) {
     2543            val = elem.checked;
     2544
     2545        } else if ( type === "select-multiple" ) {
     2546            val = elem.selectedIndex > -1 ?
     2547                jQuery.map( elem.options, function( elem ) {
     2548                    return elem.selected;
     2549                }).join("-") :
     2550                "";
     2551
     2552        } else if ( elem.nodeName.toLowerCase() === "select" ) {
     2553            val = elem.selectedIndex;
     2554        }
     2555
     2556        return val;
     2557    },
     2558
     2559    testChange = function testChange( e ) {
     2560        var elem = e.target, data, val;
     2561
     2562        if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
     2563            return;
     2564        }
     2565
     2566        data = jQuery.data( elem, "_change_data" );
     2567        val = getVal(elem);
     2568
     2569        // the current data will be also retrieved by beforeactivate
     2570        if ( e.type !== "focusout" || elem.type !== "radio" ) {
     2571            jQuery.data( elem, "_change_data", val );
     2572        }
     2573       
     2574        if ( data === undefined || val === data ) {
     2575            return;
     2576        }
     2577
     2578        if ( data != null || val ) {
     2579            e.type = "change";
     2580            e.liveFired = undefined;
     2581            return jQuery.event.trigger( e, arguments[1], elem );
     2582        }
     2583    };
     2584
     2585    jQuery.event.special.change = {
     2586        filters: {
     2587            focusout: testChange,
     2588
     2589            beforedeactivate: testChange,
     2590
     2591            click: function( e ) {
     2592                var elem = e.target, type = elem.type;
     2593
     2594                if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
     2595                    return testChange.call( this, e );
     2596                }
     2597            },
     2598
     2599            // Change has to be called before submit
     2600            // Keydown will be called before keypress, which is used in submit-event delegation
     2601            keydown: function( e ) {
     2602                var elem = e.target, type = elem.type;
     2603
     2604                if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
     2605                    (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
     2606                    type === "select-multiple" ) {
     2607                    return testChange.call( this, e );
     2608                }
     2609            },
     2610
     2611            // Beforeactivate happens also before the previous element is blurred
     2612            // with this event you can't trigger a change event, but you can store
     2613            // information
     2614            beforeactivate: function( e ) {
     2615                var elem = e.target;
     2616                jQuery.data( elem, "_change_data", getVal(elem) );
     2617            }
     2618        },
     2619
     2620        setup: function( data, namespaces ) {
     2621            if ( this.type === "file" ) {
     2622                return false;
     2623            }
     2624
     2625            for ( var type in changeFilters ) {
     2626                jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
     2627            }
     2628
     2629            return rformElems.test( this.nodeName );
     2630        },
     2631
     2632        teardown: function( namespaces ) {
     2633            jQuery.event.remove( this, ".specialChange" );
     2634
     2635            return rformElems.test( this.nodeName );
     2636        }
     2637    };
     2638
     2639    changeFilters = jQuery.event.special.change.filters;
     2640
     2641    // Handle when the input is .focus()'d
     2642    changeFilters.focus = changeFilters.beforeactivate;
     2643}
     2644
     2645function trigger( type, elem, args ) {
     2646    args[0].type = type;
     2647    return jQuery.event.handle.apply( elem, args );
     2648}
     2649
     2650// Create "bubbling" focus and blur events
     2651if ( document.addEventListener ) {
     2652    jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
     2653        jQuery.event.special[ fix ] = {
     2654            setup: function() {
     2655                if ( focusCounts[fix]++ === 0 ) {
     2656                    document.addEventListener( orig, handler, true );
     2657                }
     2658            },
     2659            teardown: function() {
     2660                if ( --focusCounts[fix] === 0 ) {
     2661                    document.removeEventListener( orig, handler, true );
     2662                }
     2663            }
     2664        };
     2665
     2666        function handler( e ) {
     2667            e = jQuery.event.fix( e );
     2668            e.type = fix;
     2669            return jQuery.event.trigger( e, null, e.target );
     2670        }
     2671    });
     2672}
     2673
     2674jQuery.each(["bind", "one"], function( i, name ) {
     2675    jQuery.fn[ name ] = function( type, data, fn ) {
     2676        // Handle object literals
     2677        if ( typeof type === "object" ) {
     2678            for ( var key in type ) {
     2679                this[ name ](key, data, type[key], fn);
     2680            }
     2681            return this;
     2682        }
     2683       
     2684        if ( jQuery.isFunction( data ) || data === false ) {
     2685            fn = data;
     2686            data = undefined;
     2687        }
     2688
     2689        var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
     2690            jQuery( this ).unbind( event, handler );
     2691            return fn.apply( this, arguments );
     2692        }) : fn;
     2693
     2694        if ( type === "unload" && name !== "one" ) {
     2695            this.one( type, data, fn );
     2696
     2697        } else {
     2698            for ( var i = 0, l = this.length; i < l; i++ ) {
     2699                jQuery.event.add( this[i], type, handler, data );
     2700            }
     2701        }
     2702
     2703        return this;
     2704    };
     2705});
     2706
     2707jQuery.fn.extend({
     2708    unbind: function( type, fn ) {
     2709        // Handle object literals
     2710        if ( typeof type === "object" && !type.preventDefault ) {
     2711            for ( var key in type ) {
     2712                this.unbind(key, type[key]);
     2713            }
     2714
     2715        } else {
     2716            for ( var i = 0, l = this.length; i < l; i++ ) {
     2717                jQuery.event.remove( this[i], type, fn );
     2718            }
     2719        }
     2720
     2721        return this;
     2722    },
     2723   
     2724    delegate: function( selector, types, data, fn ) {
     2725        return this.live( types, data, fn, selector );
     2726    },
     2727   
     2728    undelegate: function( selector, types, fn ) {
     2729        if ( arguments.length === 0 ) {
     2730                return this.unbind( "live" );
     2731       
     2732        } else {
     2733            return this.die( types, null, fn, selector );
     2734        }
     2735    },
     2736   
     2737    trigger: function( type, data ) {
     2738        return this.each(function() {
     2739            jQuery.event.trigger( type, data, this );
     2740        });
     2741    },
     2742
     2743    triggerHandler: function( type, data ) {
     2744        if ( this[0] ) {
     2745            var event = jQuery.Event( type );
     2746            event.preventDefault();
     2747            event.stopPropagation();
     2748            jQuery.event.trigger( event, data, this[0] );
     2749            return event.result;
     2750        }
     2751    },
     2752
     2753    toggle: function( fn ) {
     2754        // Save reference to arguments for access in closure
     2755        var args = arguments, i = 1;
     2756
     2757        // link all the functions, so any of them can unbind this click handler
     2758        while ( i < args.length ) {
     2759            jQuery.proxy( fn, args[ i++ ] );
     2760        }
     2761
     2762        return this.click( jQuery.proxy( fn, function( event ) {
     2763            // Figure out which function to execute
     2764            var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
     2765            jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
     2766
     2767            // Make sure that clicks stop
     2768            event.preventDefault();
     2769
     2770            // and execute the function
     2771            return args[ lastToggle ].apply( this, arguments ) || false;
     2772        }));
     2773    },
     2774
     2775    hover: function( fnOver, fnOut ) {
     2776        return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
     2777    }
     2778});
     2779
     2780var liveMap = {
     2781    focus: "focusin",
     2782    blur: "focusout",
     2783    mouseenter: "mouseover",
     2784    mouseleave: "mouseout"
     2785};
     2786
     2787jQuery.each(["live", "die"], function( i, name ) {
     2788    jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
     2789        var type, i = 0, match, namespaces, preType,
     2790            selector = origSelector || this.selector,
     2791            context = origSelector ? this : jQuery( this.context );
     2792       
     2793        if ( typeof types === "object" && !types.preventDefault ) {
     2794            for ( var key in types ) {
     2795                context[ name ]( key, data, types[key], selector );
     2796            }
     2797           
     2798            return this;
     2799        }
     2800
     2801        if ( jQuery.isFunction( data ) ) {
     2802            fn = data;
     2803            data = undefined;
     2804        }
     2805
     2806        types = (types || "").split(" ");
     2807
     2808        while ( (type = types[ i++ ]) != null ) {
     2809            match = rnamespaces.exec( type );
     2810            namespaces = "";
     2811
     2812            if ( match )  {
     2813                namespaces = match[0];
     2814                type = type.replace( rnamespaces, "" );
     2815            }
     2816
     2817            if ( type === "hover" ) {
     2818                types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
     2819                continue;
     2820            }
     2821
     2822            preType = type;
     2823
     2824            if ( type === "focus" || type === "blur" ) {
     2825                types.push( liveMap[ type ] + namespaces );
     2826                type = type + namespaces;
     2827
     2828            } else {
     2829                type = (liveMap[ type ] || type) + namespaces;
     2830            }
     2831
     2832            if ( name === "live" ) {
     2833                // bind live handler
     2834                for ( var j = 0, l = context.length; j < l; j++ ) {
     2835                    jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
     2836                        { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
     2837                }
     2838
     2839            } else {
     2840                // unbind live handler
     2841                context.unbind( "live." + liveConvert( type, selector ), fn );
     2842            }
     2843        }
     2844       
     2845        return this;
     2846    };
     2847});
     2848
     2849function liveHandler( event ) {
     2850    var stop, maxLevel, elems = [], selectors = [],
     2851        related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
     2852        events = jQuery.data( this, this.nodeType ? "events" : "__events__" );
     2853
     2854    if ( typeof events === "function" ) {
     2855        events = events.events;
     2856    }
     2857
     2858    // Make sure we avoid non-left-click bubbling in Firefox (#3861)
     2859    if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
     2860        return;
     2861    }
     2862   
     2863    if ( event.namespace ) {
     2864        namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
     2865    }
     2866
     2867    event.liveFired = this;
     2868
     2869    var live = events.live.slice(0);
     2870
     2871    for ( j = 0; j < live.length; j++ ) {
     2872        handleObj = live[j];
     2873
     2874        if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
     2875            selectors.push( handleObj.selector );
     2876
     2877        } else {
     2878            live.splice( j--, 1 );
     2879        }
     2880    }
     2881
     2882    match = jQuery( event.target ).closest( selectors, event.currentTarget );
     2883
     2884    for ( i = 0, l = match.length; i < l; i++ ) {
     2885        close = match[i];
     2886
     2887        for ( j = 0; j < live.length; j++ ) {
     2888            handleObj = live[j];
     2889
     2890            if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) {
     2891                elem = close.elem;
     2892                related = null;
     2893
     2894                // Those two events require additional checking
     2895                if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
     2896                    event.type = handleObj.preType;
     2897                    related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
     2898                }
     2899
     2900                if ( !related || related !== elem ) {
     2901                    elems.push({ elem: elem, handleObj: handleObj, level: close.level });
     2902                }
     2903            }
     2904        }
     2905    }
     2906
     2907    for ( i = 0, l = elems.length; i < l; i++ ) {
     2908        match = elems[i];
     2909
     2910        if ( maxLevel && match.level > maxLevel ) {
     2911            break;
     2912        }
     2913
     2914        event.currentTarget = match.elem;
     2915        event.data = match.handleObj.data;
     2916        event.handleObj = match.handleObj;
     2917
     2918        ret = match.handleObj.origHandler.apply( match.elem, arguments );
     2919
     2920        if ( ret === false || event.isPropagationStopped() ) {
     2921            maxLevel = match.level;
     2922
     2923            if ( ret === false ) {
     2924                stop = false;
     2925            }
     2926            if ( event.isImmediatePropagationStopped() ) {
     2927                break;
     2928            }
     2929        }
     2930    }
     2931
     2932    return stop;
     2933}
     2934
     2935function liveConvert( type, selector ) {
     2936    return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");
     2937}
     2938
     2939jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
     2940    "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
     2941    "change select submit keydown keypress keyup error").split(" "), function( i, name ) {
     2942
     2943    // Handle event binding
     2944    jQuery.fn[ name ] = function( data, fn ) {
     2945        if ( fn == null ) {
     2946            fn = data;
     2947            data = null;
     2948        }
     2949
     2950        return arguments.length > 0 ?
     2951            this.bind( name, data, fn ) :
     2952            this.trigger( name );
     2953    };
     2954
     2955    if ( jQuery.attrFn ) {
     2956        jQuery.attrFn[ name ] = true;
     2957    }
     2958});
     2959
     2960// Prevent memory leaks in IE
     2961// Window isn't included so as not to unbind existing unload events
     2962// More info:
     2963//  - http://isaacschlueter.com/2006/10/msie-memory-leaks/
     2964if ( window.attachEvent && !window.addEventListener ) {
     2965    jQuery(window).bind("unload", function() {
     2966        for ( var id in jQuery.cache ) {
     2967            if ( jQuery.cache[ id ].handle ) {
     2968                // Try/Catch is to handle iframes being unloaded, see #4280
     2969                try {
     2970                    jQuery.event.remove( jQuery.cache[ id ].handle.elem );
     2971                } catch(e) {}
     2972            }
     2973        }
     2974    });
     2975}
     2976
     2977
     2978/*!
     2979 * Sizzle CSS Selector Engine - v1.0
     2980 *  Copyright 2009, The Dojo Foundation
     2981 *  Released under the MIT, BSD, and GPL Licenses.
     2982 *  More information: http://sizzlejs.com/
     2983 */
     2984(function(){
     2985
     2986var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
     2987    done = 0,
     2988    toString = Object.prototype.toString,
     2989    hasDuplicate = false,
     2990    baseHasDuplicate = true;
     2991
     2992// Here we check if the JavaScript engine is using some sort of
     2993// optimization where it does not always call our comparision
     2994// function. If that is the case, discard the hasDuplicate value.
     2995//   Thus far that includes Google Chrome.
     2996[0, 0].sort(function(){
     2997    baseHasDuplicate = false;
     2998    return 0;
     2999});
     3000
     3001var Sizzle = function(selector, context, results, seed) {
     3002    results = results || [];
     3003    context = context || document;
     3004
     3005    var origContext = context;
     3006
     3007    if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
     3008        return [];
     3009    }
     3010   
     3011    if ( !selector || typeof selector !== "string" ) {
     3012        return results;
     3013    }
     3014
     3015    var parts = [], m, set, checkSet, extra, prune = true, contextXML = Sizzle.isXML(context),
     3016        soFar = selector, ret, cur, pop, i;
     3017   
     3018    // Reset the position of the chunker regexp (start from head)
     3019    do {
     3020        chunker.exec("");
     3021        m = chunker.exec(soFar);
     3022
     3023        if ( m ) {
     3024            soFar = m[3];
     3025       
     3026            parts.push( m[1] );
     3027       
     3028            if ( m[2] ) {
     3029                extra = m[3];
     3030                break;
     3031            }
     3032        }
     3033    } while ( m );
     3034
     3035    if ( parts.length > 1 && origPOS.exec( selector ) ) {
     3036        if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
     3037            set = posProcess( parts[0] + parts[1], context );
     3038        } else {
     3039            set = Expr.relative[ parts[0] ] ?
     3040                [ context ] :
     3041                Sizzle( parts.shift(), context );
     3042
     3043            while ( parts.length ) {
     3044                selector = parts.shift();
     3045
     3046                if ( Expr.relative[ selector ] ) {
     3047                    selector += parts.shift();
     3048                }
     3049               
     3050                set = posProcess( selector, set );
     3051            }
     3052        }
     3053    } else {
     3054        // Take a shortcut and set the context if the root selector is an ID
     3055        // (but not if it'll be faster if the inner selector is an ID)
     3056        if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
     3057                Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
     3058            ret = Sizzle.find( parts.shift(), context, contextXML );
     3059            context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
     3060        }
     3061
     3062        if ( context ) {
     3063            ret = seed ?
     3064                { expr: parts.pop(), set: makeArray(seed) } :
     3065                Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
     3066            set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
     3067
     3068            if ( parts.length > 0 ) {
     3069                checkSet = makeArray(set);
     3070            } else {
     3071                prune = false;
     3072            }
     3073
     3074            while ( parts.length ) {
     3075                cur = parts.pop();
     3076                pop = cur;
     3077
     3078                if ( !Expr.relative[ cur ] ) {
     3079                    cur = "";
     3080                } else {
     3081                    pop = parts.pop();
     3082                }
     3083
     3084                if ( pop == null ) {
     3085                    pop = context;
     3086                }
     3087
     3088                Expr.relative[ cur ]( checkSet, pop, contextXML );
     3089            }
     3090        } else {
     3091            checkSet = parts = [];
     3092        }
     3093    }
     3094
     3095    if ( !checkSet ) {
     3096        checkSet = set;
     3097    }
     3098
     3099    if ( !checkSet ) {
     3100        Sizzle.error( cur || selector );
     3101    }
     3102
     3103    if ( toString.call(checkSet) === "[object Array]" ) {
     3104        if ( !prune ) {
     3105            results.push.apply( results, checkSet );
     3106        } else if ( context && context.nodeType === 1 ) {
     3107            for ( i = 0; checkSet[i] != null; i++ ) {
     3108                if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
     3109                    results.push( set[i] );
     3110                }
     3111            }
     3112        } else {
     3113            for ( i = 0; checkSet[i] != null; i++ ) {
     3114                if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
     3115                    results.push( set[i] );
     3116                }
     3117            }
     3118        }
     3119    } else {
     3120        makeArray( checkSet, results );
     3121    }
     3122
     3123    if ( extra ) {
     3124        Sizzle( extra, origContext, results, seed );
     3125        Sizzle.uniqueSort( results );
     3126    }
     3127
     3128    return results;
     3129};
     3130
     3131Sizzle.uniqueSort = function(results){
     3132    if ( sortOrder ) {
     3133        hasDuplicate = baseHasDuplicate;
     3134        results.sort(sortOrder);
     3135
     3136        if ( hasDuplicate ) {
     3137            for ( var i = 1; i < results.length; i++ ) {
     3138                if ( results[i] === results[i-1] ) {
     3139                    results.splice(i--, 1);
     3140                }
     3141            }
     3142        }
     3143    }
     3144
     3145    return results;
     3146};
     3147
     3148Sizzle.matches = function(expr, set){
     3149    return Sizzle(expr, null, null, set);
     3150};
     3151
     3152Sizzle.matchesSelector = function(node, expr){
     3153    return Sizzle(expr, null, null, [node]).length > 0;
     3154};
     3155
     3156Sizzle.find = function(expr, context, isXML){
     3157    var set;
     3158
     3159    if ( !expr ) {
     3160        return [];
     3161    }
     3162
     3163    for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
     3164        var type = Expr.order[i], match;
     3165       
     3166        if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
     3167            var left = match[1];
     3168            match.splice(1,1);
     3169
     3170            if ( left.substr( left.length - 1 ) !== "\\" ) {
     3171                match[1] = (match[1] || "").replace(/\\/g, "");
     3172                set = Expr.find[ type ]( match, context, isXML );
     3173                if ( set != null ) {
     3174                    expr = expr.replace( Expr.match[ type ], "" );
     3175                    break;
     3176                }
     3177            }
     3178        }
     3179    }
     3180
     3181    if ( !set ) {
     3182        set = context.getElementsByTagName("*");
     3183    }
     3184
     3185    return {set: set, expr: expr};
     3186};
     3187
     3188Sizzle.filter = function(expr, set, inplace, not){
     3189    var old = expr, result = [], curLoop = set, match, anyFound,
     3190        isXMLFilter = set && set[0] && Sizzle.isXML(set[0]);
     3191
     3192    while ( expr && set.length ) {
     3193        for ( var type in Expr.filter ) {
     3194            if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
     3195                var filter = Expr.filter[ type ], found, item, left = match[1];
     3196                anyFound = false;
     3197
     3198                match.splice(1,1);
     3199
     3200                if ( left.substr( left.length - 1 ) === "\\" ) {
     3201                    continue;
     3202                }
     3203
     3204                if ( curLoop === result ) {
     3205                    result = [];
     3206                }
     3207
     3208                if ( Expr.preFilter[ type ] ) {
     3209                    match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
     3210
     3211                    if ( !match ) {
     3212                        anyFound = found = true;
     3213                    } else if ( match === true ) {
     3214                        continue;
     3215                    }
     3216                }
     3217
     3218                if ( match ) {
     3219                    for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
     3220                        if ( item ) {
     3221                            found = filter( item, match, i, curLoop );
     3222                            var pass = not ^ !!found;
     3223
     3224                            if ( inplace && found != null ) {
     3225                                if ( pass ) {
     3226                                    anyFound = true;
     3227                                } else {
     3228                                    curLoop[i] = false;
     3229                                }
     3230                            } else if ( pass ) {
     3231                                result.push( item );
     3232                                anyFound = true;
     3233                            }
     3234                        }
     3235                    }
     3236                }
     3237
     3238                if ( found !== undefined ) {
     3239                    if ( !inplace ) {
     3240                        curLoop = result;
     3241                    }
     3242
     3243                    expr = expr.replace( Expr.match[ type ], "" );
     3244
     3245                    if ( !anyFound ) {
     3246                        return [];
     3247                    }
     3248
     3249                    break;
     3250                }
     3251            }
     3252        }
     3253
     3254        // Improper expression
     3255        if ( expr === old ) {
     3256            if ( anyFound == null ) {
     3257                Sizzle.error( expr );
     3258            } else {
     3259                break;
     3260            }
     3261        }
     3262
     3263        old = expr;
     3264    }
     3265
     3266    return curLoop;
     3267};
     3268
     3269Sizzle.error = function( msg ) {
     3270    throw "Syntax error, unrecognized expression: " + msg;
     3271};
     3272
     3273var Expr = Sizzle.selectors = {
     3274    order: [ "ID", "NAME", "TAG" ],
     3275    match: {
     3276        ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
     3277        CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
     3278        NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
     3279        ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
     3280        TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
     3281        CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
     3282        POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
     3283        PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
     3284    },
     3285    leftMatch: {},
     3286    attrMap: {
     3287        "class": "className",
     3288        "for": "htmlFor"
     3289    },
     3290    attrHandle: {
     3291        href: function(elem){
     3292            return elem.getAttribute("href");
     3293        }
     3294    },
     3295    relative: {
     3296        "+": function(checkSet, part){
     3297            var isPartStr = typeof part === "string",
     3298                isTag = isPartStr && !/\W/.test(part),
     3299                isPartStrNotTag = isPartStr && !isTag;
     3300
     3301            if ( isTag ) {
     3302                part = part.toLowerCase();
     3303            }
     3304
     3305            for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
     3306                if ( (elem = checkSet[i]) ) {
     3307                    while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
     3308
     3309                    checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
     3310                        elem || false :
     3311                        elem === part;
     3312                }
     3313            }
     3314
     3315            if ( isPartStrNotTag ) {
     3316                Sizzle.filter( part, checkSet, true );
     3317            }
     3318        },
     3319        ">": function(checkSet, part){
     3320            var isPartStr = typeof part === "string",
     3321                elem, i = 0, l = checkSet.length;
     3322
     3323            if ( isPartStr && !/\W/.test(part) ) {
     3324                part = part.toLowerCase();
     3325
     3326                for ( ; i < l; i++ ) {
     3327                    elem = checkSet[i];
     3328                    if ( elem ) {
     3329                        var parent = elem.parentNode;
     3330                        checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
     3331                    }
     3332                }
     3333            } else {
     3334                for ( ; i < l; i++ ) {
     3335                    elem = checkSet[i];
     3336                    if ( elem ) {
     3337                        checkSet[i] = isPartStr ?
     3338                            elem.parentNode :
     3339                            elem.parentNode === part;
     3340                    }
     3341                }
     3342
     3343                if ( isPartStr ) {
     3344                    Sizzle.filter( part, checkSet, true );
     3345                }
     3346            }
     3347        },
     3348        "": function(checkSet, part, isXML){
     3349            var doneName = done++, checkFn = dirCheck, nodeCheck;
     3350
     3351            if ( typeof part === "string" && !/\W/.test(part) ) {
     3352                part = part.toLowerCase();
     3353                nodeCheck = part;
     3354                checkFn = dirNodeCheck;
     3355            }
     3356
     3357            checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
     3358        },
     3359        "~": function(checkSet, part, isXML){
     3360            var doneName = done++, checkFn = dirCheck, nodeCheck;
     3361
     3362            if ( typeof part === "string" && !/\W/.test(part) ) {
     3363                part = part.toLowerCase();
     3364                nodeCheck = part;
     3365                checkFn = dirNodeCheck;
     3366            }
     3367
     3368            checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
     3369        }
     3370    },
     3371    find: {
     3372        ID: function(match, context, isXML){
     3373            if ( typeof context.getElementById !== "undefined" && !isXML ) {
     3374                var m = context.getElementById(match[1]);
     3375                // Check parentNode to catch when Blackberry 4.6 returns
     3376                // nodes that are no longer in the document #6963
     3377                return m && m.parentNode ? [m] : [];
     3378            }
     3379        },
     3380        NAME: function(match, context){
     3381            if ( typeof context.getElementsByName !== "undefined" ) {
     3382                var ret = [], results = context.getElementsByName(match[1]);
     3383
     3384                for ( var i = 0, l = results.length; i < l; i++ ) {
     3385                    if ( results[i].getAttribute("name") === match[1] ) {
     3386                        ret.push( results[i] );
     3387                    }
     3388                }
     3389
     3390                return ret.length === 0 ? null : ret;
     3391            }
     3392        },
     3393        TAG: function(match, context){
     3394            return context.getElementsByTagName(match[1]);
     3395        }
     3396    },
     3397    preFilter: {
     3398        CLASS: function(match, curLoop, inplace, result, not, isXML){
     3399            match = " " + match[1].replace(/\\/g, "") + " ";
     3400
     3401            if ( isXML ) {
     3402                return match;
     3403            }
     3404
     3405            for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
     3406                if ( elem ) {
     3407                    if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
     3408                        if ( !inplace ) {
     3409                            result.push( elem );
     3410                        }
     3411                    } else if ( inplace ) {
     3412                        curLoop[i] = false;
     3413                    }
     3414                }
     3415            }
     3416
     3417            return false;
     3418        },
     3419        ID: function(match){
     3420            return match[1].replace(/\\/g, "");
     3421        },
     3422        TAG: function(match, curLoop){
     3423            return match[1].toLowerCase();
     3424        },
     3425        CHILD: function(match){
     3426            if ( match[1] === "nth" ) {
     3427                // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
     3428                var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
     3429                    match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
     3430                    !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
     3431
     3432                // calculate the numbers (first)n+(last) including if they are negative
     3433                match[2] = (test[1] + (test[2] || 1)) - 0;
     3434                match[3] = test[3] - 0;
     3435            }
     3436
     3437            // TODO: Move to normal caching system
     3438            match[0] = done++;
     3439
     3440            return match;
     3441        },
     3442        ATTR: function(match, curLoop, inplace, result, not, isXML){
     3443            var name = match[1].replace(/\\/g, "");
     3444           
     3445            if ( !isXML && Expr.attrMap[name] ) {
     3446                match[1] = Expr.attrMap[name];
     3447            }
     3448
     3449            if ( match[2] === "~=" ) {
     3450                match[4] = " " + match[4] + " ";
     3451            }
     3452
     3453            return match;
     3454        },
     3455        PSEUDO: function(match, curLoop, inplace, result, not){
     3456            if ( match[1] === "not" ) {
     3457                // If we're dealing with a complex expression, or a simple one
     3458                if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
     3459                    match[3] = Sizzle(match[3], null, null, curLoop);
     3460                } else {
     3461                    var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
     3462                    if ( !inplace ) {
     3463                        result.push.apply( result, ret );
     3464                    }
     3465                    return false;
     3466                }
     3467            } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
     3468                return true;
     3469            }
     3470           
     3471            return match;
     3472        },
     3473        POS: function(match){
     3474            match.unshift( true );
     3475            return match;
     3476        }
     3477    },
     3478    filters: {
     3479        enabled: function(elem){
     3480            return elem.disabled === false && elem.type !== "hidden";
     3481        },
     3482        disabled: function(elem){
     3483            return elem.disabled === true;
     3484        },
     3485        checked: function(elem){
     3486            return elem.checked === true;
     3487        },
     3488        selected: function(elem){
     3489            // Accessing this property makes selected-by-default
     3490            // options in Safari work properly
     3491            elem.parentNode.selectedIndex;
     3492            return elem.selected === true;
     3493        },
     3494        parent: function(elem){
     3495            return !!elem.firstChild;
     3496        },
     3497        empty: function(elem){
     3498            return !elem.firstChild;
     3499        },
     3500        has: function(elem, i, match){
     3501            return !!Sizzle( match[3], elem ).length;
     3502        },
     3503        header: function(elem){
     3504            return (/h\d/i).test( elem.nodeName );
     3505        },
     3506        text: function(elem){
     3507            return "text" === elem.type;
     3508        },
     3509        radio: function(elem){
     3510            return "radio" === elem.type;
     3511        },
     3512        checkbox: function(elem){
     3513            return "checkbox" === elem.type;
     3514        },
     3515        file: function(elem){
     3516            return "file" === elem.type;
     3517        },
     3518        password: function(elem){
     3519            return "password" === elem.type;
     3520        },
     3521        submit: function(elem){
     3522            return "submit" === elem.type;
     3523        },
     3524        image: function(elem){
     3525            return "image" === elem.type;
     3526        },
     3527        reset: function(elem){
     3528            return "reset" === elem.type;
     3529        },
     3530        button: function(elem){
     3531            return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
     3532        },
     3533        input: function(elem){
     3534            return (/input|select|textarea|button/i).test(elem.nodeName);
     3535        }
     3536    },
     3537    setFilters: {
     3538        first: function(elem, i){
     3539            return i === 0;
     3540        },
     3541        last: function(elem, i, match, array){
     3542            return i === array.length - 1;
     3543        },
     3544        even: function(elem, i){
     3545            return i % 2 === 0;
     3546        },
     3547        odd: function(elem, i){
     3548            return i % 2 === 1;
     3549        },
     3550        lt: function(elem, i, match){
     3551            return i < match[3] - 0;
     3552        },
     3553        gt: function(elem, i, match){
     3554            return i > match[3] - 0;
     3555        },
     3556        nth: function(elem, i, match){
     3557            return match[3] - 0 === i;
     3558        },
     3559        eq: function(elem, i, match){
     3560            return match[3] - 0 === i;
     3561        }
     3562    },
     3563    filter: {
     3564        PSEUDO: function(elem, match, i, array){
     3565            var name = match[1], filter = Expr.filters[ name ];
     3566
     3567            if ( filter ) {
     3568                return filter( elem, i, match, array );
     3569            } else if ( name === "contains" ) {
     3570                return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
     3571            } else if ( name === "not" ) {
     3572                var not = match[3];
     3573
     3574                for ( var j = 0, l = not.length; j < l; j++ ) {
     3575                    if ( not[j] === elem ) {
     3576                        return false;
     3577                    }
     3578                }
     3579
     3580                return true;
     3581            } else {
     3582                Sizzle.error( "Syntax error, unrecognized expression: " + name );
     3583            }
     3584        },
     3585        CHILD: function(elem, match){
     3586            var type = match[1], node = elem;
     3587            switch (type) {
     3588                case 'only':
     3589                case 'first':
     3590                    while ( (node = node.previousSibling) )  {
     3591                        if ( node.nodeType === 1 ) {
     3592                            return false;
     3593                        }
     3594                    }
     3595                    if ( type === "first" ) {
     3596                        return true;
     3597                    }
     3598                    node = elem;
     3599                case 'last':
     3600                    while ( (node = node.nextSibling) )  {
     3601                        if ( node.nodeType === 1 ) {
     3602                            return false;
     3603                        }
     3604                    }
     3605                    return true;
     3606                case 'nth':
     3607                    var first = match[2], last = match[3];
     3608
     3609                    if ( first === 1 && last === 0 ) {
     3610                        return true;
     3611                    }
     3612                   
     3613                    var doneName = match[0],
     3614                        parent = elem.parentNode;
     3615   
     3616                    if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
     3617                        var count = 0;
     3618                        for ( node = parent.firstChild; node; node = node.nextSibling ) {
     3619                            if ( node.nodeType === 1 ) {
     3620                                node.nodeIndex = ++count;
     3621                            }
     3622                        }
     3623                        parent.sizcache = doneName;
     3624                    }
     3625                   
     3626                    var diff = elem.nodeIndex - last;
     3627                    if ( first === 0 ) {
     3628                        return diff === 0;
     3629                    } else {
     3630                        return ( diff % first === 0 && diff / first >= 0 );
     3631                    }
     3632            }
     3633        },
     3634        ID: function(elem, match){
     3635            return elem.nodeType === 1 && elem.getAttribute("id") === match;
     3636        },
     3637        TAG: function(elem, match){
     3638            return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
     3639        },
     3640        CLASS: function(elem, match){
     3641            return (" " + (elem.className || elem.getAttribute("class")) + " ")
     3642                .indexOf( match ) > -1;
     3643        },
     3644        ATTR: function(elem, match){
     3645            var name = match[1],
     3646                result = Expr.attrHandle[ name ] ?
     3647                    Expr.attrHandle[ name ]( elem ) :
     3648                    elem[ name ] != null ?
     3649                        elem[ name ] :
     3650                        elem.getAttribute( name ),
     3651                value = result + "",
     3652                type = match[2],
     3653                check = match[4];
     3654
     3655            return result == null ?
     3656                type === "!=" :
     3657                type === "=" ?
     3658                value === check :
     3659                type === "*=" ?
     3660                value.indexOf(check) >= 0 :
     3661                type === "~=" ?
     3662                (" " + value + " ").indexOf(check) >= 0 :
     3663                !check ?
     3664                value && result !== false :
     3665                type === "!=" ?
     3666                value !== check :
     3667                type === "^=" ?
     3668                value.indexOf(check) === 0 :
     3669                type === "$=" ?
     3670                value.substr(value.length - check.length) === check :
     3671                type === "|=" ?
     3672                value === check || value.substr(0, check.length + 1) === check + "-" :
     3673                false;
     3674        },
     3675        POS: function(elem, match, i, array){
     3676            var name = match[2], filter = Expr.setFilters[ name ];
     3677
     3678            if ( filter ) {
     3679                return filter( elem, i, match, array );
     3680            }
     3681        }
     3682    }
     3683};
     3684
     3685var origPOS = Expr.match.POS,
     3686    fescape = function(all, num){
     3687        return "\\" + (num - 0 + 1);
     3688    };
     3689
     3690for ( var type in Expr.match ) {
     3691    Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
     3692    Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
     3693}
     3694
     3695var makeArray = function(array, results) {
     3696    array = Array.prototype.slice.call( array, 0 );
     3697
     3698    if ( results ) {
     3699        results.push.apply( results, array );
     3700        return results;
     3701    }
     3702   
     3703    return array;
     3704};
     3705
     3706// Perform a simple check to determine if the browser is capable of
     3707// converting a NodeList to an array using builtin methods.
     3708// Also verifies that the returned array holds DOM nodes
     3709// (which is not the case in the Blackberry browser)
     3710try {
     3711    Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
     3712
     3713// Provide a fallback method if it does not work
     3714} catch(e){
     3715    makeArray = function(array, results) {
     3716        var ret = results || [], i = 0;
     3717
     3718        if ( toString.call(array) === "[object Array]" ) {
     3719            Array.prototype.push.apply( ret, array );
     3720        } else {
     3721            if ( typeof array.length === "number" ) {
     3722                for ( var l = array.length; i < l; i++ ) {
     3723                    ret.push( array[i] );
     3724                }
     3725            } else {
     3726                for ( ; array[i]; i++ ) {
     3727                    ret.push( array[i] );
     3728                }
     3729            }
     3730        }
     3731
     3732        return ret;
     3733    };
     3734}
     3735
     3736var sortOrder, siblingCheck;
     3737
     3738if ( document.documentElement.compareDocumentPosition ) {
     3739    sortOrder = function( a, b ) {
     3740        if ( a === b ) {
     3741            hasDuplicate = true;
     3742            return 0;
     3743        }
     3744
     3745        if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
     3746            return a.compareDocumentPosition ? -1 : 1;
     3747        }
     3748
     3749        return a.compareDocumentPosition(b) & 4 ? -1 : 1;
     3750    };
     3751} else {
     3752    sortOrder = function( a, b ) {
     3753        var ap = [], bp = [], aup = a.parentNode, bup = b.parentNode,
     3754            cur = aup, al, bl;
     3755
     3756        // The nodes are identical, we can exit early
     3757        if ( a === b ) {
     3758            hasDuplicate = true;
     3759            return 0;
     3760
     3761        // If the nodes are siblings (or identical) we can do a quick check
     3762        } else if ( aup === bup ) {
     3763            return siblingCheck( a, b );
     3764
     3765        // If no parents were found then the nodes are disconnected
     3766        } else if ( !aup ) {
     3767            return -1;
     3768
     3769        } else if ( !bup ) {
     3770            return 1;
     3771        }
     3772
     3773        // Otherwise they're somewhere else in the tree so we need
     3774        // to build up a full list of the parentNodes for comparison
     3775        while ( cur ) {
     3776            ap.unshift( cur );
     3777            cur = cur.parentNode;
     3778        }
     3779
     3780        cur = bup;
     3781
     3782        while ( cur ) {
     3783            bp.unshift( cur );
     3784            cur = cur.parentNode;
     3785        }
     3786
     3787        al = ap.length;
     3788        bl = bp.length;
     3789
     3790        // Start walking down the tree looking for a discrepancy
     3791        for ( var i = 0; i < al && i < bl; i++ ) {
     3792            if ( ap[i] !== bp[i] ) {
     3793                return siblingCheck( ap[i], bp[i] );
     3794            }
     3795        }
     3796
     3797        // We ended someplace up the tree so do a sibling check
     3798        return i === al ?
     3799            siblingCheck( a, bp[i], -1 ) :
     3800            siblingCheck( ap[i], b, 1 );
     3801    };
     3802
     3803    siblingCheck = function( a, b, ret ) {
     3804        if ( a === b ) {
     3805            return ret;
     3806        }
     3807
     3808        var cur = a.nextSibling;
     3809
     3810        while ( cur ) {
     3811            if ( cur === b ) {
     3812                return -1;
     3813            }
     3814
     3815            cur = cur.nextSibling;
     3816        }
     3817
     3818        return 1;
     3819    };
     3820}
     3821
     3822// Utility function for retreiving the text value of an array of DOM nodes
     3823Sizzle.getText = function( elems ) {
     3824    var ret = "", elem;
     3825
     3826    for ( var i = 0; elems[i]; i++ ) {
     3827        elem = elems[i];
     3828
     3829        // Get the text from text nodes and CDATA nodes
     3830        if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
     3831            ret += elem.nodeValue;
     3832
     3833        // Traverse everything else, except comment nodes
     3834        } else if ( elem.nodeType !== 8 ) {
     3835            ret += Sizzle.getText( elem.childNodes );
     3836        }
     3837    }
     3838
     3839    return ret;
     3840};
     3841
     3842// Check to see if the browser returns elements by name when
     3843// querying by getElementById (and provide a workaround)
     3844(function(){
     3845    // We're going to inject a fake input element with a specified name
     3846    var form = document.createElement("div"),
     3847        id = "script" + (new Date()).getTime();
     3848    form.innerHTML = "<a name='" + id + "'/>";
     3849
     3850    // Inject it into the root element, check its status, and remove it quickly
     3851    var root = document.documentElement;
     3852    root.insertBefore( form, root.firstChild );
     3853
     3854    // The workaround has to do additional checks after a getElementById
     3855    // Which slows things down for other browsers (hence the branching)
     3856    if ( document.getElementById( id ) ) {
     3857        Expr.find.ID = function(match, context, isXML){
     3858            if ( typeof context.getElementById !== "undefined" && !isXML ) {
     3859                var m = context.getElementById(match[1]);
     3860                return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
     3861            }
     3862        };
     3863
     3864        Expr.filter.ID = function(elem, match){
     3865            var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
     3866            return elem.nodeType === 1 && node && node.nodeValue === match;
     3867        };
     3868    }
     3869
     3870    root.removeChild( form );
     3871    root = form = null; // release memory in IE
     3872})();
     3873
     3874(function(){
     3875    // Check to see if the browser returns only elements
     3876    // when doing getElementsByTagName("*")
     3877
     3878    // Create a fake element
     3879    var div = document.createElement("div");
     3880    div.appendChild( document.createComment("") );
     3881
     3882    // Make sure no comments are found
     3883    if ( div.getElementsByTagName("*").length > 0 ) {
     3884        Expr.find.TAG = function(match, context){
     3885            var results = context.getElementsByTagName(match[1]);
     3886
     3887            // Filter out possible comments
     3888            if ( match[1] === "*" ) {
     3889                var tmp = [];
     3890
     3891                for ( var i = 0; results[i]; i++ ) {
     3892                    if ( results[i].nodeType === 1 ) {
     3893                        tmp.push( results[i] );
     3894                    }
     3895                }
     3896
     3897                results = tmp;
     3898            }
     3899
     3900            return results;
     3901        };
     3902    }
     3903
     3904    // Check to see if an attribute returns normalized href attributes
     3905    div.innerHTML = "<a href='#'></a>";
     3906    if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
     3907            div.firstChild.getAttribute("href") !== "#" ) {
     3908        Expr.attrHandle.href = function(elem){
     3909            return elem.getAttribute("href", 2);
     3910        };
     3911    }
     3912
     3913    div = null; // release memory in IE
     3914})();
     3915
     3916if ( document.querySelectorAll ) {
     3917    (function(){
     3918        var oldSizzle = Sizzle, div = document.createElement("div");
     3919        div.innerHTML = "<p class='TEST'></p>";
     3920
     3921        // Safari can't handle uppercase or unicode characters when
     3922        // in quirks mode.
     3923        if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
     3924            return;
     3925        }
     3926   
     3927        Sizzle = function(query, context, extra, seed){
     3928            context = context || document;
     3929
     3930            // Only use querySelectorAll on non-XML documents
     3931            // (ID selectors don't work in non-HTML documents)
     3932            if ( !seed && !Sizzle.isXML(context) ) {
     3933                if ( context.nodeType === 9 ) {
     3934                    try {
     3935                        return makeArray( context.querySelectorAll(query), extra );
     3936                    } catch(qsaError) {}
     3937
     3938                // qSA works strangely on Element-rooted queries
     3939                // We can work around this by specifying an extra ID on the root
     3940                // and working up from there (Thanks to Andrew Dupont for the technique)
     3941                // IE 8 doesn't work on object elements
     3942                } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
     3943                    var old = context.getAttribute( "id" ), id = context.id = "__sizzle__";
     3944
     3945                    try {
     3946                        return makeArray( context.querySelectorAll( "#" + id + " " + query ), extra );
     3947
     3948                    } catch(pseudoError) {
     3949                    } finally {
     3950                        if ( old ) {
     3951                            context.id = old;
     3952
     3953                        } else {
     3954                            context.removeAttribute( "id" );
     3955                        }
     3956                    }
     3957                }
     3958            }
     3959       
     3960            return oldSizzle(query, context, extra, seed);
     3961        };
     3962
     3963        for ( var prop in oldSizzle ) {
     3964            Sizzle[ prop ] = oldSizzle[ prop ];
     3965        }
     3966
     3967        div = null; // release memory in IE
     3968    })();
     3969}
     3970
     3971(function(){
     3972    var html = document.documentElement,
     3973        matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector,
     3974        pseudoWorks = false;
     3975
     3976    try {
     3977        // This should fail with an exception
     3978        // Gecko does not error, returns false instead
     3979        matches.call( document.documentElement, "[test!='']:sizzle" );
     3980   
     3981    } catch( pseudoError ) {
     3982        pseudoWorks = true;
     3983    }
     3984
     3985    if ( matches ) {
     3986        Sizzle.matchesSelector = function( node, expr ) {
     3987            if ( !Sizzle.isXML( node ) ) {
     3988                try {
     3989                    if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
     3990                        return matches.call( node, expr );
     3991                    }
     3992                } catch(e) {}
     3993            }
     3994
     3995            return Sizzle(expr, null, null, [node]).length > 0;
     3996        };
     3997    }
     3998})();
     3999
     4000(function(){
     4001    var div = document.createElement("div");
     4002
     4003    div.innerHTML = "<div class='test e'></div><div class='test'></div>";
     4004
     4005    // Opera can't find a second classname (in 9.6)
     4006    // Also, make sure that getElementsByClassName actually exists
     4007    if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
     4008        return;
     4009    }
     4010
     4011    // Safari caches class attributes, doesn't catch changes (in 3.2)
     4012    div.lastChild.className = "e";
     4013
     4014    if ( div.getElementsByClassName("e").length === 1 ) {
     4015        return;
     4016    }
     4017   
     4018    Expr.order.splice(1, 0, "CLASS");
     4019    Expr.find.CLASS = function(match, context, isXML) {
     4020        if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
     4021            return context.getElementsByClassName(match[1]);
     4022        }
     4023    };
     4024
     4025    div = null; // release memory in IE
     4026})();
     4027
     4028function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
     4029    for ( var i = 0, l = checkSet.length; i < l; i++ ) {
     4030        var elem = checkSet[i];
     4031        if ( elem ) {
     4032            elem = elem[dir];
     4033            var match = false;
     4034
     4035            while ( elem ) {
     4036                if ( elem.sizcache === doneName ) {
     4037                    match = checkSet[elem.sizset];
     4038                    break;
     4039                }
     4040
     4041                if ( elem.nodeType === 1 && !isXML ){
     4042                    elem.sizcache = doneName;
     4043                    elem.sizset = i;
     4044                }
     4045
     4046                if ( elem.nodeName.toLowerCase() === cur ) {
     4047                    match = elem;
     4048                    break;
     4049                }
     4050
     4051                elem = elem[dir];
     4052            }
     4053
     4054            checkSet[i] = match;
     4055        }
     4056    }
     4057}
     4058
     4059function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
     4060    for ( var i = 0, l = checkSet.length; i < l; i++ ) {
     4061        var elem = checkSet[i];
     4062        if ( elem ) {
     4063            elem = elem[dir];
     4064            var match = false;
     4065
     4066            while ( elem ) {
     4067                if ( elem.sizcache === doneName ) {
     4068                    match = checkSet[elem.sizset];
     4069                    break;
     4070                }
     4071
     4072                if ( elem.nodeType === 1 ) {
     4073                    if ( !isXML ) {
     4074                        elem.sizcache = doneName;
     4075                        elem.sizset = i;
     4076                    }
     4077                    if ( typeof cur !== "string" ) {
     4078                        if ( elem === cur ) {
     4079                            match = true;
     4080                            break;
     4081                        }
     4082
     4083                    } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
     4084                        match = elem;
     4085                        break;
     4086                    }
     4087                }
     4088
     4089                elem = elem[dir];
     4090            }
     4091
     4092            checkSet[i] = match;
     4093        }
     4094    }
     4095}
     4096
     4097if ( document.documentElement.contains ) {
     4098    Sizzle.contains = function(a, b){
     4099        return a !== b && (a.contains ? a.contains(b) : true);
     4100    };
     4101
     4102} else if ( document.documentElement.compareDocumentPosition ) {
     4103    Sizzle.contains = function(a, b){
     4104        return !!(a.compareDocumentPosition(b) & 16);
     4105    };
     4106
     4107} else {
     4108    Sizzle.contains = function(){
     4109        return false;
     4110    };
     4111}
     4112
     4113Sizzle.isXML = function(elem){
     4114    // documentElement is verified for cases where it doesn't yet exist
     4115    // (such as loading iframes in IE - #4833)
     4116    var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
     4117    return documentElement ? documentElement.nodeName !== "HTML" : false;
     4118};
     4119
     4120var posProcess = function(selector, context){
     4121    var tmpSet = [], later = "", match,
     4122        root = context.nodeType ? [context] : context;
     4123
     4124    // Position selectors must be done after the filter
     4125    // And so must :not(positional) so we move all PSEUDOs to the end
     4126    while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
     4127        later += match[0];
     4128        selector = selector.replace( Expr.match.PSEUDO, "" );
     4129    }
     4130
     4131    selector = Expr.relative[selector] ? selector + "*" : selector;
     4132
     4133    for ( var i = 0, l = root.length; i < l; i++ ) {
     4134        Sizzle( selector, root[i], tmpSet );
     4135    }
     4136
     4137    return Sizzle.filter( later, tmpSet );
     4138};
     4139
     4140// EXPOSE
     4141jQuery.find = Sizzle;
     4142jQuery.expr = Sizzle.selectors;
     4143jQuery.expr[":"] = jQuery.expr.filters;
     4144jQuery.unique = Sizzle.uniqueSort;
     4145jQuery.text = Sizzle.getText;
     4146jQuery.isXMLDoc = Sizzle.isXML;
     4147jQuery.contains = Sizzle.contains;
     4148
     4149
     4150})();
     4151
     4152
     4153var runtil = /Until$/,
     4154    rparentsprev = /^(?:parents|prevUntil|prevAll)/,
     4155    // Note: This RegExp should be improved, or likely pulled from Sizzle
     4156    rmultiselector = /,/,
     4157    isSimple = /^.[^:#\[\.,]*$/,
     4158    slice = Array.prototype.slice,
     4159    POS = jQuery.expr.match.POS;
     4160
     4161jQuery.fn.extend({
     4162    find: function( selector ) {
     4163        var ret = this.pushStack( "", "find", selector ), length = 0;
     4164
     4165        for ( var i = 0, l = this.length; i < l; i++ ) {
     4166            length = ret.length;
     4167            jQuery.find( selector, this[i], ret );
     4168
     4169            if ( i > 0 ) {
     4170                // Make sure that the results are unique
     4171                for ( var n = length; n < ret.length; n++ ) {
     4172                    for ( var r = 0; r < length; r++ ) {
     4173                        if ( ret[r] === ret[n] ) {
     4174                            ret.splice(n--, 1);
     4175                            break;
     4176                        }
     4177                    }
     4178                }
     4179            }
     4180        }
     4181
     4182        return ret;
     4183    },
     4184
     4185    has: function( target ) {
     4186        var targets = jQuery( target );
     4187        return this.filter(function() {
     4188            for ( var i = 0, l = targets.length; i < l; i++ ) {
     4189                if ( jQuery.contains( this, targets[i] ) ) {
     4190                    return true;
     4191                }
     4192            }
     4193        });
     4194    },
     4195
     4196    not: function( selector ) {
     4197        return this.pushStack( winnow(this, selector, false), "not", selector);
     4198    },
     4199
     4200    filter: function( selector ) {
     4201        return this.pushStack( winnow(this, selector, true), "filter", selector );
     4202    },
     4203   
     4204    is: function( selector ) {
     4205        return !!selector && jQuery.filter( selector, this ).length > 0;
     4206    },
     4207
     4208    closest: function( selectors, context ) {
     4209        var ret = [], i, l, cur = this[0];
     4210
     4211        if ( jQuery.isArray( selectors ) ) {
     4212            var match, matches = {}, selector, level = 1;
     4213
     4214            if ( cur && selectors.length ) {
     4215                for ( i = 0, l = selectors.length; i < l; i++ ) {
     4216                    selector = selectors[i];
     4217
     4218                    if ( !matches[selector] ) {
     4219                        matches[selector] = jQuery.expr.match.POS.test( selector ) ?
     4220                            jQuery( selector, context || this.context ) :
     4221                            selector;
     4222                    }
     4223                }
     4224
     4225                while ( cur && cur.ownerDocument && cur !== context ) {
     4226                    for ( selector in matches ) {
     4227                        match = matches[selector];
     4228
     4229                        if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
     4230                            ret.push({ selector: selector, elem: cur, level: level });
     4231                        }
     4232                    }
     4233
     4234                    cur = cur.parentNode;
     4235                    level++;
     4236                }
     4237            }
     4238
     4239            return ret;
     4240        }
     4241
     4242        var pos = POS.test( selectors ) ?
     4243            jQuery( selectors, context || this.context ) : null;
     4244
     4245        for ( i = 0, l = this.length; i < l; i++ ) {
     4246            cur = this[i];
     4247
     4248            while ( cur ) {
     4249                if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
     4250                    ret.push( cur );
     4251                    break;
     4252
     4253                } else {
     4254                    cur = cur.parentNode;
     4255                    if ( !cur || !cur.ownerDocument || cur === context ) {
     4256                        break;
     4257                    }
     4258                }
     4259            }
     4260        }
     4261
     4262        ret = ret.length > 1 ? jQuery.unique(ret) : ret;
     4263       
     4264        return this.pushStack( ret, "closest", selectors );
     4265    },
     4266   
     4267    // Determine the position of an element within
     4268    // the matched set of elements
     4269    index: function( elem ) {
     4270        if ( !elem || typeof elem === "string" ) {
     4271            return jQuery.inArray( this[0],
     4272                // If it receives a string, the selector is used
     4273                // If it receives nothing, the siblings are used
     4274                elem ? jQuery( elem ) : this.parent().children() );
     4275        }
     4276        // Locate the position of the desired element
     4277        return jQuery.inArray(
     4278            // If it receives a jQuery object, the first element is used
     4279            elem.jquery ? elem[0] : elem, this );
     4280    },
     4281
     4282    add: function( selector, context ) {
     4283        var set = typeof selector === "string" ?
     4284                jQuery( selector, context || this.context ) :
     4285                jQuery.makeArray( selector ),
     4286            all = jQuery.merge( this.get(), set );
     4287
     4288        return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
     4289            all :
     4290            jQuery.unique( all ) );
     4291    },
     4292
     4293    andSelf: function() {
     4294        return this.add( this.prevObject );
     4295    }
     4296});
     4297
     4298// A painfully simple check to see if an element is disconnected
     4299// from a document (should be improved, where feasible).
     4300function isDisconnected( node ) {
     4301    return !node || !node.parentNode || node.parentNode.nodeType === 11;
     4302}
     4303
     4304jQuery.each({
     4305    parent: function( elem ) {
     4306        var parent = elem.parentNode;
     4307        return parent && parent.nodeType !== 11 ? parent : null;
     4308    },
     4309    parents: function( elem ) {
     4310        return jQuery.dir( elem, "parentNode" );
     4311    },
     4312    parentsUntil: function( elem, i, until ) {
     4313        return jQuery.dir( elem, "parentNode", until );
     4314    },
     4315    next: function( elem ) {
     4316        return jQuery.nth( elem, 2, "nextSibling" );
     4317    },
     4318    prev: function( elem ) {
     4319        return jQuery.nth( elem, 2, "previousSibling" );
     4320    },
     4321    nextAll: function( elem ) {
     4322        return jQuery.dir( elem, "nextSibling" );
     4323    },
     4324    prevAll: function( elem ) {
     4325        return jQuery.dir( elem, "previousSibling" );
     4326    },
     4327    nextUntil: function( elem, i, until ) {
     4328        return jQuery.dir( elem, "nextSibling", until );
     4329    },
     4330    prevUntil: function( elem, i, until ) {
     4331        return jQuery.dir( elem, "previousSibling", until );
     4332    },
     4333    siblings: function( elem ) {
     4334        return jQuery.sibling( elem.parentNode.firstChild, elem );
     4335    },
     4336    children: function( elem ) {
     4337        return jQuery.sibling( elem.firstChild );
     4338    },
     4339    contents: function( elem ) {
     4340        return jQuery.nodeName( elem, "iframe" ) ?
     4341            elem.contentDocument || elem.contentWindow.document :
     4342            jQuery.makeArray( elem.childNodes );
     4343    }
     4344}, function( name, fn ) {
     4345    jQuery.fn[ name ] = function( until, selector ) {
     4346        var ret = jQuery.map( this, fn, until );
     4347       
     4348        if ( !runtil.test( name ) ) {
     4349            selector = until;
     4350        }
     4351
     4352        if ( selector && typeof selector === "string" ) {
     4353            ret = jQuery.filter( selector, ret );
     4354        }
     4355
     4356        ret = this.length > 1 ? jQuery.unique( ret ) : ret;
     4357
     4358        if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
     4359            ret = ret.reverse();
     4360        }
     4361
     4362        return this.pushStack( ret, name, slice.call(arguments).join(",") );
     4363    };
     4364});
     4365
     4366jQuery.extend({
     4367    filter: function( expr, elems, not ) {
     4368        if ( not ) {
     4369            expr = ":not(" + expr + ")";
     4370        }
     4371
     4372        return elems.length === 1 ?
     4373            jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
     4374            jQuery.find.matches(expr, elems);
     4375    },
     4376   
     4377    dir: function( elem, dir, until ) {
     4378        var matched = [], cur = elem[dir];
     4379        while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
     4380            if ( cur.nodeType === 1 ) {
     4381                matched.push( cur );
     4382            }
     4383            cur = cur[dir];
     4384        }
     4385        return matched;
     4386    },
     4387
     4388    nth: function( cur, result, dir, elem ) {
     4389        result = result || 1;
     4390        var num = 0;
     4391
     4392        for ( ; cur; cur = cur[dir] ) {
     4393            if ( cur.nodeType === 1 && ++num === result ) {
     4394                break;
     4395            }
     4396        }
     4397
     4398        return cur;
     4399    },
     4400
     4401    sibling: function( n, elem ) {
     4402        var r = [];
     4403
     4404        for ( ; n; n = n.nextSibling ) {
     4405            if ( n.nodeType === 1 && n !== elem ) {
     4406                r.push( n );
     4407            }
     4408        }
     4409
     4410        return r;
     4411    }
     4412});
     4413
     4414// Implement the identical functionality for filter and not
     4415function winnow( elements, qualifier, keep ) {
     4416    if ( jQuery.isFunction( qualifier ) ) {
     4417        return jQuery.grep(elements, function( elem, i ) {
     4418            var retVal = !!qualifier.call( elem, i, elem );
     4419            return retVal === keep;
     4420        });
     4421
     4422    } else if ( qualifier.nodeType ) {
     4423        return jQuery.grep(elements, function( elem, i ) {
     4424            return (elem === qualifier) === keep;
     4425        });
     4426
     4427    } else if ( typeof qualifier === "string" ) {
     4428        var filtered = jQuery.grep(elements, function( elem ) {
     4429            return elem.nodeType === 1;
     4430        });
     4431
     4432        if ( isSimple.test( qualifier ) ) {
     4433            return jQuery.filter(qualifier, filtered, !keep);
     4434        } else {
     4435            qualifier = jQuery.filter( qualifier, filtered );
     4436        }
     4437    }
     4438
     4439    return jQuery.grep(elements, function( elem, i ) {
     4440        return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
     4441    });
     4442}
     4443
     4444
     4445
     4446
     4447var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
     4448    rleadingWhitespace = /^\s+/,
     4449    rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
     4450    rtagName = /<([\w:]+)/,
     4451    rtbody = /<tbody/i,
     4452    rhtml = /<|&#?\w+;/,
     4453    rnocache = /<(?:script|object|embed|option|style)/i,
     4454    rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,  // checked="checked" or checked (html5)
     4455    raction = /\=([^="'>\s]+\/)>/g,
     4456    wrapMap = {
     4457        option: [ 1, "<select multiple='multiple'>", "</select>" ],
     4458        legend: [ 1, "<fieldset>", "</fieldset>" ],
     4459        thead: [ 1, "<table>", "</table>" ],
     4460        tr: [ 2, "<table><tbody>", "</tbody></table>" ],
     4461        td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
     4462        col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
     4463        area: [ 1, "<map>", "</map>" ],
     4464        _default: [ 0, "", "" ]
     4465    };
     4466
     4467wrapMap.optgroup = wrapMap.option;
     4468wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
     4469wrapMap.th = wrapMap.td;
     4470
     4471// IE can't serialize <link> and <script> tags normally
     4472if ( !jQuery.support.htmlSerialize ) {
     4473    wrapMap._default = [ 1, "div<div>", "</div>" ];
     4474}
     4475
     4476jQuery.fn.extend({
     4477    text: function( text ) {
     4478        if ( jQuery.isFunction(text) ) {
     4479            return this.each(function(i) {
     4480                var self = jQuery(this);
     4481                self.text( text.call(this, i, self.text()) );
     4482            });
     4483        }
     4484
     4485        if ( typeof text !== "object" && text !== undefined ) {
     4486            return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
     4487        }
     4488
     4489        return jQuery.text( this );
     4490    },
     4491
     4492    wrapAll: function( html ) {
     4493        if ( jQuery.isFunction( html ) ) {
     4494            return this.each(function(i) {
     4495                jQuery(this).wrapAll( html.call(this, i) );
     4496            });
     4497        }
     4498
     4499        if ( this[0] ) {
     4500            // The elements to wrap the target around
     4501            var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
     4502
     4503            if ( this[0].parentNode ) {
     4504                wrap.insertBefore( this[0] );
     4505            }
     4506
     4507            wrap.map(function() {
     4508                var elem = this;
     4509
     4510                while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
     4511                    elem = elem.firstChild;
     4512                }
     4513
     4514                return elem;
     4515            }).append(this);
     4516        }
     4517
     4518        return this;
     4519    },
     4520
     4521    wrapInner: function( html ) {
     4522        if ( jQuery.isFunction( html ) ) {
     4523            return this.each(function(i) {
     4524                jQuery(this).wrapInner( html.call(this, i) );
     4525            });
     4526        }
     4527
     4528        return this.each(function() {
     4529            var self = jQuery( this ), contents = self.contents();
     4530
     4531            if ( contents.length ) {
     4532                contents.wrapAll( html );
     4533
     4534            } else {
     4535                self.append( html );
     4536            }
     4537        });
     4538    },
     4539
     4540    wrap: function( html ) {
     4541        return this.each(function() {
     4542            jQuery( this ).wrapAll( html );
     4543        });
     4544    },
     4545
     4546    unwrap: function() {
     4547        return this.parent().each(function() {
     4548            if ( !jQuery.nodeName( this, "body" ) ) {
     4549                jQuery( this ).replaceWith( this.childNodes );
     4550            }
     4551        }).end();
     4552    },
     4553
     4554    append: function() {
     4555        return this.domManip(arguments, true, function( elem ) {
     4556            if ( this.nodeType === 1 ) {
     4557                this.appendChild( elem );
     4558            }
     4559        });
     4560    },
     4561
     4562    prepend: function() {
     4563        return this.domManip(arguments, true, function( elem ) {
     4564            if ( this.nodeType === 1 ) {
     4565                this.insertBefore( elem, this.firstChild );
     4566            }
     4567        });
     4568    },
     4569
     4570    before: function() {
     4571        if ( this[0] && this[0].parentNode ) {
     4572            return this.domManip(arguments, false, function( elem ) {
     4573                this.parentNode.insertBefore( elem, this );
     4574            });
     4575        } else if ( arguments.length ) {
     4576            var set = jQuery(arguments[0]);
     4577            set.push.apply( set, this.toArray() );
     4578            return this.pushStack( set, "before", arguments );
     4579        }
     4580    },
     4581
     4582    after: function() {
     4583        if ( this[0] && this[0].parentNode ) {
     4584            return this.domManip(arguments, false, function( elem ) {
     4585                this.parentNode.insertBefore( elem, this.nextSibling );
     4586            });
     4587        } else if ( arguments.length ) {
     4588            var set = this.pushStack( this, "after", arguments );
     4589            set.push.apply( set, jQuery(arguments[0]).toArray() );
     4590            return set;
     4591        }
     4592    },
     4593   
     4594    // keepData is for internal use only--do not document
     4595    remove: function( selector, keepData ) {
     4596        for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
     4597            if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
     4598                if ( !keepData && elem.nodeType === 1 ) {
     4599                    jQuery.cleanData( elem.getElementsByTagName("*") );
     4600                    jQuery.cleanData( [ elem ] );
     4601                }
     4602
     4603                if ( elem.parentNode ) {
     4604                     elem.parentNode.removeChild( elem );
     4605                }
     4606            }
     4607        }
     4608       
     4609        return this;
     4610    },
     4611
     4612    empty: function() {
     4613        for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
     4614            // Remove element nodes and prevent memory leaks
     4615            if ( elem.nodeType === 1 ) {
     4616                jQuery.cleanData( elem.getElementsByTagName("*") );
     4617            }
     4618
     4619            // Remove any remaining nodes
     4620            while ( elem.firstChild ) {
     4621                elem.removeChild( elem.firstChild );
     4622            }
     4623        }
     4624       
     4625        return this;
     4626    },
     4627
     4628    clone: function( events ) {
     4629        // Do the clone
     4630        var ret = this.map(function() {
     4631            if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
     4632                // IE copies events bound via attachEvent when
     4633                // using cloneNode. Calling detachEvent on the
     4634                // clone will also remove the events from the orignal
     4635                // In order to get around this, we use innerHTML.
     4636                // Unfortunately, this means some modifications to
     4637                // attributes in IE that are actually only stored
     4638                // as properties will not be copied (such as the
     4639                // the name attribute on an input).
     4640                var html = this.outerHTML, ownerDocument = this.ownerDocument;
     4641                if ( !html ) {
     4642                    var div = ownerDocument.createElement("div");
     4643                    div.appendChild( this.cloneNode(true) );
     4644                    html = div.innerHTML;
     4645                }
     4646
     4647                return jQuery.clean([html.replace(rinlinejQuery, "")
     4648                    // Handle the case in IE 8 where action=/test/> self-closes a tag
     4649                    .replace(raction, '="$1">')
     4650                    .replace(rleadingWhitespace, "")], ownerDocument)[0];
     4651            } else {
     4652                return this.cloneNode(true);
     4653            }
     4654        });
     4655
     4656        // Copy the events from the original to the clone
     4657        if ( events === true ) {
     4658            cloneCopyEvent( this, ret );
     4659            cloneCopyEvent( this.find("*"), ret.find("*") );
     4660        }
     4661
     4662        // Return the cloned set
     4663        return ret;
     4664    },
     4665
     4666    html: function( value ) {
     4667        if ( value === undefined ) {
     4668            return this[0] && this[0].nodeType === 1 ?
     4669                this[0].innerHTML.replace(rinlinejQuery, "") :
     4670                null;
     4671
     4672        // See if we can take a shortcut and just use innerHTML
     4673        } else if ( typeof value === "string" && !rnocache.test( value ) &&
     4674            (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
     4675            !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
     4676
     4677            value = value.replace(rxhtmlTag, "<$1></$2>");
     4678
     4679            try {
     4680                for ( var i = 0, l = this.length; i < l; i++ ) {
     4681                    // Remove element nodes and prevent memory leaks
     4682                    if ( this[i].nodeType === 1 ) {
     4683                        jQuery.cleanData( this[i].getElementsByTagName("*") );
     4684                        this[i].innerHTML = value;
     4685                    }
     4686                }
     4687
     4688            // If using innerHTML throws an exception, use the fallback method
     4689            } catch(e) {
     4690                this.empty().append( value );
     4691            }
     4692
     4693        } else if ( jQuery.isFunction( value ) ) {
     4694            this.each(function(i){
     4695                var self = jQuery(this);
     4696                self.html( value.call(this, i, self.html()) );
     4697            });
     4698
     4699        } else {
     4700            this.empty().append( value );
     4701        }
     4702
     4703        return this;
     4704    },
     4705
     4706    replaceWith: function( value ) {
     4707        if ( this[0] && this[0].parentNode ) {
     4708            // Make sure that the elements are removed from the DOM before they are inserted
     4709            // this can help fix replacing a parent with child elements
     4710            if ( jQuery.isFunction( value ) ) {
     4711                return this.each(function(i) {
     4712                    var self = jQuery(this), old = self.html();
     4713                    self.replaceWith( value.call( this, i, old ) );
     4714                });
     4715            }
     4716
     4717            if ( typeof value !== "string" ) {
     4718                value = jQuery(value).detach();
     4719            }
     4720
     4721            return this.each(function() {
     4722                var next = this.nextSibling, parent = this.parentNode;
     4723
     4724                jQuery(this).remove();
     4725
     4726                if ( next ) {
     4727                    jQuery(next).before( value );
     4728                } else {
     4729                    jQuery(parent).append( value );
     4730                }
     4731            });
     4732        } else {
     4733            return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
     4734        }
     4735    },
     4736
     4737    detach: function( selector ) {
     4738        return this.remove( selector, true );
     4739    },
     4740
     4741    domManip: function( args, table, callback ) {
     4742        var results, first, value = args[0], scripts = [], fragment, parent;
     4743
     4744        // We can't cloneNode fragments that contain checked, in WebKit
     4745        if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
     4746            return this.each(function() {
     4747                jQuery(this).domManip( args, table, callback, true );
     4748            });
     4749        }
     4750
     4751        if ( jQuery.isFunction(value) ) {
     4752            return this.each(function(i) {
     4753                var self = jQuery(this);
     4754                args[0] = value.call(this, i, table ? self.html() : undefined);
     4755                self.domManip( args, table, callback );
     4756            });
     4757        }
     4758
     4759        if ( this[0] ) {
     4760            parent = value && value.parentNode;
     4761
     4762            // If we're in a fragment, just use that instead of building a new one
     4763            if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
     4764                results = { fragment: parent };
     4765
     4766            } else {
     4767                results = jQuery.buildFragment( args, this, scripts );
     4768            }
     4769           
     4770            fragment = results.fragment;
     4771           
     4772            if ( fragment.childNodes.length === 1 ) {
     4773                first = fragment = fragment.firstChild;
     4774            } else {
     4775                first = fragment.firstChild;
     4776            }
     4777
     4778            if ( first ) {
     4779                table = table && jQuery.nodeName( first, "tr" );
     4780
     4781                for ( var i = 0, l = this.length; i < l; i++ ) {
     4782                    callback.call(
     4783                        table ?
     4784                            root(this[i], first) :
     4785                            this[i],
     4786                        i > 0 || results.cacheable || this.length > 1  ?
     4787                            fragment.cloneNode(true) :
     4788                            fragment
     4789                    );
     4790                }
     4791            }
     4792
     4793            if ( scripts.length ) {
     4794                jQuery.each( scripts, evalScript );
     4795            }
     4796        }
     4797
     4798        return this;
     4799    }
     4800});
     4801
     4802function root( elem, cur ) {
     4803    return jQuery.nodeName(elem, "table") ?
     4804        (elem.getElementsByTagName("tbody")[0] ||
     4805        elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
     4806        elem;
     4807}
     4808
     4809function cloneCopyEvent(orig, ret) {
     4810    var i = 0;
     4811
     4812    ret.each(function() {
     4813        if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
     4814            return;
     4815        }
     4816
     4817        var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
     4818
     4819        if ( events ) {
     4820            delete curData.handle;
     4821            curData.events = {};
     4822
     4823            for ( var type in events ) {
     4824                for ( var handler in events[ type ] ) {
     4825                    jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
     4826                }
     4827            }
     4828        }
     4829    });
     4830}
     4831
     4832jQuery.buildFragment = function( args, nodes, scripts ) {
     4833    var fragment, cacheable, cacheresults,
     4834        doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
     4835
     4836    // Only cache "small" (1/2 KB) strings that are associated with the main document
     4837    // Cloning options loses the selected state, so don't cache them
     4838    // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
     4839    // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
     4840    if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
     4841        !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
     4842
     4843        cacheable = true;
     4844        cacheresults = jQuery.fragments[ args[0] ];
     4845        if ( cacheresults ) {
     4846            if ( cacheresults !== 1 ) {
     4847                fragment = cacheresults;
     4848            }
     4849        }
     4850    }
     4851
     4852    if ( !fragment ) {
     4853        fragment = doc.createDocumentFragment();
     4854        jQuery.clean( args, doc, fragment, scripts );
     4855    }
     4856
     4857    if ( cacheable ) {
     4858        jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
     4859    }
     4860
     4861    return { fragment: fragment, cacheable: cacheable };
     4862};
     4863
     4864jQuery.fragments = {};
     4865
     4866jQuery.each({
     4867    appendTo: "append",
     4868    prependTo: "prepend",
     4869    insertBefore: "before",
     4870    insertAfter: "after",
     4871    replaceAll: "replaceWith"
     4872}, function( name, original ) {
     4873    jQuery.fn[ name ] = function( selector ) {
     4874        var ret = [], insert = jQuery( selector ),
     4875            parent = this.length === 1 && this[0].parentNode;
     4876       
     4877        if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
     4878            insert[ original ]( this[0] );
     4879            return this;
     4880           
     4881        } else {
     4882            for ( var i = 0, l = insert.length; i < l; i++ ) {
     4883                var elems = (i > 0 ? this.clone(true) : this).get();
     4884                jQuery( insert[i] )[ original ]( elems );
     4885                ret = ret.concat( elems );
     4886            }
     4887       
     4888            return this.pushStack( ret, name, insert.selector );
     4889        }
     4890    };
     4891});
     4892
     4893jQuery.extend({
     4894    clean: function( elems, context, fragment, scripts ) {
     4895        context = context || document;
     4896
     4897        // !context.createElement fails in IE with an error but returns typeof 'object'
     4898        if ( typeof context.createElement === "undefined" ) {
     4899            context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
     4900        }
     4901
     4902        var ret = [];
     4903
     4904        for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
     4905            if ( typeof elem === "number" ) {
     4906                elem += "";
     4907            }
     4908
     4909            if ( !elem ) {
     4910                continue;
     4911            }
     4912
     4913            // Convert html string into DOM nodes
     4914            if ( typeof elem === "string" && !rhtml.test( elem ) ) {
     4915                elem = context.createTextNode( elem );
     4916
     4917            } else if ( typeof elem === "string" ) {
     4918                // Fix "XHTML"-style tags in all browsers
     4919                elem = elem.replace(rxhtmlTag, "<$1></$2>");
     4920
     4921                // Trim whitespace, otherwise indexOf won't work as expected
     4922                var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
     4923                    wrap = wrapMap[ tag ] || wrapMap._default,
     4924                    depth = wrap[0],
     4925                    div = context.createElement("div");
     4926
     4927                // Go to html and back, then peel off extra wrappers
     4928                div.innerHTML = wrap[1] + elem + wrap[2];
     4929
     4930                // Move to the right depth
     4931                while ( depth-- ) {
     4932                    div = div.lastChild;
     4933                }
     4934
     4935                // Remove IE's autoinserted <tbody> from table fragments
     4936                if ( !jQuery.support.tbody ) {
     4937
     4938                    // String was a <table>, *may* have spurious <tbody>
     4939                    var hasBody = rtbody.test(elem),
     4940                        tbody = tag === "table" && !hasBody ?
     4941                            div.firstChild && div.firstChild.childNodes :
     4942
     4943                            // String was a bare <thead> or <tfoot>
     4944                            wrap[1] === "<table>" && !hasBody ?
     4945                                div.childNodes :
     4946                                [];
     4947
     4948                    for ( var j = tbody.length - 1; j >= 0 ; --j ) {
     4949                        if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
     4950                            tbody[ j ].parentNode.removeChild( tbody[ j ] );
     4951                        }
     4952                    }
     4953
     4954                }
     4955
     4956                // IE completely kills leading whitespace when innerHTML is used
     4957                if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
     4958                    div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
     4959                }
     4960
     4961                elem = div.childNodes;
     4962            }
     4963
     4964            if ( elem.nodeType ) {
     4965                ret.push( elem );
     4966            } else {
     4967                ret = jQuery.merge( ret, elem );
     4968            }
     4969        }
     4970
     4971        if ( fragment ) {
     4972            for ( i = 0; ret[i]; i++ ) {
     4973                if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
     4974                    scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
     4975               
     4976                } else {
     4977                    if ( ret[i].nodeType === 1 ) {
     4978                        ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
     4979                    }
     4980                    fragment.appendChild( ret[i] );
     4981                }
     4982            }
     4983        }
     4984
     4985        return ret;
     4986    },
     4987   
     4988    cleanData: function( elems ) {
     4989        var data, id, cache = jQuery.cache,
     4990            special = jQuery.event.special,
     4991            deleteExpando = jQuery.support.deleteExpando;
     4992       
     4993        for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
     4994            if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
     4995                continue;
     4996            }
     4997
     4998            id = elem[ jQuery.expando ];
     4999           
     5000            if ( id ) {
     5001                data = cache[ id ];
     5002               
     5003                if ( data && data.events ) {
     5004                    for ( var type in data.events ) {
     5005                        if ( special[ type ] ) {
     5006                            jQuery.event.remove( elem, type );
     5007
     5008                        } else {
     5009                            jQuery.removeEvent( elem, type, data.handle );
     5010                        }
     5011                    }
     5012                }
     5013               
     5014                if ( deleteExpando ) {
     5015                    delete elem[ jQuery.expando ];
     5016
     5017                } else if ( elem.removeAttribute ) {
     5018                    elem.removeAttribute( jQuery.expando );
     5019                }
     5020               
     5021                delete cache[ id ];
     5022            }
     5023        }
     5024    }
     5025});
     5026
     5027function evalScript( i, elem ) {
     5028    if ( elem.src ) {
     5029        jQuery.ajax({
     5030            url: elem.src,
     5031            async: false,
     5032            dataType: "script"
     5033        });
     5034    } else {
     5035        jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
     5036    }
     5037
     5038    if ( elem.parentNode ) {
     5039        elem.parentNode.removeChild( elem );
     5040    }
     5041}
     5042
     5043
     5044
     5045
     5046var ralpha = /alpha\([^)]*\)/i,
     5047    ropacity = /opacity=([^)]*)/,
     5048    rdashAlpha = /-([a-z])/ig,
     5049    rupper = /([A-Z])/g,
     5050    rnumpx = /^-?\d+(?:px)?$/i,
     5051    rnum = /^-?\d/,
     5052
     5053    cssShow = { position: "absolute", visibility: "hidden", display: "block" },
     5054    cssWidth = [ "Left", "Right" ],
     5055    cssHeight = [ "Top", "Bottom" ],
     5056    curCSS,
     5057
     5058    // cache check for defaultView.getComputedStyle
     5059    getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
     5060
     5061    fcamelCase = function( all, letter ) {
     5062        return letter.toUpperCase();
     5063    };
     5064
     5065jQuery.fn.css = function( name, value ) {
     5066    // Setting 'undefined' is a no-op
     5067    if ( arguments.length === 2 && value === undefined ) {
     5068        return this;
     5069    }
     5070
     5071    return jQuery.access( this, name, value, true, function( elem, name, value ) {
     5072        return value !== undefined ?
     5073            jQuery.style( elem, name, value ) :
     5074            jQuery.css( elem, name );
     5075    });
     5076};
     5077
     5078jQuery.extend({
     5079    // Add in style property hooks for overriding the default
     5080    // behavior of getting and setting a style property
     5081    cssHooks: {
     5082        opacity: {
     5083            get: function( elem, computed ) {
     5084                if ( computed ) {
     5085                    // We should always get a number back from opacity
     5086                    var ret = curCSS( elem, "opacity", "opacity" );
     5087                    return ret === "" ? "1" : ret;
     5088
     5089                } else {
     5090                    return elem.style.opacity;
     5091                }
     5092            }
     5093        }
     5094    },
     5095
     5096    // Exclude the following css properties to add px
     5097    cssNumber: {
     5098        "zIndex": true,
     5099        "fontWeight": true,
     5100        "opacity": true,
     5101        "zoom": true,
     5102        "lineHeight": true
     5103    },
     5104
     5105    // Add in properties whose names you wish to fix before
     5106    // setting or getting the value
     5107    cssProps: {
     5108        // normalize float css property
     5109        "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
     5110    },
     5111
     5112    // Get and set the style property on a DOM Node
     5113    style: function( elem, name, value, extra ) {
     5114        // Don't set styles on text and comment nodes
     5115        if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
     5116            return;
     5117        }
     5118
     5119        // Make sure that we're working with the right name
     5120        var ret, origName = jQuery.camelCase( name ),
     5121            style = elem.style, hooks = jQuery.cssHooks[ origName ];
     5122
     5123        name = jQuery.cssProps[ origName ] || origName;
     5124
     5125        // Check if we're setting a value
     5126        if ( value !== undefined ) {
     5127            // Make sure that NaN and null values aren't set. See: #7116
     5128            if ( typeof value === "number" && isNaN( value ) || value == null ) {
     5129                return;
     5130            }
     5131
     5132            // If a number was passed in, add 'px' to the (except for certain CSS properties)
     5133            if ( typeof value === "number" && !jQuery.cssNumber[ origName ] ) {
     5134                value += "px";
     5135            }
     5136
     5137            // If a hook was provided, use that value, otherwise just set the specified value
     5138            if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
     5139                // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
     5140                // Fixes bug #5509
     5141                try {
     5142                    style[ name ] = value;
     5143                } catch(e) {}
     5144            }
     5145
     5146        } else {
     5147            // If a hook was provided get the non-computed value from there
     5148            if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
     5149                return ret;
     5150            }
     5151
     5152            // Otherwise just get the value from the style object
     5153            return style[ name ];
     5154        }
     5155    },
     5156
     5157    css: function( elem, name, extra ) {
     5158        // Make sure that we're working with the right name
     5159        var ret, origName = jQuery.camelCase( name ),
     5160            hooks = jQuery.cssHooks[ origName ];
     5161
     5162        name = jQuery.cssProps[ origName ] || origName;
     5163
     5164        // If a hook was provided get the computed value from there
     5165        if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
     5166            return ret;
     5167
     5168        // Otherwise, if a way to get the computed value exists, use that
     5169        } else if ( curCSS ) {
     5170            return curCSS( elem, name, origName );
     5171        }
     5172    },
     5173
     5174    // A method for quickly swapping in/out CSS properties to get correct calculations
     5175    swap: function( elem, options, callback ) {
     5176        var old = {};
     5177
     5178        // Remember the old values, and insert the new ones
     5179        for ( var name in options ) {
     5180            old[ name ] = elem.style[ name ];
     5181            elem.style[ name ] = options[ name ];
     5182        }
     5183
     5184        callback.call( elem );
     5185
     5186        // Revert the old values
     5187        for ( name in options ) {
     5188            elem.style[ name ] = old[ name ];
     5189        }
     5190    },
     5191
     5192    camelCase: function( string ) {
     5193        return string.replace( rdashAlpha, fcamelCase );
     5194    }
     5195});
     5196
     5197// DEPRECATED, Use jQuery.css() instead
     5198jQuery.curCSS = jQuery.css;
     5199
     5200jQuery.each(["height", "width"], function( i, name ) {
     5201    jQuery.cssHooks[ name ] = {
     5202        get: function( elem, computed, extra ) {
     5203            var val;
     5204
     5205            if ( computed ) {
     5206                if ( elem.offsetWidth !== 0 ) {
     5207                    val = getWH( elem, name, extra );
     5208
     5209                } else {
     5210                    jQuery.swap( elem, cssShow, function() {
     5211                        val = getWH( elem, name, extra );
     5212                    });
     5213                }
     5214
     5215                if ( val <= 0 ) {
     5216                    val = curCSS( elem, name, name );
     5217
     5218                    if ( val != null ) {
     5219                        return val === "auto" ? "" : val;
     5220                    }
     5221                }
     5222
     5223                if ( val < 0 || val == null ) {
     5224                    return elem.style[ name ];
     5225                }
     5226
     5227                return typeof val === "string" ? val : val + "px";
     5228            }
     5229        },
     5230
     5231        set: function( elem, value ) {
     5232            if ( rnumpx.test( value ) ) {
     5233                // ignore negative width and height values #1599
     5234                value = parseFloat(value);
     5235
     5236                if ( value >= 0 ) {
     5237                    return value + "px";
     5238                }
     5239
     5240            } else {
     5241                return value;
     5242            }
     5243        }
     5244    };
     5245});
     5246
     5247if ( !jQuery.support.opacity ) {
     5248    jQuery.cssHooks.opacity = {
     5249        get: function( elem, computed ) {
     5250            // IE uses filters for opacity
     5251            return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ?
     5252                (parseFloat(RegExp.$1) / 100) + "" :
     5253                computed ? "1" : "";
     5254        },
     5255
     5256        set: function( elem, value ) {
     5257            var style = elem.style;
     5258
     5259            // IE has trouble with opacity if it does not have layout
     5260            // Force it by setting the zoom level
     5261            style.zoom = 1;
     5262
     5263            // Set the alpha filter to set the opacity
     5264            var opacity = jQuery.isNaN(value) ?
     5265                "" :
     5266                "alpha(opacity=" + value * 100 + ")",
     5267                filter = style.filter || "";
     5268
     5269            style.filter = ralpha.test(filter) ?
     5270                filter.replace(ralpha, opacity) :
     5271                style.filter + ' ' + opacity;
     5272        }
     5273    };
     5274}
     5275
     5276if ( getComputedStyle ) {
     5277    curCSS = function( elem, newName, name ) {
     5278        var ret, defaultView, computedStyle;
     5279
     5280        name = name.replace( rupper, "-$1" ).toLowerCase();
     5281
     5282        if ( !(defaultView = elem.ownerDocument.defaultView) ) {
     5283            return undefined;
     5284        }
     5285
     5286        if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
     5287            ret = computedStyle.getPropertyValue( name );
     5288            if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
     5289                ret = jQuery.style( elem, name );
     5290            }
     5291        }
     5292
     5293        return ret;
     5294    };
     5295
     5296} else if ( document.documentElement.currentStyle ) {
     5297    curCSS = function( elem, name ) {
     5298        var left, rsLeft, ret = elem.currentStyle && elem.currentStyle[ name ], style = elem.style;
     5299
     5300        // From the awesome hack by Dean Edwards
     5301        // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
     5302
     5303        // If we're not dealing with a regular pixel number
     5304        // but a number that has a weird ending, we need to convert it to pixels
     5305        if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
     5306            // Remember the original values
     5307            left = style.left;
     5308            rsLeft = elem.runtimeStyle.left;
     5309
     5310            // Put in the new values to get a computed value out
     5311            elem.runtimeStyle.left = elem.currentStyle.left;
     5312            style.left = name === "fontSize" ? "1em" : (ret || 0);
     5313            ret = style.pixelLeft + "px";
     5314
     5315            // Revert the changed values
     5316            style.left = left;
     5317            elem.runtimeStyle.left = rsLeft;
     5318        }
     5319
     5320        return ret;
     5321    };
     5322}
     5323
     5324function getWH( elem, name, extra ) {
     5325    var which = name === "width" ? cssWidth : cssHeight,
     5326        val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
     5327
     5328    if ( extra === "border" ) {
     5329        return val;
     5330    }
     5331
     5332    jQuery.each( which, function() {
     5333        if ( !extra ) {
     5334            val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0;
     5335        }
     5336
     5337        if ( extra === "margin" ) {
     5338            val += parseFloat(jQuery.css( elem, "margin" + this )) || 0;
     5339
     5340        } else {
     5341            val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0;
     5342        }
     5343    });
     5344
     5345    return val;
     5346}
     5347
     5348if ( jQuery.expr && jQuery.expr.filters ) {
     5349    jQuery.expr.filters.hidden = function( elem ) {
     5350        var width = elem.offsetWidth, height = elem.offsetHeight;
     5351
     5352        return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
     5353    };
     5354
     5355    jQuery.expr.filters.visible = function( elem ) {
     5356        return !jQuery.expr.filters.hidden( elem );
     5357    };
     5358}
     5359
     5360
     5361
     5362
     5363var jsc = jQuery.now(),
     5364    rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
     5365    rselectTextarea = /^(?:select|textarea)/i,
     5366    rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
     5367    rnoContent = /^(?:GET|HEAD)$/,
     5368    rbracket = /\[\]$/,
     5369    jsre = /\=\?(&|$)/,
     5370    rquery = /\?/,
     5371    rts = /([?&])_=[^&]*/,
     5372    rurl = /^(\w+:)?\/\/([^\/?#]+)/,
     5373    r20 = /%20/g,
     5374    rhash = /#.*$/,
     5375
     5376    // Keep a copy of the old load method
     5377    _load = jQuery.fn.load;
     5378
     5379jQuery.fn.extend({
     5380    load: function( url, params, callback ) {
     5381        if ( typeof url !== "string" && _load ) {
     5382            return _load.apply( this, arguments );
     5383
     5384        // Don't do a request if no elements are being requested
     5385        } else if ( !this.length ) {
     5386            return this;
     5387        }
     5388
     5389        var off = url.indexOf(" ");
     5390        if ( off >= 0 ) {
     5391            var selector = url.slice(off, url.length);
     5392            url = url.slice(0, off);
     5393        }
     5394
     5395        // Default to a GET request
     5396        var type = "GET";
     5397
     5398        // If the second parameter was provided
     5399        if ( params ) {
     5400            // If it's a function
     5401            if ( jQuery.isFunction( params ) ) {
     5402                // We assume that it's the callback
     5403                callback = params;
     5404                params = null;
     5405
     5406            // Otherwise, build a param string
     5407            } else if ( typeof params === "object" ) {
     5408                params = jQuery.param( params, jQuery.ajaxSettings.traditional );
     5409                type = "POST";
     5410            }
     5411        }
     5412
     5413        var self = this;
     5414
     5415        // Request the remote document
     5416        jQuery.ajax({
     5417            url: url,
     5418            type: type,
     5419            dataType: "html",
     5420            data: params,
     5421            complete: function( res, status ) {
     5422                // If successful, inject the HTML into all the matched elements
     5423                if ( status === "success" || status === "notmodified" ) {
     5424                    // See if a selector was specified
     5425                    self.html( selector ?
     5426                        // Create a dummy div to hold the results
     5427                        jQuery("<div>")
     5428                            // inject the contents of the document in, removing the scripts
     5429                            // to avoid any 'Permission Denied' errors in IE
     5430                            .append(res.responseText.replace(rscript, ""))
     5431
     5432                            // Locate the specified elements
     5433                            .find(selector) :
     5434
     5435                        // If not, just inject the full result
     5436                        res.responseText );
     5437                }
     5438
     5439                if ( callback ) {
     5440                    self.each( callback, [res.responseText, status, res] );
     5441                }
     5442            }
     5443        });
     5444
     5445        return this;
     5446    },
     5447
     5448    serialize: function() {
     5449        return jQuery.param(this.serializeArray());
     5450    },
     5451
     5452    serializeArray: function() {
     5453        return this.map(function() {
     5454            return this.elements ? jQuery.makeArray(this.elements) : this;
     5455        })
     5456        .filter(function() {
     5457            return this.name && !this.disabled &&
     5458                (this.checked || rselectTextarea.test(this.nodeName) ||
     5459                    rinput.test(this.type));
     5460        })
     5461        .map(function( i, elem ) {
     5462            var val = jQuery(this).val();
     5463
     5464            return val == null ?
     5465                null :
     5466                jQuery.isArray(val) ?
     5467                    jQuery.map( val, function( val, i ) {
     5468                        return { name: elem.name, value: val };
     5469                    }) :
     5470                    { name: elem.name, value: val };
     5471        }).get();
     5472    }
     5473});
     5474
     5475// Attach a bunch of functions for handling common AJAX events
     5476jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
     5477    jQuery.fn[o] = function( f ) {
     5478        return this.bind(o, f);
     5479    };
     5480});
     5481
     5482jQuery.extend({
     5483    get: function( url, data, callback, type ) {
     5484        // shift arguments if data argument was omited
     5485        if ( jQuery.isFunction( data ) ) {
     5486            type = type || callback;
     5487            callback = data;
     5488            data = null;
     5489        }
     5490
     5491        return jQuery.ajax({
     5492            type: "GET",
     5493            url: url,
     5494            data: data,
     5495            success: callback,
     5496            dataType: type
     5497        });
     5498    },
     5499
     5500    getScript: function( url, callback ) {
     5501        return jQuery.get(url, null, callback, "script");
     5502    },
     5503
     5504    getJSON: function( url, data, callback ) {
     5505        return jQuery.get(url, data, callback, "json");
     5506    },
     5507
     5508    post: function( url, data, callback, type ) {
     5509        // shift arguments if data argument was omited
     5510        if ( jQuery.isFunction( data ) ) {
     5511            type = type || callback;
     5512            callback = data;
     5513            data = {};
     5514        }
     5515
     5516        return jQuery.ajax({
     5517            type: "POST",
     5518            url: url,
     5519            data: data,
     5520            success: callback,
     5521            dataType: type
     5522        });
     5523    },
     5524
     5525    ajaxSetup: function( settings ) {
     5526        jQuery.extend( jQuery.ajaxSettings, settings );
     5527    },
     5528
     5529    ajaxSettings: {
     5530        url: location.href,
     5531        global: true,
     5532        type: "GET",
     5533        contentType: "application/x-www-form-urlencoded",
     5534        processData: true,
     5535        async: true,
     5536        /*
     5537        timeout: 0,
     5538        data: null,
     5539        username: null,
     5540        password: null,
     5541        traditional: false,
     5542        */
     5543        // This function can be overriden by calling jQuery.ajaxSetup
     5544        xhr: function() {
     5545            return new window.XMLHttpRequest();
     5546        },
     5547        accepts: {
     5548            xml: "application/xml, text/xml",
     5549            html: "text/html",
     5550            script: "text/javascript, application/javascript",
     5551            json: "application/json, text/javascript",
     5552            text: "text/plain",
     5553            _default: "*/*"
     5554        }
     5555    },
     5556
     5557    ajax: function( origSettings ) {
     5558        var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings),
     5559            jsonp, status, data, type = s.type.toUpperCase(), noContent = rnoContent.test(type);
     5560
     5561        s.url = s.url.replace( rhash, "" );
     5562
     5563        // Use original (not extended) context object if it was provided
     5564        s.context = origSettings && origSettings.context != null ? origSettings.context : s;
     5565
     5566        // convert data if not already a string
     5567        if ( s.data && s.processData && typeof s.data !== "string" ) {
     5568            s.data = jQuery.param( s.data, s.traditional );
     5569        }
     5570
     5571        // Handle JSONP Parameter Callbacks
     5572        if ( s.dataType === "jsonp" ) {
     5573            if ( type === "GET" ) {
     5574                if ( !jsre.test( s.url ) ) {
     5575                    s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
     5576                }
     5577            } else if ( !s.data || !jsre.test(s.data) ) {
     5578                s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
     5579            }
     5580            s.dataType = "json";
     5581        }
     5582
     5583        // Build temporary JSONP function
     5584        if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
     5585            jsonp = s.jsonpCallback || ("jsonp" + jsc++);
     5586
     5587            // Replace the =? sequence both in the query string and the data
     5588            if ( s.data ) {
     5589                s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
     5590            }
     5591
     5592            s.url = s.url.replace(jsre, "=" + jsonp + "$1");
     5593
     5594            // We need to make sure
     5595            // that a JSONP style response is executed properly
     5596            s.dataType = "script";
     5597
     5598            // Handle JSONP-style loading
     5599            var customJsonp = window[ jsonp ];
     5600
     5601            window[ jsonp ] = function( tmp ) {
     5602                if ( jQuery.isFunction( customJsonp ) ) {
     5603                    customJsonp( tmp );
     5604
     5605                } else {
     5606                    // Garbage collect
     5607                    window[ jsonp ] = undefined;
     5608
     5609                    try {
     5610                        delete window[ jsonp ];
     5611                    } catch( jsonpError ) {}
     5612                }
     5613
     5614                data = tmp;
     5615                jQuery.handleSuccess( s, xhr, status, data );
     5616                jQuery.handleComplete( s, xhr, status, data );
     5617               
     5618                if ( head ) {
     5619                    head.removeChild( script );
     5620                }
     5621            };
     5622        }
     5623
     5624        if ( s.dataType === "script" && s.cache === null ) {
     5625            s.cache = false;
     5626        }
     5627
     5628        if ( s.cache === false && noContent ) {
     5629            var ts = jQuery.now();
     5630
     5631            // try replacing _= if it is there
     5632            var ret = s.url.replace(rts, "$1_=" + ts);
     5633
     5634            // if nothing was replaced, add timestamp to the end
     5635            s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
     5636        }
     5637
     5638        // If data is available, append data to url for GET/HEAD requests
     5639        if ( s.data && noContent ) {
     5640            s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
     5641        }
     5642
     5643        // Watch for a new set of requests
     5644        if ( s.global && jQuery.active++ === 0 ) {
     5645            jQuery.event.trigger( "ajaxStart" );
     5646        }
     5647
     5648        // Matches an absolute URL, and saves the domain
     5649        var parts = rurl.exec( s.url ),
     5650            remote = parts && (parts[1] && parts[1].toLowerCase() !== location.protocol || parts[2].toLowerCase() !== location.host);
     5651
     5652        // If we're requesting a remote document
     5653        // and trying to load JSON or Script with a GET
     5654        if ( s.dataType === "script" && type === "GET" && remote ) {
     5655            var head = document.getElementsByTagName("head")[0] || document.documentElement;
     5656            var script = document.createElement("script");
     5657            if ( s.scriptCharset ) {
     5658                script.charset = s.scriptCharset;
     5659            }
     5660            script.src = s.url;
     5661
     5662            // Handle Script loading
     5663            if ( !jsonp ) {
     5664                var done = false;
     5665
     5666                // Attach handlers for all browsers
     5667                script.onload = script.onreadystatechange = function() {
     5668                    if ( !done && (!this.readyState ||
     5669                            this.readyState === "loaded" || this.readyState === "complete") ) {
     5670                        done = true;
     5671                        jQuery.handleSuccess( s, xhr, status, data );
     5672                        jQuery.handleComplete( s, xhr, status, data );
     5673
     5674                        // Handle memory leak in IE
     5675                        script.onload = script.onreadystatechange = null;
     5676                        if ( head && script.parentNode ) {
     5677                            head.removeChild( script );
     5678                        }
     5679                    }
     5680                };
     5681            }
     5682
     5683            // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
     5684            // This arises when a base node is used (#2709 and #4378).
     5685            head.insertBefore( script, head.firstChild );
     5686
     5687            // We handle everything using the script element injection
     5688            return undefined;
     5689        }
     5690
     5691        var requestDone = false;
     5692
     5693        // Create the request object
     5694        var xhr = s.xhr();
     5695
     5696        if ( !xhr ) {
     5697            return;
     5698        }
     5699
     5700        // Open the socket
     5701        // Passing null username, generates a login popup on Opera (#2865)
     5702        if ( s.username ) {
     5703            xhr.open(type, s.url, s.async, s.username, s.password);
     5704        } else {
     5705            xhr.open(type, s.url, s.async);
     5706        }
     5707
     5708        // Need an extra try/catch for cross domain requests in Firefox 3
     5709        try {
     5710            // Set content-type if data specified and content-body is valid for this type
     5711            if ( (s.data != null && !noContent) || (origSettings && origSettings.contentType) ) {
     5712                xhr.setRequestHeader("Content-Type", s.contentType);
     5713            }
     5714
     5715            // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
     5716            if ( s.ifModified ) {
     5717                if ( jQuery.lastModified[s.url] ) {
     5718                    xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
     5719                }
     5720
     5721                if ( jQuery.etag[s.url] ) {
     5722                    xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
     5723                }
     5724            }
     5725
     5726            // Set header so the called script knows that it's an XMLHttpRequest
     5727            // Only send the header if it's not a remote XHR
     5728            if ( !remote ) {
     5729                xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
     5730            }
     5731
     5732            // Set the Accepts header for the server, depending on the dataType
     5733            xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
     5734                s.accepts[ s.dataType ] + ", */*; q=0.01" :
     5735                s.accepts._default );
     5736        } catch( headerError ) {}
     5737
     5738        // Allow custom headers/mimetypes and early abort
     5739        if ( s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false ) {
     5740            // Handle the global AJAX counter
     5741            if ( s.global && jQuery.active-- === 1 ) {
     5742                jQuery.event.trigger( "ajaxStop" );
     5743            }
     5744
     5745            // close opended socket
     5746            xhr.abort();
     5747            return false;
     5748        }
     5749
     5750        if ( s.global ) {
     5751            jQuery.triggerGlobal( s, "ajaxSend", [xhr, s] );
     5752        }
     5753
     5754        // Wait for a response to come back
     5755        var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
     5756            // The request was aborted
     5757            if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
     5758                // Opera doesn't call onreadystatechange before this point
     5759                // so we simulate the call
     5760                if ( !requestDone ) {
     5761                    jQuery.handleComplete( s, xhr, status, data );
     5762                }
     5763
     5764                requestDone = true;
     5765                if ( xhr ) {
     5766                    xhr.onreadystatechange = jQuery.noop;
     5767                }
     5768
     5769            // The transfer is complete and the data is available, or the request timed out
     5770            } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
     5771                requestDone = true;
     5772                xhr.onreadystatechange = jQuery.noop;
     5773
     5774                status = isTimeout === "timeout" ?
     5775                    "timeout" :
     5776                    !jQuery.httpSuccess( xhr ) ?
     5777                        "error" :
     5778                        s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
     5779                            "notmodified" :
     5780                            "success";
     5781
     5782                var errMsg;
     5783
     5784                if ( status === "success" ) {
     5785                    // Watch for, and catch, XML document parse errors
     5786                    try {
     5787                        // process the data (runs the xml through httpData regardless of callback)
     5788                        data = jQuery.httpData( xhr, s.dataType, s );
     5789                    } catch( parserError ) {
     5790                        status = "parsererror";
     5791                        errMsg = parserError;
     5792                    }
     5793                }
     5794
     5795                // Make sure that the request was successful or notmodified
     5796                if ( status === "success" || status === "notmodified" ) {
     5797                    // JSONP handles its own success callback
     5798                    if ( !jsonp ) {
     5799                        jQuery.handleSuccess( s, xhr, status, data );
     5800                    }
     5801                } else {
     5802                    jQuery.handleError( s, xhr, status, errMsg );
     5803                }
     5804
     5805                // Fire the complete handlers
     5806                if ( !jsonp ) {
     5807                    jQuery.handleComplete( s, xhr, status, data );
     5808                }
     5809
     5810                if ( isTimeout === "timeout" ) {
     5811                    xhr.abort();
     5812                }
     5813
     5814                // Stop memory leaks
     5815                if ( s.async ) {
     5816                    xhr = null;
     5817                }
     5818            }
     5819        };
     5820
     5821        // Override the abort handler, if we can (IE 6 doesn't allow it, but that's OK)
     5822        // Opera doesn't fire onreadystatechange at all on abort
     5823        try {
     5824            var oldAbort = xhr.abort;
     5825            xhr.abort = function() {
     5826                // xhr.abort in IE7 is not a native JS function
     5827                // and does not have a call property
     5828                if ( xhr && oldAbort.call ) {
     5829                    oldAbort.call( xhr );
     5830                }
     5831
     5832                onreadystatechange( "abort" );
     5833            };
     5834        } catch( abortError ) {}
     5835
     5836        // Timeout checker
     5837        if ( s.async && s.timeout > 0 ) {
     5838            setTimeout(function() {
     5839                // Check to see if the request is still happening
     5840                if ( xhr && !requestDone ) {
     5841                    onreadystatechange( "timeout" );
     5842                }
     5843            }, s.timeout);
     5844        }
     5845
     5846        // Send the data
     5847        try {
     5848            xhr.send( noContent || s.data == null ? null : s.data );
     5849
     5850        } catch( sendError ) {
     5851            jQuery.handleError( s, xhr, null, sendError );
     5852
     5853            // Fire the complete handlers
     5854            jQuery.handleComplete( s, xhr, status, data );
     5855        }
     5856
     5857        // firefox 1.5 doesn't fire statechange for sync requests
     5858        if ( !s.async ) {
     5859            onreadystatechange();
     5860        }
     5861
     5862        // return XMLHttpRequest to allow aborting the request etc.
     5863        return xhr;
     5864    },
     5865
     5866    // Serialize an array of form elements or a set of
     5867    // key/values into a query string
     5868    param: function( a, traditional ) {
     5869        var s = [], add = function( key, value ) {
     5870            // If value is a function, invoke it and return its value
     5871            value = jQuery.isFunction(value) ? value() : value;
     5872            s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
     5873        };
     5874       
     5875        // Set traditional to true for jQuery <= 1.3.2 behavior.
     5876        if ( traditional === undefined ) {
     5877            traditional = jQuery.ajaxSettings.traditional;
     5878        }
     5879       
     5880        // If an array was passed in, assume that it is an array of form elements.
     5881        if ( jQuery.isArray(a) || a.jquery ) {
     5882            // Serialize the form elements
     5883            jQuery.each( a, function() {
     5884                add( this.name, this.value );
     5885            });
     5886           
     5887        } else {
     5888            // If traditional, encode the "old" way (the way 1.3.2 or older
     5889            // did it), otherwise encode params recursively.
     5890            for ( var prefix in a ) {
     5891                buildParams( prefix, a[prefix], traditional, add );
     5892            }
     5893        }
     5894
     5895        // Return the resulting serialization
     5896        return s.join("&").replace(r20, "+");
     5897    }
     5898});
     5899
     5900function buildParams( prefix, obj, traditional, add ) {
     5901    if ( jQuery.isArray(obj) && obj.length ) {
     5902        // Serialize array item.
     5903        jQuery.each( obj, function( i, v ) {
     5904            if ( traditional || rbracket.test( prefix ) ) {
     5905                // Treat each array item as a scalar.
     5906                add( prefix, v );
     5907
     5908            } else {
     5909                // If array item is non-scalar (array or object), encode its
     5910                // numeric index to resolve deserialization ambiguity issues.
     5911                // Note that rack (as of 1.0.0) can't currently deserialize
     5912                // nested arrays properly, and attempting to do so may cause
     5913                // a server error. Possible fixes are to modify rack's
     5914                // deserialization algorithm or to provide an option or flag
     5915                // to force array serialization to be shallow.
     5916                buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
     5917            }
     5918        });
     5919           
     5920    } else if ( !traditional && obj != null && typeof obj === "object" ) {
     5921        if ( jQuery.isEmptyObject( obj ) ) {
     5922            add( prefix, "" );
     5923
     5924        // Serialize object item.
     5925        } else {
     5926            jQuery.each( obj, function( k, v ) {
     5927                buildParams( prefix + "[" + k + "]", v, traditional, add );
     5928            });
     5929        }
     5930                   
     5931    } else {
     5932        // Serialize scalar item.
     5933        add( prefix, obj );
     5934    }
     5935}
     5936
     5937// This is still on the jQuery object... for now
     5938// Want to move this to jQuery.ajax some day
     5939jQuery.extend({
     5940
     5941    // Counter for holding the number of active queries
     5942    active: 0,
     5943
     5944    // Last-Modified header cache for next request
     5945    lastModified: {},
     5946    etag: {},
     5947
     5948    handleError: function( s, xhr, status, e ) {
     5949        // If a local callback was specified, fire it
     5950        if ( s.error ) {
     5951            s.error.call( s.context, xhr, status, e );
     5952        }
     5953
     5954        // Fire the global callback
     5955        if ( s.global ) {
     5956            jQuery.triggerGlobal( s, "ajaxError", [xhr, s, e] );
     5957        }
     5958    },
     5959
     5960    handleSuccess: function( s, xhr, status, data ) {
     5961        // If a local callback was specified, fire it and pass it the data
     5962        if ( s.success ) {
     5963            s.success.call( s.context, data, status, xhr );
     5964        }
     5965
     5966        // Fire the global callback
     5967        if ( s.global ) {
     5968            jQuery.triggerGlobal( s, "ajaxSuccess", [xhr, s] );
     5969        }
     5970    },
     5971
     5972    handleComplete: function( s, xhr, status ) {
     5973        // Process result
     5974        if ( s.complete ) {
     5975            s.complete.call( s.context, xhr, status );
     5976        }
     5977
     5978        // The request was completed
     5979        if ( s.global ) {
     5980            jQuery.triggerGlobal( s, "ajaxComplete", [xhr, s] );
     5981        }
     5982
     5983        // Handle the global AJAX counter
     5984        if ( s.global && jQuery.active-- === 1 ) {
     5985            jQuery.event.trigger( "ajaxStop" );
     5986        }
     5987    },
     5988       
     5989    triggerGlobal: function( s, type, args ) {
     5990        (s.context && s.context.url == null ? jQuery(s.context) : jQuery.event).trigger(type, args);
     5991    },
     5992
     5993    // Determines if an XMLHttpRequest was successful or not
     5994    httpSuccess: function( xhr ) {
     5995        try {
     5996            // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
     5997            return !xhr.status && location.protocol === "file:" ||
     5998                xhr.status >= 200 && xhr.status < 300 ||
     5999                xhr.status === 304 || xhr.status === 1223;
     6000        } catch(e) {}
     6001
     6002        return false;
     6003    },
     6004
     6005    // Determines if an XMLHttpRequest returns NotModified
     6006    httpNotModified: function( xhr, url ) {
     6007        var lastModified = xhr.getResponseHeader("Last-Modified"),
     6008            etag = xhr.getResponseHeader("Etag");
     6009
     6010        if ( lastModified ) {
     6011            jQuery.lastModified[url] = lastModified;
     6012        }
     6013
     6014        if ( etag ) {
     6015            jQuery.etag[url] = etag;
     6016        }
     6017
     6018        return xhr.status === 304;
     6019    },
     6020
     6021    httpData: function( xhr, type, s ) {
     6022        var ct = xhr.getResponseHeader("content-type") || "",
     6023            xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
     6024            data = xml ? xhr.responseXML : xhr.responseText;
     6025
     6026        if ( xml && data.documentElement.nodeName === "parsererror" ) {
     6027            jQuery.error( "parsererror" );
     6028        }
     6029
     6030        // Allow a pre-filtering function to sanitize the response
     6031        // s is checked to keep backwards compatibility
     6032        if ( s && s.dataFilter ) {
     6033            data = s.dataFilter( data, type );
     6034        }
     6035
     6036        // The filter can actually parse the response
     6037        if ( typeof data === "string" ) {
     6038            // Get the JavaScript object, if JSON is used.
     6039            if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
     6040                data = jQuery.parseJSON( data );
     6041
     6042            // If the type is "script", eval it in global context
     6043            } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
     6044                jQuery.globalEval( data );
     6045            }
     6046        }
     6047
     6048        return data;
     6049    }
     6050
     6051});
     6052
     6053/*
     6054 * Create the request object; Microsoft failed to properly
     6055 * implement the XMLHttpRequest in IE7 (can't request local files),
     6056 * so we use the ActiveXObject when it is available
     6057 * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
     6058 * we need a fallback.
     6059 */
     6060if ( window.ActiveXObject ) {
     6061    jQuery.ajaxSettings.xhr = function() {
     6062        if ( window.location.protocol !== "file:" ) {
     6063            try {
     6064                return new window.XMLHttpRequest();
     6065            } catch(xhrError) {}
     6066        }
     6067
     6068        try {
     6069            return new window.ActiveXObject("Microsoft.XMLHTTP");
     6070        } catch(activeError) {}
     6071    };
     6072}
     6073
     6074// Does this browser support XHR requests?
     6075jQuery.support.ajax = !!jQuery.ajaxSettings.xhr();
     6076
     6077
     6078
     6079
     6080var elemdisplay = {},
     6081    rfxtypes = /^(?:toggle|show|hide)$/,
     6082    rfxnum = /^([+\-]=)?([\d+.\-]+)(.*)$/,
     6083    timerId,
     6084    fxAttrs = [
     6085        // height animations
     6086        [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
     6087        // width animations
     6088        [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
     6089        // opacity animations
     6090        [ "opacity" ]
     6091    ];
     6092
     6093jQuery.fn.extend({
     6094    show: function( speed, easing, callback ) {
     6095        var elem, display;
     6096
     6097        if ( speed || speed === 0 ) {
     6098            return this.animate( genFx("show", 3), speed, easing, callback);
     6099
     6100        } else {
     6101            for ( var i = 0, j = this.length; i < j; i++ ) {
     6102                elem = this[i];
     6103                display = elem.style.display;
     6104
     6105                // Reset the inline display of this element to learn if it is
     6106                // being hidden by cascaded rules or not
     6107                if ( !jQuery.data(elem, "olddisplay") && display === "none" ) {
     6108                    elem.style.display = "";
     6109                }
     6110
     6111                // Set elements which have been overridden with display: none
     6112                // in a stylesheet to whatever the default browser style is
     6113                // for such an element
     6114                if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
     6115                    jQuery.data(elem, "olddisplay", defaultDisplay(elem.nodeName));
     6116                }
     6117            }
     6118
     6119            // Set the display of most of the elements in a second loop
     6120            // to avoid the constant reflow
     6121            for ( i = 0; i < j; i++ ) {
     6122                elem = this[i];
     6123                display = elem.style.display;
     6124
     6125                if ( display === "" || display === "none" ) {
     6126                    elem.style.display = jQuery.data(elem, "olddisplay") || "";
     6127                }
     6128            }
     6129
     6130            return this;
     6131        }
     6132    },
     6133
     6134    hide: function( speed, easing, callback ) {
     6135        if ( speed || speed === 0 ) {
     6136            return this.animate( genFx("hide", 3), speed, easing, callback);
     6137
     6138        } else {
     6139            for ( var i = 0, j = this.length; i < j; i++ ) {
     6140                var display = jQuery.css( this[i], "display" );
     6141
     6142                if ( display !== "none" ) {
     6143                    jQuery.data( this[i], "olddisplay", display );
     6144                }
     6145            }
     6146
     6147            // Set the display of the elements in a second loop
     6148            // to avoid the constant reflow
     6149            for ( i = 0; i < j; i++ ) {
     6150                this[i].style.display = "none";
     6151            }
     6152
     6153            return this;
     6154        }
     6155    },
     6156
     6157    // Save the old toggle function
     6158    _toggle: jQuery.fn.toggle,
     6159
     6160    toggle: function( fn, fn2, callback ) {
     6161        var bool = typeof fn === "boolean";
     6162
     6163        if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
     6164            this._toggle.apply( this, arguments );
     6165
     6166        } else if ( fn == null || bool ) {
     6167            this.each(function() {
     6168                var state = bool ? fn : jQuery(this).is(":hidden");
     6169                jQuery(this)[ state ? "show" : "hide" ]();
     6170            });
     6171
     6172        } else {
     6173            this.animate(genFx("toggle", 3), fn, fn2, callback);
     6174        }
     6175
     6176        return this;
     6177    },
     6178
     6179    fadeTo: function( speed, to, easing, callback ) {
     6180        return this.filter(":hidden").css("opacity", 0).show().end()
     6181                    .animate({opacity: to}, speed, easing, callback);
     6182    },
     6183
     6184    animate: function( prop, speed, easing, callback ) {
     6185        var optall = jQuery.speed(speed, easing, callback);
     6186
     6187        if ( jQuery.isEmptyObject( prop ) ) {
     6188            return this.each( optall.complete );
     6189        }
     6190
     6191        return this[ optall.queue === false ? "each" : "queue" ](function() {
     6192            // XXX ‘this’ does not always have a nodeName when running the
     6193            // test suite
     6194
     6195            var opt = jQuery.extend({}, optall), p,
     6196                isElement = this.nodeType === 1,
     6197                hidden = isElement && jQuery(this).is(":hidden"),
     6198                self = this;
     6199
     6200            for ( p in prop ) {
     6201                var name = jQuery.camelCase( p );
     6202
     6203                if ( p !== name ) {
     6204                    prop[ name ] = prop[ p ];
     6205                    delete prop[ p ];
     6206                    p = name;
     6207                }
     6208
     6209                if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
     6210                    return opt.complete.call(this);
     6211                }
     6212
     6213                if ( isElement && ( p === "height" || p === "width" ) ) {
     6214                    // Make sure that nothing sneaks out
     6215                    // Record all 3 overflow attributes because IE does not
     6216                    // change the overflow attribute when overflowX and
     6217                    // overflowY are set to the same value
     6218                    opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
     6219
     6220                    // Set display property to inline-block for height/width
     6221                    // animations on inline elements that are having width/height
     6222                    // animated
     6223                    if ( jQuery.css( this, "display" ) === "inline" &&
     6224                            jQuery.css( this, "float" ) === "none" ) {
     6225                        if ( !jQuery.support.inlineBlockNeedsLayout ) {
     6226                            this.style.display = "inline-block";
     6227
     6228                        } else {
     6229                            var display = defaultDisplay(this.nodeName);
     6230
     6231                            // inline-level elements accept inline-block;
     6232                            // block-level elements need to be inline with layout
     6233                            if ( display === "inline" ) {
     6234                                this.style.display = "inline-block";
     6235
     6236                            } else {
     6237                                this.style.display = "inline";
     6238                                this.style.zoom = 1;
     6239                            }
     6240                        }
     6241                    }
     6242                }
     6243
     6244                if ( jQuery.isArray( prop[p] ) ) {
     6245                    // Create (if needed) and add to specialEasing
     6246                    (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
     6247                    prop[p] = prop[p][0];
     6248                }
     6249            }
     6250
     6251            if ( opt.overflow != null ) {
     6252                this.style.overflow = "hidden";
     6253            }
     6254
     6255            opt.curAnim = jQuery.extend({}, prop);
     6256
     6257            jQuery.each( prop, function( name, val ) {
     6258                var e = new jQuery.fx( self, opt, name );
     6259
     6260                if ( rfxtypes.test(val) ) {
     6261                    e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
     6262
     6263                } else {
     6264                    var parts = rfxnum.exec(val),
     6265                        start = e.cur() || 0;
     6266
     6267                    if ( parts ) {
     6268                        var end = parseFloat( parts[2] ),
     6269                            unit = parts[3] || "px";
     6270
     6271                        // We need to compute starting value
     6272                        if ( unit !== "px" ) {
     6273                            jQuery.style( self, name, (end || 1) + unit);
     6274                            start = ((end || 1) / e.cur()) * start;
     6275                            jQuery.style( self, name, start + unit);
     6276                        }
     6277
     6278                        // If a +=/-= token was provided, we're doing a relative animation
     6279                        if ( parts[1] ) {
     6280                            end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
     6281                        }
     6282
     6283                        e.custom( start, end, unit );
     6284
     6285                    } else {
     6286                        e.custom( start, val, "" );
     6287                    }
     6288                }
     6289            });
     6290
     6291            // For JS strict compliance
     6292            return true;
     6293        });
     6294    },
     6295
     6296    stop: function( clearQueue, gotoEnd ) {
     6297        var timers = jQuery.timers;
     6298
     6299        if ( clearQueue ) {
     6300            this.queue([]);
     6301        }
     6302
     6303        this.each(function() {
     6304            // go in reverse order so anything added to the queue during the loop is ignored
     6305            for ( var i = timers.length - 1; i >= 0; i-- ) {
     6306                if ( timers[i].elem === this ) {
     6307                    if (gotoEnd) {
     6308                        // force the next step to be the last
     6309                        timers[i](true);
     6310                    }
     6311
     6312                    timers.splice(i, 1);
     6313                }
     6314            }
     6315        });
     6316
     6317        // start the next in the queue if the last step wasn't forced
     6318        if ( !gotoEnd ) {
     6319            this.dequeue();
     6320        }
     6321
     6322        return this;
     6323    }
     6324
     6325});
     6326
     6327function genFx( type, num ) {
     6328    var obj = {};
     6329
     6330    jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
     6331        obj[ this ] = type;
     6332    });
     6333
     6334    return obj;
     6335}
     6336
     6337// Generate shortcuts for custom animations
     6338jQuery.each({
     6339    slideDown: genFx("show", 1),
     6340    slideUp: genFx("hide", 1),
     6341    slideToggle: genFx("toggle", 1),
     6342    fadeIn: { opacity: "show" },
     6343    fadeOut: { opacity: "hide" },
     6344    fadeToggle: { opacity: "toggle" }
     6345}, function( name, props ) {
     6346    jQuery.fn[ name ] = function( speed, easing, callback ) {
     6347        return this.animate( props, speed, easing, callback );
     6348    };
     6349});
     6350
     6351jQuery.extend({
     6352    speed: function( speed, easing, fn ) {
     6353        var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
     6354            complete: fn || !fn && easing ||
     6355                jQuery.isFunction( speed ) && speed,
     6356            duration: speed,
     6357            easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
     6358        };
     6359
     6360        opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
     6361            opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
     6362
     6363        // Queueing
     6364        opt.old = opt.complete;
     6365        opt.complete = function() {
     6366            if ( opt.queue !== false ) {
     6367                jQuery(this).dequeue();
     6368            }
     6369            if ( jQuery.isFunction( opt.old ) ) {
     6370                opt.old.call( this );
     6371            }
     6372        };
     6373
     6374        return opt;
     6375    },
     6376
     6377    easing: {
     6378        linear: function( p, n, firstNum, diff ) {
     6379            return firstNum + diff * p;
     6380        },
     6381        swing: function( p, n, firstNum, diff ) {
     6382            return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
     6383        }
     6384    },
     6385
     6386    timers: [],
     6387
     6388    fx: function( elem, options, prop ) {
     6389        this.options = options;
     6390        this.elem = elem;
     6391        this.prop = prop;
     6392
     6393        if ( !options.orig ) {
     6394            options.orig = {};
     6395        }
     6396    }
     6397
     6398});
     6399
     6400jQuery.fx.prototype = {
     6401    // Simple function for setting a style value
     6402    update: function() {
     6403        if ( this.options.step ) {
     6404            this.options.step.call( this.elem, this.now, this );
     6405        }
     6406
     6407        (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
     6408    },
     6409
     6410    // Get the current size
     6411    cur: function() {
     6412        if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
     6413            return this.elem[ this.prop ];
     6414        }
     6415
     6416        var r = parseFloat( jQuery.css( this.elem, this.prop ) );
     6417        return r && r > -10000 ? r : 0;
     6418    },
     6419
     6420    // Start an animation from one number to another
     6421    custom: function( from, to, unit ) {
     6422        this.startTime = jQuery.now();
     6423        this.start = from;
     6424        this.end = to;
     6425        this.unit = unit || this.unit || "px";
     6426        this.now = this.start;
     6427        this.pos = this.state = 0;
     6428
     6429        var self = this, fx = jQuery.fx;
     6430        function t( gotoEnd ) {
     6431            return self.step(gotoEnd);
     6432        }
     6433
     6434        t.elem = this.elem;
     6435
     6436        if ( t() && jQuery.timers.push(t) && !timerId ) {
     6437            timerId = setInterval(fx.tick, fx.interval);
     6438        }
     6439    },
     6440
     6441    // Simple 'show' function
     6442    show: function() {
     6443        // Remember where we started, so that we can go back to it later
     6444        this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
     6445        this.options.show = true;
     6446
     6447        // Begin the animation
     6448        // Make sure that we start at a small width/height to avoid any
     6449        // flash of content
     6450        this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
     6451
     6452        // Start by showing the element
     6453        jQuery( this.elem ).show();
     6454    },
     6455
     6456    // Simple 'hide' function
     6457    hide: function() {
     6458        // Remember where we started, so that we can go back to it later
     6459        this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
     6460        this.options.hide = true;
     6461
     6462        // Begin the animation
     6463        this.custom(this.cur(), 0);
     6464    },
     6465
     6466    // Each step of an animation
     6467    step: function( gotoEnd ) {
     6468        var t = jQuery.now(), done = true;
     6469
     6470        if ( gotoEnd || t >= this.options.duration + this.startTime ) {
     6471            this.now = this.end;
     6472            this.pos = this.state = 1;
     6473            this.update();
     6474
     6475            this.options.curAnim[ this.prop ] = true;
     6476
     6477            for ( var i in this.options.curAnim ) {
     6478                if ( this.options.curAnim[i] !== true ) {
     6479                    done = false;
     6480                }
     6481            }
     6482
     6483            if ( done ) {
     6484                // Reset the overflow
     6485                if ( this.options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
     6486                    var elem = this.elem, options = this.options;
     6487                    jQuery.each( [ "", "X", "Y" ], function (index, value) {
     6488                        elem.style[ "overflow" + value ] = options.overflow[index];
     6489                    } );
     6490                }
     6491
     6492                // Hide the element if the "hide" operation was done
     6493                if ( this.options.hide ) {
     6494                    jQuery(this.elem).hide();
     6495                }
     6496
     6497                // Reset the properties, if the item has been hidden or shown
     6498                if ( this.options.hide || this.options.show ) {
     6499                    for ( var p in this.options.curAnim ) {
     6500                        jQuery.style( this.elem, p, this.options.orig[p] );
     6501                    }
     6502                }
     6503
     6504                // Execute the complete function
     6505                this.options.complete.call( this.elem );
     6506            }
     6507
     6508            return false;
     6509
     6510        } else {
     6511            var n = t - this.startTime;
     6512            this.state = n / this.options.duration;
     6513
     6514            // Perform the easing function, defaults to swing
     6515            var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
     6516            var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
     6517            this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
     6518            this.now = this.start + ((this.end - this.start) * this.pos);
     6519
     6520            // Perform the next step of the animation
     6521            this.update();
     6522        }
     6523
     6524        return true;
     6525    }
     6526};
     6527
     6528jQuery.extend( jQuery.fx, {
     6529    tick: function() {
     6530        var timers = jQuery.timers;
     6531
     6532        for ( var i = 0; i < timers.length; i++ ) {
     6533            if ( !timers[i]() ) {
     6534                timers.splice(i--, 1);
     6535            }
     6536        }
     6537
     6538        if ( !timers.length ) {
     6539            jQuery.fx.stop();
     6540        }
     6541    },
     6542
     6543    interval: 13,
     6544
     6545    stop: function() {
     6546        clearInterval( timerId );
     6547        timerId = null;
     6548    },
     6549
     6550    speeds: {
     6551        slow: 600,
     6552        fast: 200,
     6553        // Default speed
     6554        _default: 400
     6555    },
     6556
     6557    step: {
     6558        opacity: function( fx ) {
     6559            jQuery.style( fx.elem, "opacity", fx.now );
     6560        },
     6561
     6562        _default: function( fx ) {
     6563            if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
     6564                fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
     6565            } else {
     6566                fx.elem[ fx.prop ] = fx.now;
     6567            }
     6568        }
     6569    }
     6570});
     6571
     6572if ( jQuery.expr && jQuery.expr.filters ) {
     6573    jQuery.expr.filters.animated = function( elem ) {
     6574        return jQuery.grep(jQuery.timers, function( fn ) {
     6575            return elem === fn.elem;
     6576        }).length;
     6577    };
     6578}
     6579
     6580function defaultDisplay( nodeName ) {
     6581    if ( !elemdisplay[ nodeName ] ) {
     6582        var elem = jQuery("<" + nodeName + ">").appendTo("body"),
     6583            display = elem.css("display");
     6584
     6585        elem.remove();
     6586
     6587        if ( display === "none" || display === "" ) {
     6588            display = "block";
     6589        }
     6590
     6591        elemdisplay[ nodeName ] = display;
     6592    }
     6593
     6594    return elemdisplay[ nodeName ];
     6595}
     6596
     6597
     6598
     6599
     6600var rtable = /^t(?:able|d|h)$/i,
     6601    rroot = /^(?:body|html)$/i;
     6602
     6603if ( "getBoundingClientRect" in document.documentElement ) {
     6604    jQuery.fn.offset = function( options ) {
     6605        var elem = this[0], box;
     6606
     6607        if ( options ) {
     6608            return this.each(function( i ) {
     6609                jQuery.offset.setOffset( this, options, i );
     6610            });
     6611        }
     6612
     6613        if ( !elem || !elem.ownerDocument ) {
     6614            return null;
     6615        }
     6616
     6617        if ( elem === elem.ownerDocument.body ) {
     6618            return jQuery.offset.bodyOffset( elem );
     6619        }
     6620
     6621        try {
     6622            box = elem.getBoundingClientRect();
     6623        } catch(e) {}
     6624
     6625        var doc = elem.ownerDocument,
     6626            docElem = doc.documentElement;
     6627
     6628        // Make sure we're not dealing with a disconnected DOM node
     6629        if ( !box || !jQuery.contains( docElem, elem ) ) {
     6630            return box || { top: 0, left: 0 };
     6631        }
     6632
     6633        var body = doc.body,
     6634            win = getWindow(doc),
     6635            clientTop  = docElem.clientTop  || body.clientTop  || 0,
     6636            clientLeft = docElem.clientLeft || body.clientLeft || 0,
     6637            scrollTop  = (win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop ),
     6638            scrollLeft = (win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft),
     6639            top  = box.top  + scrollTop  - clientTop,
     6640            left = box.left + scrollLeft - clientLeft;
     6641
     6642        return { top: top, left: left };
     6643    };
     6644
     6645} else {
     6646    jQuery.fn.offset = function( options ) {
     6647        var elem = this[0];
     6648
     6649        if ( options ) {
     6650            return this.each(function( i ) {
     6651                jQuery.offset.setOffset( this, options, i );
     6652            });
     6653        }
     6654
     6655        if ( !elem || !elem.ownerDocument ) {
     6656            return null;
     6657        }
     6658
     6659        if ( elem === elem.ownerDocument.body ) {
     6660            return jQuery.offset.bodyOffset( elem );
     6661        }
     6662
     6663        jQuery.offset.initialize();
     6664
     6665        var offsetParent = elem.offsetParent, prevOffsetParent = elem,
     6666            doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
     6667            body = doc.body, defaultView = doc.defaultView,
     6668            prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
     6669            top = elem.offsetTop, left = elem.offsetLeft;
     6670
     6671        while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
     6672            if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
     6673                break;
     6674            }
     6675
     6676            computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
     6677            top  -= elem.scrollTop;
     6678            left -= elem.scrollLeft;
     6679
     6680            if ( elem === offsetParent ) {
     6681                top  += elem.offsetTop;
     6682                left += elem.offsetLeft;
     6683
     6684                if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
     6685                    top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
     6686                    left += parseFloat( computedStyle.borderLeftWidth ) || 0;
     6687                }
     6688
     6689                prevOffsetParent = offsetParent;
     6690                offsetParent = elem.offsetParent;
     6691            }
     6692
     6693            if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
     6694                top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
     6695                left += parseFloat( computedStyle.borderLeftWidth ) || 0;
     6696            }
     6697
     6698            prevComputedStyle = computedStyle;
     6699        }
     6700
     6701        if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
     6702            top  += body.offsetTop;
     6703            left += body.offsetLeft;
     6704        }
     6705
     6706        if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
     6707            top  += Math.max( docElem.scrollTop, body.scrollTop );
     6708            left += Math.max( docElem.scrollLeft, body.scrollLeft );
     6709        }
     6710
     6711        return { top: top, left: left };
     6712    };
     6713}
     6714
     6715jQuery.offset = {
     6716    initialize: function() {
     6717        var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
     6718            html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
     6719
     6720        jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
     6721
     6722        container.innerHTML = html;
     6723        body.insertBefore( container, body.firstChild );
     6724        innerDiv = container.firstChild;
     6725        checkDiv = innerDiv.firstChild;
     6726        td = innerDiv.nextSibling.firstChild.firstChild;
     6727
     6728        this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
     6729        this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
     6730
     6731        checkDiv.style.position = "fixed";
     6732        checkDiv.style.top = "20px";
     6733
     6734        // safari subtracts parent border width here which is 5px
     6735        this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
     6736        checkDiv.style.position = checkDiv.style.top = "";
     6737
     6738        innerDiv.style.overflow = "hidden";
     6739        innerDiv.style.position = "relative";
     6740
     6741        this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
     6742
     6743        this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
     6744
     6745        body.removeChild( container );
     6746        body = container = innerDiv = checkDiv = table = td = null;
     6747        jQuery.offset.initialize = jQuery.noop;
     6748    },
     6749
     6750    bodyOffset: function( body ) {
     6751        var top = body.offsetTop, left = body.offsetLeft;
     6752
     6753        jQuery.offset.initialize();
     6754
     6755        if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
     6756            top  += parseFloat( jQuery.css(body, "marginTop") ) || 0;
     6757            left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
     6758        }
     6759
     6760        return { top: top, left: left };
     6761    },
     6762   
     6763    setOffset: function( elem, options, i ) {
     6764        var position = jQuery.css( elem, "position" );
     6765
     6766        // set position first, in-case top/left are set even on static elem
     6767        if ( position === "static" ) {
     6768            elem.style.position = "relative";
     6769        }
     6770
     6771        var curElem = jQuery( elem ),
     6772            curOffset = curElem.offset(),
     6773            curCSSTop = jQuery.css( elem, "top" ),
     6774            curCSSLeft = jQuery.css( elem, "left" ),
     6775            calculatePosition = (position === "absolute" && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1),
     6776            props = {}, curPosition = {}, curTop, curLeft;
     6777
     6778        // need to be able to calculate position if either top or left is auto and position is absolute
     6779        if ( calculatePosition ) {
     6780            curPosition = curElem.position();
     6781        }
     6782
     6783        curTop  = calculatePosition ? curPosition.top  : parseInt( curCSSTop,  10 ) || 0;
     6784        curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0;
     6785
     6786        if ( jQuery.isFunction( options ) ) {
     6787            options = options.call( elem, i, curOffset );
     6788        }
     6789
     6790        if (options.top != null) {
     6791            props.top = (options.top - curOffset.top) + curTop;
     6792        }
     6793        if (options.left != null) {
     6794            props.left = (options.left - curOffset.left) + curLeft;
     6795        }
     6796       
     6797        if ( "using" in options ) {
     6798            options.using.call( elem, props );
     6799        } else {
     6800            curElem.css( props );
     6801        }
     6802    }
     6803};
     6804
     6805
     6806jQuery.fn.extend({
     6807    position: function() {
     6808        if ( !this[0] ) {
     6809            return null;
     6810        }
     6811
     6812        var elem = this[0],
     6813
     6814        // Get *real* offsetParent
     6815        offsetParent = this.offsetParent(),
     6816
     6817        // Get correct offsets
     6818        offset       = this.offset(),
     6819        parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
     6820
     6821        // Subtract element margins
     6822        // note: when an element has margin: auto the offsetLeft and marginLeft
     6823        // are the same in Safari causing offset.left to incorrectly be 0
     6824        offset.top  -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
     6825        offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
     6826
     6827        // Add offsetParent borders
     6828        parentOffset.top  += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
     6829        parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
     6830
     6831        // Subtract the two offsets
     6832        return {
     6833            top:  offset.top  - parentOffset.top,
     6834            left: offset.left - parentOffset.left
     6835        };
     6836    },
     6837
     6838    offsetParent: function() {
     6839        return this.map(function() {
     6840            var offsetParent = this.offsetParent || document.body;
     6841            while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
     6842                offsetParent = offsetParent.offsetParent;
     6843            }
     6844            return offsetParent;
     6845        });
     6846    }
     6847});
     6848
     6849
     6850// Create scrollLeft and scrollTop methods
     6851jQuery.each( ["Left", "Top"], function( i, name ) {
     6852    var method = "scroll" + name;
     6853
     6854    jQuery.fn[ method ] = function(val) {
     6855        var elem = this[0], win;
     6856       
     6857        if ( !elem ) {
     6858            return null;
     6859        }
     6860
     6861        if ( val !== undefined ) {
     6862            // Set the scroll offset
     6863            return this.each(function() {
     6864                win = getWindow( this );
     6865
     6866                if ( win ) {
     6867                    win.scrollTo(
     6868                        !i ? val : jQuery(win).scrollLeft(),
     6869                         i ? val : jQuery(win).scrollTop()
     6870                    );
     6871
     6872                } else {
     6873                    this[ method ] = val;
     6874                }
     6875            });
     6876        } else {
     6877            win = getWindow( elem );
     6878
     6879            // Return the scroll offset
     6880            return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
     6881                jQuery.support.boxModel && win.document.documentElement[ method ] ||
     6882                    win.document.body[ method ] :
     6883                elem[ method ];
     6884        }
     6885    };
     6886});
     6887
     6888function getWindow( elem ) {
     6889    return jQuery.isWindow( elem ) ?
     6890        elem :
     6891        elem.nodeType === 9 ?
     6892            elem.defaultView || elem.parentWindow :
     6893            false;
     6894}
     6895
     6896
     6897
     6898
     6899// Create innerHeight, innerWidth, outerHeight and outerWidth methods
     6900jQuery.each([ "Height", "Width" ], function( i, name ) {
     6901
     6902    var type = name.toLowerCase();
     6903
     6904    // innerHeight and innerWidth
     6905    jQuery.fn["inner" + name] = function() {
     6906        return this[0] ?
     6907            parseFloat( jQuery.css( this[0], type, "padding" ) ) :
     6908            null;
     6909    };
     6910
     6911    // outerHeight and outerWidth
     6912    jQuery.fn["outer" + name] = function( margin ) {
     6913        return this[0] ?
     6914            parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) :
     6915            null;
     6916    };
     6917
     6918    jQuery.fn[ type ] = function( size ) {
     6919        // Get window width or height
     6920        var elem = this[0];
     6921        if ( !elem ) {
     6922            return size == null ? null : this;
     6923        }
     6924       
     6925        if ( jQuery.isFunction( size ) ) {
     6926            return this.each(function( i ) {
     6927                var self = jQuery( this );
     6928                self[ type ]( size.call( this, i, self[ type ]() ) );
     6929            });
     6930        }
     6931
     6932        if ( jQuery.isWindow( elem ) ) {
     6933            // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
     6934            return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
     6935                elem.document.body[ "client" + name ];
     6936
     6937        // Get document width or height
     6938        } else if ( elem.nodeType === 9 ) {
     6939            // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
     6940            return Math.max(
     6941                elem.documentElement["client" + name],
     6942                elem.body["scroll" + name], elem.documentElement["scroll" + name],
     6943                elem.body["offset" + name], elem.documentElement["offset" + name]
     6944            );
     6945
     6946        // Get or set width or height on the element
     6947        } else if ( size === undefined ) {
     6948            var orig = jQuery.css( elem, type ), ret = parseFloat( orig );
     6949            return jQuery.isNaN( ret ) ? orig : ret;
     6950
     6951        // Set the width or height on the element (default to pixels if value is unitless)
     6952        } else {
     6953            return this.css( type, typeof size === "string" ? size : size + "px" );
     6954        }
     6955    };
     6956
     6957});
     6958
     6959
     6960})(window);
     6961jQuery.noConflict();
Note: See TracChangeset for help on using the changeset viewer.