summaryrefslogtreecommitdiffstats
path: root/pelican-themes/gum/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'pelican-themes/gum/static/js')
-rw-r--r--pelican-themes/gum/static/js/libs/gumby.init.js27
-rw-r--r--pelican-themes/gum/static/js/libs/gumby.js145
-rw-r--r--pelican-themes/gum/static/js/libs/gumby.min.js1
-rw-r--r--pelican-themes/gum/static/js/libs/jquery-1.9.1.min.js5
-rw-r--r--pelican-themes/gum/static/js/libs/jquery.mobile.custom.min.js3
-rw-r--r--pelican-themes/gum/static/js/libs/modernizr-2.6.2.min.js4
-rw-r--r--pelican-themes/gum/static/js/libs/ui/gumby.navbar.js69
-rw-r--r--pelican-themes/gum/static/js/plugins.js8
8 files changed, 262 insertions, 0 deletions
diff --git a/pelican-themes/gum/static/js/libs/gumby.init.js b/pelican-themes/gum/static/js/libs/gumby.init.js
new file mode 100644
index 0000000..e14f7e2
--- /dev/null
+++ b/pelican-themes/gum/static/js/libs/gumby.init.js
@@ -0,0 +1,27 @@
+/**
+* Gumby Init
+*/
+
+// test for touch event support
+Modernizr.load({
+ test: Modernizr.touch,
+
+ // if present load custom jQuery mobile build and update Gumby.click
+ yep: 'js/libs/jquery.mobile.custom.min.js',
+ callback: function(url, result, key) {
+ // check jQuery mobile has successfully loaded before using tap events
+ if($.mobile) {
+ window.Gumby.click = 'tap';
+ }
+ },
+
+ // either way initialize Gumby
+ complete: function() {
+ window.Gumby.init();
+
+ // if AMD return Gumby object to define
+ if(typeof define == "function" && define.amd) {
+ define(window.Gumby);
+ }
+ }
+});
diff --git a/pelican-themes/gum/static/js/libs/gumby.js b/pelican-themes/gum/static/js/libs/gumby.js
new file mode 100644
index 0000000..49b08ac
--- /dev/null
+++ b/pelican-themes/gum/static/js/libs/gumby.js
@@ -0,0 +1,145 @@
+/**
+* Gumby Framework
+* ---------------
+*
+* Follow @gumbycss on twitter and spread the love.
+* We worked super hard on making this awesome and released it to the web.
+* All we ask is you leave this intact. #gumbyisawesome
+*
+* Gumby Framework
+* http://gumbyframework.com
+*
+* Built with love by your friends @digitalsurgeons
+* http://www.digitalsurgeons.com
+*
+* Free to use under the MIT license.
+* http://www.opensource.org/licenses/mit-license.php
+*/
+!function() {
+
+ 'use strict';
+
+ function Gumby() {
+ this.$dom = $(document);
+ this.isOldie = !!this.$dom.find('html').hasClass('oldie');
+ this.click = 'click';
+ this.onReady = this.onOldie = this.onTouch = false;
+ this.uiModules = {};
+ this.inits = {};
+ }
+
+ // initialize Gumby
+ Gumby.prototype.init = function() {
+ // init UI modules
+ this.initUIModules();
+
+ var scope = this;
+
+ // call ready() code when dom is ready
+ this.$dom.ready(function() {
+ if(scope.onReady) {
+ scope.onReady();
+ }
+
+ // call oldie() callback if applicable
+ if(scope.isOldie && scope.onOldie) {
+ scope.onOldie();
+ }
+
+ // call touch() callback if applicable
+ if(Modernizr.touch && scope.onTouch) {
+ scope.onTouch();
+ }
+ });
+ };
+
+ // public helper - set Gumby ready callback
+ Gumby.prototype.ready = function(code) {
+ if(code && typeof code === 'function') {
+ this.onReady = code;
+ }
+ };
+
+ // public helper - set oldie callback
+ Gumby.prototype.oldie = function(code) {
+ if(code && typeof code === 'function') {
+ this.onOldie = code;
+ }
+ };
+
+ // public helper - set touch callback
+ Gumby.prototype.touch = function(code) {
+ if(code && typeof code === 'function') {
+ this.onTouch = code;
+ }
+ };
+
+ // public helper - return debuggin object including uiModules object
+ Gumby.prototype.debug = function() {
+ return {
+ $dom: this.$dom,
+ isOldie: this.isOldie,
+ uiModules: this.uiModules,
+ click: this.click
+ };
+ };
+
+
+ // grab attribute value, testing data- gumby- and no prefix
+ Gumby.prototype.selectAttr = function() {
+ var i = 0;
+
+ // any number of attributes can be passed
+ for(; i < arguments.length; i++) {
+ // various formats
+ var attr = arguments[i],
+ dataAttr = 'data-'+arguments[i],
+ gumbyAttr = 'gumby-'+arguments[i];
+
+ // first test for data-attr
+ if(this.attr(dataAttr)) {
+ return this.attr(dataAttr);
+
+ // next test for gumby-attr
+ } else if(this.attr(gumbyAttr)) {
+ return this.attr(gumbyAttr);
+
+ // finally no prefix
+ } else if(this.attr(attr)) {
+ return this.attr(attr);
+ }
+ }
+
+ // none found
+ return false;
+ };
+
+ // add an initialisation method
+ Gumby.prototype.addInitalisation = function(ref, code) {
+ this.inits[ref] = code;
+ };
+
+ // initialize a uiModule
+ Gumby.prototype.initialize = function(ref) {
+ if(this.inits[ref] && typeof this.inits[ref] === 'function') {
+ this.inits[ref]();
+ }
+ };
+
+ // store a UI module
+ Gumby.prototype.UIModule = function(data) {
+ var module = data.module;
+ this.uiModules[module] = data;
+ };
+
+ // loop round and init all UI modules
+ Gumby.prototype.initUIModules = function() {
+ var x;
+ for(x in this.uiModules) {
+ this.uiModules[x].init();
+ }
+ };
+
+ window.Gumby = new Gumby();
+
+}();
diff --git a/pelican-themes/gum/static/js/libs/gumby.min.js b/pelican-themes/gum/static/js/libs/gumby.min.js
new file mode 100644
index 0000000..da25e72
--- /dev/null
+++ b/pelican-themes/gum/static/js/libs/gumby.min.js
@@ -0,0 +1 @@
+!function(){"use strict";function Gumby(){this.$dom=$(document);this.isOldie=!!this.$dom.find("html").hasClass("oldie");this.click="click";this.onReady=this.onOldie=this.onTouch=false;this.uiModules={};this.inits={}}Gumby.prototype.init=function(){this.initUIModules();var scope=this;this.$dom.ready(function(){if(scope.onReady){scope.onReady()}if(scope.isOldie&&scope.onOldie){scope.onOldie()}if(Modernizr.touch&&scope.onTouch){scope.onTouch()}})};Gumby.prototype.ready=function(code){if(code&&typeof code==="function"){this.onReady=code}};Gumby.prototype.oldie=function(code){if(code&&typeof code==="function"){this.onOldie=code}};Gumby.prototype.touch=function(code){if(code&&typeof code==="function"){this.onTouch=code}};Gumby.prototype.debug=function(){return{$dom:this.$dom,isOldie:this.isOldie,uiModules:this.uiModules,click:this.click}};Gumby.prototype.selectAttr=function(){var i=0;for(;i<arguments.length;i++){var attr=arguments[i],dataAttr="data-"+arguments[i],gumbyAttr="gumby-"+arguments[i];if(this.attr(dataAttr)){return this.attr(dataAttr)}else if(this.attr(gumbyAttr)){return this.attr(gumbyAttr)}else if(this.attr(attr)){return this.attr(attr)}}return false};Gumby.prototype.addInitalisation=function(ref,code){this.inits[ref]=code};Gumby.prototype.initialize=function(ref){if(this.inits[ref]&&typeof this.inits[ref]==="function"){this.inits[ref]()}};Gumby.prototype.UIModule=function(data){var module=data.module;this.uiModules[module]=data};Gumby.prototype.initUIModules=function(){var x;for(x in this.uiModules){this.uiModules[x].init()}};window.Gumby=new Gumby}();!function(){"use strict";function Checkbox($el){this.$el=$el;var scope=this;this.$el.on(Gumby.click,function(e){scope.click(e)}).on("gumby.check",function(){scope.update(true)}).on("gumby.uncheck",function(){scope.update(false)});if(scope.$el.hasClass("checked")){scope.update(true)}}Checkbox.prototype.click=function(e){var $target=$(e.target);e.stopPropagation();e.preventDefault();if(this.$el.hasClass("checked")){this.update(false)}else{this.update(true)}};Checkbox.prototype.update=function(check){if(check){this.$el.find("input").prop("checked",true).end().addClass("checked").append('<i class="icon-check" />').trigger("gumby.onCheck").trigger("gumby.onChange")}else{this.$el.find("input").prop("checked",false).end().find("i").remove().end().removeClass("checked").trigger("gumby.onUncheck").trigger("gumby.onChange")}};Gumby.addInitalisation("checkboxes",function(){$(".checkbox").each(function(){var $this=$(this);if($this.data("isCheckbox")){return true}$this.data("isCheckbox",true);new Checkbox($this)})});Gumby.UIModule({module:"checkbox",events:["onCheck","onUncheck","onChange","check","uncheck"],init:function(){Gumby.initialize("checkboxes")}})}();!function(){"use strict";function Fixed($el){this.$el=$el;this.$holder=Gumby.selectAttr.apply(this.$el,["holder"]);this.fixedPoint=Gumby.selectAttr.apply(this.$el,["fixed"]);this.unfixPoint=false;if(this.$holder){this.$holder=$(this.$holder)}else{this.$holder=$(window)}if(this.fixedPoint.indexOf("|")>-1){var points=this.fixedPoint.split("|");this.fixedPoint=points[0];this.unfixPoint=points[1]}this.fixedPoint=this.parseAttrValue(this.fixedPoint);if(this.unfixPoint){this.unfixPoint=this.parseAttrValue(this.unfixPoint)}var scope=this;this.$holder.scroll(function(){scope.scroll()})}Fixed.prototype.scroll=function(){var offset=this.$holder.scrollTop(),fixedPoint=this.fixedPoint,unfixPoint=this.unfixPoint,endPoint=this.endPoint;fixedPoint=fixedPoint instanceof jQuery?this.fixedPoint.offset().top:this.fixedPoint;unfixPoint=unfixPoint instanceof jQuery?this.unfixPoint.offset().top:this.unfixPoint;if(!unfixPoint){unfixPoint=offset*2}if(offset>=fixedPoint&&offset<unfixPoint&&!this.$el.hasClass("fixed")){this.$el.addClass("fixed").trigger("gumby.onFixed")}else if(offset<=fixedPoint&&this.$el.hasClass("fixed")){this.$el.removeClass("fixed").trigger("gumby.onUnfixed",0)}if(unfixPoint&&offset>=unfixPoint&&this.$el.hasClass("fixed")){this.$el.removeClass("fixed").trigger("gumby.onUnfixed",1)}};Fixed.prototype.parseAttrValue=function(attr){if($.isNumeric(attr)){return Number(attr)}else if(attr==="top"){return this.$el.offset().top}else{var $el=$(attr);return $el.length?$el:false}};Gumby.addInitalisation("fixed",function(){$("[data-fixed],[gumby-fixed],[fixed]").each(function(){var $this=$(this);if($this.data("isFixed")){return true}$this.data("isFixed",true);new Fixed($this)})});Gumby.UIModule({module:"fixed",events:["onFixed","onUnfixed"],init:function(){Gumby.initialize("fixed")}})}();!function(){"use strict";if(!Modernizr.touch){return}function Navbar($el){this.$el=$el;var scope=this;this.$el.find("li").on(Gumby.click,function(e){var $this=$(this);e.stopPropagation();if(this.href==="#"){e.preventDefault()}scope.dropdown($this)})}Navbar.prototype.dropdown=function($this){if($this.children(".dropdown").length){if($this.hasClass("active")){$this.removeClass("active")}else{$this.addClass("active")}}else{this.$items.removeClass("active")}};Gumby.addInitalisation("navbars",function(){$(".navbar").each(function(){var $this=$(this);if($this.data("isNavbar")){return true}$this.data("isNavbar",true);new Navbar($this)})});Gumby.UIModule({module:"navbar",events:[],init:function(){Gumby.initialize("navbars")}})}();!function(){"use strict";function RadioBtn($el){this.$el=$el;var scope=this;this.$el.on(Gumby.click,function(e){scope.click(e)}).on("gumby.check",function(){scope.update()});if(scope.$el.hasClass("checked")){scope.update()}}RadioBtn.prototype.click=function(e){var $target=$(e.target);e.stopPropagation();e.preventDefault();this.update()};RadioBtn.prototype.update=function(){var $input=this.$el.find("input[type=radio]"),group='input[name="'+$input.attr("name")+'"]';$(".radio").has(group).removeClass("checked").find("input").prop("checked",false).end().find("i").remove();$input.prop("checked",true);this.$el.append('<i class="icon-dot" />').addClass("checked").trigger("gumby.onChange")};Gumby.addInitalisation("radiobtns",function(){$(".radio").each(function(){var $this=$(this);if($this.data("isRadioBtn")){return true}$this.data("isRadioBtn",true);new RadioBtn($this)})});Gumby.UIModule({module:"radiobtn",events:["onChange","check"],init:function(){Gumby.initialize("radiobtns")}})}();!function(){"use strict";function Retina($el){this.$el=$el;this.imageSrc=this.$el.attr("src");this.retinaSrc=this.fetchRetinaImage();this.$retinaImg=$(new Image);var scope=this;if(!this.retinaSrc){return false}this.$retinaImg.attr("src",this.retinaSrc).load(function(){scope.retinaImageLoaded()})}Retina.prototype.fetchRetinaImage=function(){var imgSrc=this.imageSrc,index=this.imageSrc.search(/(\.|\/)(gif|jpe?g|png)$/i);if(index<0){return false}return imgSrc.substr(0,index)+"@2x"+imgSrc.substr(index,imgSrc.length)};Retina.prototype.retinaImageLoaded=function(){this.$el.attr("src",this.$retinaImg.attr("src")).trigger("gumby.onRetina")};Gumby.addInitalisation("retina",function(){if(!window.devicePixelRatio||window.devicePixelRatio<=1){return}$("img[data-retina],img[gumby-retina],img[retina]").each(function(){var $this=$(this);if($this.data("isRetina")){return true}$this.data("isRetina",true);new Retina($this)})});Gumby.UIModule({module:"retina",events:["onRetina"],init:function(){Gumby.initialize("retina")}})}();!function(){"use strict";function SkipLink($el){this.$el=$el;this.targetPos=0;this.duration=Number(Gumby.selectAttr.apply(this.$el,["duration"]))||200;this.offset=Gumby.selectAttr.apply(this.$el,["offset"])||false;this.easing=Gumby.selectAttr.apply(this.$el,["easing"])||"swing";var scope=this;this.$el.on(Gumby.click+" gumby.skip",function(e){e.preventDefault();scope.calculateTarget()})}SkipLink.prototype.calculateTarget=function(){var scope=this,target=Gumby.selectAttr.apply(this.$el,["goto"]),$target;if(target=="top"){this.targetPos=0}else if($.isNumeric(target)){this.targetPos=Number(target)}else{$target=$(target);if(!$target){return false}this.targetPos=$target.offset().top}this.skipTo()};SkipLink.prototype.skipTo=function(){var scope=this;$("html,body").animate({scrollTop:this.calculateOffset()},this.duration,this.easing).promise().done(function(){scope.$el.trigger("gumby.onComplete")})};SkipLink.prototype.calculateOffset=function(){if(!this.offset){return this.targetPos}var op=this.offset.substr(0,1),off=Number(this.offset.substr(1,this.offset.length));if(op==="-"){return this.targetPos-off}else if(op==="+"){return this.targetPos+off}};Gumby.addInitalisation("skiplinks",function(){$(".skiplink > a, .skip").each(function(){var $this=$(this);if($this.data("isSkipLink")){return true}$this.data("isSkipLink",true);new SkipLink($this)})});Gumby.UIModule({module:"skiplink",events:["onComplete","skip"],init:function(){Gumby.initialize("skiplinks")}})}();!function(){"use strict";function Tabs($el){this.$el=$el;this.$nav=this.$el.find("ul.tab-nav > li");this.$content=this.$el.find(".tab-content");var scope=this;this.$nav.children("a").on(Gumby.click,function(e){e.preventDefault();scope.click($(this))});this.$el.on("gumby.set",function(e,index){scope.set(e,index)})}Tabs.prototype.click=function($this){var index=$this.parent().index();this.$nav.add(this.$content).removeClass("active");this.$nav.eq(index).add(this.$content.eq(index)).addClass("active");this.$el.trigger("gumby.onChange",index)};Tabs.prototype.set=function(e,index){this.$nav.eq(index).find("a").trigger(Gumby.click)};Gumby.addInitalisation("tabs",function(){$(".tabs").each(function(){var $this=$(this);if($this.data("isTabs")){return true}$this.data("isTabs",true);new Tabs($this)})});Gumby.UIModule({module:"tabs",events:["onChange","set"],init:function(){Gumby.initialize("tabs")}})}();!function(){"use strict";function Toggle($el){this.$el=$($el);this.targets=[];this.on="";if(this.$el.length){this.init()}}function Switch($el){this.$el=$($el);this.targets=[];this.on="";if(this.$el.length){this.init()}}Toggle.prototype.init=function(){this.targets=this.parseTargets();this.on=Gumby.selectAttr.apply(this.$el,["on"])||Gumby.click;var scope=this;this.$el.on(this.on,function(e){if($(this).prop("tagName")==="A"){e.preventDefault()}e.stopPropagation();scope.trigger(scope.triggered)}).on("gumby.trigger",function(){scope.trigger(scope.triggered)})};Toggle.prototype.parseTargets=function(){var targetStr=Gumby.selectAttr.apply(this.$el,["trigger"]),secondaryTargets=0,targets=[];if(!targetStr){return false}secondaryTargets=targetStr.indexOf("|");if(secondaryTargets===-1){return[$(targetStr)]}targets=targetStr.split("|");return targets.length>1?[$(targets[0]),$(targets[1])]:[$(targets[0])]};Toggle.prototype.triggered=function(){this.$el.trigger("gumby.onTrigger",[this.$el.hasClass("active")])};Switch.prototype=new Toggle;Toggle.prototype.trigger=function(cb){if(!this.targets){this.$el.toggleClass("active")}else if(this.targets.length==1){this.$el.add(this.targets[0]).toggleClass("active")}else if(this.targets.length>1){if(this.targets[0].hasClass("active")){this.$el.add(this.targets[0]).removeClass("active");this.targets[1].addClass("active")}else{this.targets[1].removeClass("active");this.$el.add(this.targets[0]).addClass("active")}}if(cb&&typeof cb==="function"){cb.apply(this)}};Switch.prototype.trigger=function(cb){if(!this.targets){this.$el.addClass("active")}else if(this.targets.length==1){this.$el.add(this.targets[0]).addClass("active")}else if(this.targets.length>1){this.$el.add(this.targets[0]).addClass("active");this.targets[1].removeClass("active")}if(cb&&typeof cb==="function"){cb.apply(this)}};Gumby.addInitalisation("toggles",function(){$(".toggle").each(function(){var $this=$(this);if($this.data("isToggle")){return true}$this.data("isToggle",true);new Toggle($this)})});Gumby.addInitalisation("switches",function(){$(".switch").each(function(){var $this=$(this);if($this.data("isSwitch")){return true}$this.data("isSwitch",true);new Switch($this)})});Gumby.UIModule({module:"toggleswitch",events:["trigger","onTrigger"],init:function(){Gumby.initialize("switches");Gumby.initialize("toggles")}})}();!function($){"use strict";function Validation($this,req){this.$this=$this;this.$field=this.$this.parents(".field");this.req=req||function(){return!!this.$this.val().length};var scope=this;if(this.$this.is("[type=checkbox], [type=radio]")){this.$field=this.$this.parent("label");this.$field.on("gumby.onChange",function(){scope.validate()})}else if(this.$this.is("select")){this.$field=this.$this.parents(".picker");this.$field.on("change",function(){scope.validate()})}else{this.$this.on("blur",function(e){if(e.which!==9){scope.validate()}})}}Validation.prototype.validate=function(){var result=this.req(this.$this);if(!result){this.$field.removeClass("success").addClass("danger")}else{this.$field.removeClass("danger").addClass("success")}return result};$.fn.validation=function(options){var settings=$.extend({submit:false,fail:false,required:[]},options),validations=[];return this.each(function(){if(!settings.required.length){return false}var $this=$(this),reqLength=settings.required.length,i;for(i=0;i<reqLength;i++){validations.push(new Validation($this.find('[name="'+settings.required[i].name+'"]'),settings.required[i].validate||false))}$this.on("submit",function(e){var failed=false;if(!$this.data("passed")){e.preventDefault();var reqLength=validations.length,i;for(i=0;i<reqLength;i++){if(!validations[i].validate()){failed=true}}if(!failed){if(settings.submit&&typeof settings.submit==="function"){settings.submit($this.serializeArray());return}$this.data("passed",true).submit()}else{if(settings.fail&&typeof settings.fail==="function"){settings.fail();return}}}})})}}(jQuery);Modernizr.load({test:Modernizr.touch,yep:"js/libs/jquery.mobile.custom.min.js",callback:function(url,result,key){if($.mobile){window.Gumby.click="tap"}},complete:function(){window.Gumby.init();if(typeof define=="function"&&define.amd){define(window.Gumby)}}}); \ No newline at end of file
diff --git a/pelican-themes/gum/static/js/libs/jquery-1.9.1.min.js b/pelican-themes/gum/static/js/libs/jquery-1.9.1.min.js
new file mode 100644
index 0000000..32d50cb
--- /dev/null
+++ b/pelican-themes/gum/static/js/libs/jquery-1.9.1.min.js
@@ -0,0 +1,5 @@
+/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
+//@ sourceMappingURL=jquery.min.map
+*/(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPreve